/* =====================================================================
   Иван Суворов — портфолио
   Приёмы: The Romans (типографика, skew, sticky, занавес, курсор)
         + Lusion (WebGL-физика, объёмные карточки, лента, перекатывание букв)
   ===================================================================== */

/* ---------- Токены ---------- */
:root {
  --black: #0b0b0c;
  --white: #f2f0ea;
  --grey: #8b8a85;
  --line: #0b0b0c1f;
  --accent: #ffd60a;          /* жёлтый — из фото */
  --accent-2: #ffb800;
  --blue: #2a38ee;

  --ease-out: cubic-bezier(.14, 1, .34, 1);
  --ease-in-out: cubic-bezier(.9, 0, .1, 1);
  --ease-roll: cubic-bezier(.6, 0, .2, 1);
  --skew-deg: -10deg;
  --skew-tan: 0.1763;

  --gutter: clamp(16px, 2vw, 28px);
  --radius: 18px;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --text: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); }
body { margin: 0; color: var(--white); font: 17px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--black); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--black); padding: 10px 14px; font-weight: 600; }
.skip-link:focus { top: 16px; }

.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: -0.01em;
}
.light { background: var(--white); color: var(--black); }

/* ---------- Интро-переход (The Romans) ---------- */
.intro { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: none; }
.intro span { position: absolute; inset: 0; }
.intro .layer-one { background: var(--accent); }
.intro .layer-two { background: var(--black); }
html.intro-playing .intro { display: block; }
html.intro-playing .page { position: relative; z-index: 101; }
html.intro-playing:not(.intro-started) .page { clip-path: inset(50% 50%); }

/* ---------- Перекатывание букв (Lusion) ---------- */
.roll-group { display: inline; }
.roll { display: inline-flex; overflow: hidden; height: 1.15em; line-height: 1.15; vertical-align: middle; }
.roll .ch { display: inline-flex; flex-direction: column; white-space: pre; }
.roll .ch span { display: block; transition: transform .5s var(--ease-roll); transition-delay: calc(var(--i) * 16ms); }
.roll-host:hover .roll .ch span,
.roll-host:focus-visible .roll .ch span { transform: translateY(-100%); }

/* ---------- Маски и «фальшивый курсив» (The Romans) ---------- */
.mask { display: inline-block; overflow: clip; padding: .06em .03em; margin: -.06em -.03em; vertical-align: top; }
.word { display: inline-block; }
.italic .mask { transform: skewX(var(--skew-deg)); }
.italic-static { display: inline-block; transform: skewX(var(--skew-deg)); }

/* ---------- Тег ---------- */
.tag {
  display: inline-block;
  font: 700 14px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
  padding: 9px 13px; border: 1px solid currentColor;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .35s var(--ease-out);
}
.tag.is-in { clip-path: inset(0); }

/* ---------- Кнопка-скос (The Romans) ---------- */
.btn-skew {
  --h: 58px;
  --off: calc(var(--skew-tan) * var(--h));
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 40px;
  height: var(--h); padding: 0 24px; min-width: 220px;
  font: 700 17px/1 var(--display); text-transform: uppercase;
  color: var(--black);
}
.btn-skew::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0 calc(var(--off) / -2);
  background: var(--accent);
  clip-path: polygon(calc(var(--off) / 2) 0, calc(100% - var(--off) / 2) 0, calc(100% - var(--off) / 2) 100%, calc(var(--off) / 2) 100%);
  transition: clip-path .3s var(--ease-out), background-color .3s;
}
.btn-skew:hover::before, .btn-skew:focus-visible::before { clip-path: polygon(var(--off) 0, 100% 0, calc(100% - var(--off)) 100%, 0 100%); }
.btn-skew .arrow { transition: translate .3s var(--ease-out); }
.btn-skew:hover .arrow { translate: 5px 0; }
.btn-skew.dark { color: var(--white); }
.btn-skew.dark::before { background: var(--black); }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 18px var(--gutter);
  color: #fff;
  mix-blend-mode: difference;                /* читается на любом фоне */
  transition: translate .6s var(--ease-out);
}
.site-header.is-hidden { translate: 0 -120%; }
.logo { font: 700 26px/1 var(--display); text-transform: uppercase; justify-self: start; }
.nav { display: flex; gap: 22px; font: 700 16px/1 var(--display); text-transform: uppercase; }
.clock { justify-self: end; font: 700 14px/1 var(--display); text-transform: uppercase; border: 1px solid currentColor; padding: 9px 13px; }

/* =====================================================================
   HERO: заголовок + «окно» в 3D, которое раскрывается на весь экран
   ===================================================================== */
.hero { height: 260svh; }
.hero-sticky { position: sticky; top: 0; height: 100svh; overflow: clip; display: grid; place-items: center; }
.hero-title {
  font-size: min(11.5vw, 26svh);
  margin: 0; padding: 0 var(--gutter);
  display: grid; justify-items: center; gap: .03em;
}
.line { display: flex; align-items: center; gap: .2em; white-space: nowrap; }

/* Слот в строке — резервирует место под окно (сам он невидим) */
.asset-slot {
  --aw: 1.15em; --ah: .74em;
  display: block; flex: none;
  width: var(--aw); height: var(--ah);
}

/* Полноэкранный слой WebGL; clip-path каждый кадр ставит JS */
.hero-gl {
  position: absolute; inset: 0; z-index: 2;
  clip-path: inset(50% 50%);
  background: radial-gradient(110% 110% at 50% 45%, #1d1d22, #050506);
}
.hero-gl canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-over {
  position: absolute; inset: 0; z-index: 1;
  display: grid; align-content: end; justify-items: start; gap: 14px;
  padding: 0 var(--gutter) 120px;
  pointer-events: none;
  opacity: var(--over, 0);
}
.hero-over-kicker { font: 700 13px/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.hero-over-title { font-size: clamp(44px, 7vw, 112px); color: var(--white); }

.hero-desc { position: absolute; left: var(--gutter); bottom: 22px; margin: 0; max-width: 460px; font-size: 16px; color: #d9d7d0; z-index: 3; }
.hero-scroll { position: absolute; right: var(--gutter); bottom: 22px; width: 46px; height: 46px; border: 1px solid currentColor; display: grid; place-items: center; z-index: 3; }

/* Интро-анимации заголовка (стартуют по data-intro) */
@media (prefers-reduced-motion: no-preference) {
  html[data-intro] .hero .word { transform: translateY(110%); }
  html[data-intro="reveal"] .hero .word,
  html[data-intro="done"] .hero .word { animation: reset-translate 1s var(--ease-out) forwards; animation-delay: calc(var(--w) * 60ms); }
  html[data-intro] .hero .italic .mask { transform: none; }
  html[data-intro="reveal"] .hero .italic .mask { animation: reset-italic 1s .35s var(--ease-out) forwards; }
  html[data-intro="done"] .hero .italic .mask { transform: skewX(var(--skew-deg)); }
  html[data-intro] .asset-slot { width: 0; }
  html[data-intro="reveal"] .asset-slot { animation: slot-open 1s .25s var(--ease-out) forwards; }
  html[data-intro="done"] .asset-slot { width: var(--aw); }
  html[data-intro] .hero-desc, html[data-intro] .hero-scroll { opacity: 0; }
  html[data-intro="reveal"] :is(.hero-desc, .hero-scroll),
  html[data-intro="done"] :is(.hero-desc, .hero-scroll) { animation: fade-up .9s .55s var(--ease-out) both; }
}
@keyframes reset-translate { to { transform: translateY(0); } }
@keyframes reset-italic { from { transform: skewX(0); } to { transform: skewX(var(--skew-deg)); } }
@keyframes slot-open { from { width: 0; } to { width: var(--aw); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   ОБО МНЕ
   ===================================================================== */
.about {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: calc(var(--gutter) * 2);
  padding: 18svh var(--gutter) 16svh;
}
.ribbon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.about-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 40px; }
.statement { font-size: clamp(44px, 6vw, 104px); margin: 0 0 36px; }
.statement .word { transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i) * 35ms); }
.statement.is-in .word { transform: none; }
.about-lead { font-size: 18px; max-width: 58ch; color: #3b3a37; margin: 0 0 48px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); border-top: 1px solid var(--line); }
.stats li { padding-top: 18px; }
.stats b { display: block; font: 700 clamp(56px, 6vw, 96px)/.9 var(--display); }
.stats span { display: block; font-size: 14px; color: #5b5a55; margin-top: 8px; max-width: 22ch; }

.about-photo { position: relative; z-index: 1; margin: 0; align-self: start; }
.photo-frame { aspect-ratio: 4 / 5; overflow: clip; background: var(--black); }
.photo-frame img {
  width: 100%; height: calc(100% + 120px); margin-top: -60px; object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter .8s var(--ease-out);
}
.about-photo:hover .photo-frame img { filter: none; }
/* жёлтый дуотон поверх ч/б (как синий у Lusion) */
.photo-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--accent); mix-blend-mode: multiply;
  transition: opacity .8s var(--ease-out);
}
.photo-frame { position: relative; }
.about-photo:hover .photo-frame::after { opacity: 0; }
.about-photo figcaption { margin-top: 12px; font: 700 13px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--grey); }

/* =====================================================================
   СТЕК: гигантские строки + курсор-превью
   ===================================================================== */
.stack { position: relative; z-index: 3; padding: 6svh var(--gutter) 18svh; text-align: center; border-top: 1px solid var(--line); }
.rows { list-style: none; margin: 40px 0 0; padding: 0; display: grid; justify-items: center; }
.row { display: flex; align-items: center; gap: 16px; font-size: min(13.5vw, 200px); cursor: default; flex-wrap: wrap; justify-content: center; }
.row:nth-child(even) { flex-direction: row-reverse; }
.row .word-wrap { display: inline-block; transition: transform .6s var(--ease-out); }
.row:hover .word-wrap { transform: skewX(var(--skew-deg)); }
.tile {
  --off: calc(var(--skew-tan) * .8em);
  width: .8em; height: .8em; flex: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition: clip-path .5s var(--ease-out);
}
.row:hover .tile { clip-path: polygon(var(--off) 0, 100% 0, calc(100% - var(--off)) 100%, 0 100%); }
.row-list { display: none; flex-basis: 100%; font: 500 14px/1.5 var(--text); text-transform: none; color: #5b5a55; margin: 4px 0 28px; }
@media (hover: none) { .row-list { display: block; } }

.rows .word { transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.rows.is-in .word { transform: none; }

.cursor { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; transform-origin: bottom; will-change: transform; }
.cursor-card {
  width: 300px; min-height: 320px;
  display: grid; align-content: end; gap: 10px;
  padding: 18px;
  color: #fff;
  scale: 0; transform-origin: bottom center;
  transition: scale .5s var(--ease-out);
}
.cursor-card b { font: 700 30px/1 var(--display); text-transform: uppercase; }
.cursor-card span { font: 500 14px/1.45 var(--text); }
.cursor.is-on .cursor-card { scale: 1; }

/* =====================================================================
   ИЗБРАННЫЕ ПРОЕКТЫ: липкий заголовок + карточки поверх
   ===================================================================== */
.work { position: relative; z-index: 3; background: var(--black); padding-bottom: 16svh; }
.work-title {
  position: sticky; top: 0; height: 100svh; margin: 0;
  display: grid; place-content: center; justify-items: center; text-align: center;
  font-size: min(16vw, 250px);
}
.work-title .tag { font-size: 14px; margin-bottom: 24px; }
.cards {
  position: relative; z-index: 1;
  margin-top: -55svh;
  display: flex; flex-direction: column; gap: 26svh;   /* лесенка: каждая карточка в своей строке */
  padding: 0 var(--gutter);
}
.card { width: min(42%, 640px); margin-left: 8%; background: var(--black); }
.card:nth-child(even) { margin-left: auto; margin-right: 8%; }
.card-media { position: relative; aspect-ratio: 4 / 3; cursor: crosshair; }
.card-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card-media.no-gl { border-radius: var(--radius); background: linear-gradient(140deg, #1c1c22, #3a3a44); }
.card-body { padding: 18px 2px 0; }
.card-tags { font: 700 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 12px; }
.card h3 { font: 700 clamp(30px, 3vw, 48px)/1 var(--display); text-transform: uppercase; margin: 0 0 12px; }
.card p { margin: 0 0 16px; color: #b9b7b0; font-size: 16px; }
.chips { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12px; font-weight: 500; padding: 5px 10px; border: 1px solid #ffffff2a; border-radius: 99px; color: #d9d7d0; }
.light .chips li { border-color: var(--line); color: #3b3a37; }
.chips-links a { display: inline-block; transition: color .2s; }
.chips-links li { transition: background-color .25s, border-color .25s; }
.chips-links li:hover { background: var(--accent); border-color: var(--accent); }

/* =====================================================================
   PLAY REEL (Lusion): слова разъезжаются, видео растёт
   ===================================================================== */
.reel { position: relative; z-index: 3; height: 240svh; background: var(--black); view-timeline-name: --reel; }
.reel-sticky { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; overflow: clip; }
.reel-card { position: absolute; inset: var(--gutter); border-radius: var(--radius); overflow: hidden; background: #15151a; }
.reel-card video { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); }
.reel-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #0005, #0008); }
.reel-title { position: relative; z-index: 1; display: flex; align-items: center; gap: 2.4vw; font-size: clamp(52px, 10vw, 170px); color: #fff; }
.reel-play {
  position: relative; z-index: 2;
  width: 1.1em; height: .62em; border-radius: 99px; background: var(--accent);
  display: grid; place-items: center;
  transition: scale .5s var(--ease-out);
}
.reel-play:hover { scale: 1.08; }
.reel-play::before { content: ""; border-left: .15em solid var(--black); border-block: .095em solid transparent; margin-left: .05em; }
.reel-caption { position: absolute; left: 50%; bottom: calc(var(--gutter) + 20px); translate: -50% 0; z-index: 1; margin: 0; width: min(90%, 620px); text-align: center; font-size: 15px; color: #e8e6df; }

.video-dialog { border: 0; padding: 0; background: #000; width: min(94vw, 1200px); aspect-ratio: 16 / 9; overflow: visible; }
.video-dialog::backdrop { background: rgb(0 0 0 / .85); }
.video-dialog video { width: 100%; height: 100%; display: block; }
.dialog-close { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; background: var(--accent); color: var(--black); font-size: 18px; }

/* =====================================================================
   ЕЩЁ ПРОЕКТЫ: фильтр + список (View Transitions)
   ===================================================================== */
.more { position: relative; z-index: 3; padding: 16svh var(--gutter) 10svh; }
.more-head { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 36px; }
.more-head h2 { font-size: clamp(48px, 8vw, 140px); margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: 700 14px/1 var(--display); text-transform: uppercase;
  padding: 11px 16px; border: 1px solid var(--line); border-radius: 99px;
  transition: background-color .25s, color .25s, border-color .25s;
}
.filter:hover { border-color: var(--black); }
.filter.is-active { background: var(--black); color: var(--white); border-color: var(--black); }

.project-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.p-row { border-bottom: 1px solid var(--line); view-transition-class: p-row; }
.p-link {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 20px; align-items: baseline;
  overflow-wrap: anywhere;
  padding: 22px 8px;
}
/* заливка строки слева направо при наведении */
.p-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.p-link:hover::before { transform: scaleX(1); transform-origin: left; }
.p-num { font: 700 14px/1 var(--display); color: var(--grey); }
.p-name { font: 700 clamp(24px, 2.6vw, 38px)/1.15 var(--display); text-transform: uppercase; }
.p-desc { font-size: 15px; color: #3b3a37; }
.p-desc small { display: block; margin-top: 6px; font-size: 12px; color: var(--grey); letter-spacing: .02em; }
.p-arrow { font-size: 22px; transition: translate .4s var(--ease-out); }
a.p-link:hover .p-arrow { translate: 6px -6px; }
.p-link:not(a) .p-arrow { opacity: .25; }
::view-transition-group(*.p-row) { animation-duration: .45s; animation-timing-function: cubic-bezier(.14, 1, .34, 1); }

/* =====================================================================
   ОПЫТ И ОБРАЗОВАНИЕ
   ===================================================================== */
.cv { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gutter) * 2); padding: 8svh var(--gutter) 18svh; }
.cv-col { display: grid; align-content: start; gap: 28px; }
.cv-col > .tag { justify-self: start; }
.cv-item { border-top: 1px solid var(--line); padding-top: 18px; }
.cv-item h3 { font: 700 clamp(26px, 2.6vw, 40px)/1 var(--display); text-transform: uppercase; margin: 0 0 10px; }
.cv-org { color: var(--grey); font-size: 15px; margin: 0 0 12px; }
.cv-item p { margin: 0 0 12px; color: #3b3a37; }
.cv-item ul:not(.chips) { margin: 0; padding-left: 18px; color: #3b3a37; }
.cv-item li { margin-bottom: 4px; }

/* =====================================================================
   КОНТАКТЫ: футер-занавес
   ===================================================================== */
.cta {
  position: relative; z-index: 0;
  min-height: 100svh;
  background: var(--accent); color: var(--black);
  display: grid; align-content: center; justify-items: center; gap: 44px;
  text-align: center; padding: 100px var(--gutter) 90px;
}
.cta h2 { font-size: min(20vw, 300px); margin: 0; }
.cta .italic .mask { transform: none; }
.cta.is-in .italic .mask { transform: skewX(var(--skew-deg)); transition: transform 1s .2s var(--ease-out); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 28px; }
.footer { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 20px; display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }

/* =====================================================================
   SCROLL-DRIVEN — только где поддерживается
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .photo-frame { animation: scroll-inset linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    @keyframes scroll-inset { from { clip-path: inset(0 12%); } to { clip-path: inset(0); } }

    [data-scroll="shift"] { animation: scroll-shift linear both; animation-timeline: view(); animation-range: cover; }
    @keyframes scroll-shift { from { translate: 0 -50px; } to { translate: 0 50px; } }

    .card { animation: scroll-rise linear both; animation-timeline: view(); animation-range: entry; }
    @keyframes scroll-rise { from { translate: 0 25svh; } }

    .reel-card { animation: reel-grow linear both; animation-timeline: --reel; animation-range: contain 0% contain 55%; }
    @keyframes reel-grow { from { inset: 24svh 32vw; border-radius: 40px; } }
    .reel-word-l { animation: split-l linear both; animation-timeline: --reel; animation-range: contain 0% contain 55%; }
    .reel-word-r { animation: split-r linear both; animation-timeline: --reel; animation-range: contain 0% contain 55%; }
    @keyframes split-l { from { translate: 14vw 0; opacity: 0; } 40% { opacity: 1; } }
    @keyframes split-r { from { translate: -10vw 0; opacity: 0; } 40% { opacity: 1; } }

    /* занавес: секция стоит на месте, верхние уезжают */
    .cta { animation: scroll-pin linear both; animation-timeline: view(); animation-range: entry; }
    @keyframes scroll-pin { from { translate: 0 -100%; } to { translate: 0 0; } }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 100svh; }
  .tag { clip-path: none; }
  .statement .word, .rows .word { transform: none; transition: none; }
  .roll .ch span { transition: none; }
}

/* =====================================================================
   АДАПТИВ
   ===================================================================== */
@media (max-width: 900px) {
  .nav { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  .about, .cv { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .stats { grid-template-columns: 1fr; }
  .card, .card:nth-child(even) { width: 100%; margin: 0; }
  .cards { row-gap: 14svh; }
  .p-link { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .p-desc { grid-column: 2 / -1; grid-row: 2; }
  .footer { flex-direction: column; align-items: center; position: static; margin-top: 20px; }
  .hero-desc { max-width: 70%; font-size: 14px; }
}
@media (max-width: 560px) {
  .hero-title { font-size: 10.5vw; }
  .line { gap: .15em; }
  .btn-skew { min-width: 0; gap: 20px; }
}

/* =====================================================================
   REVIXIE: дополнения к стилю v1
   ===================================================================== */
/* Манифест вместо фото — чёрная карточка с крутящимся знаком */
.manifesto { display: grid; align-content: space-between; padding: 28px; color: var(--white); background: var(--black); }
.manifesto::after { display: none; }
.mf-mark { font-size: clamp(110px, 13vw, 210px); color: var(--accent); line-height: .8; display: inline-block; animation: mf-spin 14s linear infinite; transform-origin: 30% 55%; }
@keyframes mf-spin { 50% { transform: skewX(var(--skew-deg)); } }
.mf-list { list-style: none; margin: 0; padding: 0; counter-reset: mf; display: grid; gap: 0; }
.mf-list li { counter-increment: mf; display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid #ffffff22; font: 700 clamp(20px, 1.8vw, 28px)/1.05 var(--display); text-transform: uppercase; }
.mf-list li::before { content: "0" counter(mf); color: var(--accent); font-size: .6em; padding-top: .3em; }

/* Интерлюдия: анимированный градиент вместо видео */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.reel-gradient {
  background:
    radial-gradient(circle at 22% 30%, #ffd60a66, transparent 42%),
    radial-gradient(circle at 78% 72%, #ff3b3055, transparent 40%),
    conic-gradient(from var(--spin) at 50% 50%, #0b0b0c, #2a2a30, #ffd60a, #0b0b0c 70%, #3a2a00, #0b0b0c);
  animation: spin-bg 16s linear infinite;
}
@keyframes spin-bg { to { --spin: 1turn; } }
.reel-mark { display: grid; place-items: center; cursor: default; }
.reel-mark::before { content: "✺"; border: 0; margin: 0; font: 700 .42em/1 var(--display); color: var(--black); animation: mf-rot 6s linear infinite; }
@keyframes mf-rot { to { rotate: 1turn; } }
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .reel-card.reel-gradient { animation: spin-bg 16s linear infinite, reel-grow linear both; animation-timeline: auto, --reel; animation-range: normal, contain 0% contain 55%; }
  }
}
.chips-links span { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .mf-mark, .reel-mark::before, .reel-gradient { animation: none; } }

/* =====================================================================
   REVIXIE: ВНУТРЕННИЕ СТРАНИЦЫ
   ===================================================================== */
.nav a.is-current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
html.is-leaving { pointer-events: none; }

/* ---------- Заголовок страницы ---------- */
.phero { min-height: 92svh; display: grid; align-content: end; gap: 28px; padding: 140px var(--gutter) 9svh; position: relative; overflow: clip; }
.phero-meta { display: flex; gap: 14px; align-items: center; font: 700 14px/1 var(--display); text-transform: uppercase; color: var(--grey); }
.phero-meta a { color: var(--grey); }
.phero-meta a:hover { color: var(--accent); }
.phero-title { font-size: min(15.5vw, 240px); margin: 0; }
.phero-title .line { display: block; white-space: normal; }
.phero-lead { max-width: 640px; margin: 0; font-size: clamp(17px, 1.4vw, 21px); color: #d9d7d0; }
.phero-bg { position: absolute; right: -6vw; top: 50%; translate: 0 -50%; font: 700 min(60vw, 900px)/.8 var(--display); color: #ffffff06; pointer-events: none; user-select: none; }
@media (prefers-reduced-motion: no-preference) {
  html[data-intro] .phero .word { transform: translateY(110%); }
  html[data-intro="reveal"] .phero .word, html[data-intro="done"] .phero .word { animation: reset-translate 1s var(--ease-out) forwards; animation-delay: calc(var(--w, 0) * 70ms); }
  html[data-intro] .phero .italic .mask { transform: none; }
  html[data-intro="reveal"] .phero .italic .mask { animation: reset-italic 1s .35s var(--ease-out) forwards; }
  html[data-intro="done"] .phero .italic .mask { transform: skewX(var(--skew-deg)); }
  html[data-intro] .phero :is(.phero-lead, .phero-meta) { opacity: 0; }
  html[data-intro="reveal"] .phero :is(.phero-lead, .phero-meta), html[data-intro="done"] .phero :is(.phero-lead, .phero-meta) { animation: fade-up .9s .5s var(--ease-out) both; }
}

/* ---------- Общие секции ---------- */
.sec { position: relative; z-index: 3; padding: 14svh var(--gutter); }
.sec.dark { background: var(--black); color: var(--white); }
.sec-head { display: grid; gap: 22px; justify-items: start; margin-bottom: 7svh; }
.sec-head h2 { font-size: clamp(48px, 8vw, 132px); margin: 0; }
.sec-head p { max-width: 640px; margin: 0; font-size: 18px; color: #3b3a37; }
.sec.dark .sec-head p { color: #b9b7b0; }
.split-words .word { transform: translateY(105%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i) * 40ms); }
.split-words.is-in .word { transform: none; }
.reveal { opacity: 0; translate: 0 40px; transition: opacity .9s var(--ease-out), translate 1s var(--ease-out); }
.reveal.is-in { opacity: 1; translate: 0 0; }
.more-link { display: inline-flex; margin-top: 40px; }

/* ---------- Манифест: большие правила ---------- */
.rules { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: minmax(90px, 180px) 1fr 1.1fr; gap: var(--gutter); align-items: start; padding: 36px 0; border-top: 1px solid var(--line); }
.rules li::before { content: "0" counter(r); font: 700 clamp(64px, 8vw, 128px)/.8 var(--display); color: var(--accent); -webkit-text-stroke: 2px var(--black); }
.rules h3 { margin: 0; font: 700 clamp(30px, 3.6vw, 56px)/.95 var(--display); text-transform: uppercase; }
.rules p { margin: 0; font-size: 18px; color: #3b3a37; max-width: 560px; }

/* ---------- Роли команды ---------- */
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gutter); }
.role { padding: 26px 0 0; border-top: 3px solid var(--accent); }
.role h3 { margin: 0 0 12px; font: 700 34px/1 var(--display); text-transform: uppercase; }
.role p { margin: 0 0 16px; color: #b9b7b0; }

/* ---------- Ритм недели ---------- */
.week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--line); border: 2px solid var(--black); }
.week div { background: var(--white); padding: 22px 18px 26px; min-height: 220px; display: grid; align-content: start; gap: 10px; }
.week b { font: 700 46px/1 var(--display); text-transform: uppercase; }
.week div:nth-child(5) { background: var(--accent); }
.week span { font-size: 15px; color: #3b3a37; }

/* ---------- Услуги подробно ---------- */
.svc { display: grid; grid-template-columns: 1fr 1.25fr; gap: calc(var(--gutter) * 2); padding: 8svh 0; border-top: 1px solid var(--line); scroll-margin-top: 60px; }
.svc-title { position: sticky; top: 90px; align-self: start; display: grid; gap: 18px; }
.svc-title h3 { margin: 0; font: 700 clamp(48px, 6.5vw, 108px)/.86 var(--display); text-transform: uppercase; }
.svc-title .tile { width: 100px; height: 100px; }
.svc-title p { margin: 0; font-size: 18px; color: #3b3a37; max-width: 460px; }
.svc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 26px var(--gutter); }
.svc-info h4 { margin: 0 0 10px; font: 700 14px/1 var(--display); text-transform: uppercase; color: var(--grey); letter-spacing: .04em; }
.svc-info ul { margin: 0; padding-left: 18px; }
.svc-info li { margin-bottom: 6px; }
.svc-info .wide { grid-column: 1 / -1; }
.svc-time { font: 700 40px/1 var(--display); text-transform: uppercase; }
.rows .row a { color: inherit; }

/* ---------- Форматы ---------- */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.format { position: relative; padding: 30px 26px 34px; border: 2px solid var(--white); display: grid; gap: 14px; align-content: start; transition: background-color .3s, color .3s; }
.format:hover { background: var(--accent); color: var(--black); border-color: var(--accent); }
.format h3 { margin: 0; font: 700 44px/.95 var(--display); text-transform: uppercase; }
.format .f-time { font: 700 15px/1 var(--display); text-transform: uppercase; color: var(--accent); }
.format:hover .f-time { color: var(--black); }
.format ul { margin: 0; padding-left: 18px; color: inherit; }

/* ---------- Кейсы полностью ---------- */
.cases-full { display: grid; gap: 16svh; }
.case-full.card { width: auto; margin: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: calc(var(--gutter) * 2); align-items: center; background: transparent; scroll-margin-top: 80px; }
.case-full.card:nth-child(even) .card-media { order: 2; }
.case-full .card-body { padding: 0; }
.case-full h3 { font-size: clamp(44px, 5vw, 84px) !important; }
.case-full dl { margin: 20px 0 22px; display: grid; gap: 14px; }
.case-full dt { font: 700 13px/1 var(--display); text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.case-full dd { margin: 0; color: #c9c7c0; }

/* ---------- Процесс по шагам ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.step { counter-increment: s; display: grid; grid-template-columns: minmax(110px, 220px) 1.1fr 1fr; gap: calc(var(--gutter) * 1.5); padding: 7svh 0; border-top: 1px solid var(--line); }
.step::before { content: "0" counter(s); font: 700 clamp(90px, 11vw, 190px)/.78 var(--display); color: transparent; -webkit-text-stroke: 2px var(--black); transition: color .5s; }
.step.is-in::before { color: var(--accent); }
.step h3 { margin: 0 0 6px; font: 700 clamp(36px, 4vw, 64px)/.92 var(--display); text-transform: uppercase; }
.step .s-time { display: inline-block; margin-bottom: 16px; padding: 6px 10px; background: var(--black); color: var(--accent); font: 700 13px/1 var(--display); text-transform: uppercase; }
.step p { margin: 0; color: #3b3a37; }
.step h4 { margin: 0 0 10px; font: 700 14px/1 var(--display); text-transform: uppercase; color: var(--grey); }
.step ul { margin: 0; padding-left: 18px; }

/* ---------- Вопросы ---------- */
.faq details { border-top: 1px solid #ffffff22; }
.faq details:last-child { border-bottom: 1px solid #ffffff22; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; padding: 26px 0; font: 700 clamp(24px, 2.8vw, 42px)/1 var(--display); text-transform: uppercase; transition: color .25s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); transition: rotate .4s var(--ease-out); }
.faq details[open] summary::after { rotate: 45deg; }
.faq summary:hover { color: var(--accent); }
:root { interpolate-size: allow-keywords; }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size .5s var(--ease-out), content-visibility .5s allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq .a { padding: 0 0 28px; max-width: 760px; color: #c9c7c0; font-size: 17px; }

/* ---------- Форма брифа ---------- */
.brief-wrap { display: grid; grid-template-columns: 1.4fr .8fr; gap: calc(var(--gutter) * 2.5); align-items: start; }
.brief { display: grid; gap: 34px; }
.field { display: grid; gap: 10px; }
.field > span, .choice-label { font: 700 14px/1 var(--display); text-transform: uppercase; color: var(--grey); letter-spacing: .04em; }
.field input, .field textarea { font: 500 clamp(20px, 2vw, 28px)/1.3 var(--text); color: var(--black); background: none; border: 0; border-bottom: 2px solid var(--black); padding: 8px 0 10px; outline: none; resize: vertical; transition: border-color .25s; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 120px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice button { font: 700 16px/1 var(--display); text-transform: uppercase; padding: 14px 18px; border: 2px solid var(--black); transition: background-color .2s, color .2s, transform .3s var(--ease-out); }
.choice button:hover { transform: translateY(-2px); }
.choice button[aria-pressed="true"] { background: var(--black); color: var(--accent); }
.brief-note { margin: 0; min-height: 1.5em; color: #3b3a37; }
.aside-card { position: sticky; top: 100px; display: grid; gap: 22px; padding: 30px; background: var(--black); color: var(--white); }
.aside-card h3 { margin: 0; font: 700 34px/1 var(--display); text-transform: uppercase; }
.aside-card ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: #c9c7c0; }
.aside-card a { color: var(--accent); }
.page-foot { display: flex; justify-content: space-between; gap: 16px; padding: 28px var(--gutter); background: var(--black); color: #8b8a85; font-size: 14px; }
.page-foot a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .rules li, .step { grid-template-columns: 1fr; gap: 12px; }
  .week { grid-template-columns: 1fr; }
  .week div { min-height: 0; }
  .svc, .brief-wrap { grid-template-columns: 1fr; }
  .svc-title { position: static; }
  .svc-info { grid-template-columns: 1fr; }
  .formats { grid-template-columns: 1fr; }
  .case-full.card { grid-template-columns: 1fr; }
  .case-full.card:nth-child(even) .card-media { order: 0; }
  .aside-card { position: static; }
  .page-foot { flex-direction: column; }
}

/* ---------- Меню на телефоне ---------- */
.menu-btn { display: none; font: 700 14px/1 var(--display); text-transform: uppercase; color: inherit; border: 1px solid currentColor; padding: 9px 13px; justify-self: end; }
@media (max-width: 900px) {
  .menu-btn { display: inline-block; }
  .site-header .clock { display: none; }
  body.menu-open .site-header { mix-blend-mode: normal; }
  body.menu-open .nav { display: flex; position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 4px; padding: 0 var(--gutter); background: var(--black); font-size: clamp(44px, 13vw, 90px); animation: fade-up .45s var(--ease-out) both; }
  body.menu-open .nav a { padding: 4px 0; }
  body.menu-open { overflow: hidden; }
}
