/* Lucidity State — pilot A «Погружение». One family (Onest, variable weight), night palette, one warm light. */

:root {
  --night: #050816;
  --deep: #0a1330;
  --ink: #ece8df;
  --ink-2: #b9bfcf;
  --ink-3: #7f879b;
  --warm: #f4ead8;
  --warm-2: #d9c9a6;
  --line: rgba(236, 232, 223, 0.14);

  --font: 'Onest', 'Helvetica Neue', Arial, sans-serif;
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lead: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-h1: clamp(2.5rem, 1.2rem + 4.6vw, 5.25rem);
  --text-h2: clamp(1.9rem, 1.2rem + 2.4vw, 3.4rem);
  --text-quote: clamp(1.35rem, 1rem + 1.15vw, 2.1rem);

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --measure: 62ch;

  --dur-fast: 160ms;
  --dur: 400ms;
  --dur-slow: 900ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 4px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 1rem; top: -3rem; z-index: 20; background: var(--warm); color: var(--night); padding: .5rem .9rem; border-radius: 999px; transition: top var(--dur-fast) var(--ease-out); }
.skip:focus { top: 1rem; }

/* ---------- Scene ---------- */
.scene {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  display: block;
}
.scene-fallback { display: none; }
html.no-webgl .scene { display: none; }
html.no-webgl .scene-fallback {
  display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(244, 234, 216, 0.10), transparent 70%),
    radial-gradient(90% 60% at 20% 110%, rgba(106, 122, 153, 0.20), transparent 70%),
    radial-gradient(80% 50% at 80% 80%, rgba(106, 122, 153, 0.14), transparent 70%),
    linear-gradient(180deg, #111a38 0%, var(--night) 45%, var(--deep) 100%);
}
html.no-webgl .scene-fallback::after {
  content: ''; position: absolute; inset: 0; opacity: .18; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .6 0 0 0 0 .75 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 400px 400px;
}

main, .site-head, .site-foot { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  background: rgba(5, 8, 22, 0);
  transition: background-color var(--dur) var(--ease-out), padding var(--dur) var(--ease-out);
}
.site-head.is-scrolled { background: rgba(5, 8, 22, 0.78); padding-block: .8rem; }
.logo { font-weight: 500; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; gap: 1.4rem; margin-inline: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; transition: color var(--dur-fast) ease; }
.site-nav a:hover { color: var(--ink); }
.head-tools { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; }
.lang { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--ink-3); }
.lang-btn { color: var(--ink-3); padding: .2rem .15rem; transition: color var(--dur-fast) ease; font-weight: 500; letter-spacing: .04em; }
.lang-btn[aria-pressed="true"] { color: var(--ink); }
.lang-btn:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .95rem 1.6rem; border-radius: 999px;
  font-weight: 500; text-decoration: none; line-height: 1.2;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
  will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn-warm { background: var(--warm); color: var(--night); }
.btn-warm:hover { background: #fbf4e6; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: rgba(244, 234, 216, .5); }
.btn-small { padding: .6rem 1.1rem; font-size: .9rem; }
.btn-large { padding: 1.15rem 2.2rem; font-size: 1.1rem; }
.link-quiet { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: .1rem; transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease; }
.link-quiet:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------- Type ---------- */
.h1 {
  font-size: var(--text-h1);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 440;
  max-width: 17ch;
  text-wrap: balance;
}
.h1 .w { display: inline-block; will-change: transform, opacity; }
.h2 {
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 450;
  text-wrap: balance;
}
.h2-quiet { font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem); color: var(--ink-2); font-weight: 400; }
.lead { font-size: var(--text-lead); line-height: 1.5; color: var(--ink); max-width: var(--measure); font-weight: 350; }

/* ---------- Sections ---------- */
section { padding-inline: var(--gutter); }

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(6rem, 14vh, 9rem);
  padding-bottom: 3rem;
  position: relative;
}
.hero-inner { max-width: 62rem; }
.hero-sub { margin-top: clamp(1.4rem, 3vh, 2.2rem); max-width: 56ch; color: var(--ink-2); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); line-height: 1.55; }
.hero-actions { margin-top: clamp(1.8rem, 4vh, 2.8rem); display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; }
.hero-note { color: var(--ink-3); font-size: .95rem; }
.hero-secondary { display: inline-block; margin-top: 1.6rem; font-size: .95rem; }
.stats-line { margin-top: clamp(3rem, 9vh, 6rem); font-size: .85rem; color: var(--ink-3); letter-spacing: .01em; max-width: 70ch; }
.scroll-cue { position: absolute; right: var(--gutter); bottom: 2.2rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--ink-3); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.scroll-cue i { display: block; width: 1px; height: 3rem; background: linear-gradient(180deg, var(--ink-3), transparent); transform-origin: top; animation: cue 2.6s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Who — three voices at three depths */
.who {
  min-height: 100svh; display: grid; align-content: center;
  padding-block: clamp(5rem, 12vh, 8rem) clamp(3rem, 8vh, 6rem);
  max-width: 88rem; margin-inline: auto; scroll-margin-top: 5rem;
}
.who-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.voice { display: flex; flex-direction: column; max-width: none; margin: 0; padding: 0; min-height: 0; }
.voice:nth-child(2) { margin-top: clamp(1.5rem, 6vh, 4.5rem); }
.voice:nth-child(3) { margin-top: clamp(3rem, 12vh, 9rem); }
.voice-right { margin-inline: 0; }
section[id] { scroll-margin-top: 5rem; }
.voice-q {
  font-size: var(--text-quote); line-height: 1.12; letter-spacing: -0.02em; font-weight: 300;
  text-wrap: balance; quotes: '«' '»';
}
.voice-q::before { content: open-quote; color: var(--ink-3); }
.voice-q::after { content: close-quote; color: var(--ink-3); }
.voice figcaption { margin-top: 1.1rem; max-width: 40ch; }
.voice-l { display: block; font-weight: 500; color: var(--warm-2); margin-bottom: .45rem; }
.voice-a { color: var(--ink-2); }

/* Send */
.send { min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; padding-block: 12vh; }
.send-inner { max-width: 48rem; display: flex; flex-direction: column; align-items: center; }
.send .h2 { max-width: 18ch; }
.send .lead { margin-top: 1.6rem; color: var(--ink-2); }
.actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; }

/* Route — four points of light on the descent line */
.how { padding-block: 14vh; max-width: 62rem; margin-inline: auto; }
.route { position: relative; margin-top: 3rem; padding-left: 2.6rem; }
.route::before { content: ''; position: absolute; left: .55rem; top: .4rem; bottom: .4rem; width: 1px; background: linear-gradient(180deg, transparent, var(--line) 12%, var(--line) 88%, transparent); }
.step { position: relative; padding-block: 1.6rem 2rem; }
.step + .step { border-top: 1px solid rgba(236, 232, 223, 0.07); }
.dot {
  position: absolute; left: -2.6rem; top: 2.15rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: radial-gradient(circle, var(--ink-3) 0 22%, transparent 24%);
  transform: scale(.6); opacity: .5;
  transition: transform 500ms var(--ease-out), opacity 500ms ease;
}
.dot::after {
  content: ''; position: absolute; inset: -1.3rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 234, 216, .55), rgba(244, 234, 216, .12) 35%, transparent 70%);
  opacity: 0; transition: opacity 700ms ease;
}
.step.is-lit .dot { transform: scale(1); opacity: 1; background: radial-gradient(circle, var(--warm) 0 24%, transparent 26%); }
.step.is-lit .dot::after { opacity: 1; }
.step-t { font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); font-weight: 450; letter-spacing: -0.015em; line-height: 1.2; }
.step-p { color: var(--warm-2); font-weight: 400; white-space: nowrap; }
.step-p::before { content: '— '; color: var(--ink-3); }
.step-d { margin-top: .5rem; color: var(--ink-2); max-width: 52ch; }

/* About */
.about { padding-block: 14vh; }
.about-grid { display: grid; grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; max-width: 72rem; margin-inline: auto; }
.portrait svg { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 2px; }
.portrait figcaption { margin-top: 1rem; font-size: .95rem; color: var(--ink-2); line-height: 1.4; }
.portrait strong { font-weight: 500; color: var(--ink); }
.about-copy .lead { margin-top: 1.6rem; }
.science { margin-top: 2.4rem; display: grid; gap: .55rem; max-width: var(--measure); border-top: 1px solid var(--line); padding-top: 1.4rem; }
.science dt { color: var(--ink-3); font-size: .85rem; letter-spacing: .03em; }
.science dd { color: var(--ink); }
.science-caption { margin-top: 2.2rem; max-width: 40ch; font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); line-height: 1.3; font-weight: 400; color: var(--warm); letter-spacing: -0.01em; }

/* Reviews — replies, not cards */
.reviews { padding-block: 12vh; max-width: 62rem; margin-inline: auto; }
.replies { margin-top: 2.4rem; display: grid; gap: 2.6rem; max-width: 72rem; margin-inline: auto; }
.replies li { max-width: 52ch; }
.replies li:nth-child(2) { margin-left: auto; text-align: right; }
.reply-t { font-size: var(--text-lead); font-weight: 300; line-height: 1.4; letter-spacing: -0.01em; }
.reply-n { display: block; margin-top: .7rem; color: var(--ink-3); font-size: .9rem; }

/* FAQ — accordion via grid rows */
.faq { padding-block: 12vh; max-width: 48rem; margin-inline: auto; }
.acc { margin-top: 2rem; border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item h3 { font-size: inherit; font-weight: inherit; }
.acc-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; text-align: left; padding: 1.2rem 0; font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); font-weight: 450; transition: color var(--dur-fast) ease; }
.acc-btn:hover { color: var(--warm); }
.acc-ic { flex: 0 0 auto; width: 1rem; height: 1rem; color: var(--ink-3); transition: transform var(--dur) var(--ease-out); }
.acc-btn[aria-expanded="true"] .acc-ic { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 500ms var(--ease-out); }
.acc-body > div { overflow: hidden; }
.acc-body p { color: var(--ink-2); padding-bottom: 1.3rem; max-width: 60ch; opacity: 0; transform: translateY(6px); transition: opacity 400ms ease, transform 400ms var(--ease-out); }
.acc-item.is-open .acc-body { grid-template-rows: 1fr; }
.acc-item.is-open .acc-body p { opacity: 1; transform: none; }

/* Final — the bottom */
.final { min-height: 92svh; display: flex; align-items: center; justify-content: center; text-align: center; padding-block: 12vh 8vh; }
.final-inner { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; }
.h2-final { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 4.4rem); max-width: 16ch; font-weight: 400; }

/* Footer */
.site-foot { padding: 2.4rem var(--gutter) 2.6rem; border-top: 1px solid rgba(236, 232, 223, 0.08); background: linear-gradient(180deg, rgba(5, 8, 22, 0.55), rgba(5, 8, 22, 0.9) 40%); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; font-size: .9rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.foot-links a { color: var(--ink-2); text-decoration: none; transition: color var(--dur-fast) ease; }
.foot-links a:hover { color: var(--ink); }
.foot-disclaimer { color: var(--ink-3); max-width: 60ch; }

/* Thin dark underlay for running text over lit fog — shadow, not a card */
.hero-sub, .voice-a, .lead, .step-d, .acc-body p, .science dd, .reply-t, .hero-note { text-shadow: 0 2px 28px rgba(5, 8, 22, 0.7), 0 0 6px rgba(5, 8, 22, 0.5); }

/* ---------- Reveal defaults (JS animates from these) ---------- */
html.js [data-reveal]:not([data-reveal="voice"]), html.js [data-reveal="voice"] > * { opacity: 0; }
html.js .h1 .w { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 18rem; }
}
@media (max-width: 600px) {
  .site-head { gap: .8rem; padding-inline: 1.1rem; }
  .head-tools .btn { display: none; }
  .hero { padding-top: 6rem; }
  .hero-actions .btn { width: 100%; }
  .who { min-height: 0; }
  .who-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .voice:nth-child(2), .voice:nth-child(3) { margin-top: 0; }
  .scroll-cue { display: none; }
  .replies li:nth-child(2) { margin-left: 0; text-align: left; }
  .actions .btn { width: 100%; }
  .site-foot { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html.js [data-reveal], html.js [data-reveal="voice"] > *, html.js .h1 .w { opacity: 1; }
  .dot { transform: scale(1); opacity: 1; }
}
