/* ================= ТОКЕНЫ ================= */
:root {
  --bg: #000;
  --fg: #fff;
  --soft: #b8b8b8;     /* основной вторичный текст */
  --mute: #7d7d7d;     /* подписи */
  --dim: #4b4b4b;      /* совсем тихое */
  --line: rgba(255, 255, 255, .13);
  --red: #F7043F;      /* единственный акцент, из айдентики */

  --sans: 'Geologica', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --kz: 'Golos Text', system-ui, sans-serif;

  --ease: cubic-bezier(.77, 0, .18, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --bar: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--red); outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* дорожка прокрутки: невидимая, задаёт длину глав */
.track { position: relative; z-index: 0; pointer-events: none; }
.chap { height: calc(var(--n) * 100vh); }

/* ================= КАРКАС: экран стоит на месте ================= */
.app {
  position: fixed; inset: 0; z-index: 1;
  display: grid;
  grid-template-columns: clamp(300px, 32vw, 480px) minmax(0, 1fr);
  grid-template-rows: var(--bar) minmax(0, 1fr);
  grid-template-areas: "bar bar" "term stage";
}

/* ---------- верхняя полоса ---------- */
.bar {
  grid-area: bar;
  position: relative;
  display: flex; align-items: center; gap: 28px;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; text-decoration: none; font-weight: 500; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand img { flex: none; }
.chapters { display: flex; gap: clamp(12px, 1.5vw, 22px); margin-left: auto; min-width: 0; }
.chapters a { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--mute); text-decoration: none; transition: color .3s; white-space: nowrap; }
.chapters a b { font: 400 10px var(--mono); color: var(--dim); transition: color .3s; }
.chapters a:hover { color: var(--fg); }
.chapters a.on { color: var(--fg); }
.chapters a.on b { color: var(--red); }
.now { display: none; margin-left: auto; font: 400 12px var(--mono); color: var(--soft); white-space: nowrap; }
.now b { color: var(--red); font-weight: 400; }
.bar-tg {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--fg);
  font-size: 13px; text-decoration: none;
  transition: background .25s, color .25s;
}
.bar-tg:hover { background: var(--fg); color: var(--bg); }
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--red);
  transform-origin: 0 50%; transform: scaleX(0);
}
@media (max-width: 1180px) { .chapters a b { display: none; } }
@media (max-width: 1000px) { .chapters { display: none; } .now { display: block; } }

/* ---------- терминал ---------- */
.term {
  grid-area: term;
  container: term / inline-size;
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  border-right: 1px solid var(--line);
  font: 400 13px/1.65 var(--mono);
}
.term-head { display: flex; justify-content: space-between; padding: 14px 22px 6px; font-size: 11px; color: var(--dim); }
#term-state.busy { color: var(--red); }
.term-out {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 6px 22px 14px;
  color: var(--mute);
  white-space: pre-wrap; overflow-wrap: anywhere;
  scrollbar-width: thin; scrollbar-color: #333 transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 48px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 48px);
}
/* перенесённая строка уходит под начало текста, а не под первый символ */
.term-out > div { min-height: 1.65em; padding-left: 2ch; text-indent: -2ch; }
.term-out .c { color: var(--fg); margin-top: 10px; }
.term-out .c .p { color: var(--red); }
.term-out .c.g .p { color: var(--mute); }
.term-out .hl { color: var(--fg); }
.term-out .dim { color: var(--dim); }
.term-out .err { color: var(--red); }
.term-out .tag { color: var(--red); }
.term-out a { color: var(--fg); text-decoration-color: var(--red); text-underline-offset: 3px; }
.term-out .caret::after { content: ''; display: inline-block; width: .6em; height: 1.1em; margin-left: 1px; vertical-align: -.2em; background: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-in { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); cursor: text; }
.term-in .ps { color: var(--mute); white-space: nowrap; }
.term-in input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--fg); font: inherit; caret-color: var(--red); }
.term-in input::placeholder { color: var(--dim); }
.term-in:focus-within .ps { color: var(--red); }
@container term (max-width: 380px) {
  .term-head, .term-out, .term-in { padding-left: 16px; padding-right: 16px; }
  .term-out, .term-in { font-size: 12px; }
}
@container term (max-width: 300px) {
  .term-out, .term-in { font-size: 11px; }
}

/* ---------- сцена ---------- */
.stage { grid-area: stage; position: relative; overflow: hidden; min-width: 0; container: stage / size; }
.scene {
  --pad: clamp(18px, 4.2cqmin, 56px);
  position: absolute; inset: 0;
  padding: var(--pad);
  visibility: hidden;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease);
  background: var(--bg);
}
.scene.leaving { transition: transform 1s var(--ease), filter 1s var(--ease); transform: scale(.965); filter: brightness(.35); }

/* появление содержимого */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--out), transform 1s var(--out); transition-delay: var(--d, 0s); }
.scene.in .rv { opacity: 1; transform: none; }

/* ---------- типографика: от размера сцены, а не окна ---------- */
.display {
  margin: 0;
  font-weight: 600;
  font-style: oblique 10deg;
  font-size: clamp(44px, min(12.5cqw, 17cqh), 150px);
  line-height: .92;
  letter-spacing: -.05em;
  padding-right: .1em; /* наклон не обрезается справа */
}
.h {
  margin: 0;
  font-weight: 600;
  font-style: oblique 10deg;
  font-size: clamp(26px, min(6.2cqw, 8cqh), 60px);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.lede { margin: 0; max-width: 40ch; font-size: clamp(15px, 1.9cqw, 19px); color: var(--soft); text-wrap: pretty; }
.sub { margin: 10px 0 0; font-size: 15px; color: var(--mute); max-width: 52ch; }
.scene-head { position: relative; z-index: 2; min-width: 0; }

/* ================= 01 ИНТРО ================= */
/* имя и знак — один блок; размер знака привязан к размеру имени, поэтому они не разъезжаются */
.s-intro {
  --fs: clamp(44px, min(10.5cqw, 15cqh), 210px);
  display: flex; flex-direction: column; justify-content: center;
}
.intro-wrap { display: flex; align-items: center; gap: calc(var(--fs) * .55); min-width: 0; }
.intro-text { display: grid; gap: clamp(16px, 3cqh, 32px); min-width: 0; }
.s-intro .display { font-size: var(--fs); }
.s-intro .lede { font-size: clamp(15px, calc(var(--fs) * .14), 22px); }
.intro-mark { flex: none; height: calc(var(--fs) * 2.6); width: auto; overflow: visible; }
.im { fill: transparent; stroke: var(--fg); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: miter; }
.im.f, .im.o, .im.p { stroke-dasharray: 1; stroke-dashoffset: 1; }
.im.o2 { opacity: 0; }
.scene.in .im.f, .scene.in .im.o, .scene.in .im.p { animation: draw 1.8s var(--ease) forwards .2s; }
.scene.in .im.p { animation-delay: .45s; }
.scene.in .im.p { transition: fill .9s var(--out) 1.9s; fill: var(--red); }
.scene.in .im.f { transition: fill .9s var(--out) 2.1s; fill: var(--fg); }
.scene.in .im.o2 { transition: opacity .6s 2.2s; opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scroll-hint {
  position: absolute; right: var(--pad); bottom: var(--pad);
  display: flex; align-items: center; gap: 12px;
  margin: 0; font: 400 12px var(--mono); color: var(--mute);
}
.scroll-hint i { position: relative; width: 1px; height: 44px; background: var(--line); overflow: hidden; }
.scroll-hint i::after { content: ''; position: absolute; left: 0; top: -100%; width: 1px; height: 100%; background: var(--fg); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }
/* узкая сцена: знак над именем */
@container stage (max-width: 640px) {
  .s-intro { --fs: clamp(44px, 15cqw, 96px); justify-content: flex-end; }
  .intro-wrap { flex-direction: column; align-items: flex-start; gap: 24px; }
  .intro-mark { order: -1; height: min(calc(var(--fs) * 2.2), 34cqh); }
  .scroll-hint { display: none; }
}
@container stage (max-height: 360px) { .s-intro .lede { display: none; } }

/* svg внутри grid-ячейки: абсолютно в обёртке, иначе Safari считает высоту по-своему и схема наезжает на текст */
.svg-box { position: relative; min-height: 0; min-width: 0; }
.svg-box > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ================= 02 СЕРВЕРЫ: схема ================= */
.s-infra { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 3cqh, 24px); }
.flow { overflow: visible; }
.flow .zone rect { fill: none; stroke: rgba(255, 255, 255, .2); stroke-dasharray: 3 6; }
.flow .zone text { fill: var(--mute); font: 400 11px var(--mono); }
.flow .edge { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1.4; transition: stroke .5s; }
.flow .edge.seen { stroke: rgba(255, 255, 255, .38); }
.flow .edge.act { stroke: var(--red); stroke-dasharray: 5 6; animation: flowdash .7s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -11; } }
.flow .pk { fill: var(--red); }
.flow .node rect { fill: var(--bg); stroke: rgba(255, 255, 255, .2); stroke-width: 1.2; transition: stroke .5s, fill .5s; }
.flow .node text { fill: var(--dim); font-family: var(--sans); font-weight: 500; transition: fill .5s; }
.flow .node text.s { font-family: var(--mono); font-weight: 400; }
.flow .node.on rect { stroke: var(--fg); }
.flow .node.on text { fill: var(--fg); }
.flow .node.on text.s { fill: var(--mute); }
.flow .node.live text.s { fill: #46d17a; }
.flow-cap { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: baseline; min-height: 3.3em; }
.flow-n { font: 400 12px var(--mono); color: var(--red); }
.flow-cap p { margin: 0; max-width: 62ch; font-size: clamp(14px, 1.9cqw, 18px); color: var(--soft); text-wrap: pretty; }
@container stage (max-width: 640px) {
  .flow-cap { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .s-infra .sub { display: none; }
}
@container stage (max-height: 520px) {
  .s-infra .sub { display: none; }
}
@media (max-width: 820px), (max-height: 520px) {
  /* камера наезжает на узлы: края схемы плавно гаснут, а не режутся */
  .flow {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    mask-composite: intersect;
  }
}

/* ================= 03 ЖЕЛЕЗО: чертёж ================= */
.s-hw { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(12px, 3cqh, 24px); }
.blueprint .gd { stroke: rgba(255, 255, 255, .045); stroke-width: 1; }
.blueprint .ln { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: square; }
.blueprint .fr { stroke: var(--fg); }
.blueprint .fr.hot { stroke: var(--red); }
.blueprint .bk, .blueprint .cn { stroke: rgba(255, 255, 255, .3); }
.blueprint .dm { stroke: var(--mute); }
.blueprint text { fill: var(--mute); font: 400 11px var(--mono); opacity: 0; transition: opacity .6s; }
.blueprint text.on { opacity: 1; }
.hw-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3cqw, 28px); }
.hw-list li { padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--mute); text-wrap: pretty; }
.hw-list b { display: block; margin-bottom: 6px; font-weight: 500; font-size: 16px; color: var(--fg); }
@container stage (max-width: 760px) {
  /* на узком экране чертёж поменьше, зато видны все три пункта */
  .s-hw { grid-template-rows: auto minmax(110px, 1fr) auto; }
  .hw-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hw-list li { padding: 9px 0; font-size: 13px; line-height: 1.45; }
  .hw-list b { font-size: 14px; margin-bottom: 2px; }
}
@container stage (max-height: 520px) {
  .hw-list li { font-size: 0; padding: 6px 0; }
  .hw-list b { margin: 0; }
}

/* ================= 04 ФОТО: стена плиток, колонки едут навстречу друг другу ================= */
.s-photo { padding: 0; }
.wall { position: absolute; inset: 0; display: flex; align-items: flex-start; gap: 10px; padding: 0 10px; overflow: hidden; }
.wall-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; will-change: transform; }
.tile {
  position: relative; display: block; flex: none; width: 100%; padding: 0; border: 0;
  background: #111; overflow: hidden; cursor: zoom-in;
  transition: opacity .4s var(--out);
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--out), filter .4s; }
.tile:hover img { transform: scale(1.04); }
.wall:hover .tile:not(:hover) { opacity: .35; }
.tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  font-size: 13px; text-align: left;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .4s var(--out);
}
.tile-cap small { display: block; font: 400 11px var(--mono); color: var(--soft); }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
.tile:focus-visible { outline-offset: -2px; }
.wall-label {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  max-width: min(420px, 100%);
  padding: clamp(16px, 3cqmin, 28px) clamp(18px, 4cqmin, 40px);
  background: var(--bg);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line);
}
.wall-label p { margin: 8px 0 0; font-size: 14px; color: var(--mute); }
@container stage (max-width: 520px) { .wall-label p { display: none; } .wall-label { padding: 12px 16px; } }

/* просмотр фото */
.viewer { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: rgba(0, 0, 0, .96); }
.viewer[hidden] { display: none; }
.viewer img { width: 100%; height: 100%; object-fit: contain; padding: clamp(12px, 3vw, 40px); animation: vIn .5s var(--out); }
@keyframes vIn { from { opacity: 0; transform: scale(.98); } }
.v-bar { display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 3vw, 40px) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.v-n { font: 400 12px var(--mono); color: var(--red); flex: none; }
.v-cap { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-cap small { margin-left: 10px; font: 400 12px var(--mono); color: var(--mute); }
.v-btn { flex: none; padding: 8px 14px; background: none; border: 1px solid var(--line); font: 400 14px var(--sans); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.v-btn:hover { border-color: var(--fg); }
.v-close { border-color: var(--fg); }
.v-close:hover { background: var(--fg); color: var(--bg); }

/* ================= 05 КЛИПЫ ================= */
.s-video { display: grid; grid-template-rows: auto auto minmax(0, 1fr); align-content: start; gap: clamp(14px, 3cqh, 28px); }
.vid-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(16px, 3.4cqw, 40px); align-items: stretch; min-width: 0; }
.poster, .vid-top iframe {
  position: relative; display: block; aspect-ratio: 16 / 9;
  width: min(100%, calc(44cqh * 16 / 9));
  padding: 0; border: 1px solid var(--line); background: #111;
  overflow: hidden; cursor: pointer;
}
.poster img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) brightness(.85); transition: filter .6s, transform 1.2s var(--out); }
.poster:hover img { filter: none; transform: scale(1.03); }
.play { position: absolute; left: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--fg); transition: background .3s, border-color .3s; }
.play::after { content: ''; position: absolute; left: 20px; top: 16px; border: 10px solid transparent; border-left: 15px solid var(--fg); border-right: 0; }
.poster:hover .play { background: var(--red); border-color: var(--red); }
.vid-meta { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
.vid-kicker { margin: 0 0 6px; font: 400 12px var(--mono); color: var(--mute); }
.vid-meta h3 { margin: 0 0 18px; font-weight: 600; font-style: oblique 10deg; font-size: clamp(24px, 3.6cqw, 40px); line-height: 1; letter-spacing: -.035em; }
.vid-meta dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; font-size: 14px; }
.vid-meta dt { margin-top: 10px; font: 400 11px var(--mono); color: var(--mute); }
.vid-meta dd { margin: 0; color: var(--soft); }
.vid-stat { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.vid-stat b { display: block; font-weight: 600; font-size: clamp(22px, 3cqw, 34px); letter-spacing: -.03em; color: var(--fg); }

/* лента других съёмок: высота по месту, едет вбок при прокрутке */
.reel-box { position: relative; min-height: 0; overflow: hidden; }
.reel { position: absolute; left: 0; top: 0; bottom: 0; display: flex; gap: 12px; will-change: transform; }
.card { flex: none; display: flex; flex-direction: column; gap: 8px; height: 100%; text-decoration: none; }
.card-img { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #111; border: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.3) brightness(.85); transition: filter .4s, transform .8s var(--out); }
.card:hover .card-img img { filter: none; transform: scale(1.05); }
.card-t { font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.card-d { margin-top: -6px; font: 400 11px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover .card-t { color: var(--red); }
@container stage (max-width: 700px) {
  .vid-top { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .poster { width: min(100%, calc(36cqh * 16 / 9)); }
  .vid-meta dl, .vid-stat { display: none; }
  .vid-meta h3 { margin-bottom: 0; }
}
@container stage (max-height: 520px) { .reel-box { display: none; } .s-video { grid-template-rows: auto auto; } .vid-stat { display: none; } }

/* ================= 06 ИВЕНТЫ: по очереди раскрывается каждый ================= */
.s-events { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(0, 1.6fr); gap: clamp(20px, 4cqw, 56px); }
.ev-side { display: flex; flex-direction: column; gap: clamp(16px, 4cqh, 32px); min-width: 0; }
.ev-index { list-style: none; margin: 0; padding: 0; counter-reset: ev; }
.ev-index li { counter-increment: ev; }
.ev-index button {
  display: grid; grid-template-columns: 2.4em minmax(0, 1fr); width: 100%;
  padding: 9px 0; background: none; border: 0; border-top: 1px solid var(--line);
  font-size: 14px; text-align: left; color: var(--dim); cursor: pointer;
  transition: color .3s, padding .4s var(--out);
}
.ev-index button::before { content: counter(ev, decimal-leading-zero); font: 400 11px var(--mono); padding-top: .25em; }
.ev-index button:hover { color: var(--soft); }
.ev-index li.past button { color: var(--mute); }
.ev-index li.on button { color: var(--fg); padding-left: 8px; }
.ev-index li.on button::before { color: var(--red); }
.ev-stage { position: relative; min-width: 0; min-height: 0; }
.ev-card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: safe flex-end; gap: 14px;
  overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(24px);
  transition: opacity .5s var(--out), transform .7s var(--out), visibility 0s .5s;
}
.ev-card.on { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--out) .1s, transform .8s var(--out) .1s, visibility 0s; }
.ev-img { flex: 1 1 auto; min-height: 0; max-height: 52cqh; overflow: hidden; border: 1px solid var(--line); background: #111; }
.ev-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--out); }
.ev-card.on .ev-img img { transform: none; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 400 12px var(--mono); color: var(--mute); }
.ev-meta .r { color: var(--red); }
.ev-card h3 { margin: 0; font-weight: 600; font-style: oblique 10deg; font-size: clamp(26px, 4.4cqw, 54px); line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.ev-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-width: 64ch; }
.ev-points li { position: relative; padding-left: 18px; font-size: clamp(14px, 1.7cqw, 16px); color: var(--soft); text-wrap: pretty; }
.ev-points li::before { content: ''; position: absolute; left: 0; top: .72em; width: 8px; height: 1px; background: var(--red); }
.ev-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.ev-links a { text-underline-offset: 4px; text-decoration-color: var(--red); }
.ev-links a:hover { color: var(--red); }
.ev-card.noimg h3 { font-size: clamp(30px, 6cqw, 72px); }
.ev-card.noimg::before {
  content: attr(data-n);
  margin-bottom: auto;
  font: 200 clamp(90px, 26cqh, 280px)/.8 var(--sans);
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .22);
}
@container stage (max-height: 520px) { .ev-card.noimg::before { display: none; } }
@container stage (max-width: 760px) {
  .s-events { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 14px; }
  .ev-index { display: flex; gap: 4px; }
  .ev-index li { flex: 1; }
  .ev-index button { height: 3px; padding: 0; border: 0; background: var(--dim); font-size: 0; }
  .ev-index button::before { content: none; }
  .ev-index li.past button { background: var(--soft); }
  .ev-index li.on button { background: var(--red); padding: 0; }
  .ev-img { max-height: 30cqh; }
}
@container stage (max-height: 620px) { .ev-img { max-height: 34cqh; } .ev-points li:nth-child(n+3) { display: none; } }
@container stage (max-height: 460px) {
  .ev-img { display: none; }
  .ev-card { gap: 10px; }
  .ev-points li:nth-child(n+2) { display: none; }
  .ev-card h3, .ev-card.noimg h3 { font-size: clamp(24px, 7cqw, 34px); }
}

/* ================= 07 KLEMZU ================= */
.s-klemzu { padding: 0; display: grid; place-items: center; background: #F2F2F7; color: #313131; font-family: var(--kz); overflow: hidden; }
.hexmap { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.kz-card {
  position: relative; z-index: 2;
  width: min(calc(100% - 32px), 500px);
  max-height: calc(100% - 32px);
  padding: clamp(20px, 4cqmin, 40px);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .36));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: inset 0 1.5px 0 #fff, inset 0 -10px 30px rgba(255, 255, 255, .35), 0 24px 60px rgba(49, 49, 49, .14);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  text-align: center;
}
.kz-logo { width: clamp(56px, 12cqh, 96px); height: auto; aspect-ratio: 1; margin: 0 auto 4px; }
.kz-title { margin: 0 0 12px; font: 700 clamp(36px, min(9cqw, 9cqh), 68px)/1 var(--kz); letter-spacing: -.03em; }
.kz-text { margin: 0 auto 10px; max-width: 40ch; font-size: clamp(14px, 2.6cqmin, 17px); text-wrap: pretty; }
.kz-team { margin: 0 0 22px; color: #6b6b70; font-size: 15px; }
.kz-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: center; align-items: center; }
.kz-btn { padding: 13px 22px; border-radius: 999px; background: #1F57FF; color: #fff; font-weight: 600; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 20px rgba(31, 87, 255, .3); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.kz-btn:hover { transform: scale(1.04); }
.kz-link { color: #1F57FF; font-weight: 600; text-underline-offset: 4px; }
.kz-slogan { margin: 22px 0 0; font-weight: 700; font-size: 18px; }
.s-klemzu :focus-visible { outline-color: #1F57FF; }
@container stage (max-height: 620px) { .kz-team, .kz-slogan { display: none; } .kz-text { margin-bottom: 18px; } }
@container stage (max-height: 440px) { .kz-logo { display: none; } .kz-title { margin-bottom: 6px; } }
@container stage (max-width: 480px) { .kz-btn { padding: 11px 18px; } }

/* ================= 08 СВЯЗЬ ================= */
.s-contact { display: flex; flex-direction: column; }
.contact { margin: auto 0; display: grid; gap: clamp(16px, 4cqh, 28px); justify-items: start; min-width: 0; }
.cta {
  font-weight: 500; font-size: clamp(26px, 6cqw, 52px); letter-spacing: -.03em;
  text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 10px;
  transition: color .25s;
}
.cta:hover { color: var(--red); }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.links a { color: var(--mute); text-underline-offset: 4px; transition: color .25s; }
.links a:hover { color: var(--fg); }
.foot { flex: none; margin: 24px 0 0; font: 400 11px var(--mono); color: var(--dim); text-wrap: pretty; }
@container stage (max-height: 440px) { .s-contact .lede { display: none; } }

/* ================= ТЕЛЕФОН И ПЛАНШЕТ ПОРТРЕТОМ ================= */
@media (max-width: 820px) {
  :root { --bar: 50px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--bar) minmax(0, 1fr) clamp(150px, 30vh, 320px);
    grid-template-areas: "bar" "stage" "term";
  }
  .bar { gap: 14px; padding: 0 16px; }
  .brand span { display: none; }
  .bar-tg { padding: 5px 10px; font-size: 12px; }
  .term { border-right: 0; border-top: 1px solid var(--line); }
  .term-head { display: none; }
  .term-in { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .term-in input { font-size: 16px; } /* без зума на iOS */
}

/* ================= ТЕЛЕФОН В АЛЬБОМНОЙ ОРИЕНТАЦИИ ================= */
@media (min-width: 821px) and (max-height: 520px) {
  :root { --bar: 44px; }
  .app { grid-template-columns: clamp(280px, 34vw, 380px) minmax(0, 1fr); }
  .term-head { display: none; }
  .brand span { display: none; }
}

/* ================= МЕНЬШЕ ДВИЖЕНИЯ ================= */
@media (prefers-reduced-motion: reduce) {
  .scene, .scene.leaving, .rv, .rows li { transition: none !important; }
  .scene.leaving { transform: none; filter: none; }
  .im { stroke-dashoffset: 0 !important; animation: none !important; }
  .scroll-hint i::after, .flow .edge.act { animation: none; }
}
