/* ============================================================================
   Narrly home — "жоско" redesign. Loaded ONLY on index.html, so the shared
   site.css (about / pricing / features / …) is never touched. Builds on the
   committed identity: Literata · Manrope · Caveat, cream + coral + grape, the
   custom ease cubic-bezier(.32,.72,0,1), the starfield/comets, .reveal.
   ============================================================================ */

/* ── Paper grain: gives the cream real tooth so it never reads digital-flat.
   z-index:-1 keeps it behind ALL content; the starfield twinkles over it. ── */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
@media (prefers-reduced-motion: reduce) { .grain { display: none; } }

/* general underline accent (lifted out of `.ehero h1 .u-line` so the hero can use it) */
.u-line { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px;
  text-underline-offset: 7px; text-decoration-skip-ink: none; }

/* ════════════════════════════ HERO STAGE ════════════════════════════ */
.hero-stage { position: relative; overflow: hidden; padding: 30px 0 84px; }
/* one warm bedside-lamp glow, low-centre, behind the open book — single light source */
.hero-stage::before { content: ""; position: absolute; left: 50%; top: 290px; width: 760px; height: 520px;
  transform: translateX(-50%); z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(232,149,59,.20) 0%, rgba(242,103,90,.10) 38%, transparent 70%); }
.hero-stage > .wrap { position: relative; z-index: 1; }

.hero-stage__intro { text-align: center; max-width: 760px; margin: 0 auto; }
.hero-stage__intro .badge { margin-bottom: 18px; }
.hero-stage h1 { font-family: 'Literata', Georgia, serif; font-weight: 700; color: var(--ink);
  font-size: clamp(30px, 5.1vw, 58px); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance;
  margin: 4px 0 14px; min-height: 2.3em; } /* reserve ~2 lines so the swapping value word never reflows the page */
.hero-stage h1 b { font-weight: 700; color: var(--grape-deep); }
.hs-value { display: inline-block; color: var(--gold-text); font-style: italic;
  transition: transform .19s var(--ease), opacity .19s var(--ease); will-change: transform; }
.hs-value.is-flip { transform: translateY(-7px); opacity: 0; }
.hero-stage .lead { font-size: clamp(17px, 2vw, 20px); color: var(--mist-dim); max-width: 50ch;
  margin: 0 auto; line-height: 1.6; text-wrap: pretty; }

/* ── the open storybook: left leaf = watercolor plate, right leaf = live title page ── */
.bookspread { position: relative; display: grid; grid-template-columns: .92fr 1.08fr; align-items: stretch;
  max-width: 860px; margin: 38px auto 28px; padding: 16px; border-radius: 22px;
  background: linear-gradient(170deg, #F3E6CC 0%, #E9D6B4 100%);
  box-shadow: 0 44px 88px -26px rgba(46,34,71,.46), 0 12px 26px -10px rgba(46,34,71,.30),
    inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(120,84,40,.18);
  transform: rotate(-.5deg); }
/* gutter shadow down the spine */
.bookspread::after { content: ""; position: absolute; top: 8%; bottom: 8%; left: 50%; width: 26px;
  transform: translateX(-50%); pointer-events: none; z-index: 3; border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(90,60,30,.20), transparent 72%); }

.bookspread__plate { position: relative; margin: 0; border-radius: 16px 6px 6px 16px; overflow: hidden;
  background: #fff; padding: 9px;
  box-shadow: inset 0 0 0 1px rgba(232,149,59,.35), 0 10px 22px -12px rgba(46,34,71,.4); }
.bookspread__plate img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px 3px 3px 10px;
  display: block; -webkit-mask-image: radial-gradient(125% 125% at 50% 50%, #000 78%, transparent 100%);
  mask-image: radial-gradient(125% 125% at 50% 50%, #000 78%, transparent 100%); }

/* right leaf — the live title page (overrides the base .book card so it sits in the spread) */
.bookspread .book { max-width: none; margin: 0; border-radius: 6px 16px 16px 6px;
  background: linear-gradient(180deg, #FFFDF7 0%, #FBF2DF 100%); color: var(--ink);
  padding: 30px 30px 26px; box-shadow: inset 0 0 0 1px rgba(120,84,40,.10);
  display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: 2px; }
.bookspread .book__ded { font-family: 'Caveat', cursive; font-size: 25px; color: var(--gold-deep); margin: 0 0 14px; }
.bookspread .book__seal { width: 84px; height: 84px; border-radius: 50%; margin: 0 0 16px; position: relative;
  color: #FFF7E8; display: grid; place-items: center;
  background: radial-gradient(circle at 36% 30%, var(--gold-soft), var(--gold-deep) 86%);
  box-shadow: 0 9px 22px rgba(196,117,32,.5), inset 0 0 0 3px rgba(255,255,255,.35), inset 0 -3px 6px rgba(120,60,10,.4);
  isolation: isolate; /* permanent stacking context so the ink-bloom ::after always sits in front of the leaf */
  transition: transform .2s var(--ease); }
.bookspread .book__seal .ic { width: 38px; height: 38px; filter: drop-shadow(0 1px 0 rgba(120,60,10,.55)) drop-shadow(0 -1px 0 rgba(255,255,255,.4)); }
/* ink-bloom: a warm radial blooms behind the seal on each stamp */
.bookspread .book__seal::after { content: ""; position: absolute; left: 50%; top: 50%; width: 150px; height: 150px;
  transform: translate(-50%,-50%) scale(.4); border-radius: 50%; z-index: -1; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(242,103,90,.5) 0%, rgba(232,149,59,.28) 40%, transparent 70%); }
.book.is-bloom .book__seal::after { animation: inkBloom .42s var(--ease); }
@keyframes inkBloom { 0% { opacity: .9; transform: translate(-50%,-50%) scale(.4); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
.bookspread .book__title { font-family: 'Literata', serif; font-weight: 700; color: var(--ink);
  font-size: clamp(23px, 3.2vw, 32px); line-height: 1.16; margin: 0 0 10px; text-wrap: balance;
  min-height: 2.32em; display: flex; align-items: center; transition: opacity .2s ease; }
.bookspread .book__teaser { font-family: 'Literata', serif; font-style: italic; font-size: 16.5px; line-height: 1.5;
  color: #5E4F72; margin: 0; min-height: 6em; transition: opacity .2s ease; } /* min-height holds the longest teaser; #5E4F72 ≈6:1 */
.bookspread .book__hint { margin-top: 13px; font-family: 'Caveat', cursive; font-size: 18px; line-height: 1;
  color: var(--gold-text); } /* a storybook hand-note, not a tracked micro-eyebrow */
/* the swap press: seal presses + tilts, title/teaser fade out (base .book.is-swapping only covered `b`) */
.bookspread .book.is-swapping .book__seal { transform: scale(.82) rotate(-7deg); }
.bookspread .book.is-swapping .book__title,
.bookspread .book.is-swapping .book__teaser { opacity: 0; }

/* value rail — a real radiogroup */
.hero-stage .vrail { margin: 0 auto 26px; }
.hero-stage .vrail__label { color: var(--mist-dim); font-weight: 700; font-size: 14px; }
.hero-stage .vchip[aria-checked="true"] { background: var(--gold-text); color: #fff; border-color: var(--gold-deep); } /* white on gold-text ≈5.1:1 (AA) */
.hero-stage .vchip.is-nudge { animation: chipNudge 1.4s var(--ease); }
@keyframes chipNudge { 0%,100% { transform: none; box-shadow: var(--shadow-sm); }
  30% { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(232,149,59,.4); } 60% { transform: none; } }
.vrail__more { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 14px; color: var(--gold-text);
  padding: 9px 14px; align-self: center; }
.vrail__more:hover { text-decoration: underline; }

/* hero CTA cluster */
.hero-stage__act { text-align: center; margin-top: 4px; }
.hero-stage__act .ehero__note { margin-top: 12px; }
.hero-stage__proof { display: inline-block; margin-top: 14px; font-weight: 800; font-size: 15px; }
.hero-stage__proof:hover { text-decoration: underline; }

/* ════════════════════════ PROBLEM (elevated) ════════════════════════ */
.home .problem { padding: 0; } /* drop the base section{padding:96px} so the white strip hugs the one line */
.home .problem .wrap { padding: 44px 24px; }
.home .problem p { font-size: clamp(21px, 3vw, 30px); line-height: 1.4; max-width: 22ch; margin: 0 auto; }

/* ════════════════════ STORY PATH (kills the 1·2·3 flow) ════════════════════ */
.path__track { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
  max-width: 980px; margin: 8px auto 0; padding-top: 14px; }
.path__ink { position: absolute; left: 0; right: 0; top: 18px; width: 100%; height: 200px; z-index: 0; pointer-events: none; overflow: visible; }
.path__line { stroke-dashoffset: 0; }
.js .path__line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.5s var(--ease) .25s; }
.path__track.in .path__line { stroke-dashoffset: 0; }
.path__moment { position: relative; z-index: 1; text-align: center; padding: 0 8px; }
.path__moment--a { margin-top: 0; }
.path__moment--b { margin-top: 50px; }
.path__moment--c { margin-top: 16px; }
.path__glyph { width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center;
  font-size: 30px; color: var(--gold-text);
  background: linear-gradient(160deg, #fff 0%, #FFF4E6 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 6px rgba(255,255,255,.5); }
.path__glyph .ic { width: 30px; height: 30px; }
.path__moment h3 { font-family: 'Literata', serif; font-size: 19px; color: var(--ink); margin: 0 0 7px; font-weight: 700; }
.path__moment p { font-size: 15.5px; color: var(--mist-dim); margin: 0; max-width: 26ch; margin-inline: auto; line-height: 1.5; }

/* ════════════════════ VALUES (hero-scale constellation) ════════════════════ */
.home .constel { width: min(680px, 94vw); margin-top: 28px; }
/* the centre medallion now reuses the hero's wax-seal material — a visual rhyme */
.home .constel__center { width: 144px; height: 144px; gap: 2px; color: #FFF7E8;
  box-shadow: 0 16px 38px rgba(196,117,32,.5), inset 0 0 0 4px rgba(255,255,255,.34), inset 0 -4px 8px rgba(120,60,10,.4); }
.home .constel__center .ic { width: 22px; height: 22px; margin: 0 auto 2px; }
.home .constel__center b { font-size: 17px; }
.home .constel__node { transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease); }
.home .constel__node:hover { border-color: var(--gold-text); color: var(--gold-deep);
  box-shadow: 0 10px 22px -8px rgba(232,149,59,.5); }
.values__lang { text-align: center; max-width: 640px; margin: 36px auto 0; color: var(--mist-dim);
  font-size: 16px; line-height: 1.6; }
.values__lang .values__kk { font-family: 'Literata', serif; font-weight: 700; color: var(--gold-text); } /* ≈4.6:1 on cream (AA) */
.values__lang .values__sub { display: block; margin-top: 4px; font-size: 13.5px; color: var(--mist-dim); }

/* ════════════════════ SAMPLE STORY (deckled mats on the real panels) ════════════════════ */
.home .story-demo__panels .panel__art { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), inset 0 0 0 5px #fff,
  0 8px 18px -8px rgba(46,34,71,.36); }

/* ════════════════════ FINAL CTA truth-line ════════════════════ */
.cta .cta__truth { position: relative; z-index: 1; color: rgba(237,233,251,.82); font-family: 'Manrope', sans-serif;
  font-size: 14.5px; font-weight: 600; margin: 22px auto 0; max-width: 46ch; line-height: 1.5; } /* .cta .x beats base .cta p */

/* ════════════════════════════ RESPONSIVE ════════════════════════════ */
@media (max-width: 820px) {
  .bookspread { grid-template-columns: 1fr; max-width: 440px; transform: none; gap: 10px; }
  .bookspread::after { display: none; }
  .bookspread__plate { border-radius: 14px; }
  .bookspread__plate img { aspect-ratio: 16 / 11; -webkit-mask-image: none; mask-image: none; border-radius: 8px; }
  .bookspread .book { border-radius: 14px; }
  .bookspread .book__title { min-height: 0; }
  .bookspread .book__teaser { min-height: 0; }
  .path__track { grid-template-columns: 1fr; gap: 30px; max-width: 360px; }
  .path__ink { display: none; }
  .path__moment, .path__moment--a, .path__moment--b, .path__moment--c { margin-top: 0; }
}
@media (max-width: 640px) {
  .hero-stage { padding: 18px 0 60px; }
  .hero-stage::before { width: 420px; top: 240px; }
  .hero-stage h1 { font-size: clamp(27px, 8vw, 40px); }
}

/* ════════════════════════════ REDUCED MOTION ════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .hs-value, .bookspread .book__title, .bookspread .book__teaser, .bookspread .book__seal,
  .home .constel__node, .js .path__line { transition: none; }
  .js .path__line { stroke-dashoffset: 0; }
  .book.is-bloom .book__seal::after, .hero-stage .vchip.is-nudge { animation: none; }
}

/* ════════════════ Post-review fixes (contrast · a11y · responsive) ════════════════ */
/* Home CTAs clear large-text contrast: white on --gold-deep ≈3.6:1 (bar is 3:1). Scoped to the home. */
.home .btn--cta, .home .cta .btn { background: var(--gold-deep); box-shadow: 0 10px 30px rgba(196,117,32,.40); }
.home .btn--cta:hover, .home .cta .btn:hover { box-shadow: 0 16px 38px rgba(196,117,32,.55); }
.home .langs a.on { background: var(--gold-text); } /* RU pill, white on gold-text ≈5.1:1 */

/* the radiogroup is one tab stop; this wrapper carries the role without disturbing the .vrail flex */
.vrail__chips { display: contents; }
/* keep the two inline links at a 44px touch target */
.vrail__more, .hero-stage__proof { min-height: 44px; display: inline-flex; align-items: center; }

/* Constellation: collapse to the wrapped pill-cloud earlier (≤760) so the fixed-radius orbit is never
   shown cramped, and re-assert the centre banner the base ≤620 rule intends (home overrides outrank it). */
@media (max-width: 760px) {
  .home .constel { width: auto; aspect-ratio: auto; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .home .constel__center { position: static; transform: none; width: 100%; height: auto; aspect-ratio: auto;
    border-radius: 18px; padding: 14px 18px;
    box-shadow: 0 12px 28px rgba(196,117,32,.4), inset 0 0 0 3px rgba(255,255,255,.3); }
  .home .constel__center .ic { margin-bottom: 0; }
  .home .constel__node { position: static; transform: none !important; font-size: 11px; padding: 6px 11px; }
  .home .constel__node .ic { display: none; }
}

/* ════════════ Minimalistic bedtime decoration for the empty hero side-margins ════════════
   A soft moon, wispy cloud-haze and a few glowing stars. Static (calm), desktop only,
   behind the content. Hidden where there is no side room. */
.hero-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
@media (max-width: 1120px) { .hero-deco { display: none; } }
.deco-moon { position: absolute; top: 50px; right: 4.5%; width: 102px; height: 102px; border-radius: 50%;
  background: radial-gradient(circle at 37% 33%, #FFF8DC, #FAE07A 62%, #EFC047);
  box-shadow: 0 0 72px 8px rgba(251,192,45,.36), inset -9px -7px 18px rgba(196,130,30,.26),
    inset 7px 7px 14px rgba(255,255,255,.55); }
.deco-cloud { position: absolute; border-radius: 50%; filter: blur(17px); opacity: .5;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,243,225,.4) 70%, transparent); }
.deco-cloud--r { width: 152px; height: 60px; top: 178px; right: 2.5%; }
.deco-cloud--l { width: 132px; height: 54px; top: 318px; left: 3%; opacity: .38; }
.deco-star { position: absolute; border-radius: 50%; background: #fff; }
.deco-star--1 { width: 9px; height: 9px; top: 118px; left: 7%; box-shadow: 0 0 12px 3px rgba(251,192,45,.6); }
.deco-star--2 { width: 7px; height: 7px; top: 382px; right: 8%; box-shadow: 0 0 10px 2px rgba(242,103,90,.5); }
.deco-star--3 { width: 6px; height: 6px; top: 250px; left: 11%; box-shadow: 0 0 9px 2px rgba(124,92,196,.5); }
