/* =========================================================
   AXIS - прототип, этап 1
   Варианты стиля: data-variant = a | b | c
   Темы: data-theme = dark | light
   ========================================================= */

/* ---------- Вариант A: «Лаборатория» ---------- */
:root, [data-variant="a"] {
  --font-display: 'Unbounded', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
  --display-weight: 500;
  --display-track: -0.045em;
  --serif-scale: 1.12;
  --accent: #FF5B1F;
  --accent-ink: #FF5B1F;
  --on-accent: #0E0F12;
}
[data-variant="a"][data-theme="dark"]  { --bg: #0E0F12; --bg-2: #15171B; --fg: #F2EFE9; --metal: #cfd2d8; }
[data-variant="a"][data-theme="light"] { --bg: #F1EDE6; --bg-2: #E7E2D9; --fg: #131417; --metal: #6d7079; --accent-ink: #E2470E; }

/* ---------- Вариант B: «Хром» ---------- */
[data-variant="b"] {
  --font-display: 'Onest', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --display-weight: 600;
  --display-track: -0.05em;
  --serif-scale: 1;
  --accent: #3D6BFF;
  --accent-ink: #6B8CFF;
  --on-accent: #ffffff;
}
[data-variant="b"][data-theme="dark"]  { --bg: #07090D; --bg-2: #0E121A; --fg: #EEF1F6; --metal: #dfe5ee; }
[data-variant="b"][data-theme="light"] { --bg: #EEF0F4; --bg-2: #E2E6ED; --fg: #0B0E14; --metal: #5c6676; --accent-ink: #2C55E8; }

/* ---------- Вариант C: «Кислота» ---------- */
[data-variant="c"] {
  --font-display: 'Inter Tight', sans-serif;
  --font-serif: 'Lora', serif;
  --display-weight: 700;
  --display-track: -0.055em;
  --serif-scale: 0.98;
  --accent: #C6FF3D;
  --accent-ink: #C6FF3D;
  --on-accent: #0A0B09;
}
[data-variant="c"][data-theme="dark"]  { --bg: #0A0B09; --bg-2: #121410; --fg: #F1F3EC; --metal: #c9cec2; }
[data-variant="c"][data-theme="light"] { --bg: #F2F3EE; --bg-2: #E5E7DF; --fg: #0B0C0A; --metal: #5f6459; --accent-ink: #4E7300; }

:root {
  --mono: 'JetBrains Mono', monospace;
  --body: 'Manrope', 'Onest', system-ui, sans-serif;
  --muted: color-mix(in srgb, var(--fg) 58%, transparent);
  --line: color-mix(in srgb, var(--fg) 14%, transparent);
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.19, 1, .22, 1);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
/* clip (не hidden!) - не ломает position: sticky, но не даёт 3D-карточкам и лентам раздувать ширину страницы на телефоне */
main, .footer { overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; font-size: calc(1em * var(--serif-scale)); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
::selection { background: var(--accent); color: var(--on-accent); }

/* Плёночное зерно - даёт «дорогую» фактуру */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .035;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
[data-theme="light"] .grain { opacity: .09; mix-blend-mode: multiply; }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Кнопки ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  height: 52px; padding: 0 26px; border-radius: 100px;
  font-family: var(--body); font-weight: 600; font-size: 15px; white-space: nowrap;
  overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease), color .4s var(--ease);
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { transform: scaleY(1); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent::before { background: var(--fg); }
.btn-accent:hover { color: var(--bg); }
.btn-ghost { box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); backdrop-filter: blur(8px); }
.btn-ghost::before { background: var(--fg); }
.btn-ghost:hover { color: var(--bg); }
.btn-sm { height: 42px; padding: 0 18px; font-size: 14px; }

/* ---------- Прелоадер ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-items: center;
}
.pre-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px; background-position: center;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 65%);
}
.pre-center { position: relative; display: grid; place-items: center; }
.pre-axis { width: min(46vw, 220px); overflow: visible; }
.pre-axis line, .pre-axis circle { fill: none; stroke: var(--fg); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pre-axis .pre-x2 { stroke: var(--accent); stroke-width: 2; }
.pre-axis .pre-ring { stroke-dasharray: 2 6; opacity: .6; transform-origin: center; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pre-count { position: absolute; bottom: -48px; font-size: 13px; }
.pre-enter {
  position: absolute; bottom: 18vh; display: flex; flex-direction: column; align-items: center; gap: 18px;
  opacity: 0; visibility: hidden;
}
.pre-enter p { color: var(--muted); }
.pre-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pre-foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px;
  display: flex; justify-content: space-between; color: var(--muted);
}

/* ---------- WebGL ---------- */
.gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.ring-label {
  position: fixed; z-index: 30; pointer-events: none; padding: 7px 12px; border-radius: 100px;
  background: var(--accent); color: var(--on-accent); font-weight: 500;
  opacity: 0; transform: translate(18px, -50%) scale(.8); transition: opacity .25s, transform .35s var(--ease);
}
.ring-label.show { opacity: 1; transform: translate(18px, -50%) scale(1); }

/* ---------- Шапка ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
}
.logo { display: inline-flex; align-items: center; font-family: 'Unbounded', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -.02em; }
.logo-x { width: .9em; height: .9em; margin: 0 .04em; }
.logo-x line { stroke: var(--fg); stroke-width: 4.5; stroke-linecap: square; }
.logo-x line.acc { stroke: var(--accent); }
.logo:hover .logo-x { animation: spin .9s var(--ease); }
.nav { display: flex; gap: 4px; padding: 5px; border-radius: 100px; box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 45%, transparent); }
.nav a { padding: 8px 16px; border-radius: 100px; font-size: 14px; font-weight: 500; transition: background .3s, color .3s; }
.nav a:hover { background: var(--fg); color: var(--bg); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(14px);
  transition: background .3s, transform .4s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); transform: rotate(-12deg); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--fg); stroke-width: 1.6; }
.icon-btn svg .fill { fill: var(--fg); stroke: none; }
.eq { display: flex; align-items: center; gap: 2px; height: 14px; }
.eq i { display: block; width: 2px; height: 3px; background: var(--fg); border-radius: 2px; transition: height .3s; }
.sound-on .eq i { animation: eq .9s ease-in-out infinite; }
.sound-on .eq i:nth-child(2) { animation-delay: -.3s; } .sound-on .eq i:nth-child(3) { animation-delay: -.6s; } .sound-on .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 2; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px;
  padding: 96px var(--gutter) 40px;
}
.hero-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.hero-title {
  align-self: end;
  font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track);
  font-size: clamp(40px, min(7.2vw, 12.5vh), 132px); line-height: .92;
  position: relative; z-index: 4;
  display: flex; flex-direction: column;
}
.hero-title .hl { display: block; }
.hero-title .hl:nth-child(2) { padding-left: 1.4em; }
.hero-title em { color: var(--accent-ink); }
.split-char { display: inline-block; will-change: transform; }
.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.hero-sub { max-width: 520px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-scroll { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; color: var(--muted); }
.hero-scroll i { width: 1px; height: 28px; background: var(--line); position: relative; overflow: hidden; }
.hero-scroll i::after { content: ''; position: absolute; left: 0; top: -100%; width: 100%; height: 100%; background: var(--accent); animation: drop 1.8s var(--ease) infinite; }
@keyframes drop { to { top: 100%; } }
.hero-hint { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); color: var(--muted); white-space: nowrap; }
.hero-bottom { position: relative; z-index: 4; }
.hero.dragging { cursor: grabbing; }
.hero { cursor: grab; }
.hero a, .hero button { cursor: pointer; }

/* ---------- Выноски к кольцам (как на техническом чертеже) ---------- */
.callouts { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.callout-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.callout-lines path { fill: none; stroke: var(--fg); stroke-opacity: .32; stroke-width: 1; }
.callout-lines circle { fill: var(--accent); }
.callout { position: absolute; display: grid; gap: 2px; padding: 10px 0; max-width: 220px; }
.callout b { color: var(--accent-ink); font-weight: 500; }
.callout strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; letter-spacing: -.02em; line-height: 1.1; }
.callout span { color: var(--muted); font-size: 10px; }
.callout.c0 { left: var(--gutter); top: 21%; }
.callout.c3 { left: var(--gutter); top: 33%; }
.callout.c1 { right: var(--gutter); top: 21%; text-align: right; justify-items: end; }
.callout.c2 { right: var(--gutter); top: 33%; text-align: right; justify-items: end; }

/* ---------- UI-карточки в направлениях ---------- */
.dir-cards { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.dset { position: absolute; inset: 0; }
.dcard {
  position: absolute; border-radius: 22px; padding: 16px;
  background: color-mix(in srgb, var(--bg-2) 62%, transparent);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 color-mix(in srgb, var(--fg) 12%, transparent), 0 40px 80px -30px rgba(0,0,0,.55);
  opacity: 0; transform: translate3d(calc(var(--mx, 0) * var(--d, 20px)), calc(40px + var(--my, 0) * var(--d, 20px)), 0) scale(.94);
  transition: opacity .6s var(--ease), transform 1s var(--ease);
}
.dset.is-active .dcard { opacity: 1; transform: translate3d(calc(var(--mx, 0) * var(--d, 20px)), calc(var(--my, 0) * var(--d, 20px)), 0) scale(1); }
.dset.is-active .dcard:nth-child(2) { transition-delay: .12s; }
.dset.is-active .dcard:nth-child(3) { transition-delay: .22s; }
.dcard.ig, .dcard.ads, .dcard.browser { right: 3%; top: 15%; width: 310px; --d: -26px; }
.dcard.phone { right: 5%; top: 12%; width: 220px; height: 400px; padding: 0; overflow: hidden; --d: -26px; }
.dcard.chip { padding: 12px 16px; display: grid; gap: 2px; min-width: 150px; --d: 34px; }
.dcard.chip.c-a { left: 47%; top: 19%; }
.dcard.chip.c-b { left: 53%; bottom: 17%; --d: 48px; }
.dcard.chip span { color: var(--muted); font-size: 10px; }
.dcard.chip b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; letter-spacing: -.03em; line-height: 1; }
.dcard.chip svg { width: 120px; height: 36px; margin-top: 4px; }
.dcard.chip svg path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 1.6s var(--ease) .4s; }
.dset.is-active .dcard.chip svg path { stroke-dashoffset: 0; }

/* Instagram */
.ig-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ig-head .ava { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), #ff2d87, #7a5cff, var(--accent)); padding: 2px; box-shadow: inset 0 0 0 2px var(--bg-2); }
.ig-head div { flex: 1; display: grid; line-height: 1.2; }
.ig-head b { font-size: 14px; }
.ig-head span { font-size: 11px; color: var(--muted); }
.ig-head em { font-style: normal; font-family: var(--body); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px; background: var(--accent); color: var(--on-accent); }
.ig-stats { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 10px; color: var(--muted); text-align: center; }
.ig-stats b { display: block; font-size: 15px; color: var(--fg); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 10px; overflow: hidden; }
.ig-grid i { aspect-ratio: 1; transform: scale(.6); opacity: 0; transition: transform .7s var(--ease), opacity .5s; }
.dset.is-active .ig-grid i { transform: none; opacity: 1; }
.ig-grid i:nth-child(1) { background: linear-gradient(135deg, #2b2f38, #6b7280); transition-delay: .25s; }
.ig-grid i:nth-child(2) { background: linear-gradient(160deg, var(--accent), #ff2d87); transition-delay: .3s; }
.ig-grid i:nth-child(3) { background: linear-gradient(200deg, #e9e4da, #b9ae9c); transition-delay: .35s; }
.ig-grid i:nth-child(4) { background: linear-gradient(120deg, #1b1d22, #3a3f4a); transition-delay: .4s; }
.ig-grid i:nth-child(5) { background: radial-gradient(circle at 30% 30%, #fff, #c9c3b8 40%, #6f6a62); transition-delay: .45s; }
.ig-grid i:nth-child(6) { background: linear-gradient(45deg, #7a5cff, #2ec5ff); transition-delay: .5s; }
.ig-grid i:nth-child(7) { background: linear-gradient(170deg, #d8cfc2, #8c7f6e); transition-delay: .55s; }
.ig-grid i:nth-child(8) { background: linear-gradient(135deg, var(--accent), #ffcf3a); transition-delay: .6s; }
.ig-grid i:nth-child(9) { background: linear-gradient(200deg, #30343c, #0f1013); transition-delay: .65s; }

/* Meta Ads */
.ads-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; margin-bottom: 14px; }
.ads-top i { font-style: normal; color: #3ddc84; }
.ads-metrics { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ads-metrics div { display: grid; gap: 2px; }
.ads-metrics span { font-size: 10px; color: var(--muted); }
.ads-metrics b { font-size: 17px; letter-spacing: -.02em; }
.ads-metrics em { font-style: normal; font-size: 11px; color: #3ddc84; font-weight: 600; }
.ads-chart { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ads-chart i { flex: 1; height: var(--h); border-radius: 4px 4px 1px 1px; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 35%, transparent), var(--accent)); transform: scaleY(0); transform-origin: bottom; transition: transform 1s var(--ease); }
.dset.is-active .ads-chart i { transform: scaleY(1); }
.ads-chart i:nth-child(n) { transition-delay: calc(.2s + var(--h) * 0); }
.ads-chart i:nth-child(2) { transition-delay: .25s; } .ads-chart i:nth-child(3) { transition-delay: .3s; } .ads-chart i:nth-child(4) { transition-delay: .35s; }
.ads-chart i:nth-child(5) { transition-delay: .4s; } .ads-chart i:nth-child(6) { transition-delay: .45s; } .ads-chart i:nth-child(7) { transition-delay: .5s; }
.ads-chart i:nth-child(8) { transition-delay: .55s; } .ads-chart i:nth-child(9) { transition-delay: .6s; } .ads-chart i:nth-child(10) { transition-delay: .65s; }
.ads-chart i:nth-child(11) { transition-delay: .7s; } .ads-chart i:nth-child(12) { transition-delay: .75s; } .ads-chart i:nth-child(13) { transition-delay: .8s; } .ads-chart i:nth-child(14) { transition-delay: .85s; }

/* TikTok */
.tt-video { position: absolute; inset: 0; background: linear-gradient(160deg, #141018, #2a1530 40%, #0d1a24); overflow: hidden; }
.tt-video i { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .85; animation: blob 8s ease-in-out infinite alternate; }
.tt-video i:nth-child(1) { width: 180px; height: 180px; background: #ff2d55; left: -40px; top: 40px; }
.tt-video i:nth-child(2) { width: 160px; height: 160px; background: #25f4ee; right: -50px; top: 150px; animation-delay: -3s; }
.tt-video i:nth-child(3) { width: 140px; height: 140px; background: var(--accent); left: 30px; bottom: -30px; animation-delay: -5s; }
@keyframes blob { to { transform: translate(40px, -50px) scale(1.25); } }
.tt-side { position: absolute; right: 10px; bottom: 90px; display: grid; gap: 14px; text-align: center; color: #fff; font-size: 20px; }
.tt-side small { display: block; font-size: 9px; font-family: var(--mono); opacity: .85; }
.tt-cap { position: absolute; left: 12px; right: 60px; bottom: 16px; color: #fff; font-size: 11px; line-height: 1.35; }
.tt-hearts { position: absolute; inset: 0; pointer-events: none; }
.tt-hearts span { position: absolute; right: 22px; bottom: 120px; color: #ff2d55; font-size: 18px; animation: heart 2.2s ease-out forwards; }
@keyframes heart { to { transform: translate(var(--x), -260px) scale(1.4); opacity: 0; } }

/* Сайт */
.br-bar { display: flex; align-items: center; gap: 5px; margin: -4px 0 12px; }
.br-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.br-bar span { margin-left: 10px; flex: 1; font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 4px 10px; border-radius: 6px; background: color-mix(in srgb, var(--fg) 6%, transparent); }
.br-hero { position: relative; height: 130px; border-radius: 12px; padding: 16px; display: grid; align-content: end; gap: 6px; background: radial-gradient(circle at 75% 30%, var(--accent), transparent 55%), linear-gradient(135deg, #1a1c21, #2c2f37); overflow: hidden; }
.br-hero b { display: block; height: 10px; border-radius: 3px; background: #f2efe9; width: 70%; transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease) .3s; }
.br-hero b + b { width: 45%; transition-delay: .4s; }
.br-hero em { width: 64px; height: 18px; border-radius: 20px; background: var(--accent); margin-top: 6px; transform: scale(0); transition: transform .6s var(--ease) .6s; }
.dset.is-active .br-hero b { transform: scaleX(1); }
.dset.is-active .br-hero em { transform: scale(1); }
.br-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.br-cols i { height: 60px; border-radius: 10px; background: color-mix(in srgb, var(--fg) 7%, transparent); opacity: 0; transform: translateY(14px); transition: .7s var(--ease); }
.dset.is-active .br-cols i { opacity: 1; transform: none; }
.br-cols i:nth-child(1) { transition-delay: .5s; } .br-cols i:nth-child(2) { transition-delay: .6s; } .br-cols i:nth-child(3) { transition-delay: .7s; }

/* ---------- Бегущая строка ---------- */
.marquee { position: relative; z-index: 2; overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.marquee-track { display: flex; align-items: center; gap: 40px; width: max-content; animation: marquee 32s linear infinite; }
.marquee span { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(28px, 4.4vw, 64px); line-height: 1; }
.marquee span:nth-of-type(even) { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.marquee b { color: var(--accent-ink); font-size: 22px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Манифест ---------- */
.manifesto { position: relative; z-index: 2; padding: 22vh var(--gutter) 18vh; max-width: 1400px; }
.label { color: var(--accent-ink); margin-bottom: 36px; }
.manifesto-text { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: calc(var(--display-track) * .6); font-size: clamp(22px, 2.9vw, 46px); line-height: 1.14; display: grid; gap: .9em; }
.manifesto-text .w { opacity: .14; transition: none; }
.manifesto-foot { display: flex; gap: clamp(20px, 6vw, 96px); margin-top: 72px; color: var(--muted); flex-wrap: wrap; }
.manifesto-foot b { display: block; font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(40px, 5vw, 80px); letter-spacing: var(--display-track); color: var(--fg); line-height: 1; margin-bottom: 8px; }

/* ---------- Направления (3D-история) ---------- */
.directions { position: relative; z-index: 2; height: 500vh; }
.dir-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: clip; padding: 96px var(--gutter) 40px; display: grid; grid-template-rows: auto 1fr auto; }
.dir-head { display: flex; justify-content: space-between; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.dir-counter b { color: var(--accent-ink); font-weight: 500; }
.dir-panels { position: relative; align-self: center; width: min(560px, 46vw); min-height: 440px; }
.dir-panel { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 22px; pointer-events: none; }
.dir-panel.is-active { pointer-events: auto; }
.dir-panel > * { opacity: 0; transform: translateY(30px); transition: opacity .5s var(--ease), transform .8s var(--ease); }
.dir-panel.is-active > * { opacity: 1; transform: none; }
.dir-panel.is-active > *:nth-child(2) { transition-delay: .05s; } .dir-panel.is-active > *:nth-child(3) { transition-delay: .1s; }
.dir-panel.is-active > *:nth-child(4) { transition-delay: .15s; } .dir-panel.is-active > *:nth-child(5) { transition-delay: .2s; }
.dir-num { color: var(--accent-ink); }
.dir-panel h2 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(38px, 5.2vw, 84px); line-height: .95; }
.dir-panel h2 em { display: block; color: var(--muted); font-size: .62em; margin-top: .15em; }
.dir-panel p:not(.dir-num) { color: var(--muted); font-size: 17px; max-width: 460px; }
.dir-price { display: flex; flex-direction: column; gap: 2px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 460px; }
.dir-price b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; letter-spacing: -.02em; }
.dir-price span { color: var(--muted); font-size: 14px; }
.dir-link { align-self: flex-start; font-weight: 600; border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: color .3s; }
.dir-link:hover { color: var(--accent-ink); }
/* оффер услуги - крупная строка под названием */
.hcard .hcard-info > p.dir-offer, .dir-offer { color: var(--fg); font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -.02em; font-size: clamp(17px, 1.5vw, 22px); line-height: 1.2; max-width: 460px; }
.dir-more { align-self: flex-start; margin-top: -4px; font-size: 10px; color: var(--muted); transition: color .3s; }
.dir-more:hover { color: var(--accent-ink); }
.foot-services a:hover { color: var(--fg); }
.dir-progress { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.dir-progress i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ---------- CTA ---------- */
.cta { position: relative; z-index: 2; min-height: 100vh; padding: 20vh var(--gutter); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 28px; }
.cta .label { margin: 0; }
.cta-title { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(34px, 6vw, 108px); line-height: .95; max-width: 16ch; }
.cta-title em { color: var(--accent-ink); }
.cta-sub { color: var(--muted); font-size: 18px; max-width: 560px; }
.cta-sub b { color: var(--fg); white-space: nowrap; }

.footer { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 16px; padding: 28px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); }

/* ---------- Панель прототипа ---------- */
.proto-panel {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  padding: 14px; border-radius: 18px; width: 252px;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0,0,0,.4);
}
.proto-panel > p:first-child { color: var(--muted); margin-bottom: 10px; padding-right: 28px; }
.proto-toggle { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; font-size: 14px; line-height: 1; box-shadow: inset 0 0 0 1px var(--line); transition: transform .4s var(--ease); }
.proto-panel.collapsed { width: auto; padding: 8px 44px 8px 14px; }
.proto-panel.collapsed > p:first-child { margin: 0; padding: 4px 0; }
.proto-panel.collapsed .proto-variants, .proto-panel.collapsed .proto-fonts { display: none; }
.proto-panel.collapsed .proto-toggle { transform: rotate(180deg); }
.proto-variants { display: flex; flex-direction: column; gap: 4px; }
.proto-variants button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; text-align: left; transition: background .3s; }
.proto-variants button:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.proto-variants button.active { background: var(--fg); color: var(--bg); }
.proto-variants i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.proto-variants b { font-family: var(--mono); font-weight: 500; font-size: 12px; opacity: .6; }
.proto-fonts { margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; text-transform: none; letter-spacing: .02em; }

/* ---------- Смена темы (View Transitions API) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 900px) {
  .nav, .hero-hint, .callouts { display: none; }
  .dcard.chip { display: none; }
  .dcard.ig, .dcard.ads, .dcard.browser, .dcard.phone { right: 8px; top: 120px; transform-origin: top right; scale: .58; }
  .hero { cursor: auto; }
  .header-tools .btn { display: none; }
  .hero-meta span:nth-child(2) { display: none; }
  .hero { padding-top: 84px; }
  .hero-title .hl:nth-child(2) { padding-left: 0; }
  .hero-scroll { display: none; }
  .btn { height: 48px; padding: 0 20px; font-size: 14px; }
  .dir-sticky { padding-top: 84px; }
  .dir-panels { width: 100%; align-self: end; min-height: 330px; }
  .dir-panels::before { content: ''; position: absolute; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); bottom: -40px; height: 150%; background: linear-gradient(to bottom, transparent, var(--bg) 38%); pointer-events: none; }
  .dir-panel { justify-content: flex-end; gap: 14px; }
  .dir-panel p:not(.dir-num) { font-size: 15px; }
  .proto-panel { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px; }
  .proto-variants { flex-direction: row; }
  .proto-variants button { flex: 1; justify-content: center; padding: 8px 4px; font-size: 12px; }
  .proto-variants b, .proto-fonts { display: none; }
  .footer { flex-direction: column; padding-bottom: 110px; }
}

/* ---------- Шкала глубины (спуск по лестнице) ---------- */
.depth { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); height: 46vh; display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 2; }
.depth > span { color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9px; }
.depth-scale { position: relative; flex: 1; width: 1px; background: var(--line); }
.depth-scale::before { content: ''; position: absolute; inset: 0 -5px; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 12px); width: 11px; }
.depth-scale i { position: absolute; left: -9px; top: calc(var(--p) * 100%); width: 19px; height: 1px; background: var(--fg); opacity: .5; }
.depth-scale small { position: absolute; right: 26px; top: -7px; font-size: 9px; color: var(--muted); }
.depth-scale b { position: absolute; left: -6px; top: 0; width: 13px; height: 13px; margin-top: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 24px var(--accent); }
.depth-scale em { position: absolute; right: 24px; top: -1px; font-style: normal; font-size: 10px; color: var(--accent-ink); white-space: nowrap; }
.dcard.ig, .dcard.ads, .dcard.browser { right: calc(var(--gutter) + 56px); }
.dcard.phone { right: calc(var(--gutter) + 70px); }
@media (max-width: 900px) {
  .depth { height: 30vh; top: 38%; }
  .depth > span { display: none; }
  .dcard.ig, .dcard.ads, .dcard.browser, .dcard.phone { right: 44px; }
}

@media (max-height: 640px) { .callouts { display: none; } }

/* =========================================================
   Винтовая лестница из карточек услуг
   ========================================================= */
.helix { position: absolute; inset: 0; perspective: 1600px; perspective-origin: 50% 42%; pointer-events: none; z-index: 2; }
.helix-track { position: absolute; left: 50%; top: 54%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.hcard {
  position: absolute; left: 0; top: 0; width: min(800px, 84vw);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: center;
  padding: 32px 36px; border-radius: 30px;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 color-mix(in srgb, var(--fg) 14%, transparent), 0 60px 120px -40px rgba(0,0,0,.6);
  backface-visibility: hidden; will-change: transform, opacity; pointer-events: none;
}
.hcard.is-active { pointer-events: auto; }
/* светящаяся кромка у текущей карточки */
.hcard::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--accent), transparent 35%, transparent 70%, color-mix(in srgb, var(--accent) 60%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .6s var(--ease); }
.hcard.is-active::after { opacity: 1; }
.hcard-info { display: flex; flex-direction: column; gap: 16px; }
.hcard .dir-num { color: var(--accent-ink); }
.hcard h2 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(34px, 4.2vw, 66px); line-height: .95; }
.hcard h2 em { display: block; color: var(--muted); font-size: .58em; margin-top: .15em; }
.hcard-info > p:not(.dir-num) { color: var(--muted); font-size: 15px; }
.hcard-demo { position: relative; display: grid; place-items: center; min-height: 300px; }
.hcard .hcard-demo .dcard { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: 100%; max-width: 330px; opacity: 1; transform: none; transition: none; box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0,0,0,.5); }
.hcard .hcard-demo .dcard.phone { width: 180px; height: 320px; }
.hcard .hcard-demo .dcard.chip { position: absolute; width: auto; min-width: 0; z-index: 2; animation: floaty 5s ease-in-out infinite; }
.hcard .hcard-demo .dcard.chip.c-a { top: -30px; right: -34px; left: auto; bottom: auto; }
.hcard .hcard-demo .dcard.chip.c-b { bottom: -26px; left: -30px; right: auto; top: auto; animation-delay: -2.5s; }
@keyframes floaty { 50% { translate: 0 -10px; } }

@media (max-width: 900px) {
  .helix { perspective: 900px; }
  .helix-track { top: 60%; }
  .hcard { grid-template-columns: 1fr; width: 86vw; padding: 22px; gap: 14px; }
  .hcard-demo { display: none; }
  .hcard h2 { font-size: 34px; }
  .hcard-info > p:not(.dir-num) { font-size: 14px; }
}
@media (max-width: 900px) {
  .hcard { width: 80vw; }
  .depth { display: none; }
}

/* стиль утверждён - панель выбора скрыта (код оставлен на случай сравнения) */
.proto-panel { display: none !important; }

/* ---------- Плашка ниши (персонализация из ссылки ?n=) ---------- */
.hero-niche { position: relative; z-index: 4; align-self: end; justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-bottom: -6px;
  padding: 8px 14px; border-radius: 100px; color: var(--fg); font-size: 11px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); backdrop-filter: blur(10px); }
.hero-niche i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero:has(.hero-niche:not([hidden])) { grid-template-rows: auto 1fr auto auto; }

/* шапка получает подложку, как только начинается скролл */
.header { transition: background .4s, backdrop-filter .4s; }
.header.is-scrolled { background: linear-gradient(color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg) 0%, transparent)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ---------- Типографика: ровные заголовки, без «сирот» в абзацах ---------- */
h1, h2, h3, .hcard h2, .cs-title, .faq-q strong { text-wrap: balance; }
p, li, blockquote, dd { text-wrap: pretty; hanging-punctuation: first; }
body { font-kerning: normal; font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* моноширинные цифры - только там, где число «бежит» (счётчики), чтобы не дёргалось */
.calc-total b, .scan-pct b, #xRead, #depthVal, #preCount { font-variant-numeric: tabular-nums; }
/* крупные цифры-заголовки - пропорциональные, иначе «311K» выглядит как «31 1K» */
.case-big, .cs-big, .fstep b, .vs-side b, .vs-ratio b, .cs-results b, .gr-x, .dir-price b, .manifesto-foot b, .cs-related strong { font-variant-numeric: proportional-nums; }

/* атрибут hidden всегда скрывает, даже если у элемента свой display */
[hidden] { display: none !important; }
@media (max-width: 900px) { .hcard .hcard-info > p.dir-offer { font-size: 17px; } }

/* ---------- Телефон: читаемость текста поверх яркого гироскопа ---------- */
@media (max-width: 900px) {
  .hero-sub, .cta-sub, .cta-alt, .calc-sub { text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 2px 18px rgba(0,0,0,.85); color: color-mix(in srgb, var(--fg) 82%, transparent); }
  .hero-title, .cta-title { text-shadow: 0 2px 24px rgba(0,0,0,.6); }
}
:root[data-theme="light"] .hero-sub, :root[data-theme="light"] .cta-sub, :root[data-theme="light"] .cta-alt, :root[data-theme="light"] .calc-sub,
:root[data-theme="light"] .hero-title, :root[data-theme="light"] .cta-title { text-shadow: none; }
/* низкие телефоны (iPhone SE, Android с панелями браузера): карточка услуги целиком влезает в экран */
@media (max-width: 900px) and (max-height: 720px) {
  .hcard { padding: 18px; gap: 10px; }
  .hcard-info { gap: 10px; }
  .hcard h2 { font-size: 28px; }
  .hcard .hcard-info > p.dir-offer { font-size: 15px; }
  .hcard-info > p:not(.dir-num) { font-size: 13px; line-height: 1.45; }
  .dir-price b { font-size: 22px; }
  .dir-price { padding-top: 10px; }
  .dir-sticky { padding-top: 72px; }
}
