/* SpeedReading — лендинг на токенах «Лампы» (Modules/DesignSystem/tokens.json) */

@font-face { font-family: "Source Serif 4"; font-weight: 400 600; font-display: swap; src: url(assets/fonts/serif-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Serif 4"; font-weight: 400 600; font-display: swap; src: url(assets/fonts/serif-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/inter-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/inter-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Токены ---------- */
:root {
  --paper: #FAF4EA;
  --paper-raised: #FFFCF6;
  --paper-sunken: #F3EADC;
  --hairline: #E6D8C4;
  --ink: #33261C;
  --ink-muted: #76604F;
  --ink-faint: #9A8472;
  --lamp: #E8834A;
  --on-lamp: #2B1D13;
  --lamp-text: #A34A17;
  --lamp-soft: #FBE3D2;
  --wing: #2A6F86;
  --wing-soft: #DCEEF2;
  --leaf: #36703A;
  --ember: #B03A26;

  /* Комната без света — фон карточки Live Activity */
  --room: #120E0B;
  --room-ink: #F4E9DA;
  --room-muted: #BCA894;

  --serif: ui-serif, "New York", "Source Serif 4", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 10px; --radius-segment: 12px; --radius-md: 16px; --radius-lg: 26px;
  --tap: 44px; --button-h: 54px;

  --shadow-card: 0 1px 0 rgba(51, 38, 28, .04), 0 18px 40px -24px rgba(51, 38, 28, .28);
  --shadow-control: 0 6px 18px -6px rgba(0, 0, 0, .22);
  --shadow-phone: 0 50px 80px -40px rgba(43, 29, 19, .55), 0 18px 30px -18px rgba(43, 29, 19, .35);

  --gutter: max(clamp(16px, 4vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
  --section-y: clamp(88px, 12vw, 152px);
  --ease-out: cubic-bezier(.22, .8, .24, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1B1511;
  --paper-raised: #262019;
  --paper-sunken: #322A22;
  --hairline: #3A3028;
  --ink: #F4E9DA;
  --ink-muted: #BCA894;
  --ink-faint: #8A7866;
  --lamp: #F2955C;
  --on-lamp: #2A1A10;
  --lamp-text: #F4A673;
  --lamp-soft: #3D2618;
  --wing: #7CC3D6;
  --wing-soft: #1E3238;
  --leaf: #8BC486;
  --ember: #F08A78;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .2), 0 18px 40px -24px rgba(0, 0, 0, .6);
  --shadow-phone: 0 50px 80px -40px rgba(0, 0, 0, .8), 0 18px 30px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .6s ease, color .6s ease;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--lamp-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lamp-text); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.container { width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--paper-raised); color: var(--ink); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow-card); transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Типографика ---------- */
.h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.h3 { font-family: var(--serif); font-size: 22px; line-height: 28px; font-weight: 600; }
.lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-muted); max-width: 34em; }
.muted { color: var(--ink-muted); }
.footnote { font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---------- Кнопки (LampaButtonStyle) ---------- */
.btn {
  --h: var(--button-h);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 26px;
  border-radius: 999px; border: 0;
  font: 600 17px/22px var(--sans);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .3s, box-shadow .3s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--lamp); color: var(--on-lamp); box-shadow: 0 10px 24px -12px rgba(232, 131, 74, .9); }
.btn--primary:hover { filter: brightness(1.05); box-shadow: 0 14px 30px -12px rgba(232, 131, 74, 1); }
.btn--secondary { background: var(--lamp-soft); color: var(--lamp-text); }
.btn--secondary:hover { filter: brightness(.98) saturate(1.1); }
.btn--small { --h: 38px; padding: 0 18px; font-size: 15px; }
.btn--store { --h: 60px; padding: 0 26px 0 22px; text-align: left; }
.btn--store .icon { width: 26px; height: 26px; }
.btn--store span { display: flex; flex-direction: column; line-height: 1.15; }
.btn--store small { font-size: 12px; font-weight: 500; }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cta-row--center { justify-content: center; }

/* ---------- Чип (LampaChip) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--lamp-soft); color: var(--lamp-text);
  font: 600 13px/18px var(--sans);
  transition: background-color .4s, color .4s;
}
.chip .icon { width: 15px; height: 15px; }
.chip--small { padding: 2px 9px; font-size: 12px; vertical-align: 3px; margin-left: 6px; }

/* ---------- Карточка (LampaCard) ---------- */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}

/* ---------- Значок (LampaIconBadge) ---------- */
.icon-badge {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--lamp-soft); color: var(--lamp-text);
}
.icon-badge .icon { width: 22px; height: 22px; }
.icon-badge--wing { background: var(--wing-soft); color: var(--wing); }
.icon-badge--soon { background: var(--paper-sunken); color: var(--ink-muted); }

/* ---------- Телефон ---------- */
.phone {
  position: relative;
  width: var(--phone-w, 300px);
  padding: calc(var(--phone-w, 300px) * .034);
  border-radius: calc(var(--phone-w, 300px) * .17);
  background: linear-gradient(145deg, #3a2f27, #15100c 40%, #2b221b);
  box-shadow: var(--shadow-phone), inset 0 0 0 1.5px rgba(255, 236, 214, .08);
}
.phone img, .phone video {
  width: 100%; height: auto;
  aspect-ratio: 640 / 1391;
  object-fit: cover;
  border-radius: calc(var(--phone-w, 300px) * .137);
  background: #FAF4EA;
}
.phone__glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 244, 228, .14) 0%, rgba(255, 244, 228, 0) 34%);
  mix-blend-mode: screen;
}

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding-top: env(safe-area-inset-top);
  color: var(--ink);
  transition: background-color .4s, color .4s, box-shadow .4s, transform .4s var(--ease-out);
}
.site-header__inner {
  width: min(1140px, 100% - var(--gutter) * 2); margin-inline: auto;
  height: 64px; display: flex; align-items: center; gap: var(--space-6);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: 17px; margin-right: auto; }
.brand img { border-radius: 8px; }
.site-nav { display: flex; gap: var(--space-6); }
.site-nav a { color: inherit; opacity: .8; text-decoration: none; font-size: 15px; padding-block: 10px; white-space: nowrap; transition: opacity .2s; }
.site-nav a:hover { opacity: 1; }
.site-header[data-over="page"] {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: 0 1px 0 var(--hairline);
}
.site-header[data-over="hero"] {
  color: var(--room-ink);
  background: linear-gradient(rgba(18, 14, 11, .85), rgba(18, 14, 11, .6) 70%, rgba(18, 14, 11, 0));
}
.site-header[data-over="hero"] .site-nav a { opacity: 1; }
.site-header[data-over="hero"] :focus-visible { outline-color: var(--lamp); }
@media (max-width: 960px) { .site-nav { display: none; } }

/* ---------- Hero: лампа ---------- */
.hero { position: relative; height: 150vh; height: 150svh; background: var(--room); }
.hero__stage {
  --cord: clamp(16px, 4svh, 48px);
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: var(--paper);
  display: grid; justify-items: center; align-content: start;
  padding: calc(64px + var(--cord) + 112px) var(--gutter) 0;
  --bx: 50%;       /* лампочка: точка, откуда идёт свет (JS) */
  --by: 180px;
  --ang: 0deg;     /* наклон оси абажура (JS) */
  --p: 0;          /* прогресс прокрутки hero 0…1 (JS) */
  --q: 0;          /* подъём телефона: 0 до p = .25, дальше 0…1 */
  --light: 1;      /* яркость лампы 0…1 (JS) */
}
/* Мелкий шум против полос градиента */
.hero__stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .08; mix-blend-mode: overlay;
}
.hero__content {
  position: relative; z-index: 4;
  max-width: 880px; text-align: center;
  display: grid; justify-items: center; gap: var(--space-6);
  transform: translateY(calc(var(--p) * -12vh));
  opacity: calc(1 - var(--p) * 3.2);
}
.hero.is-past .hero__content { visibility: hidden; }
.hero__title {
  font-family: var(--serif);
  font-size: clamp(42px, 7.2vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.022em;
  font-weight: 500;
}
.hero__lead { font-size: clamp(18px, 1.7vw, 21px); color: var(--ink-muted); max-width: 33em; text-wrap: balance; }
.hero__note { font-size: 13px; color: var(--ink-muted); }
.nowrap { white-space: nowrap; }
.hero .cta-row { justify-content: center; margin-top: var(--space-2); }
.hero__phone {
  position: absolute; z-index: 1; left: 50%; top: 100%;
  --phone-w: clamp(240px, 24vw, 380px);
  pointer-events: none;
  transform: translate(-50%, calc(-1 * min(150px, 16vh) - var(--q) * 72vh)) rotate(calc((1 - var(--q)) * -4deg));
}
.phone--hero { --phone-w: inherit; }

/* Темнота вокруг света лампы: только фон и телефон, текст — выше.
   Свет гаснет с расстоянием от лампочки… */
.hero__veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  --rx: calc((60vmax + var(--p) * 120vmax) * var(--light));
  --ry: calc((64vmax + var(--p) * 110vmax) * var(--light));
  background:
    radial-gradient(var(--rx) var(--ry) at var(--bx) var(--by),
      rgba(18, 14, 11, 0) 0%,
      rgba(18, 14, 11, 0) 54%,
      rgba(18, 14, 11, .5) 75%,
      rgba(18, 14, 11, .88) 91%,
      rgba(18, 14, 11, .97) 100%);
  transition: opacity .8s ease;
}
/* …и абажур не пускает его вверх: темно вне широкого конуса вдоль оси */
.hero__veil::after {
  content: ""; position: absolute; inset: 0;
  background: conic-gradient(from calc(var(--ang) + 180deg) at var(--bx) var(--by),
    rgba(18, 14, 11, 0) 0deg, rgba(18, 14, 11, 0) 66deg, rgba(18, 14, 11, .5) 90deg, rgba(18, 14, 11, .9) 116deg,
    rgba(18, 14, 11, .9) 244deg, rgba(18, 14, 11, .5) 270deg, rgba(18, 14, 11, 0) 294deg);
  opacity: calc(1 - var(--p) * 2.4);
}
/* Тёплый луч: ярче вдоль оси, слабеет к краям и с расстоянием */
.hero__veil::before {
  content: ""; position: absolute; inset: 0;
  background: conic-gradient(from calc(var(--ang) + 180deg) at var(--bx) var(--by),
    rgba(255, 205, 150, .55), rgba(255, 205, 150, .24) 26deg, rgba(255, 205, 150, 0) 58deg,
    rgba(255, 205, 150, 0) 302deg, rgba(255, 205, 150, .24) 334deg, rgba(255, 205, 150, .55));
  -webkit-mask-image: radial-gradient(calc(var(--rx) * .85) calc(var(--ry) * .85) at var(--bx) var(--by), #000, rgba(0, 0, 0, .45) 45%, transparent);
  mask-image: radial-gradient(calc(var(--rx) * .85) calc(var(--ry) * .85) at var(--bx) var(--by), #000, rgba(0, 0, 0, .45) 45%, transparent);
  mix-blend-mode: multiply;
  opacity: calc(1 - var(--p) * 1.8);
}
html:not(.js) .hero__veil, html:not(.js) .hero__beam, html:not(.js) .hero__dust { display: none; }
/* Конус света от абажура */
.hero__beam {
  position: absolute; z-index: 3; inset: 0; pointer-events: none;
  opacity: calc(var(--light) * (1 - var(--p) * .85));
  background: conic-gradient(from calc(var(--ang) + 180deg) at var(--bx) var(--by),
    rgba(255, 222, 180, .3), rgba(255, 214, 170, .14) 18deg, rgba(255, 208, 160, 0) 36deg,
    rgba(255, 208, 160, 0) 324deg, rgba(255, 214, 170, .14) 342deg, rgba(255, 222, 180, .3));
  -webkit-mask-image: radial-gradient(circle at var(--bx) var(--by), #000, rgba(0, 0, 0, .5) 30vmax, transparent 70vmax);
  mask-image: radial-gradient(circle at var(--bx) var(--by), #000, rgba(0, 0, 0, .5) 30vmax, transparent 70vmax);
  mix-blend-mode: soft-light;
}
.hero__dust { position: absolute; inset: 0; z-index: 3; pointer-events: none; width: 100%; height: 100%; opacity: calc(var(--light) * (1 - var(--p))); }

/* Подвесная лампа: висит от нижнего края шапки */
.lamp { position: absolute; z-index: 5; top: 64px; left: 50%; width: 0; height: 0; transform: translateY(calc(var(--p) * -300px)); }
.lamp__swing { position: absolute; left: -90px; top: 0; width: 180px; transform-origin: 90px 0; transform: rotate(var(--sway, 0deg)); }
.lamp__cord { display: block; width: 2px; height: var(--cord); margin-inline: auto; background: color-mix(in srgb, var(--ink) 70%, #000); }
.lamp__shade { width: 180px; height: 90px; margin-top: -2px; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.lamp__bulb { opacity: var(--light); filter: blur(1px); }
.lamp__swing::after { /* ореол лампочки */
  content: ""; position: absolute; left: 50%; bottom: -46px; width: 220px; height: 120px;
  translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 220, 170, .55), rgba(255, 180, 110, .15) 60%, transparent);
  opacity: var(--light); pointer-events: none; mix-blend-mode: screen;
}
html.lamp-off .lamp__swing::after { opacity: .16; }
/* Абажур можно толкнуть; на iPhone без доступа к наклону касание заодно открывает шторку */
.lamp__nudge {
  position: absolute; left: 0; top: var(--cord); width: 180px; height: 90px;
  border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50% 50% 8px 8px / 70% 70% 8px 8px;
}
html:not(.js) .lamp__nudge { display: none; }
.lamp__hint {
  position: absolute; left: 100%; top: 50%; translate: 12px -50%;
  font-size: 13px; color: var(--ink-muted); white-space: nowrap;
  text-shadow: 0 0 6px var(--paper), 0 0 12px var(--paper);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.hero.ask-tilt.show-hint .lamp__hint, .hero.ask-tilt .lamp__nudge:focus-visible .lamp__hint { opacity: 1; }

/* Шторка перед системным запросом датчиков (iPhone, iPad) */
html:has(.tilt-sheet[open]) { overflow: hidden; }
.tilt-sheet {
  width: min(480px, 100%); max-width: none; max-height: 100dvh;
  margin: auto auto 0; padding: var(--space-6) var(--gutter) calc(var(--space-5) + env(safe-area-inset-bottom));
  border: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--paper-raised); color: var(--ink);
  overflow-y: auto;
}
.tilt-sheet[open] { animation: tilt-sheet-up .4s var(--ease-out); }
.tilt-sheet::backdrop { background: rgba(18, 14, 11, .5); animation: tilt-sheet-fade .4s ease; }
.tilt-sheet__actions { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.tilt-sheet .btn { width: 100%; }
.tilt-sheet .muted { margin-top: var(--space-2); }
@keyframes tilt-sheet-up { from { transform: translateY(100%); } }
@keyframes tilt-sheet-fade { from { opacity: 0; } }

/* Выключатель-шнурок — слева от лампы, под шапкой */
.pull { --length: calc(var(--cord) + 74px); position: absolute; right: 92px; top: 0; width: 0; height: var(--length); }
html:not(.js) .pull { display: none; }
.pull__rope { position: absolute; left: 0; top: 0; max-width: none; overflow: visible; pointer-events: none; }
.pull__rope path { fill: none; stroke: #C98F62; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pull__bead {
  position: absolute; left: calc(var(--tap) / -2); top: calc(var(--tap) / -2);
  width: var(--tap); height: var(--tap); transform: translateY(var(--length));
  border: 0; padding: 0; background: none; cursor: grab;
  display: grid; place-items: center;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.pull__bead.is-dragging { cursor: grabbing; }
.pull__bead::before { content: ""; width: 12px; height: 16px; border-radius: 6px; background: linear-gradient(#F4A673, #B8612F); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.pull__hint {
  position: absolute; right: 100%; top: 50%; translate: 0 -50%;
  font-size: 13px; color: var(--ink-muted); white-space: nowrap;
  text-shadow: 0 0 6px var(--paper), 0 0 12px var(--paper);
  opacity: 0; transition: opacity .4s; pointer-events: none;
  rotate: calc(-1 * var(--pull-ang, 0rad));   /* шнурок качается, текст нет */
}
.pull__bead:focus-visible .pull__hint, .hero.show-hint .pull__hint { opacity: 1; }
@media (hover: hover) { .pull__bead:hover .pull__hint { opacity: 1; } }

/* Вступление: лампа загорается. Заголовок не прячем — его проявляет свет */
.js .hero__content > *, .js .hero__phone { transition: opacity .7s var(--ease-out), translate .7s var(--ease-out); }
.js .hero:not(.is-lit) .hero__content > :not(.hero__title) { opacity: 0; translate: 0 12px; }
.js .hero:not(.is-lit) .hero__phone { opacity: 0; }
.js .hero.is-lit .hero__content > :nth-child(2) { transition-delay: .1s; }
.js .hero.is-lit .hero__content > :nth-child(3) { transition-delay: .18s; }
.js .hero.is-lit .hero__content > :nth-child(4) { transition-delay: .24s; }
.js .hero.is-lit .hero__phone { transition-delay: .3s; }

/* Лампа выключена: вечерняя тема, комната видна целиком */
html.lamp-off .hero__veil { opacity: 0; }
html.lamp-off .phone img, html.lamp-off .phone video { filter: brightness(.88); }

/* ---------- Как это работает ---------- */
.how__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "intro device" "steps device";
  column-gap: clamp(32px, 6vw, 96px);
}
.how__intro { grid-area: intro; display: grid; gap: var(--space-5); }
.how__steps { grid-area: steps; list-style: none; margin: 0; padding: 0; }
.how__device { grid-area: device; position: relative; }
.phone--story { --phone-w: clamp(260px, 25vw, 320px); position: sticky; top: calc(50vh - var(--phone-w) * 1.12); margin-inline: auto; }
.phone--story img { transition: opacity .6s ease, transform .8s var(--ease-out); }
.phone--story img + img { position: absolute; inset: calc(var(--phone-w) * .034); width: calc(100% - var(--phone-w) * .068); }
.phone--story img:not(.is-active) { opacity: 0; transform: scale(.985); }
.step {
  display: grid; grid-template-columns: 40px 1fr; gap: var(--space-5);
  min-height: 62vh; align-content: center;
  transition: opacity .5s ease;
}
.js .step:not(.is-active) .h3 { color: var(--ink-muted); }
.js .step:not(.is-active) .step__num { background: var(--paper-sunken); color: var(--ink-muted); }
.step:first-child { min-height: 52vh; }
.step:last-child { min-height: 80vh; }
.step.is-active { opacity: 1; }
.step__num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper-sunken); color: var(--ink-muted);
  font: 600 17px/1 var(--sans); font-variant-numeric: tabular-nums;
  transition: background-color .4s, color .4s;
}
.step__num { background: var(--lamp); color: var(--on-lamp); }
.step__body { display: grid; gap: var(--space-3); align-content: start; }
.step__body p { color: var(--ink-muted); max-width: 30em; }
.step__shot { display: none; }

@media (max-width: 860px) {
  .how__grid { grid-template-columns: 1fr; grid-template-areas: "intro" "steps"; }
  .how__device { display: none; }
  .how__steps { margin-top: var(--space-12); display: grid; gap: var(--space-12); }
  .step, .step:first-child, .step:last-child { min-height: 0; }
  .js .step:not(.is-active) .h3 { color: var(--ink); }
  .js .step .step__num { background: var(--lamp); color: var(--on-lamp); }
  .step__shot { display: block; width: min(240px, 70%); height: auto; margin-top: var(--space-4); border-radius: 26px; border: 6px solid #1d1712; box-shadow: var(--shadow-phone); }
}

/* ---------- Слова по фото ---------- */
.photo { background: var(--paper-sunken); transition: background-color .6s; }
.photo__grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(40px, 8vw, 120px); align-items: center; }
.photo__text { display: grid; gap: var(--space-6); }
.phone--video { --phone-w: clamp(240px, 24vw, 300px); }
.video-toggle {
  position: absolute; right: -14px; bottom: 56px; z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--paper-raised); color: var(--ink);
  box-shadow: var(--shadow-control), inset 0 0 0 .5px var(--hairline);
}
.video-toggle .icon { width: 20px; height: 20px; }
.info-card {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4);
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--paper-raised); border: 1px solid var(--hairline);
  max-width: 30em;
}
.info-card__title { font: 600 17px/22px var(--sans); margin-bottom: 4px; }
.info-card p { color: var(--ink-muted); font-size: 15px; line-height: 21px; }
@media (max-width: 860px) {
  .photo__grid { grid-template-columns: 1fr; }
  .photo__device { order: 2; justify-self: center; }
}

/* ---------- Тренировка ---------- */
.training__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(40px, 8vw, 120px); align-items: center; }
.training__text { display: grid; gap: var(--space-6); align-content: start; }
.mode-copy { color: var(--ink-muted); min-height: 3.2em; max-width: 30em; }

/* LampaSegmentedControl: одна плашка едет к выбранному сегменту */
.segmented {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 3px; border-radius: var(--radius-segment);
  background: var(--paper-sunken); max-width: 420px;
}
.segmented button {
  position: relative; z-index: 1; min-height: 38px;
  border: 0; background: none; cursor: pointer; border-radius: 9px;
  font: 500 15px/20px var(--sans); color: var(--ink-muted);
  transition: color .3s;
}
.segmented button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.segmented__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 9px; background: var(--paper-raised);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .45s var(--ease-out);
}

.trainer {
  display: grid; justify-items: center; gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-8);
  transition: background-color .6s ease, border-color .6s ease;
}
.trainer.is-rest { background: var(--wing-soft); border-color: transparent; }
.trainer__top { width: 100%; display: grid; gap: 8px; }
.trainer__meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.seg-progress { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 4px; }
.seg-progress span { height: 4px; border-radius: 2px; background: var(--hairline); overflow: hidden; }
.seg-progress span i { display: block; height: 100%; width: calc(var(--f, 0) * 100%); background: var(--lamp); transition: width 1s linear; }
.trainer.is-rest .chip { background: color-mix(in srgb, var(--wing) 14%, transparent); color: var(--wing); }

/* LampaTimerRing */
.ring { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring__track { stroke: var(--paper-sunken); }
.trainer.is-rest .ring__track { stroke: color-mix(in srgb, var(--paper-raised) 80%, transparent); }
.ring__bar {
  stroke: var(--lamp); stroke-linecap: round;
  stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - var(--ring, 1) * 100);
  transition: stroke-dashoffset 1s linear, stroke .4s;
}
.trainer.is-rest .ring__bar { stroke: var(--wing); stroke-dasharray: .01 2.6; stroke-width: 7; }
.ring__center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.ring__time { font: 500 clamp(56px, 7vw, 72px)/1 var(--serif); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring__sub { font-size: 13px; color: var(--wing); margin-top: 4px; }
.trainer__next { font-size: 15px; color: var(--ink-muted); }

/* LampaControlButton */
.controls { display: flex; gap: var(--space-8); margin-top: var(--space-2); }
.control {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--paper-raised);
  box-shadow: var(--shadow-control), inset 0 0 0 .5px var(--hairline);
  transition: transform .2s var(--ease-out);
}
.control:active { transform: scale(.94); }
.control .icon { width: 24px; height: 24px; }
.control--pause { color: var(--wing); }
.control--stop { color: var(--ember); }
.controls__labels { display: flex; gap: var(--space-8); font-size: 12px; color: var(--ink-muted); margin-top: -8px; }
.controls__labels span { width: 64px; text-align: center; }

@media (max-width: 860px) {
  .training__grid { grid-template-columns: 1fr; }
  .trainer { width: 100%; max-width: 420px; justify-self: center; }
}

/* ---------- Прогресс ---------- */
.progress__grid { display: grid; justify-items: center; gap: var(--space-12); text-align: center; }
.progress__text { display: grid; gap: var(--space-5); justify-items: center; }
.progress__text .lead { max-width: 36em; }
.stats { width: min(520px, 100%); text-align: left; }
.stats { margin: 0; padding: var(--space-6); display: grid; gap: var(--space-5); }
.stats__head { display: flex; justify-content: space-between; align-items: center; }
.trend { display: inline-flex; align-items: center; gap: 4px; color: var(--leaf); font: 600 15px/20px var(--sans); }
.trend .icon { width: 16px; height: 16px; }
.metric { display: flex; align-items: baseline; gap: 10px; margin-top: -6px; }
.metric__value { font: 500 72px/76px var(--serif); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric__unit { color: var(--ink-muted); }

/* LampaBarStrip */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 150px; align-items: end; }
.bar { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 6px; }
.bar i {
  grid-row: 2; align-self: end; width: 100%; max-width: 28px;
  height: calc(var(--v, 0) * 100%); border-radius: 8px;
  background: var(--ink-faint);
  transform-origin: bottom; transform: scaleY(var(--grow, 1));
  transition: transform 1.1s var(--ease-out);
}
.bar em { grid-row: 1; font: 600 13px/1 var(--sans); color: var(--lamp-text); font-style: normal; font-variant-numeric: tabular-nums; }
.bar b { grid-row: 3; font: 500 12px/1 var(--sans); color: var(--ink-muted); }
.bar--today i { background: var(--lamp); }
.bar--today b { color: var(--lamp-text); font-weight: 700; }
.bar--empty i { width: 6px; height: 6px; border-radius: 50%; }
.js .bars:not(.is-in) .bar i { --grow: 0; }
.bar:nth-child(2) i { transition-delay: .06s; } .bar:nth-child(3) i { transition-delay: .12s; }
.bar:nth-child(4) i { transition-delay: .18s; } .bar:nth-child(5) i { transition-delay: .24s; }
.bar:nth-child(6) i { transition-delay: .3s; } .bar:nth-child(7) i { transition-delay: .36s; }

/* LampaStatGrid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-radius: var(--radius-md); background: var(--paper-sunken); }
.stat-grid div { padding: 12px 14px; display: flex; flex-direction: column-reverse; }
.stat-grid div + div { border-left: 1px solid var(--hairline); }
.stat-grid dt { font-size: 13px; color: var(--ink-muted); }
.stat-grid dd { margin: 0; font: 600 22px/28px var(--sans); font-variant-numeric: tabular-nums; }
.stats figcaption { text-align: center; }


/* ---------- Остальное: LampaListGroup ---------- */
.more { padding-top: 0; }
.more__title { margin-bottom: var(--space-12); max-width: 14em; }
.more__groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
.list-group { list-style: none; margin: 0; padding: 0 var(--space-5); border-radius: var(--radius-md); background: var(--paper-raised); border: 1px solid var(--hairline); }
.row { position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); padding-block: var(--space-5); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--hairline); }
.row__title { font: 600 17px/22px var(--sans); margin-bottom: 4px; }
.row p { font-size: 15px; line-height: 21px; color: var(--ink-muted); }
@media (max-width: 760px) { .more__groups { grid-template-columns: 1fr; } }

/* ---------- Честно ---------- */
.honest { padding-block: var(--section-y) 0; }
.honest__inner { display: grid; justify-items: center; }
.honest__quote { margin: 0; text-align: center; }
.honest__quote p {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.28; letter-spacing: -0.01em;
  max-width: 21em; text-wrap: balance;
}

/* ---------- Вопросы ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq__list { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  min-height: 64px; padding-block: var(--space-4);
  font: 600 18px/24px var(--sans);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-3px) rotate(45deg); transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { color: var(--ink-muted); padding-bottom: var(--space-6); max-width: 36em; }
@media (max-width: 760px) { .faq__grid { grid-template-columns: 1fr; } }

/* ---------- Финал: снова вечер, снова лампа ---------- */
.final {
  --paper: #1B1511; --paper-raised: #262019; --hairline: #3A3028;
  --ink: #F4E9DA; --ink-muted: #BCA894;
  --lamp: #F2955C; --on-lamp: #2A1A10; --lamp-text: #F4A673; --lamp-soft: #3D2618;
  background: var(--room); color: var(--ink);
  overflow: hidden; text-align: center;
}
.final__glow {
  position: absolute; left: 50%; top: 0; width: min(1100px, 160vw); aspect-ratio: 1.6;
  translate: -50% -38%;
  background: radial-gradient(closest-side, rgba(242, 149, 92, .28), rgba(242, 149, 92, .08) 55%, transparent);
  pointer-events: none;
}
.final__inner { position: relative; display: grid; justify-items: center; gap: var(--space-6); }
.final__icon { border-radius: 22px; box-shadow: 0 20px 50px -14px rgba(242, 149, 92, .55); }
.final .lead { margin-top: -8px; }
@media (max-width: 760px) { .cta-row--center { flex-direction: column; align-items: stretch; width: min(340px, 100%); } }

.site-footer { background: var(--room); color: var(--room-muted); font-size: 13px; padding: var(--space-6) 0 calc(var(--space-6) + env(safe-area-inset-bottom)); border-top: 1px solid #2a221b; }
.site-footer__inner { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- Документы (privacy/, terms/, support/ — собираются tools/build_legal.py) ---------- */
.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.site-footer__links a { color: inherit; text-decoration: none; }
.site-footer__links a:hover { color: var(--room-ink); text-decoration: underline; }

.doc-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-12);
  padding-block: calc(64px + env(safe-area-inset-top) + var(--space-12)) var(--section-y);
}
.doc-nav ul { list-style: none; margin: 0; padding: 0; position: sticky; top: calc(64px + var(--space-12)); display: grid; gap: 2px; }
.doc-nav a {
  display: block; padding: 9px 14px; border-radius: var(--radius-sm);
  color: var(--ink-muted); text-decoration: none; font-size: 15px; line-height: 20px;
  transition: background-color .2s, color .2s;
}
.doc-nav a:hover { color: var(--ink); background: var(--paper-sunken); }
.doc-nav a[aria-current="page"] { color: var(--lamp-text); background: var(--lamp-soft); font-weight: 600; }

.doc { max-width: 42rem; outline: none; }
.doc h1 {
  font-family: var(--serif); font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08;
  letter-spacing: -0.015em; margin-bottom: var(--space-6);
}
.doc h2 { font-family: var(--serif); font-size: 26px; line-height: 32px; font-weight: 600; margin: var(--space-12) 0 var(--space-3); scroll-margin-top: 88px; }
.doc h3 { font-size: 17px; font-weight: 600; margin: var(--space-6) 0 var(--space-2); }
.doc p, .doc ul, .doc ol { line-height: 1.65; }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + ol, .doc ol + p, .doc .doc-table + p, .doc p + .doc-table { margin-top: var(--space-4); }
.doc ul, .doc ol { margin: 0; padding-left: 1.3em; }
.doc li + li { margin-top: var(--space-2); }
.doc li::marker { color: var(--ink-faint); }
.doc code { font: 500 .88em/1 ui-monospace, "SF Mono", Menlo, monospace; background: var(--paper-sunken); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.doc a { overflow-wrap: anywhere; }
.doc strong { font-weight: 600; }

/* Оглавление длинных документов (LampaListGroup) */
.doc-toc { margin: var(--space-8) 0 var(--space-4); }
.doc-toc ol { list-style: none; margin: 0; padding: var(--space-2) 0; background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.doc-toc li + li { margin: 0; border-top: 1px solid var(--hairline); }
.doc-toc a { display: block; padding: 10px var(--space-4); color: var(--ink); text-decoration: none; line-height: 22px; }
.doc-toc a:hover { color: var(--lamp-text); }

.doc-table { margin-top: var(--space-4); overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--paper-raised); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.doc-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-muted); background: var(--paper-sunken); }
.doc-table th, .doc-table td { padding: 10px 14px; vertical-align: top; }
.doc-table tr + tr td, .doc-table tbody tr:first-child td { border-top: 1px solid var(--hairline); }
.doc-table td:first-child { min-width: 9em; }

/* Пометка «заполнить перед публикацией» — видна, чтобы её не пропустить */
.doc-todo { background: var(--lamp-soft); color: var(--ember); border-radius: 4px; padding: 0 3px; font-size: .92em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Статьи (stati/) — пишутся руками, на типографике .doc ---------- */
.article-layout { min-height: calc(100svh - 68px); padding-block: calc(64px + env(safe-area-inset-top) + var(--space-12)) var(--section-y); }
.article { margin-inline: auto; }
.crumbs { display: flex; gap: var(--space-2); font-size: 14px; color: var(--ink-faint); margin-bottom: var(--space-4); }
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--lamp-text); }
.doc h1 + .doc-lead { margin-top: calc(var(--space-6) * -1 + var(--space-2)); }
.doc-lead { font-size: 19px; line-height: 1.55; color: var(--ink-muted); }
.doc .doc-meta { margin-top: var(--space-4); font-size: 14px; color: var(--ink-faint); }
.answer { margin-top: var(--space-8); padding: var(--space-5) var(--space-6); border-color: var(--lamp-soft); background: linear-gradient(var(--lamp-soft), var(--paper-raised) 70%); }
.answer__title { font: 600 13px/18px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--lamp-text); margin-bottom: var(--space-2); }
.doc .answer p + p { margin-top: 0; }
.doc ol > li > strong:first-child, .doc ul > li > strong:first-child { color: var(--ink); }
.tip { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); margin-top: var(--space-8); padding: var(--space-5) var(--space-6); }
.doc h3.tip__title { margin: 6px 0 var(--space-2); }
.tip p { color: var(--ink-muted); }
.doc .tip .btn { color: var(--on-lamp); text-decoration: none; }
.sources { font-size: 15px; color: var(--ink-muted); }
/* Текст для чтения внутри статьи (тексты для проверки техники чтения) */
.doc blockquote { margin: var(--space-4) 0; padding: var(--space-5) var(--space-6); background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: var(--radius-md); font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.article .doc-table td strong { white-space: nowrap; }
@media (max-width: 560px) {
  .tip { grid-template-columns: minmax(0, 1fr); padding: var(--space-5); }
  .doc blockquote { padding: var(--space-4); }
  .article .doc-table td:first-child { min-width: 4.5em; }
  .article .doc-table th, .article .doc-table td { padding-inline: 10px; }
  .article .doc-table table { font-size: 14px; hyphens: auto; -webkit-hyphens: auto; }
}

/* Список статей */
.doc .article-list { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: grid; gap: var(--space-4); }
.doc .article-list li + li { margin-top: 0; }
.article-card { display: block; padding: var(--space-5) var(--space-6); color: inherit; text-decoration: none; transition: border-color .2s; }
.article-card:hover { border-color: var(--lamp); }
.article-card__title { display: block; font: 600 21px/28px var(--serif); color: var(--ink); }
.article-card__text { display: block; margin-top: var(--space-2); color: var(--ink-muted); line-height: 1.5; }

@media (max-width: 860px) {
  .article-layout { padding-top: calc(64px + env(safe-area-inset-top) + var(--space-6)); }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding-top: calc(64px + env(safe-area-inset-top) + var(--space-6)); }
  .doc-nav { margin-inline: calc(var(--gutter) * -1); }
  .doc-nav ul { position: static; display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px var(--gutter); scrollbar-width: none; }
  .doc-nav ul::-webkit-scrollbar { display: none; }
  .doc-nav a { white-space: nowrap; border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 14px; }
  .doc-nav a[aria-current="page"] { border-color: transparent; }
}

/* ---------- Адаптив hero ---------- */
@media (max-width: 760px) {
  .hero { height: 140svh; }
  .hero__stage { padding-top: calc(64px + var(--cord) + 92px); }
  .hero__veil { --rx: calc((72vmax + var(--p) * 120vmax) * var(--light)); --ry: calc((88vmax + var(--p) * 110vmax) * var(--light)); }
  .hero .cta-row { flex-direction: column; align-items: stretch; width: min(340px, 100%); }
  .lamp__swing { scale: .8; transform-origin: 90px 0; }
  .pull { right: 78px; }
  .hero__phone { --phone-w: 230px; transform: translate(-50%, calc(-1 * min(110px, 13vh) - var(--q) * 66vh)) rotate(calc((1 - var(--q)) * -4deg)); }
}
@media (max-height: 760px) and (min-width: 761px) {
  .hero__title { font-size: clamp(40px, 6vw, 72px); }
}
/* Низкий экран или просьба не двигать: без залипания, телефон в потоке */
@media (max-height: 700px), (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__stage { position: relative; height: auto; min-height: 100svh; padding-bottom: 0; }
  .hero__content { transform: none; opacity: 1; }
  .hero.is-past .hero__content { visibility: visible; }
  .hero__phone {
    position: relative; top: auto; left: auto; transform: none;
    margin-top: var(--space-12); height: min(56vh, 420px); overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
  }
  /* Темнота только в первом экране и плавно гаснет к его низу */
  .hero__veil, .hero__beam { bottom: auto; height: 100svh; }
  .hero__veil { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
  .hero__phone .phone { --phone-w: 260px; }
  .hero__dust { display: none; }
}

/* ---------- Без движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .hero__dust { display: none; }
}
