/* KediCode — «Кот в коробке».
   Один мир: красная студия, кремовая бумага, чёрный глянцевый кот.
   Тема одна намеренно — это бренд-мир, а не интерфейс. */
:root {
  --red: #C8252B;        /* середина фона героя */
  --red-hi: #E2453F;     /* пол студии, светлый край */
  --red-deep: #8E151B;   /* углы виньетки */
  --cream: #F4ECDF;      /* бумага, коробка */
  --cream-2: #E9DECB;
  --ink: #000;
  --ink-2: #51483D;      /* приглушённый текст на креме */
  --night: #060505;      /* тёмные секции */
  --line: rgba(0, 0, 0, .14);
  --line-dark: rgba(244, 236, 223, .16);

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 3vw, 44px);
  --max: 1520px;
  --hmin: 620px;         /* минимальная высота первого экрана; кадр считает от неё */
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
img { height: auto; } /* атрибут height не должен перебивать aspect-ratio */
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.tone-dark :focus-visible, .work :focus-visible, .journal :focus-visible { outline-color: var(--cream); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--cream); transform: translateY(-160%); text-decoration: none; }
.skip:focus { transform: none; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Зерно поверх всего — фактура бумаги. Неподвижное: слой рисуется один раз. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--cream);
  font: 600 16px/1 var(--text); letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: transform .35s var(--ease), background-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { flex: none; }
.btn-light { background: var(--cream); color: var(--ink); }
.btn-red { background: var(--red); color: var(--cream); }
/* значок App Store — как дал Apple; поля вокруг не меньше четверти высоты (13 px) — по правилам Apple */
.store-badge { display: inline-flex; margin: 3px 4px 3px 0; }
.store-badge img { display: block; height: 52px; width: auto; }
html[lang="ru"] .badge-en, html:not([lang="ru"]) .badge-ru { display: none; }
.btn-ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(244, 236, 223, .55); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--cream); }

/* ---------- навигация: три капсулы ---------- */
.nav {
  position: fixed; z-index: 50; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
  transition: transform .6s var(--ease), opacity .5s;
}
.nav.is-hidden { transform: translateY(-140%); }
html:not(.fonts) .nav { opacity: 0; } /* до шрифтов — без мигания запасным шрифтом; .fonts ставит site.js */
html.intro:not(.no-video):not(.nav-in) .nav { opacity: 0; transform: translateY(-30%); }
.cap {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 4px;
  height: 50px; padding: 0 8px; border: 0; border-radius: 999px;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .45);
  text-decoration: none;
}
.brand { gap: 10px; padding: 0 18px 0 12px; font: 700 17px/1 var(--display); letter-spacing: -.01em; }
.brand img { width: 30px; height: auto; }
.links { margin-inline: auto; padding: 0 6px; }
.links > a { padding: 10px 14px; border-radius: 999px; font: 500 15px/1 var(--text); text-decoration: none; transition: background-color .2s; }
.links > a:hover { background: var(--cream-2); }
.lang { display: inline-flex; margin-left: 6px; padding: 3px; border-radius: 999px; background: var(--cream-2); }
.lang button { border: 0; background: transparent; padding: 7px 10px; border-radius: 999px; font: 600 12px/1 var(--text); letter-spacing: .06em; cursor: pointer; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.cta-cap { padding: 0 22px; background: var(--ink); color: var(--cream); font: 600 15px/1 var(--text); }
.menu-btn { display: none; width: 50px; justify-content: center; cursor: pointer; }

.menu {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(90px + env(safe-area-inset-top, 0px)) var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px)); background: var(--red); color: var(--cream);
}
.menu[hidden] { display: none; }
.menu nav { display: grid; gap: 4px; }
.menu nav a { font: 800 clamp(34px, 11vw, 64px)/1.05 var(--display); text-decoration: none; letter-spacing: -.03em; }
.menu-foot { display: flex; justify-content: space-between; align-items: center; }
.menu .lang { background: rgba(0, 0, 0, .18); }
.menu .lang button { color: var(--cream); }
.menu .lang button[aria-pressed="true"] { background: var(--cream); color: var(--ink); }
.menu-close { border: 0; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 14px 22px; font-weight: 600; cursor: pointer; }

/* ---------- первый экран ---------- */
.hero {
  position: relative; height: 100svh; min-height: var(--hmin); overflow: hidden;
  background: var(--red-hi); /* цвет пола студии: виден, только если кадр не закрывает экран */
  --ar: 1.791667;
}
.stage {
  position: absolute; left: 50%; top: 50%;
  width: max(100vw, calc(max(100svh, var(--hmin)) * var(--ar)));
  aspect-ratio: 2752 / 1536;
  /* прокрутку ведут переменные: GSAP не должен трогать translate/scale, иначе он забирает их в transform */
  --ss: 1; --sy: 0;
  translate: -50% calc(-50% + var(--sy) * 1%);
  scale: var(--ss);
  container-type: inline-size;
  will-change: translate, scale;
}
.stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 7%; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, rgba(226, 69, 63, 0), var(--red-hi));
}
.layer { position: absolute; inset: 0; }
.layer img { width: 100%; height: 100%; }
.layer-bg { z-index: 0; }
/* размытая заглушка (80×45, ~260 байт, tools/build-assets.py), видна, пока грузится картинка */
.layer-bg::before { content: ""; position: absolute; inset: 0; background: url("data:image/webp;base64,UklGRvwAAABXRUJQVlA4IPAAAABQBwCdASpQAC0APu1ssVOppTSwpnVZWpAdiWIAwrSBBAqmfZs/dgPhbullpm50g9rto4nmyHBwxfe/h3eC1s/op6IAAP7tp8YkIJRezrJ0f6u/H33Mv/ZKoJMCTzQ6YSE5vp4pFj/vBENt4y5zbDGbf7b4CeQ4ZSdchFXA5IrW6Kh2xR3d0oIrBzWJWpjS41TWKd10qZwfbf+QF0PzFKlgYLuRQihW9PVI7j3BwPAtQ6nzERsPHct6/dJCAAgVPSXs+ntccw7Fi9HttX1NwJBae/qbDLGwcU8XVIwTdNiaxycEglbqcPD0PNm2DAkAAAA=") center / cover no-repeat; filter: blur(18px); transform: scale(1.04); }
.layer-bg img { position: relative; }
.layer-cat { z-index: 2; }

/* Гигантское KEDI | CODE за котом: размер и место ставит site.js по силуэту кота. */
.mast { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mast-word {
  position: absolute; top: 40%; translate: calc(-50% + var(--drift, 0) * 1%) -50%;
  font: 900 11cqw/.78 var(--display); letter-spacing: -.035em; color: var(--cream);
  white-space: nowrap;
}
.mast-l { left: 22%; }
.mast-r { left: 79%; }
.mast-word > span { display: block; }
html.intro .mast-word > span { transform: translateY(115%); opacity: 0; }
html.ready .mast-word { clip-path: inset(-40% -10% 0 -10%); }
html.ready .mast-word > span { transition: transform 1.1s var(--ease), opacity .4s; }
html.ready.settled .mast-word { clip-path: none; }
html.ready .mast-r > span { transition-delay: .08s; }

.cat-cut { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50.4% 54%; }
.cat-hit {
  position: absolute; left: 40.8%; top: 20.5%; width: 19.4%; height: 34%;
  border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 40%;
}
.cat-hit:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; }

/* Живые глаза: белок, зрачок, неподвижный блик и веко. Геометрия — в site.js. */
.eyes { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; }
#hero-eyes { transform-origin: 50.4% 54%; }
.eye {
  position: absolute; translate: -50% -50%; rotate: var(--rot, 0deg);
  border-radius: 50%; overflow: hidden;
  background: radial-gradient(120% 120% at 38% 30%, #fff 0 48%, #f1eeea 70%, #d9d4ce 100%);
  box-shadow: inset 0 -.06em .12em rgba(0, 0, 0, .18);
}
.pupil {
  position: absolute; left: 50%; top: 50%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a2727 0, #070606 55%, #000 100%);
  translate: -50% -50%;
  will-change: transform;
}
/* Блик — отражение на поверхности глаза: стоит на месте, под ним ездит зрачок. */
.glint {
  position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #fff;
  left: 54%; top: 26%; box-shadow: 0 0 2px rgba(255, 255, 255, .6);
}
.lid {
  position: absolute; inset: -2%; border-radius: 50%;
  background: linear-gradient(180deg, #2b2626, #0d0b0b 70%);
  transform: translateY(-104%); transition: transform .9s var(--ease);
}
.eyes.blink .lid { animation: blink .2s ease-in-out; }
.eyes.sleep .lid { transform: translateY(-9%); }
@keyframes blink { 0%, 100% { transform: translateY(-104%); } 45%, 55% { transform: translateY(0); } }
html.intro .eyes, html.intro .hint { opacity: 0; }

/* Реплики кота и подсказка живут у его левого уха (в долях кадра). */
.bubble, .hint {
  position: absolute; z-index: 3; left: 43.6%; top: 27.6%;
  translate: -100% -100%;
  border-radius: 1em 1em .25em 1em; white-space: nowrap; pointer-events: none;
}
.bubble {
  padding: .55em .9em; background: var(--cream); color: var(--ink);
  font: 800 clamp(14px, 1.15cqw, 22px)/1 var(--display);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .5);
  opacity: 0; transform: scale(.4) rotate(-6deg); transform-origin: 100% 100%;
}
.bubble.show { animation: bubble 1.6s var(--ease) forwards; }
.bubble.zzz { opacity: 1; transform: none; animation: zzz 2.4s ease-in-out infinite; background: var(--ink); color: var(--cream); }
@keyframes bubble {
  0% { opacity: 0; transform: scale(.4) rotate(-6deg); }
  14% { opacity: 1; transform: scale(1.06) rotate(-3deg); }
  22%, 78% { opacity: 1; transform: scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: scale(.9) rotate(-3deg) translateY(-12px); }
}
@keyframes zzz { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.hint {
  margin: 0; padding: 8px 14px; background: var(--ink); color: var(--cream);
  font: 600 clamp(12px, .9cqw, 15px)/1 var(--text);
  rotate: -3deg;
}
html.ready .hint { transition: opacity .4s; } /* до сборки экрана — без переходов, чтобы не мигнула */
.hint.gone, .hero.scrolled .hint { opacity: 0; }
/* Узкий экран: слова стоят вертикально по краям — подсказка уходит прямо на голову. */
.hero[data-mast="v"] .bubble, .hero[data-mast="v"] .hint { left: 46.4%; top: 25.5%; translate: -50% -100%; border-radius: 1em; }

.intro-video {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; pointer-events: none; transition: opacity .45s ease;
}
html.intro .intro-video { opacity: 1; }
html.intro.no-video .intro-video { opacity: 0; }

.hero-ui {
  position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); bottom: clamp(20px, 4.2vh, 44px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
}
/* .hero-ui уводит прокрутка (GSAP), а вход показывают дети — чтобы не спорить за transform */
.hero-ui > * { transition: opacity .8s var(--ease) .25s, transform .8s var(--ease) .25s; }
.hero-ui > .actions { transition-delay: .38s; }
html.intro .hero-ui > * { opacity: 0; transform: translateY(24px); }
.sub {
  flex: 0 1 auto; min-width: 0; margin: 0; max-width: 24ch;
  font: 600 clamp(20px, 1.9vw, 30px)/1.2 var(--text); letter-spacing: -.015em;
}
.actions { flex: none; display: flex; gap: 10px; }

/* ---------- манифест ---------- */
.manifesto { padding: clamp(110px, 16vh, 200px) var(--gutter) clamp(120px, 18vh, 220px); }
.mf {
  max-width: 1400px; margin: 0 auto;
  font: 500 clamp(30px, 4.6vw, 76px)/1.1 var(--text); letter-spacing: -.035em;
}
.mf .w { opacity: .13; transition: opacity .2s linear; }
.mf.static .w { opacity: 1; }
.mf .nb { white-space: nowrap; }
.pill {
  display: inline-block; vertical-align: -.12em; height: .9em; aspect-ratio: 2; margin: 0 .04em 0 .14em;
  border-radius: 999px; overflow: hidden; background: var(--cream-2);
  box-shadow: 0 .08em .2em -.08em rgba(0, 0, 0, .35);
}
.pill img { width: 100%; height: 100%; object-fit: cover; }
.pill.r1 { rotate: -3deg; }
.pill.r2 { rotate: 3deg; }

/* ---------- работы: стопка карточек ---------- */
.work { background: var(--night); color: var(--cream); padding-top: clamp(90px, 13vh, 160px); }
.work-head, .j-head {
  display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 32px; align-items: end;
  margin-bottom: clamp(40px, 6vh, 72px);
}
.display {
  margin: 0; font: 800 clamp(56px, 11vw, 190px)/.86 var(--display); letter-spacing: -.045em;
}
.side { margin: 0; font-size: 18px; line-height: 1.5; color: rgba(244, 236, 223, .72); justify-self: end; }

.stack { padding: 0 clamp(8px, 1vw, 14px) 14px; }
.card { position: sticky; top: 0; height: 100svh; padding-top: clamp(8px, 1vw, 14px); }
.card-in {
  position: relative; height: 100%; overflow: hidden; border-radius: clamp(18px, 2vw, 30px);
  background: #111; transform-origin: 50% 0;
}
.card-media { position: absolute; inset: 0; }
.card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos); }
.card-still { display: none; }
.card-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .58) 30%, rgba(0, 0, 0, 0) 62%); }
.card-dim { position: absolute; inset: 0; z-index: 3; background: #000; opacity: 0; pointer-events: none; }
/* у UrsGirSun тень снизу мягче: под ней на столе крутится нож */
.card-shade-soft {
  background:
    linear-gradient(to top, rgba(0, 0, 0, .84) 0%, rgba(0, 0, 0, .46) 17%, rgba(0, 0, 0, 0) 38%),
    linear-gradient(to right, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, 0) 34%); /* левые свечи под заголовком */
}

/* Сцена со своими слоями (видео + нож): кадр 2752×1536 покрывает карточку, фокус и размер ставит site.js. */
/* z-index: 0 — свой слой: нож поднимается над видео, но остаётся под тенью и заголовком карточки */
.scene { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 100%; }
.scene-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Нож лежит на столе: квадрат, сжатый по вертикали под наклон столешницы; внутри крутится картинка ножа. */
.knife {
  position: absolute; z-index: 1; left: 45%; top: 66%; width: 22%; aspect-ratio: 1; /* весь оборот — на пустом столе */
  translate: -50% -50%; transform: scaleY(.4);
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knife:focus-visible { outline: 3px solid var(--cream); outline-offset: 10px; border-radius: 50%; }
.k-layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.k-layer img { position: absolute; left: 50%; top: 50%; width: 100%; height: auto; max-width: none; translate: -45% -50%; }
.k-main img { filter: brightness(.84) contrast(1.06) saturate(.92); }
.k-shadow img { filter: brightness(0) blur(5px); opacity: .62; translate: -44% -26%; }
.k-ghost { opacity: 0; }
.k-ghost img { filter: brightness(.78) blur(1.5px); }

/* Телефон с настоящими экранами Frayso: чёткий, поверх сцены, экраны листаются. */
.phone {
  position: absolute; z-index: 2; right: 7.5%; top: 9%; height: 61%; aspect-ratio: 1000 / 2099;
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 30px 34px rgba(20, 4, 60, .5)) drop-shadow(0 8px 12px rgba(0, 0, 0, .35));
  animation: phone-float 6s ease-in-out infinite;
}
@keyframes phone-float { 50% { translate: 0 -8px; } }
.phone-frame {
  position: absolute; inset: 0; display: block; padding: 3.2%;
  border-radius: 15.5% / 7.4%;
  background: linear-gradient(150deg, #5b5a62 0%, #232328 14%, #0d0d10 48%, #26262c 84%, #57565e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 0 0 4px #0b0b0d;
}
.phone-screen { position: relative; display: block; height: 100%; border-radius: 12.6% / 5.9%; overflow: hidden; background: #0d0a1e; }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.phone-screen img.on { opacity: 1; }
.phone-glare { position: absolute; inset: 0; background: linear-gradient(118deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, 0) 42%); pointer-events: none; }
.phone-dots { position: absolute; left: 50%; bottom: -24px; translate: -50% 0; display: flex; gap: 6px; }
.phone-dots i { display: block; width: 6px; height: 6px; border-radius: 3px; background: rgba(244, 236, 223, .35); transition: width .35s var(--ease), background-color .35s; }
.phone-dots i.on { width: 18px; background: var(--cream); }
.phone:focus-visible { outline: 3px solid var(--cream); outline-offset: 6px; border-radius: 28px; }
.card-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: clamp(24px, 5vw, 96px); row-gap: clamp(16px, 2.2vh, 26px); align-items: end;
  padding: clamp(22px, 3.2vw, 52px);
  color: var(--cream);
  pointer-events: none; /* пустые места сетки пропускают клик к ножу и телефону */
}
.card-body > * { pointer-events: auto; }
.card-body > .card-main { pointer-events: none; } /* блок заголовка во всю ширину, кликабельного в нём нет */
.card-main { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.chips li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px; border: 1px solid currentColor;
  font: 500 13px/1 var(--text); letter-spacing: .02em;
}
.chips .chip-strong { background: var(--cream); color: var(--ink); border-color: var(--cream); }
/* контурная плашка на живой сцене (свеча, блик) иначе теряется: подложка из затемнения и размытия */
.card .chips li:not(.chip-strong) { background: rgba(10, 8, 8, .4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-title { margin: 0; font: 800 clamp(44px, 7.4vw, 128px)/.9 var(--display); letter-spacing: -.045em; }
.card-title-img img { width: clamp(240px, 26vw, 420px); max-width: 100%; height: auto; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .6)); }
.card-copy { display: grid; gap: 22px; }
.card-desc { margin: 0; font-size: clamp(16px, 1.15vw, 19px); line-height: 1.5; max-width: 44ch; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card-meta { display: grid; gap: 12px; margin: 0; font-size: 15px; }
.card-meta div { display: grid; grid-template-columns: 7.2em 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-dark); }
.card-meta dt { opacity: .62; }
.card-meta dd { margin: 0; font-weight: 500; }

/* ---------- другие проекты ---------- */
.more { padding-block: clamp(90px, 13vh, 150px) clamp(110px, 15vh, 170px); }
.more-head { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: 32px; align-items: end; margin-bottom: 40px; }
.more-title { margin: 0; font: 800 clamp(36px, 4.6vw, 72px)/.95 var(--display); letter-spacing: -.04em; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.mini { min-width: 0; }
.mini-media { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: #151313; margin-bottom: 18px; }
.mini-media img, .mini-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .4s; }
.mini-media video { opacity: 0; }
.mini.playing .mini-media video { opacity: 1; }
.mini:hover .mini-media img, .mini:hover .mini-media video { transform: scale(1.035); }
.mini .chips { margin-bottom: 12px; }
.mini .chips li { border-color: rgba(244, 236, 223, .4); color: rgba(244, 236, 223, .85); }
.mini h4 { margin: 0 0 8px; font: 700 clamp(24px, 2.2vw, 34px)/1.05 var(--display); letter-spacing: -.03em; }
.mini p { margin: 0; color: rgba(244, 236, 223, .72); font-size: 16px; max-width: 44ch; }

/* ---------- услуги ---------- */
.services { padding: clamp(110px, 16vh, 190px) 0 0; background: var(--cream); }
.svc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 90px); align-items: center; }
.svc-copy { container-type: inline-size; }
.svc-copy .display { font-size: clamp(52px, 8.4vw, 150px); }
/* «продукт.» в Unbounded — 5,7 кегля, при 8,4vw шире колонки: русскому заголовку кегль ещё и от колонки (17cqi) */
.svc-copy .display:lang(ru) { font-size: min(clamp(52px, 8.4vw, 150px), 17cqi); }
.svc-copy .lede { margin: 28px 0 32px; max-width: 36ch; color: var(--ink-2); font-size: clamp(17px, 1.35vw, 21px); }
.svc-media { margin: 0; border-radius: clamp(18px, 2vw, 30px); overflow: hidden; aspect-ratio: 1920 / 1072; background: var(--red); box-shadow: 0 40px 80px -50px rgba(110, 10, 10, .7); }
.svc-media video { width: 100%; height: 100%; object-fit: cover; }

.caps { list-style: none; margin: clamp(80px, 12vh, 140px) auto 0; padding-block: 0; }
.cap-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 32px; align-items: center;
  position: relative; padding: clamp(22px, 3.2vh, 34px) clamp(12px, 1.5vw, 24px);
  border-radius: 18px; transition: background-color .35s var(--ease), color .35s var(--ease);
}
.cap-row::before, .cap-row:last-child::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transition: opacity .35s;
}
.cap-row:last-child::after { top: auto; bottom: 0; }
.cap-row h3 { margin: 0; font: 700 clamp(26px, 3.2vw, 52px)/1 var(--display); letter-spacing: -.035em; }
.cap-row p { margin: 0; color: var(--ink-2); max-width: 44ch; transition: color .35s; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 7px 12px; border-radius: 999px; background: var(--cream-2); font: 500 13px/1 var(--text); transition: background-color .35s, color .35s; }
@media (hover: hover) {
  .cap-row:hover { background: var(--red); color: var(--cream); }
  .cap-row:hover::before, .cap-row:hover::after, .cap-row:hover + .cap-row::before { opacity: 0; }
  .cap-row:hover p { color: rgba(244, 236, 223, .86); }
  .cap-row:hover .tags li { background: rgba(0, 0, 0, .2); color: var(--cream); }
}

.proc { margin-top: clamp(90px, 13vh, 150px); }
.proc-title { margin: 0 0 32px; font: 700 clamp(22px, 2vw, 30px)/1.1 var(--display); letter-spacing: -.02em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.steps li { padding: 26px 28px 0 0; border-top: 2px solid var(--ink); position: relative; }
.steps li::before { content: ""; position: absolute; left: 0; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.steps .n { display: block; font: 900 clamp(40px, 4.2vw, 72px)/1 var(--display); color: var(--red); letter-spacing: -.04em; margin-bottom: 18px; }
.steps h4 { margin: 0 0 10px; font: 600 21px/1.2 var(--text); }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 30ch; }

.marquee { margin-top: clamp(100px, 14vh, 160px); background: var(--ink); color: var(--cream); overflow: hidden; padding: 26px 0; }
.track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 38s linear infinite; }
.track span { font: 700 clamp(34px, 4.6vw, 72px)/1 var(--display); letter-spacing: -.035em; white-space: nowrap; }
.track i {
  flex: none; width: clamp(38px, 3.6vw, 58px); aspect-ratio: 160 / 155;
  background: var(--red); -webkit-mask: url(img/mark-holes.png) center / contain no-repeat; mask: url(img/mark-holes.png) center / contain no-repeat;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- журнал: раскрывающиеся заметки ---------- */
.journal { position: relative; background: var(--night); color: var(--cream); padding: clamp(110px, 16vh, 190px) 0; }
.j-list { list-style: none; margin: 0 auto; padding-block: 0; }
.j-item { border-top: 1px solid var(--line-dark); }
.j-item:last-child { border-bottom: 1px solid var(--line-dark); }
.j-h { margin: 0; font: inherit; }
.j-row {
  display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 13em 28px; gap: 28px; align-items: center;
  width: 100%; padding: 30px 0; border: 0; background: none; text-align: left; cursor: pointer;
  transition: color .3s;
}
.j-row time { color: rgba(244, 236, 223, .55); font-size: 15px; font-variant-numeric: tabular-nums; }
.j-t { font: 500 clamp(22px, 2.5vw, 40px)/1.15 var(--text); letter-spacing: -.025em; transition: transform .45s var(--ease); }
.j-c { font-size: 15px; color: rgba(244, 236, 223, .7); }
.j-a { transition: transform .45s var(--ease), color .3s; }
.j-row[aria-expanded="true"] .j-a { transform: rotate(45deg); color: var(--red-hi); }
.j-body {
  display: grid; grid-template-columns: minmax(0, 62ch) minmax(0, 340px); gap: 40px; align-items: start;
  padding: 0 0 36px calc(9.5em + 28px); animation: open .5s var(--ease);
}
.j-body[hidden] { display: none; }
.j-pic { grid-column: 2; grid-row: 1; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.j-text { grid-column: 1; grid-row: 1; }
.j-body p { margin: 0; font-size: 18px; line-height: 1.55; color: rgba(244, 236, 223, .82); }
.j-link { display: inline-block; margin-top: 14px; font-weight: 600; text-underline-offset: 5px; }
@keyframes open { from { opacity: 0; transform: translateY(-8px); } }
@media (hover: hover) {
  .j-row:hover .j-t { transform: translateX(14px); }
  .j-row:hover .j-a { color: var(--red-hi); }
  .j-list:hover .j-item:not(:hover) .j-row { color: rgba(244, 236, 223, .45); }
}
.j-float {
  position: fixed; left: 0; top: 0; z-index: 40; width: clamp(240px, 22vw, 360px); aspect-ratio: 4 / 3;
  border-radius: 16px; overflow: hidden; pointer-events: none; opacity: 0; scale: .7;
  transition: opacity .3s, scale .45s var(--ease); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
}
.j-float.on { opacity: 1; scale: 1; }
.j-float img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- финал ---------- */
.contact {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--red-hi) 0%, var(--red) 55%, #A91C22 100%);
  color: var(--cream);
  padding: clamp(110px, 16vh, 190px) 0 clamp(260px, 30vw, 400px);
}
.cta-big { margin: 0; display: grid; font: 900 clamp(56px, 11.5vw, 210px)/.86 var(--display); letter-spacing: -.05em; }
.cta-big .dark { color: var(--ink); }
.cta-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; margin-top: clamp(40px, 7vh, 80px); }
.cta-row .lede { margin: 0; color: var(--cream); max-width: 40ch; font-size: clamp(17px, 1.35vw, 21px); }
/* заявка */
.brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; max-width: 760px; margin-top: 32px; }
.brief .f { display: grid; gap: 8px; font: 500 14px/1.2 var(--text); letter-spacing: .02em; color: rgba(244, 236, 223, .8); }
.brief .f-wide { grid-column: 1 / -1; }
.brief input, .brief select, .brief textarea {
  width: 100%; min-height: 52px; padding: 14px 16px; border: 0; border-radius: 14px;
  background: rgba(0, 0, 0, .2); color: var(--cream); font: 500 17px/1.35 var(--text); letter-spacing: 0;
  transition: background-color .2s;
}
.brief select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23F4ECDF' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.brief option { color: var(--ink); background: var(--cream); }
.brief textarea { resize: vertical; min-height: 120px; }
.brief ::placeholder { color: rgba(244, 236, 223, .5); }
.brief input:focus, .brief select:focus, .brief textarea:focus { outline: none; background-color: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1.5px var(--cream); }
.brief .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.brief-send { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brief-send .btn:disabled { opacity: .6; cursor: progress; transform: none; }
.brief-status { margin: 0; font: 500 16px/1.4 var(--text); color: var(--cream); }
.brief-status a { color: inherit; text-underline-offset: 4px; }
.reach-or { margin: 0; font: 500 14px/1.2 var(--text); color: rgba(244, 236, 223, .8); }
.svc-price { margin: -14px 0 28px; font: 600 clamp(16px, 1.2vw, 19px)/1.4 var(--text); }
.reach { display: grid; gap: 14px; justify-items: end; }
.mail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.mail-link { font: 600 clamp(22px, 2.6vw, 40px)/1 var(--text); letter-spacing: -.02em; text-underline-offset: 6px; text-decoration-thickness: 2px; user-select: all; }
.copy.done { background: var(--cream); color: var(--ink); }
.tg {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  background: rgba(0, 0, 0, .18); color: var(--cream); text-decoration: none; font-weight: 600;
  transition: background-color .25s;
}
.tg:hover { background: rgba(0, 0, 0, .3); }
.tg-handle { opacity: .75; font-weight: 500; }

.peek {
  position: absolute; left: 50%; bottom: 0; width: clamp(300px, 38vw, 600px); aspect-ratio: 1180 / 620;
  translate: -50% 2.2%; container-type: inline-size;
}
.peek img { width: 100%; height: 100%; }

/* ---------- подвал ---------- */
.foot { background: var(--cream); padding: 64px 0 28px; position: relative; z-index: 1; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.foot-brand { display: flex; gap: 22px; align-items: flex-start; }
.foot-brand img { width: 66px; height: auto; }
.foot-brand p { margin: 6px 0 0; max-width: 24ch; color: var(--ink-2); }
.foot h4 { margin: 0 0 16px; font: 700 15px/1 var(--display); letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot ul a { text-decoration: none; color: var(--ink-2); }
.foot ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.foot-bottom a { color: var(--ink); }
.foot-legal { margin: 0; max-width: 78ch; }
.foot-links { display: flex; gap: 20px; white-space: nowrap; }

/* ---------- раскрытие больших заголовков ---------- */
.reveal { display: block; }
.js .reveal { clip-path: inset(0 0 100% 0); transform: translateY(18%); }
.js .reveal.in { clip-path: inset(-20% -5% -20% -5%); transform: none; transition: clip-path 1s var(--ease), transform 1s var(--ease); }

/* ---------- планшеты ---------- */
@media (max-width: 1100px) {
  .links { display: none; }
  .cta-cap { margin-left: auto; }
  .menu-btn { display: inline-flex; }
  .card-meta { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .cap-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tags { display: none; }
  .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more-grid .mini:last-child { grid-column: span 2; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  /* форма заявки во всю ширину, почта и Telegram — под ней */
  .cta-row { grid-template-columns: 1fr; }
  .reach, .mail { justify-items: start; justify-content: flex-start; }
}
@media (max-width: 900px) and (min-width: 761px) {
  .hero-ui { flex-direction: column; align-items: flex-start; }
}
/* Планшет стоя: кадр выше, чтобы коробка не встречалась с подписью внизу. */
@media (max-aspect-ratio: 9/10) and (min-width: 761px) {
  .stage { top: 42%; }
}

/* ---------- телефоны ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  :root { --hmin: 560px; }
  .cta-cap { padding: 0 16px; font-size: 14px; }
  .brand { margin-right: auto; }
  .stage { top: 37%; }
  .hero-ui { flex-direction: column; align-items: stretch; gap: 14px; }
  .sub { max-width: none; font-size: 19px; }
  .actions { justify-content: stretch; gap: 8px; }
  .actions .btn { flex: 1; min-height: 48px; padding: 0 12px; font-size: 15px; }
  .hint { display: none; }
  .work-head, .j-head, .more-head { grid-template-columns: 1fr; }
  .side { justify-self: start; }
  .card { position: relative; height: auto; padding-top: 12px; }
  .card-in { height: auto; display: flex; flex-direction: column; background: #0d0c0c; }
  .card-media { position: relative; inset: auto; aspect-ratio: 4 / 5; overflow: hidden; }
  .card-video { display: none; }
  .card-still { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .phone { right: 6%; top: 6%; height: 62%; }
  .phone-dots { bottom: -18px; }
  .card-shade, .card-dim { display: none; }
  .card-body { position: relative; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 20px 26px; }
  .card-title { font-size: clamp(32px, 10.4vw, 60px); }
  .card-actions .btn { flex: 1 1 auto; }
  .more-grid { grid-template-columns: 1fr; gap: 36px; }
  .more-grid .mini:last-child { grid-column: auto; }
  .svc-top { grid-template-columns: 1fr; }
  .cap-row { grid-template-columns: 1fr; gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  .j-row { grid-template-columns: 1fr 28px; gap: 8px 16px; padding: 22px 0; }
  .j-row time { grid-column: 1; grid-row: 1; }
  .j-t { grid-column: 1; grid-row: 2; }
  .j-c { display: none; }
  .j-a { grid-column: 2; grid-row: 1 / 3; }
  .j-body { grid-template-columns: 1fr; gap: 16px; padding: 0 0 26px; }
  .j-pic { grid-column: 1; grid-row: 1; }
  .j-text { grid-row: 2; }
  .j-body p { font-size: 16px; }
  .cta-row { grid-template-columns: 1fr; }
  .brief { grid-template-columns: 1fr; }
  .brief-send .btn { flex: 1; }
  .reach, .mail { justify-items: start; justify-content: flex-start; }
  .contact { padding-bottom: calc(52vw + 40px); }
  .peek { width: 86vw; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; }
}
/* Узкий телефон: рядом с кнопкой к форме слово KediCode не влезает — в плашке остаётся кот (имя и так на весь экран) */
@media (max-width: 440px) {
  .brand { padding: 0 10px; }
  .brand span { display: none; }
}

/* Планшет стоя: карточки работ — картинка сверху, текст снизу (во весь экран сцена режется и телефон Frayso
   встаёт на полэкрана). Видео идут, стопки нет. */
@media (min-width: 761px) and (max-aspect-ratio: 1/1) {
  .card { position: relative; height: auto; padding-top: 14px; }
  .card-in { height: auto; display: flex; flex-direction: column; }
  .card-media { position: relative; inset: auto; aspect-ratio: 16 / 10; overflow: hidden; }
  .card-shade, .card-dim { display: none; }
  .card-body { position: relative; }
  .phone { right: 6%; top: 7%; height: 66%; }
}

/* Телефон боком: первый экран короче, иначе коробка уходит за край. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --hmin: 360px; }
  .hero-ui { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .phone { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .track { animation: none; }
  .js .reveal { clip-path: none; transform: none; }
}

/* ---------- privacy.html ---------- */
.doc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-block: 24px; }
.doc-home { display: inline-flex; align-items: center; gap: 10px; font: 700 17px/1 var(--display); text-decoration: none; }
.doc-home img { width: 30px; }
.doc-lang { display: flex; gap: 18px; font-size: 15px; }
.doc { max-width: 52rem; padding-bottom: 96px; }
.doc h1 { margin: 32px 0 10px; font: 800 clamp(30px, 8vw, 64px)/1.05 var(--display); }
.doc h2 { margin: 40px 0 10px; font: 700 20px/1.3 var(--display); }
.doc p, .doc ul { margin: 0 0 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc-date { color: var(--ink-2); font-size: 15px; }
.doc article + article, .doc-ka { margin-top: 88px; padding-top: 40px; border-top: 1px solid var(--line); }
