@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(assets/fonts/inter-tight-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(assets/fonts/inter-tight-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f5f3;
  --paper: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #4a4a4f;
  --ink-3: #8a8a8f;
  --line: rgba(11, 11, 12, 0.12);
  --blue: #0a4dff;
  --blue-2: #2a63ff;
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4.2vw, 64px);
  --header: 76px;
  --header-bg: rgba(245, 245, 243, 0.88);
  --inv-bg: #0b0b0c;
  --inv-fg: #ffffff;
  --inv-2: #c9c9cc;
  --shade-c: #0b0b0c;
  --shot-bg: #e7e7e4;
  color-scheme: light;
}

/* Тёмная тема — включается лампой */
html[data-theme="dark"] {
  --bg: #0e0e10;
  --paper: #17171a;
  --ink: #f2f2ef;
  --ink-2: #a9a9ae;
  --ink-3: #74747a;
  --line: rgba(255, 255, 255, 0.12);
  --blue: #3d72ff;
  --blue-2: #5a87ff;
  --header-bg: rgba(14, 14, 16, 0.82);
  --inv-bg: #000000;
  --inv-fg: #f2f2ef;
  --inv-2: #a9a9ae;
  --shade-c: #000000;
  --shot-bg: #222226;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--ink); transition: background 0.6s ease, color 0.6s ease; font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Появление ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--out), transform 0.9s var(--out); }
[data-reveal].is-in { opacity: 1; transform: none; }
.reveal-line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.reveal-line > span { display: inline-block; transform: translateY(108%); transition: transform 1.05s var(--ease); }
.reveal-line:nth-child(2) > span, .reveal-line:nth-child(2) > .words { transition-delay: 0.08s; }
.reveal-line:nth-child(3) > span { transition-delay: 0.16s; }
.is-in .reveal-line > span, body.is-ready .hero .reveal-line > span { transform: none; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 30; height: var(--header); display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--gutter); background: var(--header-bg); transition: background 0.6s ease; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; }
.header nav { display: flex; align-items: center; gap: clamp(18px, 3.4vw, 52px); font-size: 18px; font-weight: 500; }
.header nav a:not(.btn-blue) { position: relative; }
.header nav a:not(.btn-blue)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--out); }
.header nav a:not(.btn-blue):hover::after { transform: scaleX(1); transform-origin: left; }

.btn-blue {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; background: var(--blue); color: #fff;
  font-weight: 500; border-radius: 2px; transition: background 0.2s; will-change: transform;
}
.btn-blue:hover { background: var(--blue-2); }
.btn-lg { font-size: 20px; padding: 18px 30px; }

/* ---------- Шапка с разгоном ---------- */
.hero {
  --hp: 0;
  --title-size: clamp(50px, 8.6vw, 148px);
  --wire: clamp(65px, max(8.5vh, 5.3vw), 100px);
  --shade-width: 220px;
  --pull-length: 70px;
  /* The SVG opening is centered at y=104 in a 200-unit viewBox. */
  --opening-y: calc(var(--wire) - 2px + var(--shade-width) * .52);
  position: relative; min-height: calc(100vh - var(--header));
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) clamp(40px, 6vh, 72px);
  /* On short screens the first line fits beside the lamp; the rotating line clears the pull. */
  padding-top: max(0px, calc(var(--opening-y) + var(--pull-length) + 60px - var(--title-size)));
}
.hero-inner { position: relative; z-index: 1; width: 100%; opacity: calc(1 - var(--hp) * 0.7); transform: translateY(calc(var(--hp) * -60px)) scale(calc(1 - var(--hp) * 0.04)); transform-origin: left bottom; }

.hero-title { --word-step: 1.11em; margin: 0; font-size: var(--title-size); line-height: 0.98; letter-spacing: -0.055em; font-weight: 800; }
.hero-title > .reveal-line:first-child, .hero-title > .words-line { height: var(--word-step); padding: 0; }
.words-line > .words { display: block; height: 100%; overflow: hidden; }
.words-track { display: block; color: var(--blue); }
.words-track > span {
  display: block; width: max-content; height: var(--word-step); white-space: nowrap;
  position: relative; top: var(--ink-offset, 0.08em);
  transform: scale(var(--word-fit, 1)); transform-origin: left var(--ink-center, center);
}

.word-snow { position: absolute; display: block; pointer-events: none; }

.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: clamp(24px, 4vh, 44px); }
.hero-foot p { margin: 0; max-width: 520px; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.4; color: var(--ink-2); }
.cue { display: inline-flex; gap: 10px; font-size: 18px; font-weight: 500; white-space: nowrap; }
.cue span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* ---------- Лампа ---------- */
.lamp {
  --rim-radius: calc(var(--shade-width) * .46);
  position: absolute; z-index: 2; top: 0; right: calc(var(--gutter) + 7vw); width: var(--shade-width);
  opacity: calc(1 - var(--hp)); pointer-events: none;
}
.lamp-swing { position: relative; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; will-change: transform; }
.lamp-wire { width: 2px; height: var(--wire); background: var(--ink); transition: background 0.6s; }
.lamp-head { position: relative; z-index: 1; width: 100%; margin-top: -2px; }
.lamp-shade { display: block; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.lamp-perch {
  position: absolute; z-index: 1; inset: -16px; margin: 0; padding: 0; border: 0; opacity: 0;
  appearance: none; -webkit-tap-highlight-color: transparent; pointer-events: auto; touch-action: none; cursor: pointer;
}
.lamp-perch:focus-visible + .lamp-shade .shade-hi { stroke: var(--blue); }
.lamp-perch[aria-disabled="true"] { cursor: grab; }
.lamp-perch:active, .lamp-bead:active { cursor: grabbing; }
.shade-body { fill: #141416; transition: fill 0.6s; }
.shade-hi { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 5; stroke-linecap: round; }
/* Свет горит в светлой теме, шнурок его выключает */
.shade-rim { fill: #ffe2a6; transition: fill 0.4s; }
.bulb { fill: #fff4d6; filter: drop-shadow(0 2px 7px rgba(255, 196, 110, 0.48)); transition: fill 0.3s, filter 0.3s; }
html[data-theme="dark"] .shade-body { fill: #2b2b30; }
html[data-theme="dark"] .shade-rim { fill: #3a3a40; }
html[data-theme="dark"] .bulb { fill: #55555c; filter: none; }

.lamp-glow {
  position: absolute; left: 50%; top: var(--opening-y); width: min(1100px, 90vw); height: 92vh;
  transform: translateX(-50%); filter: blur(5px); pointer-events: none;
  mix-blend-mode: multiply; opacity: 1; transition: opacity 0.35s ease;
}
.lamp-glow::before {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(calc(50% - var(--rim-radius)) 0, calc(50% + var(--rim-radius)) 0, 100% 100%, 0 100%);
  background: radial-gradient(ellipse 56% 92% at 50% 0%,
    rgba(255, 196, 110, 0.29), rgba(255, 204, 133, 0.19) 30%,
    rgba(255, 211, 149, 0.09) 56%, rgba(255, 217, 162, 0.03) 75%, transparent 93%);
}
html[data-theme="dark"] .lamp-glow { opacity: 0; }

.lamp-cord { position: absolute; z-index: 2; left: calc(50% + 62px); top: var(--opening-y); display: flex; flex-direction: column; align-items: center; }
.lamp-string {
  position: relative; display: flex; flex-direction: column; justify-content: space-evenly;
  width: 1.5px; height: var(--pull-length); background: var(--ink-3); transition: background 0.6s, height 0.4s var(--out);
}
.lamp-string i {
  --light: #ffd283;
  position: relative; left: -4px; flex: 0 0 7px; width: 5px; border-radius: 55% 55% 60% 60%;
  background: var(--light); transform: rotate(28deg);
  box-shadow: inset 0 1px 1px #fff9, 0 0 5px var(--light);
}
.lamp-string i:nth-child(even) { left: 1px; transform: rotate(-28deg); }
.lamp-string i:nth-child(2), .lamp-string i:nth-child(5) { --light: #79cfe9; }
.lamp-string i:nth-child(3) { --light: #f78e88; }

.lamp-bead {
  position: relative; width: 18px; height: 18px; margin-top: -2px; border: 0; border-radius: 50%; padding: 0; background: var(--blue); cursor: grab;
  pointer-events: auto; touch-action: none; box-shadow: 0 2px 6px rgba(10, 77, 255, 0.35);
}
/* Grab the full cord, with room on either side of the visible bead. */
.lamp-bead::before {
  content: ""; position: absolute; inset: calc(2px - var(--pull-length)) -17px -16px;
}
.lamp-hint {
  margin-top: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; transition: opacity 0.4s;
}
.lamp-hint.is-hidden { opacity: 0; }

.hero-snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* ---------- Кот ---------- */
[data-cat-platform] { touch-action: manipulation; }
.cat {
  position: absolute; left: 0; top: 0; z-index: 3;
  width: clamp(100px, 10.2vw, 182px); aspect-ratio: 256 / 180;
  appearance: none; border: 0; padding: 0; margin: 0; background: transparent;
  color: var(--ink); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  visibility: hidden; opacity: 0; transition: opacity 0.35s; will-change: transform;
}
.cat.is-on { visibility: visible; opacity: calc(1 - var(--hp) * 0.7); }
.cat-sprite { display: block; width: 100%; height: 100%; pointer-events: none; }
html[data-theme="dark"] .cat-sprite { filter: drop-shadow(0 0 1px rgba(255, 238, 214, 0.55)); }

.cat-say {
  position: absolute; z-index: 4; top: 0; left: 0; width: max-content; max-width: min(24ch, calc(100% - 24px));
  padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper);
  font-size: 14px; line-height: 1.35; text-wrap: balance; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.cat-say.is-on { opacity: 1; }
.cat-z { position: absolute; right: 15%; top: 9%; display: none; font-weight: 600; color: var(--ink-3); pointer-events: none; }
.cat[data-state="sleep"] .cat-z { display: block; }
.cat-z i { position: absolute; font-style: normal; opacity: 0; animation: zz 3s ease-in-out infinite; }
.cat-z i:nth-child(1) { font-size: 12px; }
.cat-z i:nth-child(2) { font-size: 15px; animation-delay: 1s; }
.cat-z i:nth-child(3) { font-size: 18px; animation-delay: 2s; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -34px); } }

/* ---------- Стопка проектов ---------- */
.projects { position: relative; isolation: isolate; }
.pcard {
  --scale: 1; --shade: 0; transition: background 0.6s ease, border-color 0.6s ease;
  --reading-offset: max(0px, calc(var(--page-height, 0px) - (100dvh - var(--header))));
  position: sticky; top: calc(var(--header) - var(--reading-offset)); z-index: var(--i);
  display: flex; flex-direction: column; min-height: calc(100dvh - var(--header)); margin-bottom: 8svh;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  transform: scale(var(--scale)); transform-origin: 50% var(--reading-offset); will-change: transform;
}
.pcard:last-child { margin-bottom: 0; }
.pcard-shade { position: absolute; inset: 0; border-radius: inherit; background: var(--shade-c); opacity: var(--shade); pointer-events: none; }
.pcard-body { flex: 1; padding: clamp(20px, 2.4vw, 36px) var(--gutter); display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 28px); }

.pcard-head { display: grid; grid-template-columns: 90px 1fr auto; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: clamp(12px, 2vh, 20px); }
.count { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pcard-head h2 { margin: 0; font-size: clamp(32px, 3.6vw, 56px); letter-spacing: -0.045em; line-height: 1; font-weight: 800; }
.meta { font-size: 16px; color: var(--ink-2); }

.pcard-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); flex: 1; }
.pshot { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.pshot-link { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: var(--shot-bg); }
.pshot-link > img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--out); }
.pshot-link:hover > img { transform: scale(1.035); }
.pshot-cta {
  position: absolute; right: 14px; bottom: 14px; padding: 9px 14px; background: var(--inv-bg); color: var(--inv-fg); font-size: 15px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--out);
}
.pshot-link:hover .pshot-cta, .pshot-link:focus-visible .pshot-cta { opacity: 1; transform: none; }
.pshot-pair {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "tags";
  gap: 14px; align-content: start;
}
.pshot-pair::before {
  content: ""; grid-area: preview; width: 100%; aspect-ratio: 1.47;
  background: #e7ecef;
}
html[data-theme="dark"] .pshot-pair::before { background: #20262c; }
.pshot-pair > .pshot-link {
  grid-area: preview; align-self: start; width: 85.7%; margin: 4.6% 0 0 2.8%;
  aspect-ratio: auto; max-height: none; border: 1px solid #bcc8cf; border-radius: 6px;
  box-shadow: 0 6px 17px rgba(33, 54, 70, 0.13);
}
.pshot-pair > .pshot-link > img { display: block; height: auto; }
.pshot-address {
  position: relative; z-index: 1; display: grid; place-items: center; height: clamp(16px, 1.6vw, 26px);
  font: 500 clamp(9px, 0.8vw, 12px)/1 Arial, sans-serif; color: #54616b; background: #f0f2f3;
}
.pshot-address::before {
  content: ""; position: absolute; left: 8px; width: 4px; height: 4px; border-radius: 50%;
  background: #b8c0c5; box-shadow: 7px 0 #b8c0c5, 14px 0 #b8c0c5;
}
.pshot-pair .pshot-cta { right: auto; left: 12px; }
.pshot-pair > .pshot-phone {
  grid-area: preview; place-self: end; z-index: 1; width: 19.6%; margin: 0 2.4% 3.5% 0;
}
.pshot-pair > .tags { grid-area: tags; }
.pshot-phone {
  display: block; aspect-ratio: 780 / 1688;
  overflow: hidden; background: #20242b;
  border: clamp(2px, 0.28vw, 4px) solid #20242b; border-radius: 13% / 6%;
  box-shadow: 0 3px 12px rgba(12, 23, 34, 0.32);
}
.pshot-phone img { width: 100%; height: 100%; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 14px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; }

.pinfo { display: grid; gap: clamp(14px, 2.2vh, 24px); align-content: start; }
.pinfo h3 { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.pinfo p { margin: 0; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.45; }
.pinfo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: clamp(15px, 1.08vw, 17px); line-height: 1.4; }
.pinfo li { position: relative; padding-left: 18px; }
.pinfo li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; background: var(--ink); }
.pinfo .can li::before { background: var(--blue); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; border-top: 1px solid var(--line); padding-top: clamp(12px, 2vh, 20px); }
.metrics dt { font-size: clamp(26px, 2.6vw, 40px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.metrics dd { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }

.pcard-next { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--line); }
.pcard-next .pcard-body { justify-content: center; align-items: flex-start; gap: 24px; }
.pcard-next h2 { margin: 0; font-size: clamp(44px, 6.4vw, 104px); letter-spacing: -0.055em; line-height: 0.96; font-weight: 800; }
.pcard-next p { margin: 0; max-width: 520px; font-size: 20px; line-height: 1.4; color: var(--inv-2); }

/* ---------- Возможности ---------- */
.big { margin: 0; font-size: clamp(40px, 6.2vw, 96px); letter-spacing: -0.055em; line-height: 0.98; font-weight: 800; }
.abilities { padding: clamp(80px, 10vw, 140px) var(--gutter) 40px; }
.ability-list { list-style: none; margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ability-list li { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ability-list li:nth-child(3n + 2) { transition-delay: 0.08s; }
.ability-list li:nth-child(3n) { transition-delay: 0.16s; }
.ability-list .n { font-size: 14px; color: var(--ink-3); }
.ability-list h3 { margin: 0; font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.035em; }
.ability-list p { margin: 0; color: var(--ink-2); line-height: 1.45; font-size: 17px; max-width: 360px; }

/* ---------- Как работаем ---------- */
.process { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px; padding: clamp(80px, 10vw, 140px) var(--gutter); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: "0" counter(s); grid-row: span 2; font-size: 14px; color: var(--ink-3); padding-top: 6px; }
.steps b { font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.03em; }
.steps span { color: var(--ink-2); line-height: 1.45; font-size: 17px; }

/* ---------- Финал ---------- */
.final { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: end; padding: clamp(90px, 12vw, 160px) var(--gutter); background: var(--inv-bg); color: var(--inv-fg); }
.final-title { margin: 0; font-size: clamp(46px, 7vw, 116px); line-height: 0.96; letter-spacing: -0.055em; font-weight: 800; }
.final-side p { margin: 0 0 26px; font-size: 20px; line-height: 1.4; color: var(--inv-2); }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 22px var(--gutter); background: var(--inv-bg); color: #8d8d92; font-size: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer a:hover { color: var(--inv-fg); }

/* ---------- Невысокие экраны ноутбуков ---------- */
@media (max-height: 860px) and (min-width: 821px) {
  .pinfo ul { gap: 3px; }
  .pinfo p, .pinfo ul { font-size: 15px; }
  .pshot-link { aspect-ratio: 16 / 9.4; }
  .metrics dt { font-size: 28px; }
}

@media (max-height: 750px) and (min-width: 821px) {
  .pcard-body { padding-block: 16px; gap: 14px; }
  .pshot-link { max-height: 45dvh; }
}

/* ---------- Планшеты и телефоны ---------- */
@media (max-width: 980px) {
  .ability-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px), (max-width: 960px) and (max-height: 500px) {
  /* Pin the results above Safari’s expanded toolbar before the next page slides in. */
  .pcard:not(.pcard-next) {
    --reading-offset: max(0px, calc(var(--page-height, 0px) - (100svh - var(--header))));
    margin-bottom: clamp(64px, 18svh, 168px);
  }
  .pcard:not(.pcard-next) .pcard-body {
    padding-bottom: max(env(safe-area-inset-bottom), clamp(48px, 18svh, 160px));
  }
}
@media (max-width: 820px), (pointer: coarse) and (max-width: 960px) and (max-height: 500px) {
  :root { --header: 64px; }
  .header nav a:not(.btn-blue) { display: none; }
  .logo { font-size: 20px; }
  .btn-blue { min-height: 44px; justify-content: center; padding: 10px 16px; }
  .btn-lg { font-size: 18px; padding: 16px 24px; }
  .logo, .cue, .footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero-inner { display: flex; flex-direction: column; }
  .hero-inner::before { content: ""; flex: 1 0 0; }
  .hero-foot { flex: 1 0 auto; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 16px; }
  .hero {
    --title-size: clamp(50px, 12vw, 72px);
    --wire: 54px; --shade-width: 120px; --pull-length: 46px;
    align-items: stretch; overflow-x: clip; min-height: calc(100svh - var(--header));
  }
  .lamp { right: 24px; }
  .lamp-cord { left: calc(50% + 30px); }
  .lamp-hint { font-size: 11px; }
  .pcard-head { grid-template-columns: 1fr; gap: 6px; }
  .pcard-body { padding-inline: calc(var(--gutter) - 1px); }
  .process, .final { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root {
    --gutter: clamp(16px, 5vw, 24px);
    --header: 60px;
    --section-space: clamp(48px, 14vw, 72px);
    --number-col: 2ch;
  }

  .header nav { font-size: 16px; }

  .hero {
    --title-size: clamp(44px, 13.6vw, 72px);
    --shade-width: clamp(100px, 27vw, 120px);
    --pull-length: 36px;
    padding-top: calc(var(--opening-y) + var(--pull-length) + 48px - var(--title-size));
    padding-bottom: 16px;
  }
  .lamp { right: var(--gutter); }
  .lamp-cord { left: 75%; }
  .hero-foot { gap: 12px; margin-top: 20px; }
  .hero-foot p { font-size: 17px; line-height: 1.45; }
  .cue { gap: 8px; font-size: 16px; }

  .pcard-body { gap: 20px; padding-block: 24px; }
  .pcard-head { gap: 8px; padding-bottom: 16px; }
  .pcard-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .pshot { gap: 12px; }
  .pshot-link { aspect-ratio: 16 / 9; }
  .tags span { font-size: 13px; padding: 4px 10px; }
  .pinfo { gap: 20px; }
  .pinfo h3 { margin-bottom: 8px; }
  .pinfo ul { gap: 8px; }
  .metrics { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .metrics div { display: grid; align-items: baseline; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.9fr); gap: 12px; }
  .metrics dd { margin: 0; line-height: 1.4; }
  .pcard-next .pcard-body { gap: 20px; }
  .pcard-next p, .final-side p { font-size: 18px; line-height: 1.45; }

  .abilities { padding-block: var(--section-space) 0; }
  .process, .final { gap: 24px; padding-block: var(--section-space); }
  .ability-list { grid-template-columns: 1fr; margin-top: 24px; }
  .ability-list li, .steps li {
    display: grid; grid-template-columns: var(--number-col) minmax(0, 1fr);
    gap: 8px 12px; padding: 20px 0;
  }
  .ability-list .n, .steps li::before { grid-column: 1; grid-row: 1; align-self: baseline; padding: 0; }
  .ability-list li > :not(.n), .steps li > * { grid-column: 2; }
  .ability-list h3, .steps b { align-self: baseline; }
  .ability-list p, .steps span { font-size: 16px; line-height: 1.5; }
  .final-side p { margin-bottom: 20px; }
  .footer { align-items: center; flex-wrap: wrap; gap: 0 12px; padding-block: 8px; }
}

@media (max-width: 600px) and (max-height: 640px) {
  .hero { padding-bottom: 8px; }
  .hero-foot { margin-top: 16px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard { position: relative; top: auto; transform: none; }
  .pcard-shade { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  [data-reveal], .reveal-line > span, .words { opacity: 1; transform: none; }
}

/* ---------- Коробка проекта ---------- */
.final {
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  grid-template-areas: "title panel" "options panel";
  align-items: start;
  gap: clamp(32px, 3.5vw, 56px) clamp(40px, 7vw, 120px);
  padding-block: clamp(70px, 8vw, 120px);
}
.final-title { grid-area: title; }
.brief-fields { grid-area: options; min-width: 0; }
.brief-panel { grid-area: panel; position: sticky; top: calc(var(--header) + 12px); }
.brief-scene { position: relative; }
.brief-box { display: block; width: min(100%, 480px); height: auto; margin: 0 auto; }
.brief-speech {
  position: absolute; top: 0; right: 9%; z-index: 2; max-width: 85%; padding: 8px 13px;
  border-radius: 14px 14px 14px 3px; background: #f3eee6; color: #302b26;
  font: 500 15px/1.3 var(--font); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.brief-speech.is-visible { opacity: 1; }
.brief-speech.is-away {
  position: fixed; inset: auto auto max(20px, env(safe-area-inset-bottom)) 50%;
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  box-shadow: 0 4px 18px #0004;
}
.brief-compose { margin: 12px auto 0; max-width: 570px; }
.brief-parts { margin: 0 0 30px; border: 0; padding: 0; min-width: 0; }
.brief-parts:last-child { margin-bottom: 0; }
.brief-parts legend, .brief-label {
  display: block; margin: 0 0 14px; padding: 0; font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 600; letter-spacing: -.02em;
}
.brief-start, .brief-options { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-start {
  display: inline-flex; padding: 4px; gap: 2px; border: 1px solid #37373c;
  border-radius: 14px; background: #19191c;
}
.brief-start button, .brief-options button, .brief-more, .brief-flight {
  display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  min-height: 44px; padding: 9px 14px; color: #e6e6e9; border: 1px solid #404045;
  border-radius: 999px; background: #1a1a1d; font: 500 15px/1.2 var(--font);
  cursor: pointer; user-select: none; transition: background .16s, border-color .16s;
}
.brief-start button { color: #c3c3c9; background: transparent; border: 0; border-radius: 10px; }
.brief-start button[aria-pressed="true"] { color: #101012; background: #f3f3ef; }
.brief-options [data-part] { cursor: grab; }
.brief-options svg { width: 16px; height: 16px; flex: none; color: #adadb4; }
.brief-options button[aria-pressed="true"] { background: #174fd6; border-color: #5b85ff; color: #fff; }
.brief-options button[aria-pressed="true"] svg { color: #fff; }
.brief-options [data-joke], .brief-more { background: transparent; border-style: dashed; }
.brief-more { margin-top: 12px; color: #c9c9cf; }
.brief-more::before { content: "+"; font-size: 18px; line-height: 1; }
.brief-more[aria-expanded="true"]::before { content: "−"; }
.brief-group { margin: 20px 0 0; border: 0; padding: 0; min-width: 0; }
.brief-parts .brief-group legend {
  margin-bottom: 9px; font: 500 14px/1.3 var(--font); color: #afafb6; letter-spacing: 0;
}
@media (hover: hover) {
  .brief-options button:hover, .brief-more:hover { border-color: #87878e; }
  .brief-start button:hover { box-shadow: inset 0 0 0 1px #626269; }
}
.final button:focus-visible, .brief-send:focus-visible, #brief-message:focus-visible {
  outline: 2px solid #a4baff; outline-offset: 3px;
}
.brief-paper-flight {
  position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; transform-origin: 0 0;
}
.brief-flight {
  position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; white-space: nowrap;
  color: #183574; background: #dbe6ff; border-color: #8aa9ff;
}
.brief-chat {
  padding: 12px 12px 12px clamp(22px, 4vw, 60px); background: #111c28;
  border: 1px solid #263647; border-radius: 16px;
}
#brief-message {
  display: block; width: 100%; min-height: 56px; max-height: 12em; padding: 12px 15px;
  resize: none; border: 0; border-radius: 14px 14px 3px 14px; color: #fff; background: #284e70;
  font: 400 16px/1.45 var(--font);
}
#brief-edit-hint, .brief-reply { display: block; color: #acacb3; font: 400 14px/1.4 var(--font); }
#brief-edit-hint { margin-top: 7px; }
.brief-send { display: inline-flex; justify-content: space-between; gap: 16px; max-width: 100%; }
.brief-preview:not([hidden]) + .brief-send { margin-top: 20px; }
.brief-reply { margin-top: 10px; }
.final [hidden] { display: none; }
@media (max-width: 820px) {
  .final { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 28px; }
  .brief-box { max-width: 380px; }
  .brief-start { padding: 0; gap: 6px; border: 0; background: transparent; }
  .brief-start button { border: 1px solid #404045; background: #19191c; }
}
@media (max-width: 650px) {
  .final {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "scene" "options" "draft";
    gap: 20px; padding-block: var(--section-space, 60px);
  }
  .brief-panel { display: contents; }
  .brief-scene { grid-area: scene; }
  .brief-box { width: min(100%, 320px); }
  .brief-compose { grid-area: draft; width: 100%; max-width: none; margin-top: 6px; }
  .brief-parts { margin-bottom: 24px; }
}
.brief-options svg {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.brief-reference { margin-top: 28px; }
#reference-url { display: block; width: min(100%, 440px); margin-bottom: 10px; padding: 12px 14px; border: 1px solid #626269; border-radius: 10px; background: #19191c; color: #fff; font: 400 16px/1.4 var(--font); }
#reference-url::placeholder { color: #b4b4ba; }

.brief-track { grid-area: options; min-width: 0; max-width: 620px; }
.brief-track h3 { margin: 0; font-size: clamp(28px, 3.2vw, 48px); line-height: 1.06; letter-spacing: -.045em; }
.brief-track h3 span { white-space: nowrap; }
.parcel-parts, .parcel-steps p { margin: 6px 0 0; color: var(--inv-2); font: 400 16px/1.45 var(--font); overflow-wrap: anywhere; }
.parcel-steps { list-style: none; margin: 26px 0 10px; padding: 0; }
.parcel-steps > li { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 13px; padding-bottom: 23px; }
.parcel-steps > li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 28px; bottom: -2px; width: 2px; background: #404045; }
.parcel-steps > li.done::before { background: var(--blue); }
.parcel-steps > li > span { width: 30px; height: 30px; display: grid; place-items: center; background: #28282c; color: #c6c6cc; border-radius: 50%; font-size: 14px; }
.parcel-steps .done > span, .parcel-steps [aria-current] > span { background: var(--blue); color: white; }
.parcel-steps strong { font: 600 20px/1.4 var(--font); }
.parcel-steps li:not(.done):not([aria-current]) strong { color: var(--inv-2); }
@media (prefers-reduced-motion: no-preference) {
  .parcel-steps [aria-current] > span { animation: parcel-pulse 2.4s ease-out infinite; }
  @keyframes parcel-pulse { from { box-shadow: 0 0 0 0 #416eff80; } 75%, to { box-shadow: 0 0 0 7px #416eff00; } }
}
.parcel-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.parcel-actions :is(a,button), .parcel-new { display: inline-flex; align-items: center; min-height: 44px; color: var(--inv-fg); font: 500 15px/1.3 var(--font); cursor: pointer; }
.parcel-actions :is(a,button) { padding: 8px 14px; border: 1px solid #55555b; background: #1a1a1d; border-radius: 9px; }
.parcel-actions .parcel-yes { background: var(--blue); border-color: transparent; color: white; }
.parcel-ask { border-top: 1px solid #39393e; padding-top: 8px; margin-top: 14px; }
.parcel-new { border: 0; background: transparent; padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.parcel-manual { width: 100%; min-height: 80px; margin-top: 10px; font: inherit; }
