/* Шапка */
.header { position: sticky; top: 0; z-index: 50; background: var(--c-paper); border-bottom: 1px solid var(--c-line); }
.header__inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; text-decoration: none; }
.nav { margin-left: auto; }
.nav__list { display: flex; gap: 32px; margin: 0; padding: 0; list-style: none; }
.nav__list a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  text-decoration: none;
  /* Лінія проростає зліва під пунктом при наведенні */
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1.5px no-repeat;
  background-origin: content-box;
  background-clip: content-box;
  transition: background-size 300ms var(--ease-curtain);
}
.nav__list a:is(:hover, :focus-visible) { background-size: 100% 1.5px; }
.header__cta { min-height: 44px; padding: 0 20px; }
.lang-switch { font-size: var(--fs-small); padding: 12px 0; }
@media (max-width: 1023px) { .lang-switch { display: none; } }
.burger, .sticky-cta, .nav__extra { display: none; }
html:not(.js) .burger { display: none !important; }

/* Мобільне меню: шторка згори вниз, пункти набирають вагу по черзі */
@keyframes nav-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes nav-out { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1023px) {
  .nav {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    padding: 40px var(--pad-x) calc(32px + env(safe-area-inset-bottom));
    background: var(--c-paper);
    overflow-y: auto;
  }
  .nav.is-open { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
  .nav__list { flex-direction: column; gap: 8px; }
  .nav__list a { font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; }
  .nav__extra { display: grid; gap: 16px; }
  .nav__extra .btn { width: 100%; }
  .nav__contacts { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0; padding: 0; list-style: none; }
  .nav__contacts a { display: inline-block; padding: 10px 0; }

  .motion .nav.is-open { animation: nav-in 480ms cubic-bezier(0.7, 0, 0.2, 1) both; }
  .motion .nav.is-closing { animation: nav-out 320ms cubic-bezier(0.7, 0, 0.2, 1) both; }
  .motion .nav .nav__list a { font-weight: 200; transition: font-weight 420ms var(--ease); }
  .motion .nav.is-shown .nav__list a { font-weight: 800; }
  .motion .nav.is-shown .nav__list li:nth-child(1) a { transition-delay: 180ms; }
  .motion .nav.is-shown .nav__list li:nth-child(2) a { transition-delay: 250ms; }
  .motion .nav.is-shown .nav__list li:nth-child(3) a { transition-delay: 320ms; }
  .motion .nav.is-closing .nav__list a { transition-duration: 200ms; transition-delay: 0ms; }
  .motion .nav.is-open .nav__extra { animation: nav-fade 260ms ease 300ms both; }
  .header__cta { display: none; }
  .burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 48px;
    height: 48px;
    margin-left: auto;
    padding: 12px;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .burger span { height: 2px; background: var(--c-ink); transition: transform var(--t) var(--ease); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .sticky-cta {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
  }
  body { padding-bottom: 88px; }
}

/* Перший екран */
.hero { padding-block: clamp(40px, 7vw, 96px) calc(var(--section-gap) / 2); }
.hero .container { container-type: inline-size; }
.statement { font-size: inherit; letter-spacing: normal; line-height: inherit; }
.statement__visual {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--w-rest);
  font-size: min(calc(100cqi / var(--statement-ratio)), 8.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.statement__line { display: block; white-space: nowrap; }
@media (max-width: 1023px) { .statement__line--split .word { display: block; } }
.motion .statement__visual { font-weight: 200; }
.hero__row { display: grid; gap: 32px; margin-top: clamp(32px, 5vw, 64px); }
.hero__lead { font-size: var(--fs-lead); line-height: 1.5; max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; }
@media (min-width: 1024px) {
  .hero__row { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .hero__actions { justify-content: flex-end; }
}

/* Футер */
.footer { padding-top: 80px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); }
.footer .container { container-type: inline-size; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 0; list-style: none; }
.footer__links a { display: inline-block; padding: 10px 0; }
.footer__copy { margin-left: auto; color: var(--c-graphite); font-size: var(--fs-small); }
.footer__mark {
  margin-top: 48px;
  max-width: none;
  font-family: var(--font-display);
  font-weight: var(--w-rest);
  font-size: calc(100cqi / var(--wordmark-ratio));
  line-height: 0.9;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.js-scrub .footer__mark { font-weight: 200; }

/* Експертиза */
.services { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
.service { border-bottom: 1px solid var(--c-line); }
.service__head { font-size: inherit; letter-spacing: normal; line-height: inherit; }
.service__name {
  display: block;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: var(--w-rest);
  font-size: var(--fs-svc);
  line-height: 1.15;
  letter-spacing: -0.03em;
  white-space: nowrap;
  cursor: pointer;
}
.service__name .letter { transition: font-weight var(--t) var(--ease); }
.expertise.is-ready .service__name { color: var(--c-graphite); transition: color var(--t) var(--ease); }
.expertise.is-ready .service.is-active .service__name { color: var(--c-ink); }
.service__body { display: grid; gap: 16px; padding: 0 0 28px; }
.service__body p, .expertise__panel p { color: var(--c-graphite); }
.tags { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.service__cta { justify-self: start; min-height: 44px; padding: 0 20px; margin-top: 4px; font-size: var(--fs-small); }
.expertise__panel { display: none; }
.expertise.is-ready .service__body { display: none; }
.expertise.is-ready .service.is-active .service__body { display: grid; }

@media (min-width: 1024px) {
  .expertise__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gutter); align-items: start; }
  .expertise.is-ready .service.is-active .service__body { display: none; }
  .expertise.is-ready .expertise__panel {
    display: grid;
    gap: 20px;
    position: sticky;
    top: calc(var(--header-h) + 64px);
    margin-top: calc(var(--fs-h2) + 56px);
    padding-left: 32px;
    border-left: 1px solid var(--c-line);
    font-size: var(--fs-lead);
  }
}

/* Що будуємо */
.schemes { display: grid; gap: 48px var(--gutter); margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .schemes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scheme { display: grid; gap: 12px; }
.scheme__art { width: 100%; height: auto; fill: none; stroke: var(--c-ink); stroke-width: 1.5; margin-bottom: 12px; }
.scheme__title { font-size: var(--fs-h3); letter-spacing: -0.02em; }
.scheme__text { color: var(--c-graphite); }
.js-schemes .scheme__art :is(rect, line, circle, polyline, path) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.js-schemes .scheme__art.is-drawn :is(rect, line, circle, polyline, path) { stroke-dashoffset: 0; }

/* Як працюємо */
.steps { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
.step { display: grid; gap: 8px; padding: 24px 0; border-bottom: 1px solid var(--c-line); }
.step__name { font-family: var(--font-display); font-weight: var(--w-rest); font-size: var(--fs-step); line-height: 1.1; letter-spacing: -0.03em; max-width: none; }
.js-scrub .step__name { font-weight: 200; }
.step__text { color: var(--c-graphite); font-size: var(--fs-small); max-width: 28ch; }
.scale { margin-top: 40px; }
.scale__track { height: 2px; background: var(--c-line); }
.scale__bar { height: 100%; background: var(--c-ink); transform-origin: left center; transform: scaleX(1); }
.js-scrub .scale__bar { transform: scaleX(0); }
.scale__ticks { display: flex; justify-content: space-between; margin: 12px 0 0; padding: 0; list-style: none; color: var(--c-graphite); font-size: var(--fs-small); }
@media (min-width: 1024px) {
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gutter); border-top: 0; }
  .step { border-bottom: 0; padding: 0; }
}

/* Під інтерфейсом */
.pledges { margin: 0; border-top: 1px solid var(--c-line); }
.pledge { display: grid; gap: 8px; padding: 28px 0; border-bottom: 1px solid var(--c-line); }
.pledge dt { font-family: var(--font-display); font-weight: var(--w-rest); font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.1; }
.pledge dd { margin: 0; color: var(--c-graphite); max-width: 52ch; }
@media (min-width: 1024px) { .pledge { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: baseline; gap: var(--gutter); } }

/* Поле ваги з точок: та сама логіка, що й у літер (курсор / хвиля) */
.engineering__grid { display: grid; gap: 32px; }
.dots { position: relative; order: -1; height: 168px; color: var(--c-ink); }
.dots canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html:not(.js) .dots { display: none; }
@media (min-width: 1024px) {
  .engineering__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gutter); align-items: stretch; }
  .dots { order: 0; height: auto; min-height: 360px; }
}

/* Контакт */
.contact .container { container-type: inline-size; }
.contact__phrase {
  font-size: calc(100cqi / var(--phrase-ratio));
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.contact__phrase .word { display: block; }
.motion .contact__phrase { font-weight: 200; }
.contact__row { display: grid; gap: 32px; margin-top: 56px; }
.contact__note { color: var(--c-mist); font-size: var(--fs-lead); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 0; list-style: none; }
.contact__links a { display: inline-block; padding: 10px 0; }
@media (min-width: 1024px) { .contact__row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; } .contact__actions { justify-content: flex-end; } }


/* Діалог і форма (темна шторка) */
.dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overscroll-behavior: contain;
}
.dialog[open] { display: block; overflow-y: auto; }
.dialog { scrollbar-color: var(--c-chip-line) var(--c-ink); }
.dialog::-webkit-scrollbar-track { background: var(--c-ink); }
.dialog::-webkit-scrollbar-thumb { background: var(--c-chip-line); border-color: var(--c-ink); }
.dialog::-webkit-scrollbar-thumb:hover { background: var(--c-mist); }
html:has(.dialog[open]) { overflow: hidden; }

/* Шторка: знизу вгору при відкритті, вгору при закритті */
@keyframes dialog-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dialog-out { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }
@keyframes dialog-fade { from { opacity: 0; } to { opacity: 1; } }
.motion .dialog[open] { animation: dialog-in 560ms cubic-bezier(0.7, 0, 0.2, 1) both; }
.motion .dialog[open].is-closing { animation: dialog-out 380ms cubic-bezier(0.7, 0, 0.2, 1) both; }
.motion .dialog[open] .dialog__fade { animation: dialog-fade 260ms ease 260ms both; }
.motion .dialog[open].is-closing .dialog__fade { animation: none; }

.dialog__inner {
  position: relative;
  display: grid;
  gap: 40px;
  min-height: 100%;
  padding-block: 32px 64px;
}
.dialog__close {
  position: absolute;
  top: 16px;
  right: calc(var(--pad-x) - 14px);
  z-index: 2; /* над колонками: анімація прозорості створює їм окремий шар */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 14px;
  background: none;
  border: 0;
  font-weight: 500;
  cursor: pointer;
}
.dialog__kbd {
  padding: 1px 6px;
  border: 1px solid var(--c-chip-line);
  color: var(--c-mist);
  font-family: var(--font-text);
  font-size: 0.75rem;
}
.dialog__aside { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding-top: 56px; }
.dialog__title { font-size: clamp(2.25rem, 5vw, 4.5rem); line-height: 0.98; letter-spacing: -0.03em; }
.dialog__title .word { display: block; }
.motion .dialog__title .letter { font-weight: 200; transition: font-weight 420ms var(--ease); }
.dialog__note { margin-top: 20px; color: var(--c-mist); max-width: 34ch; }
.dialog__direct { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.dialog__direct a { display: inline-block; padding: 10px 0; }

@media (min-width: 1024px) {
  .dialog__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
  .dialog__main { padding-top: 56px; }
}

/* Форма */
.form { display: grid; gap: 32px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  padding: 0;
  color: var(--c-mist);
  font-size: var(--fs-small);
  font-weight: 400;
  transition: color var(--t) var(--ease), font-weight var(--t) var(--ease);
}
.field:focus-within > label, .field:focus-within > legend { color: var(--c-paper); font-weight: 600; }
.field input:not([type="radio"]), .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 8px 0 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--c-chip-line);
  border-radius: 0;
  color: var(--c-paper);
  font-size: 1.1875rem;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:not([type="radio"]):hover, .field textarea:hover { border-color: var(--c-mist); }
.field input:not([type="radio"]):focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--c-paper);
  box-shadow: 0 2px 0 0 var(--c-paper);
}
.field input::placeholder, .field textarea::placeholder { color: var(--c-mist); }
.field [aria-invalid="true"] { border-color: var(--c-error-dark); }
.field input[aria-invalid="true"]:focus-visible, .field textarea[aria-invalid="true"]:focus-visible { border-color: var(--c-error-dark); box-shadow: 0 2px 0 0 var(--c-error-dark); }
.field__error, .form__error { margin: 0; color: var(--c-error-dark); font-size: var(--fs-small); }
.form__error a { color: var(--c-paper); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { position: relative; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--c-chip-line);
  color: var(--c-mist);
  cursor: pointer;
  transition: background-color var(--t) var(--ease), background-size 300ms var(--ease-curtain), color var(--t) var(--ease), border-color var(--t) var(--ease), font-weight var(--t) var(--ease);
}
.chip span {
  background: linear-gradient(var(--c-paper), var(--c-paper)) left bottom / 100% 0% no-repeat;
}
.chip:hover span { border-color: var(--c-paper); color: var(--c-paper); background-size: 100% 3px; }
.chip input:checked + span { background: var(--c-paper); border-color: var(--c-paper); color: var(--c-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--c-paper); outline-offset: 3px; }
.chip input[aria-invalid="true"] + span { border-color: var(--c-error-dark); }
.hp { position: absolute; left: -9999px; }

/* Надіслати: та сама заливка знизу (інверсія на темному) */
.dialog__send {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 28px;
  background: var(--c-paper);
  color: var(--c-ink);
  border: 0;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t) var(--ease);
}
.dialog__send::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c-ink);
  box-shadow: inset 0 0 0 1.5px var(--c-paper);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--t) var(--ease-curtain);
}
.dialog__send:is(:hover, :focus-visible) { color: var(--c-paper); }
.dialog__send:is(:hover, :focus-visible)::before { transform: scaleY(1); }
.dialog__send[aria-busy="true"] { cursor: progress; }

/* Заявку надіслано: галочка малюється лінією, заголовок набирає вагу, далі кроки «що далі» */
.form-success { display: grid; gap: 24px; align-content: start; }
.form-success:focus { outline: none; }
.form-success__mark { width: 56px; height: 56px; fill: none; stroke-width: 2; stroke-linecap: square; }
.form-success__mark circle { stroke: var(--c-chip-line); }
.form-success__mark path { stroke: var(--c-paper); stroke-width: 3; }
.form-success__title { font-size: clamp(2rem, 4.4vw, 4rem); line-height: 0.98; }
.motion .form-success__title .letter { font-weight: 200; transition: font-weight 420ms var(--ease); }
.form-success__lead { color: var(--c-mist); font-size: var(--fs-lead); line-height: 1.45; max-width: 36ch; }
.form-success__lead b { color: var(--c-paper); font-weight: 600; overflow-wrap: anywhere; }
.form-success__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; }
.form-success__steps li { position: relative; display: grid; gap: 6px; align-content: start; padding-top: 20px; color: var(--c-mist); font-size: var(--fs-small); line-height: 1.45; }
.form-success__steps li::before,
.form-success__steps li::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--c-line-dark); }
.form-success__steps li::after { background: var(--c-paper); transform: scaleX(0); transform-origin: left; }
.form-success__steps li.is-done::after { transform: scaleX(1); }
.form-success__steps b { color: var(--c-paper); font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.form-success__num { font-variant-numeric: tabular-nums; }
.form-success__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 16px; }
.form-success__again { padding: 10px 0; background-color: transparent; border: 0; border-radius: 0; cursor: pointer; }

@keyframes success-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes success-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes success-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.motion .form-success.is-in .form-success__mark :is(circle, path) { stroke-dasharray: 1; animation: success-draw 640ms var(--ease) both; }
.motion .form-success.is-in .form-success__mark path { animation-delay: 380ms; animation-duration: 420ms; }
.motion .form-success.is-in :is(.form-success__lead, .form-success__actions) { animation: success-rise 520ms var(--ease) both; }
.motion .form-success.is-in .form-success__lead { animation-delay: 480ms; }
.motion .form-success.is-in .form-success__steps li { animation: success-rise 520ms var(--ease) both; animation-delay: calc(620ms + var(--i) * 90ms); }
.motion .form-success.is-in .form-success__steps li.is-done::after { animation: success-line 700ms var(--ease-curtain) 760ms both; }
.motion .form-success.is-in .form-success__actions { animation-delay: 900ms; }

/* Діалог на мобільному: компактно, форма одразу під заголовком, контакти в кінці */
@media (max-width: 767px) {
  .dialog__kbd { display: none; }
  .dialog__inner { gap: 24px; padding-block: 8px 24px; }
  .dialog__close { top: 4px; min-height: 52px; }
  .dialog__aside { display: contents; }
  .dialog__aside > div { order: 1; padding-top: 48px; }
  .dialog__main { order: 2; }
  .dialog__direct { order: 3; }
  .dialog__title { font-size: 1.875rem; }
  .dialog__note { margin-top: 8px; font-size: var(--fs-small); }
  .form { gap: 20px; }
  .chips { gap: 6px; margin-top: 4px; }
  .chip span { padding: 0 12px; font-size: var(--fs-small); }
  .field input:not([type="radio"]), .field textarea { min-height: 44px; padding: 6px 0 8px; font-size: 1.0625rem; }
  .field textarea { height: 72px; min-height: 72px; }
  .dialog__send { position: sticky; bottom: 12px; z-index: 1; width: 100%; justify-content: center; }
  .dialog.is-sent .dialog__aside > div { display: none; }
  .dialog.is-sent .dialog__main { padding-top: 56px; }
  .form-success { gap: 20px; }
  .form-success__mark { width: 48px; height: 48px; }
  .form-success__title { font-size: 2.25rem; }
  .form-success__lead { font-size: var(--fs-body); }
  .form-success__steps { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 4px; }
  .form-success__steps li { grid-template-columns: 2.5em minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: baseline; padding-top: 14px; }
  .form-success__steps li > span:last-child { grid-column: 2; }
  .form-success__steps b { font-size: 1rem; }
  .form-success__actions .btn { width: 100%; }
}

/* Інтро-шторка першого візиту: сторінка вже готова під нею, шторка лише відкриває її */
.intro { display: none; }
html.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-ink);
  color: var(--c-paper);
  animation: intro-lift 700ms var(--ease-curtain) 760ms both;
}
.intro__mark {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 6rem);
  white-space: nowrap;
  animation: intro-mark-out 520ms var(--ease-curtain) 760ms both;
}
.intro__mark span {
  font-weight: 200;
  animation: intro-weight 320ms ease calc(120ms + var(--i) * 40ms) both;
}
html.intro-skip .intro { animation: intro-lift 240ms var(--ease-curtain) both; }
html.intro-skip .intro__mark { animation: intro-mark-out 160ms ease both; }
@keyframes intro-lift {
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 100% 0); visibility: hidden; }
}
@keyframes intro-mark-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6vh); }
}
@keyframes intro-weight {
  from { font-weight: 200; }
  to { font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { html.intro-on .intro { display: none; } }

/* Сторінка 404: величезні цифри живуть у тому ж полі ваги, що й заголовки сайту */
.nf { display: grid; align-content: center; gap: 40px; min-height: calc(100svh - var(--header-h)); padding-block: 48px 72px; }
.nf__lang { display: inline-block; margin-left: auto; }
.nf__code {
  max-width: none;
  margin: 0 0 0 -0.04em;
  font-family: var(--font-display);
  font-size: clamp(7rem, 28vw, 24rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.05em;
  user-select: none;
}
.motion .nf__code .letter { font-weight: 200; }
.nf__body { display: grid; gap: 20px; max-width: 560px; }
.nf__title { font-size: var(--fs-h3); }
.nf__text { color: var(--c-graphite); }
.nf__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
@media (min-width: 1024px) {
  .nf__body { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 64px; max-width: none; }
  .nf__title { grid-column: 1 / -1; }
  .nf__text { max-width: 44ch; }
  .nf__actions { margin-top: 0; }
}
@media (max-width: 767px) {
  .nf__actions .btn { flex: 1 1 100%; }
}
