/* learnfromx — landing page (dusk merge).
 *
 * Centered poster composition over the live atmosphere dusk scene. The scene
 * itself (cool blue SVG + stones + sunrise dusk-tint + canvas birds and
 * particles) is rendered by partials/atmosphere.html with
 * atmosphere_mood="marketing" — this file styles
 * only the content that scrolls over it.
 *
 * Layering: `.ld` is a normal document-flow block at z-55 — the DOCUMENT
 * scrolls, `.ld` is not a scroll container (see the note on `.ld` below).
 * Layer order is decided by one number: `.ld` is z-55. Everything atmosphere.css
 * puts below that paints behind the content (the sky, stones and dusk tint
 * all sit in `.atmosphere` at z-54, which is why the stones never occlude the
 * product cards); anything above it paints over. Read the z-index, do not trust a list.
 *
 * Colour voices: cream = glowing UI text · warm-sand "scene" = JP labels,
 * eyebrows, numerals · coral = the sun / the single action accent, and the
 * pen strokes drawn around the papers. On a paper, purple marks the piece of
 * grammar being learned, as it does in a lesson.
 */

:root {
  --ld-fui: 'Nunito', 'Helvetica Neue', system-ui, sans-serif;
  --ld-fjp: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;     /* display JP (vertical title, eyebrows) */
  --ld-fjp-text: 'Noto Sans JP', sans-serif;                   /* card JP (words, sentences) */
  --ld-fhand: 'Klee One', 'Nunito', cursive;                   /* pen notes written around the lesson papers */

  /* Text over the sky, loudest first: cream (headings), soft (body), mute
     (second-rank body), faint (the email placeholder, on its dark glass).
     The sky is light: pure white on it measures about 4.1:1 at the top of the
     screen and 3.1:1 at the bottom, so no value here can reach 4.5:1 and these
     sit as close under white as leaves those ranks apart. Raising soft brought it level with
     cream-90, so the two are one rank now and a soft link cannot show a hover
     by getting lighter: the footer links take an underline (the hero's ghost
     link has its arrow). A thing that is decoration, not reading, takes
     --ld-cream-whisper or --ld-cream-thread (the old faint and mute values)
     so that raising the text never raises it. */
  --ld-cream: #fdf6ef;
  --ld-cream-90: rgba(253,246,239,0.95);
  --ld-cream-soft: rgba(250,238,231,0.95);
  --ld-cream-mute: rgba(246,228,220,0.86);
  --ld-cream-whisper: rgba(228,200,192,0.42);
  --ld-cream-thread: rgba(236,212,204,0.66);

  --ld-scene: rgba(250,222,200,0.92);
  --ld-scene-soft: rgba(247,212,188,0.5);

  --ld-coral: #f1a07c;
  --ld-coral-solid: #f07a54;
  --ld-coral-solid-deep: #e0603a;

  --ld-hair: rgba(255,224,208,0.15);

  /* A lesson in the app is a LIGHT frosted paper with dark ink. The papers
     below borrow its palette, so the landing looks like the product on the
     dusk scene without copying a screen. */
  --ld-card-bg: rgba(255,255,255,0.9);
  --ld-card-edge: rgba(74,72,120,0.1);
  --ld-card-hairline: rgba(74,72,120,0.12);
  --ld-card-ink: #2a2440;
  --ld-card-ink-soft: #5b5575;
  --ld-card-ink-muted: #8d87a4;
  --ld-card-purple: #4a4878;
  --ld-card-accent: #6c5ce7;   /* the lesson's own purple: a marked piece of grammar, quotation marks */
  --ld-card-green: #4a8a6e;
  /* A paper lying face down: one of a tree's papers that has not come up yet.
     Its own values, never the text tokens above, so it stays quieter than any
     text however readable that is made. The mark in its middle is a sprout. */
  --ld-back-fill: rgba(253,246,239,0.09);
  --ld-back-edge: rgba(253,246,239,0.3);
  --ld-back-rule: rgba(253,246,239,0.15);
  --ld-back-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fdf6ef' stroke-opacity='.4' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.5v-8M12 14.5c-3.6 0-5.8-2.1-5.8-5.6 3.6 0 5.8 2.1 5.8 5.6ZM12 12c0-3.4 2-5.4 5.4-5.4 0 3.4-2 5.4-5.4 5.4Z'/%3E%3C/svg%3E");

  --ld-radius-lg: 20px;
  --ld-shadow-card: 0 2px 6px rgba(10,6,28,0.20), 0 18px 48px -14px rgba(10,6,28,0.6);
  --ld-shadow-btn: 0 6px 18px -6px rgba(10,6,28,0.45);
  --ld-txt-glow: 0 1px 10px rgba(24,16,44,0.55);

  --ld-ease: cubic-bezier(0.2, 1, 0.3, 1);
}

/* The dark violet dusk base (shows in overscroll / safe-area gutters behind the
   fixed atmosphere) is set centrally in atmosphere.css via --dusk-base for both
   moods here — body:has(.atmosphere--marketing/--legal) — so the landing and
   the document pages composite the translucent tint identically. */

/* ── Content layer (normal document flow, above the atmosphere) ──
   Do NOT restore `position: fixed; inset: 0; overflow-y: auto`. That left the
   document unscrollable, so Chrome Android promoted `.ld` to its implicit root
   scroller, and the retracting URL bar opened a --dusk-base bar at the bottom. */
.ld {
  position: relative; z-index: 55;
  overflow-x: clip;
  font-family: var(--ld-fui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ld-cream-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* the scrollbar belongs to the viewport, not to .ld */
html:has(.ld) { scrollbar-width: none; scroll-behavior: smooth; }
html:has(.ld)::-webkit-scrollbar { display: none; }
.ld a { color: inherit; text-decoration: none; }

.ld-wrap { max-width: 1000px; margin: 0 auto; padding: 0 28px; }

/* ── Nav — spread to the true corners (full width) ── */
.ld-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 42px;
}
.ld-logo {
  font-weight: 700; font-size: 12px; letter-spacing: 0.22em;
  color: var(--ld-cream-mute); text-decoration: none;
}
.ld-beta {
  display: inline-block; margin-left: 9px; vertical-align: middle;
  position: relative; top: -1px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ld-coral);
  border: 1px solid rgba(240,140,100,0.45); border-radius: 999px;
  padding: 2px 6px;
}
.ld-nav__r { display: flex; align-items: center; gap: 28px; }
.ld-nav__r a {
  font-size: 13.5px; letter-spacing: 0.02em; color: var(--ld-cream-mute);
  transition: color 0.2s; padding: 6px 2px;
}
.ld-nav__r a:hover { color: var(--ld-cream-90); }
.ld-nav__cta { font-weight: 600; color: var(--ld-coral) !important; }
.ld-nav__cta:hover { color: #fff !important; }

/* ── Ghost link ── */
.ld-ghost {
  font-size: 14.5px; font-weight: 500; color: var(--ld-scene);
  letter-spacing: 0.03em; transition: color 0.2s; text-shadow: var(--ld-txt-glow);
}
.ld-ghost:hover { color: var(--ld-cream-90); }
.ld-ghost span { display: inline-block; transition: transform 0.25s; }
.ld-ghost:hover span { transform: translateX(3px); }

/* ── Hero (centered poster composition) ── */
.ld-hero {
  position: relative;
  /* `svh` (browser UI SHOWN), not `dvh`. Now that the document is the scroller,
     a `dvh` height grows ~60px the instant Android retracts the URL bar, and
     everything below the hero jumps down mid-flick — the same class of bug as
     the blue bar. `svh` is the one height that never changes (#1045). */
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 28px 96px;
}
/* 920px, not 720: "Learn Japanese from the anime" measures 884px at the top of
   `.ld-h1`'s clamp (64px) and 766px at 1024px wide, so a 720px column orphaned
   "anime" onto a line of its own at every desktop width. Measured, not guessed --
   880px was tried first and still wrapped by 4px. `.ld-sub` keeps its own 30em
   measure, so the reading line-length is unchanged, and `.ld-halo` is
   `min(680px, 100%)`, so the glow does not grow with the column. */
.ld-hero__inner { position: relative; max-width: 920px; }
/* `min(680px, 100%)`, not 680px and not 100vw: at its natural size this glow is
   the only element wider than a phone, and ld-haloBreathe scales it to 1.05 --
   a transformed border box still counts toward scrollable overflow. `.ld`'s
   `overflow-x: clip` would hide it, but Safari 15 drops `clip`. `100%` of the
   28px-padded `.ld-hero__inner` fits even at 1.05x; desktop is unchanged. */
.ld-halo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(680px, 100%); height: 480px; z-index: -1; pointer-events: none; filter: blur(30px);
  background: radial-gradient(ellipse 52% 56% at 50% 48%,
    rgba(255,168,120,0.18) 0%, rgba(196,140,220,0.12) 44%, transparent 72%);
  animation: ld-haloBreathe 15s ease-in-out infinite;
}
.ld-h1 {
  font-family: var(--ld-fui); font-weight: 300;
  font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.14; letter-spacing: 0.005em;
  color: var(--ld-cream); margin: 0 0 22px; text-shadow: 0 2px 26px rgba(28,18,52,0.5);
}
.ld-h1 b { font-weight: 400; color: var(--ld-coral); text-shadow: 0 0 26px rgba(240,140,100,0.35); }
.ld-sub {
  font-size: clamp(1rem, 1.6vw, 1.16rem); font-weight: 300; color: var(--ld-cream-soft);
  letter-spacing: 0.02em; margin: 0 auto 40px; max-width: 30em; text-shadow: var(--ld-txt-glow);
}
/* Each sentence wraps as a unit, so a phone breaks between the two sentences
   and never strands one word on a line of its own. */
.ld-sub span { display: inline-block; }
.ld-cta-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }

/* Vertical Japanese title (book-cover / poster spine, right side) */
.ld-vt {
  position: absolute; top: 0; bottom: 0; right: 5vw; z-index: 4;
  display: flex; align-items: center; gap: 18px; pointer-events: none;
}
.ld-vt b, .ld-vt i { writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap; }
.ld-vt b {
  font-family: var(--ld-fjp); font-weight: 400; font-size: 30px; letter-spacing: 0.18em;
  color: var(--ld-scene); text-shadow: 0 2px 20px rgba(28,18,52,0.5);
}
.ld-vt i {
  font-style: normal; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ld-cream-whisper);
}

.ld-scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ld-cream-whisper);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ld-scroll-cue::after {
  content: ""; width: 1px; height: 30px;
  background: linear-gradient(var(--ld-scene-soft), transparent);
}

/* ── How it works: one story in three beats. Each beat is a numbered heading
   and a plain sentence, then something to tap. Everything a lesson would show
   sits on a pale paper; every explanation is a pen note (.ld-pen) OUTSIDE the
   papers, in the page's cream, with a coral arrow (.ld-ink) the script draws
   to what the note is about (js/landing_pen.js). Pen notes and their arrows
   are the only hand-drawn things on the page: they point, they never carry
   lesson content. Coral on a paper means one thing: a word, or in the kanji
   section a kanji, that is new. ── */
.ld-how { counter-reset: beat; padding: 78px 0 0; }
.ld-marks { position: absolute; width: 0; height: 0; }
/* The scripts show and hide with `hidden`; a display set below must not undo it. */
.ld-how [hidden] { display: none; }
.ld-beat { counter-increment: beat; display: flex; flex-direction: column; align-items: center; padding-bottom: 104px; }
.ld-beat__head { text-align: center; margin-bottom: 36px; }
.ld-beat__n {
  width: 28px; height: 28px; margin: 0 auto 16px; border: 1px solid var(--ld-scene-soft); border-radius: 50%;
  font-size: 13px; font-weight: 600; line-height: 26px; color: var(--ld-scene); text-shadow: var(--ld-txt-glow);
}
.ld-beat__n::before { content: counter(beat); }
.ld-h3 {
  margin: 0; font-family: var(--ld-fui); font-weight: 300; font-size: clamp(1.4rem, 2.7vw, 1.85rem);
  line-height: 1.3; color: var(--ld-cream); text-wrap: balance; text-shadow: 0 2px 22px rgba(24,15,48,0.45);
}
.ld-lead {
  margin: 12px auto 0; max-width: 33em; font-size: clamp(1rem, 1.7vw, 1.1rem); font-weight: 300; line-height: 1.6;
  color: var(--ld-cream-soft); text-wrap: balance; text-shadow: var(--ld-txt-glow);
}
/* The plain sentence the kanji section leads with. */
.ld-say {
  margin: 0 auto; max-width: 30em; font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 300; line-height: 1.5;
  color: var(--ld-cream-90); text-align: center; text-wrap: balance; text-shadow: var(--ld-txt-glow);
}
.ld-hint {
  font-size: 15px; font-weight: 300; color: var(--ld-cream-90); line-height: 1.6;
  margin: 22px 0 0; min-height: 1.6em; text-align: center; text-wrap: balance; text-shadow: var(--ld-txt-glow);
}
.ld-fine { max-width: 34em; margin: 12px auto 0; font-size: 13px; line-height: 1.6; color: var(--ld-cream-mute); text-align: center; text-shadow: var(--ld-txt-glow); }
/* Beat two's reason to guess, under its button: fine print whose source is a
   quiet dotted link in the same cream, not a button. */
.ld-why { max-width: 27em; margin-top: 16px; text-wrap: balance; }
.ld-why a {
  white-space: nowrap; color: var(--ld-cream-90); text-decoration: underline dotted 1px;
  text-underline-offset: 3px; text-decoration-color: var(--ld-scene); transition: color 0.2s, text-decoration-color 0.2s;
}
.ld-why a:hover { color: var(--ld-cream); text-decoration-style: solid; }
.ld-why a:focus-visible { outline: 2px solid var(--ld-coral); outline-offset: 2px; border-radius: 3px; }
.ld-btn {
  font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--ld-card-ink);
  background: var(--ld-card-bg); border: 0; border-radius: 999px; box-shadow: var(--ld-shadow-btn);
  min-height: 46px; padding: 0 30px; margin-top: 14px; cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ld-ease);
}
.ld-btn:hover { background: #fff; transform: translateY(-1px); }
.ld-btn:active { transform: translateY(0) scale(0.97); }
.ld-btn:focus-visible, .ld-audio-btn:focus-visible, .ld-play:focus-visible, .ld-chip:focus-visible,
.ld-card__turn:focus-visible, .ld-again:focus-visible {
  outline: 2px solid var(--ld-coral); outline-offset: 3px;
}
.ld-card, .ld-chip {
  background: var(--ld-card-bg); border: 1px solid var(--ld-card-edge); border-radius: var(--ld-radius-lg);
  box-shadow: var(--ld-shadow-card);
}

/* Beat one: nine one-word lines in three rows of three, each a small paper
   that says itself when tapped. They sit a little askew, like slips laid out
   by hand. */
.ld-lines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; max-width: 540px; }
.ld-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0;
  font: inherit; padding: 20px 8px 16px; cursor: pointer; rotate: -1.1deg;
  transition: rotate 0.35s var(--ld-ease), translate 0.35s var(--ld-ease), background 0.2s;
}
.ld-chip:nth-child(even) { rotate: 0.9deg; }
.ld-chip:nth-child(3n) { rotate: 0.3deg; }
.ld-chip:hover, .ld-chip.is-playing { rotate: 0deg; translate: 0 -3px; background: #fff; }
.ld-chip:active { translate: 0 0; }
.ld-chip__jp { font-family: var(--ld-fjp-text); font-size: 27px; font-weight: 700; line-height: 1.3; color: var(--ld-card-ink); }
.ld-chip__say { font-size: 12.5px; font-style: italic; letter-spacing: 0.02em; color: var(--ld-card-ink-muted); }
.ld-chip__en { font-size: 14.5px; font-weight: 500; color: var(--ld-card-ink-soft); margin-top: 7px; }
.ld-chip__play {
  position: absolute; top: 10px; right: 11px; width: 9px; height: 9px;
  fill: var(--ld-card-ink-muted); opacity: 0.55; transition: fill 0.2s, opacity 0.2s;
}
.ld-chip:hover .ld-chip__play, .ld-chip.is-playing .ld-chip__play { fill: var(--ld-card-purple); opacity: 1; }
.ld-chip.is-playing { animation: ld-ring 1.1s ease-out infinite; }

/* The stage is a paper plus the room its pen notes need. On a phone the notes
   take a strip above and a strip below the paper; from 980px they move into
   the side margins (see the media query after this block). */
.ld-try, .ld-grow { width: 100%; display: flex; flex-direction: column; align-items: center; }
.ld-stage {
  --paper: 440px;
  position: relative; width: 100%; max-width: var(--paper); display: grid; grid-template-columns: 1fr 1fr;
  grid-template-areas: "tl tr" "paper paper" "bl br"; gap: 30px 14px;
}
/* A tree has no pen notes, so on a phone it keeps no strips for them. */
.ld-stage--tree { --paper: 660px; grid-template-areas: "paper paper"; }
.ld-stage__main { grid-area: paper; position: relative; z-index: 1; min-width: 0; }
/* This paper turns in 3D, so its holder owns the perspective. */
.ld-stage__main--turns { perspective: 1400px; }
.ld-pen {
  margin: 0; max-width: 12.5em; font-family: var(--ld-fhand); font-size: 17px; line-height: 1.45;
  color: var(--ld-cream-90); text-wrap: balance; text-shadow: var(--ld-txt-glow);
  transition: opacity 0.45s 0.5s;
}
.ld-pen[data-side="right"] { --d: 0.3s; }
.ld-ink {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  fill: none; stroke: var(--ld-coral-solid); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
}
.ld-ink path { stroke-dasharray: 1; }
/* Notes fade in after the paper settles, then each arrow draws itself. The
   fill is "backwards" only, so the turn below can still fade them out. An
   arrow that comes back after being hidden draws itself again only if its
   note is marked data-redraw (js/landing_pen.js); every note that hides is. */
.is-visible .ld-pen { animation: ld-fade 0.45s calc(0.4s + var(--d, 0s)) backwards; }
.is-visible .ld-ink__line { animation: ld-draw 0.5s calc(0.65s + var(--d, 0s)) backwards ease-out; }
.is-visible .ld-ink__head { animation: ld-draw 0.2s calc(1.1s + var(--d, 0s)) backwards ease-out; }
.ld-try .ld-pen, .ld-try .ld-ink { transition: opacity 0.12s; }
.ld-stage.is-turning .ld-pen, .ld-stage.is-turning .ld-ink { opacity: 0; }
@media (max-width: 979.98px) {
  .ld-pen[data-at="top"] { align-self: end; }
  .ld-pen[data-at="top"][data-side="left"] { grid-area: tl; }
  .ld-pen[data-at="top"][data-side="right"] { grid-area: tr; }
  .ld-pen[data-at="bottom"][data-side="left"] { grid-area: bl; }
  .ld-pen[data-at="bottom"][data-side="right"] { grid-area: br; }
  .ld-pen[data-side="right"] { justify-self: end; text-align: right; }
  /* A note whose arrow goes over the paper to a word in its middle is
     centred above it, so the arrow drops straight down onto the word. */
  .ld-pen[data-at][data-side][data-over] { grid-column: 1 / -1; grid-row: 1; justify-self: center; text-align: center; }
}
@media (min-width: 980px) {
  .ld-stage { max-width: none; grid-template-columns: 1fr var(--paper) 1fr; grid-template-areas: "l paper r"; gap: 0 34px; align-items: start; }
  .ld-pen[data-side="left"] { grid-area: l; justify-self: end; text-align: right; }
  .ld-pen[data-side="right"] { grid-area: r; justify-self: start; }
  /* The answer side has no hint, so its empty line gives up its room. Only
     here: on a narrower screen the paper already moves up as its notes go,
     and closing the gap as well would pull the button from under the finger. */
  .ld-try .ld-hint:empty { min-height: 0; margin-top: 8px; }
}

/* The lesson paper. Every paper on the page (beat two's, beat three's four,
   Kanji's two, Grammar's one) is the same two sides in the order a real lesson
   in the app sets them, and differs only in
   the sizes below; .ld-card--small resets them, nothing else. Question side:
   the word, very large, with the line it sits in small under it, standing in
   the vertical middle of the paper. Answer side: the word, how it is said in
   green, what it means, a hairline, the line and its English in quotation
   marks, then sections under small labels. The two sides share one cell, so
   a paper is as big as its bigger side and keeps that size when it turns;
   the side that is away is unseen. The play button stands under both. */
.ld-card {
  --word: 76px; --word-back: 56px; --line: 19px; --say: 14px; --read: 17px; --meaning: 22px;
  --piece: 15px; --en: 14.5px; --gap: 22px;
  position: relative; width: 100%; display: grid; grid-template-rows: 1fr auto; padding: 34px 30px 26px; text-align: center;
}
.ld-card > [data-face] { grid-area: 1 / 1; min-width: 0; }
.ld-card > [data-face][hidden] { display: block; visibility: hidden; }
.ld-front { align-self: center; }
.ld-card [lang="ja"] { font-family: var(--ld-fjp-text); }
.ld-card__word { font-size: var(--word); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--ld-card-ink); width: fit-content; max-width: 100%; margin: 0 auto; }
.ld-back .ld-card__word { font-size: var(--word-back); }
/* The piece being learned in a word: its glyphs in the lesson's purple, no box. */
.ld-mark { background: none; color: var(--ld-card-accent); }
.ld-line { font-size: var(--line); font-weight: 400; line-height: 1.5; color: var(--ld-card-ink-soft); margin: 0; }
.ld-front .ld-line { margin-top: 0.6em; }
.ld-w { display: inline-block; }
.ld-w--new { font-weight: 700; color: var(--ld-card-ink); }
.ld-romaji { font-size: var(--say); font-style: italic; color: var(--ld-card-ink-muted); letter-spacing: 0.02em; margin: 0.2em 0 0; }
.ld-reading { font-size: var(--read); font-weight: 600; letter-spacing: 0.02em; color: var(--ld-card-green); margin: 0.2em 0 0; }
.ld-meaning {
  font-size: var(--meaning); font-weight: 500; line-height: 1.25; color: var(--ld-card-ink-soft); margin: 0.2em 0 0;
  text-wrap: balance; animation: ld-pop 0.5s 0.3s both cubic-bezier(0.2, 0.9, 0.3, 1.5);
}
/* The meaning pops each time the answer side comes up. */
.ld-back[hidden] .ld-meaning { animation: none; }
.ld-piece { font-size: var(--piece); font-weight: 500; color: var(--ld-card-accent); margin: 0.15em 0 0; }
.ld-head { padding-bottom: var(--gap); margin-bottom: var(--gap); border-bottom: 1px solid var(--ld-card-hairline); }
.ld-en { font-size: var(--en); line-height: 1.5; color: var(--ld-card-ink-muted); margin: 0.3em 0 0; text-wrap: balance; }
.ld-en::before { content: "\201c"; color: var(--ld-card-accent); margin-right: 2px; }
.ld-en::after { content: "\201d"; color: var(--ld-card-accent); margin-left: 2px; }
.ld-sec { text-align: left; }
.ld-en + .ld-sec { margin-top: calc(var(--gap) + 4px); }
.ld-label { margin: 0 0 0.6em; font-size: 12.5px; font-weight: 700; line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ld-card-ink-muted); }
.ld-note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ld-card-ink-soft); }
.ld-card__foot { grid-area: 2 / 1; position: relative; z-index: 1; justify-self: center; display: flex; margin-top: var(--gap); }
.ld-audio-btn, .ld-play {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em; color: var(--ld-card-ink-soft); background: none; border: 1px solid var(--ld-card-hairline);
  border-radius: 999px; padding: 8px 15px; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ld-audio-btn svg, .ld-play svg { width: 10px; height: 10px; fill: currentColor; }
.ld-audio-btn:hover, .ld-play:hover { border-color: var(--ld-card-purple); color: var(--ld-card-purple); }
.ld-audio-btn.is-playing, .ld-play.is-playing {
  background: var(--ld-card-purple); border-color: var(--ld-card-purple); color: #fff;
  animation: ld-ring 1.1s ease-out infinite;
}
/* Round, icon-only play button. */
.ld-play { flex: none; justify-content: center; width: 32px; height: 32px; padding: 0 0 0 1px; }

/* Beat three: a tree of small papers in a diamond. Each is the paper above
   with a size modifier (ld-card--small). A small paper has no visible "Show
   answer": one unseen button covers it (.ld-card__turn), so a tap anywhere
   turns it and a keyboard can too, and the play button under the sides
   stands on top of that button. */
.ld-card--small {
  --word: 40px; --word-back: 34px; --line: 15.5px; --say: 13px; --read: 14.5px; --meaning: 18px;
  --piece: 14px; --en: 13.5px; --gap: 14px;
  flex: 1; padding: 22px 16px 14px; cursor: pointer; transition: background 0.3s;
}
.ld-card--small:hover { background: #fff; }
.ld-card__turn {
  position: absolute; inset: 0; margin: 0; padding: 0; border: 0; border-radius: inherit; background: none;
  font-size: 0; color: transparent; cursor: pointer;
}
/* A paper that is not shown yet keeps its room, so the tree has its full
   height from the first paint and nothing on the page moves when a paper
   arrives. Until then the paper is unseen, out of the tab order and unread by
   screen readers, and in its room, on the very box the paper will take, a
   card lies face down (.ld-tree__room::before): a faint paper back with a
   thin rule inside its edge and a small sprout in the middle. It has no
   shadow, takes no tap and answers no pointer, so only the real papers ask
   to be tapped. A paper turns in 3D (js/landing_turn.js), so its holder owns
   the perspective. */
.ld-tree { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.ld-tree__item { display: grid; min-width: 0; }
.ld-tree__item:not(.is-shown) .ld-card { visibility: hidden; }
.ld-tree__room { --drop: 0px; position: relative; display: flex; flex-direction: column; min-height: 0; perspective: 900px; }
.ld-tree__item[data-from] .ld-tree__room { --drop: 62px; }
.ld-tree__item .ld-card { margin-top: var(--drop); }
.ld-tree__room::before {
  content: ""; position: absolute; inset: var(--drop) 0 0; border: 1px solid var(--ld-back-edge);
  border-radius: var(--ld-radius-lg); background: var(--ld-back-mark) center / 30px no-repeat, var(--ld-back-fill);
  outline: 1px solid var(--ld-back-rule); outline-offset: -9px; opacity: 0; pointer-events: none;
}
/* The fade is for "Start again", when the cards are laid face down again. */
.ld-tree__item:not(.is-shown) .ld-tree__room::before { opacity: 1; transition: opacity 0.35s; }
.ld-tree__item--top, .ld-tree__item--join { grid-column: 1 / -1; justify-self: center; }
.ld-tree__item--top { width: 240px; }
.ld-grammar-sec .ld-tree__item--top, .ld-grammar-sec .ld-tree__item--join { width: 280px; }
.ld-tree__item--join { width: 440px; }
/* A stroke (js/landing_tree.js) inks its way down when the paper it leads to is shown. */
.ld-stroke__line { stroke-dashoffset: 1; }
.ld-grow.is-visible .ld-stroke.is-inked .ld-stroke__line { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease-out 0.1s; }
.ld-again {
  font: inherit; font-size: 13px; color: var(--ld-cream-mute); background: none; border: 0; padding: 6px 10px;
  margin-top: 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-shadow: var(--ld-txt-glow);
}
.ld-again:hover { color: var(--ld-cream-90); }
/* The one note of a tree: "turn this one next". The script moves it from
   paper to paper (js/landing_tree.js): beside the paper where the stage has
   margins, under it (.is-under) where it has none, and then the stage keeps a
   strip under its last paper for it (.has-under). Each time it moves it is
   put in the page afresh, so it rises in and its arrow draws itself again. It
   never takes a tap away from a paper. */
.ld-pen--next {
  position: absolute; left: 0; top: 0; z-index: 3; width: max-content; max-width: 5.6em;
  pointer-events: none; transition: none;
}
.ld-pen--next.is-left { text-align: right; }
.ld-pen--next.is-under { max-width: none; white-space: nowrap; }
.ld-stage.has-under { padding-bottom: 58px; }
.ld-grow.is-visible .ld-pen--next { animation: ld-next 0.4s 0.6s backwards var(--ld-ease); }
.ld-grow.is-visible .ld-next .ld-ink__line { animation: ld-draw 0.4s 0.85s backwards ease-out; }
.ld-grow.is-visible .ld-next .ld-ink__head { animation: ld-draw 0.18s 1.2s backwards ease-out; }
@keyframes ld-next { from { opacity: 0; transform: translateY(6px); } }
.ld-grow .ld-fine { margin-top: 16px; }
/* Where the note sits beside the papers, the stage keeps no strip under them,
   so the line under beat three's tree needs its own room. */
.ld-how .ld-stage--tree:not(.has-under) { margin-bottom: 20px; }

/* Review (the section after Grammar): beat two's 何 comes back as a review,
   a small paper with beat two's "Show answer" (a tap on the paper turns it
   too), then hops along the review stops (js/landing_hops.js). What follows
   is the resting frame: every stop reached, 何 on the last, the trail drawn.
   .is-armed is the script's "today" frame, the stops ahead small and faint.
   A stop is placed by its --at (index.html), a sketch, not to scale. The
   line runs across here and down on a phone (the 760px block below), where
   five labels across would collide. Across, "today" and "later today" are
   too close for two labels side by side, so the second (--low) drops to a
   row of its own. The line runs on past the last stop and fades, as the
   reviews do. 何 sits centred on a stop's dot. */
.ld-memory__head { margin-bottom: 36px; text-align: center; }
.ld-memory { display: flex; flex-direction: column; align-items: center; }
.ld-recall__holder { width: 240px; perspective: 900px; }
/* Unlike beat two's, this answer side keeps its empty hint's room, so the
   button and the line under it stay put while 何 hops. */
.ld-try.ld-recall .ld-hint:empty { min-height: 1.6em; margin-top: 22px; }
.ld-hops { --line: 56px; --dot: 11px; width: 100%; max-width: 700px; margin-top: 50px; padding: 0 60px; }
.ld-hops__track { position: relative; height: 126px; }
.ld-hops__track::before {
  content: ""; position: absolute; left: -16px; right: -56px; top: var(--line); height: 1.5px; margin-top: -0.75px;
  background: linear-gradient(90deg, transparent, var(--ld-cream-thread) 16px, var(--ld-cream-thread) calc(100% - 76px), transparent);
}
.ld-hops__stops { list-style: none; margin: 0; padding: 0; }
.ld-hops__stop { position: absolute; left: calc(var(--at) * 100%); top: var(--line); width: 0; height: 0; }
.ld-hops__dot {
  position: absolute; left: calc(var(--dot) / -2); top: calc(var(--dot) / -2); width: var(--dot); height: var(--dot);
  border-radius: 50%; background: var(--ld-cream); box-shadow: 0 0 0 4px rgba(253,246,239,0.12), 0 0 14px rgba(255,186,140,0.5);
  transition: transform 0.3s var(--ld-ease), background 0.3s;
}
.ld-hops__when {
  position: absolute; left: 0; top: 27px; transform: translateX(-50%); white-space: nowrap;
  font-size: 14px; line-height: 1.3; color: var(--ld-cream-90); text-shadow: var(--ld-txt-glow); transition: color 0.3s;
}
/* The dropped label hangs from its dot on a hairline, so it reads as that
   stop's and not as the second line of "today". */
.ld-hops__stop--low .ld-hops__when { top: 51px; }
.ld-hops__stop--low::after {
  content: ""; position: absolute; left: -0.5px; top: 12px; width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--ld-cream-thread), transparent);
}
.ld-hops.is-armed .ld-hops__stop:not(.is-reached) .ld-hops__dot { transform: scale(0.72); background: var(--ld-cream-thread); box-shadow: 0 0 0 3px rgba(253,246,239,0.08); }
.ld-hops.is-armed .ld-hops__stop:not(.is-reached) .ld-hops__when { color: var(--ld-cream-mute); }
/* The trail: one thin arc per hop, inked behind 何 as it flies. */
.ld-hops__trail {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  fill: none; stroke: var(--ld-cream-whisper); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 1;
}
.ld-hops__trail path { stroke-dashoffset: 1; }
.ld-hops__trail path.is-drawn { stroke-dashoffset: 0; }
.ld-hops__word { position: absolute; z-index: 1; left: 100%; top: var(--line); width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.ld-hops__face {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 10px; transform-origin: 50% 85%;
  background: var(--ld-card-bg); border: 1px solid var(--ld-card-edge); box-shadow: 0 1px 3px rgba(10,6,28,0.2), 0 8px 18px -6px rgba(10,6,28,0.55);
  font-family: var(--ld-fjp-text); font-size: 19px; font-weight: 700; line-height: 1; color: var(--ld-card-ink);
}
/* A landing: a coral ring leaves the stop and three motes drift up, as when
   a paper of the tree arrives. */
.ld-hops__stop.is-landed .ld-hops__dot { animation: ld-bloom 0.9s ease-out; }
.ld-hops__stop.is-landed::before {
  content: ""; position: absolute; left: -2px; top: -26px; width: 4px; height: 4px; border-radius: 50%; opacity: 0;
  background: #f5a45c; box-shadow: -11px -3px 0 -0.5px var(--ld-coral-solid), 12px -6px 0 -1px #f7c873;
  animation: ld-motes 1s 0.05s ease-out;
}
.ld-hops + .ld-fine { margin-top: 30px; }
@keyframes ld-bloom {
  from { background: #ffd2b8; box-shadow: 0 0 0 0 rgba(240,122,84,0.6), 0 0 14px rgba(255,186,140,0.5); }
  to { box-shadow: 0 0 0 26px rgba(240,122,84,0), 0 0 14px rgba(255,186,140,0.5); }
}

/* A paper appearing, in order: the stroke inks its way down to the card
   lying face down, the card turns over and is the paper (the two halves of
   the turn a tap gives a paper, js/landing_turn.js, with the same timing: the
   back turns edge-on, the paper turns in from edge-on), a coral ring leaves
   it and three motes drift up from where the stroke met it. Nothing here
   loops, and nothing above a new paper moves. */
.ld-tree__item.is-arrived .ld-tree__room::before { animation: ld-turn-away 0.15s 0.45s backwards ease-in; }
.ld-tree__item.is-arrived .ld-card { animation: ld-arrive 0.34s 0.6s backwards cubic-bezier(0.2, 0.8, 0.3, 1.18), ld-glow 1s 0.95s ease-out; }
/* Three motes leave the top of the paper, like the fireflies in the scene behind. */
.ld-tree__item.is-arrived .ld-card::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 4px; height: 4px; border-radius: 50%; opacity: 0;
  background: #f5a45c; box-shadow: -11px -3px 0 -0.5px var(--ld-coral-solid), 12px -6px 0 -1px #f7c873;
  animation: ld-motes 1s 0.95s ease-out;
}
@keyframes ld-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ld-fade { from { opacity: 0; } }
@keyframes ld-pop { from { opacity: 0; transform: scale(0.86); } }
@keyframes ld-ring { from { box-shadow: 0 0 0 0 rgba(74,72,120,0.4); } to { box-shadow: 0 0 0 9px rgba(74,72,120,0); } }
@keyframes ld-glow {
  from { box-shadow: 0 0 0 0 rgba(240,122,84,0.5), var(--ld-shadow-card); }
  to { box-shadow: 0 0 0 16px rgba(240,122,84,0), var(--ld-shadow-card); }
}
/* A card turning over into its paper: the back leaves edge-on, the paper comes in edge-on. */
@keyframes ld-turn-away { from { opacity: 1; } to { opacity: 1; transform: rotateY(90deg); } }
@keyframes ld-arrive { 0% { opacity: 0; transform: rotateY(-90deg); } 1% { opacity: 1; } }
@keyframes ld-motes {
  0% { opacity: 0; transform: translateY(4px) scale(0.5); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px) scale(1.3); }
}


/* ── Kanji and Grammar: the same small papers as beat three, two side by
   side for Kanji and one for Grammar. A Kanji answer side ends under a
   centred KANJI divider, its kanji one centred group of columns: each the
   character on a soft wash of the paper's ink (the two washes lean opposite
   ways), what it means, then its parts with the tag that says what each
   gives the kanji, as the lesson's kanji block in the app does.
   The tag stands above the paper's unseen button, so a pointer reaches it:
   its explanation rises in a small bubble over it on hover or keyboard
   focus, and while a tap holds it open (.is-open, js/landing_tree.js). ── */
.ld-kanji-sec { padding: 0 0 84px; }
.ld-kanji-sec .ld-grow { margin-top: 38px; }
.ld-sec--kanji .ld-label { display: flex; align-items: center; gap: 12px; margin: 0; padding-top: 2px; }
.ld-sec--kanji .ld-label::before, .ld-sec--kanji .ld-label::after { content: ""; flex: 1; height: 1px; background: var(--ld-card-hairline); }
.ld-kanji-cols { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; justify-content: center; column-gap: 20px; padding: 12px 0 4px; }
.ld-kanji { display: flex; flex-direction: column; align-items: center; }
.ld-kanji__char {
  --wash-at: 47% 55%;
  display: grid; place-items: center; width: 84px; height: 62px; font-size: 34px; font-weight: 500; line-height: 1; color: var(--ld-card-ink);
  background: radial-gradient(closest-side at var(--wash-at), rgba(74,72,120,0.10), rgba(74,72,120,0.045) 55%, rgba(74,72,120,0));
}
.ld-kanji:nth-child(even) .ld-kanji__char { --wash-at: 54% 50%; }
.ld-kanji__gloss { margin: 2px 0 0; font-size: 14.5px; font-weight: 600; line-height: 1.25; color: var(--ld-card-ink); }
/* A kanji's parts share one left edge, the block centred under it; each
   row is a line of the page's body text tall (1.6 x 16px). */
.ld-kanji__parts { display: grid; justify-items: start; row-gap: 2px; margin-top: 10px; }
.ld-kanji__part { display: flex; align-items: center; gap: 5px; min-height: 1.6rem; margin: 0; font-size: 13px; line-height: 1.35; color: var(--ld-card-ink-soft); white-space: nowrap; }
.ld-kanji__part [lang="ja"] { font-size: 14px; color: var(--ld-card-ink); }
/* A radical's line under its meaning (index.html kanji_col), kept narrow so
   the column stays the width of its neighbours. */
.ld-kanji__note { max-width: 9.5em; margin: 6px 0 0; font-size: 12px; line-height: 1.35; text-align: center; color: var(--ld-card-ink-soft); }
.ld-kanji__role {
  --tip: 0; --tip-shown: hidden;
  position: relative; z-index: 1; padding: 2px 5px; border-radius: 999px; font-size: 8.5px; font-weight: 700; line-height: 1;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ld-card-ink-soft); background: rgba(74,72,120,0.055); cursor: help;
}
/* A tag with its bubble up: held open by a tap, or focused from the keyboard
   (role="tooltip", tied to the tag by aria-describedby in index.html). */
.ld-kanji__role:is(.is-open, :focus-visible) { --tip: 1; --tip-shown: visible; z-index: 2; color: var(--ld-card-purple); background: rgba(74,72,120,0.1); }
/* Hover only where there is a real pointer: a touch screen keeps :hover on
   the tag it last tapped, which would hold a closed bubble open. */
@media (hover: hover) {
  .ld-kanji__role:hover { --tip: 1; --tip-shown: visible; z-index: 2; color: var(--ld-card-purple); background: rgba(74,72,120,0.1); }
}
.ld-kanji__role:focus-visible { outline: 2px solid var(--ld-coral); outline-offset: 2px; }
/* Escape hushes a focused or hovered bubble (js/landing_tree.js); a tag on a
   turned-away side never shows one: the bubble's own visibility would beat
   the hidden side's. */
.ld-kanji__role.is-hushed:not(.is-open), .ld-card > [data-face][hidden] .ld-kanji__role { --tip: 0; --tip-shown: hidden; }
/* The bubble and its small point down at the tag rise into place as they fade in.
   A bubble a tap holds open takes taps as the tag does, so a tap on it never
   reaches the paper's turn button under it; one raised by hover or focus lets
   the pointer through to the tag above it, which it covers. */
.ld-kanji__tip, .ld-kanji__role::before {
  --rise: calc((1 - var(--tip)) * 5px);
  position: absolute; left: 50%; opacity: var(--tip); visibility: var(--tip-shown); pointer-events: none;
  transition: opacity 0.18s ease, transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.4), visibility 0.18s;
}
.ld-kanji__role.is-open .ld-kanji__tip { pointer-events: auto; }
.ld-kanji__tip {
  bottom: calc(100% + 9px); width: max-content; max-width: 190px; padding: 8px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none; text-align: center; white-space: normal;
  color: var(--ld-card-ink-soft); background: #fff; border: 1px solid var(--ld-card-hairline); box-shadow: 0 6px 18px rgba(74,72,120,0.14);
  transform: translate(-50%, var(--rise)) scale(calc(0.94 + var(--tip) * 0.06)); transform-origin: 50% 100%;
}
.ld-kanji__role::before {
  content: ""; bottom: calc(100% + 4px); width: 9px; height: 9px; background: #fff; z-index: 1;
  border: solid var(--ld-card-hairline); border-width: 0 1px 1px 0; transform: translate(-50%, var(--rise)) rotate(45deg);
}

/* ── Section heads ── */
.ld-sec__head { margin-bottom: 46px; text-align: center; }
.ld-eyebrow {
  font-family: var(--ld-fjp); font-weight: 400; font-size: 13px; letter-spacing: 0.3em;
  color: var(--ld-scene); margin-bottom: 10px; text-shadow: var(--ld-txt-glow);
}
.ld-h2 {
  font-family: var(--ld-fui); font-weight: 300; font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  letter-spacing: 0.005em; color: var(--ld-cream); margin: 0; text-shadow: 0 2px 22px rgba(24,15,48,0.45);
}

/* ── Final CTA ── */
.ld-final { text-align: center; padding: clamp(96px, 16vh, 168px) 28px 104px; }
/* A thread of light falls from the last demo to the proverb, so the sign-up
   reads as the end of the story and not as one more step of it. */
.ld-final::before {
  content: ""; display: block; width: 1px; height: 72px; margin: 0 auto 34px;
  background: linear-gradient(to bottom, transparent, var(--ld-cream-thread));
}
.ld-final h2 {
  font-family: var(--ld-fui); font-weight: 300; font-size: clamp(1.9rem, 4vw, 2.9rem);
  letter-spacing: 0.005em; color: var(--ld-cream); margin: 0 0 36px; text-shadow: 0 2px 24px rgba(24,15,48,0.5);
}
.ld-final__jp {
  font-family: var(--ld-fjp); font-size: clamp(1.15rem, 2.2vw, 1.5rem); letter-spacing: 0.3em; color: var(--ld-scene);
  margin: 0 0 10px; text-shadow: var(--ld-txt-glow);
}
.ld-final__en { margin: 0 0 44px; font-size: 14px; color: var(--ld-cream-mute); text-shadow: var(--ld-txt-glow); }

/* ── Footer (airy; no panel/blur — just the dusk ground falling into shadow.
   The fixed sky is brightest at its very bottom edge, exactly where the footer
   sits, so a soft to-bottom scrim darkens precisely where legibility is worst
   while the brand row up top stays open.) ── */
.ld-foot {
  border-top: 1px solid var(--ld-hair); padding: 54px 42px 40px;
  background: linear-gradient(to bottom, transparent 0%, rgba(26,16,44,0.52) 100%);
}
.ld-foot__in { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 36px; }
.ld-foot__brand .ld-logo { color: var(--ld-cream-soft); text-shadow: var(--ld-txt-glow); }
.ld-foot__brand p { margin: 10px 0 0; font-weight: 300; font-size: 14px; color: var(--ld-cream-soft); text-shadow: var(--ld-txt-glow); }
.ld-foot__prov { font-family: var(--ld-fjp); font-size: 13px; letter-spacing: 0.22em; color: var(--ld-scene); margin-top: 14px !important; }
.ld-foot__cols { display: flex; gap: 60px; }
.ld-foot__cols h5 { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ld-cream-mute); margin: 0 0 14px; text-shadow: var(--ld-txt-glow); }
.ld-foot__cols a { display: block; font-size: 14px; color: var(--ld-cream-soft); margin-bottom: 8px; transition: color 0.2s; text-shadow: var(--ld-txt-glow); }
/* A second group in one column (blog, then games) keeps the phone rows even. */
.ld-foot__cols a + h5 { margin-top: 24px; }
.ld-foot__cols a:hover { color: var(--ld-cream-90); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: var(--ld-scene); }
.ld-foot__copy { max-width: 1000px; margin: 40px auto 0; font-size: 12px; color: var(--ld-cream-soft); letter-spacing: 0.04em; text-shadow: var(--ld-txt-glow); }
.ld-foot__copy + .ld-foot__copy { margin-top: 8px; }  /* disclaimer + (c) line read as one block */

/* ── Reveal (observed by index.html's viewport-rooted IntersectionObserver) ── */
.ld-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s var(--ld-ease); }
.ld-reveal.is-visible { opacity: 1; transform: none; }

/* ── Animations ── */
@keyframes ld-haloBreathe {
  0%,100% { opacity: 0.5; transform: translate(-50%,-50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%,-50%) scale(1.05); }
}

/* The canvas loops in atmosphere.js still run; this covers everything the
   landing itself animates. */
@media (prefers-reduced-motion: reduce) {
  html:has(.ld) { scroll-behavior: auto; }
  .ld-halo { animation: none; }
  .ld-reveal { opacity: 1; transform: none; transition: none; }
  /* Every state change in the two sections below still happens, at once. */
  .ld-how *, .ld-how *::before, .ld-kanji-sec *, .ld-kanji-sec *::before { animation: none !important; transition: none !important; }
}

/* ── Responsive ── */
@media (max-width: 1024px) { .ld-vt { display: none; } }
@media (max-width: 760px) {
  .ld-nav { padding: 18px 22px; }
  .ld-nav__r { gap: 18px; }
  .ld-nav__r a { white-space: nowrap; }
  .ld-nav__r a[href="#how"] { display: none; }
  .ld-beta { display: none; }
  .ld-hero { padding: 108px 24px 80px; }
  .ld-how { padding-top: 72px; }
  .ld-beat { padding-bottom: 84px; }
  .ld-kanji-sec { padding-bottom: 72px; }
  /* Three across on a phone too, so no line is left alone in a row; the type
     comes down so the longest line fits its slip. */
  .ld-lines { gap: 10px; max-width: 420px; }
  .ld-chip { padding: 18px 4px 14px; }
  .ld-chip__jp { font-size: 22px; }
  .ld-chip__say { font-size: 11.5px; }
  .ld-chip__en { font-size: 13px; line-height: 1.3; text-wrap: balance; }
  .ld-card { --word: 64px; --word-back: 48px; padding: 30px 22px 24px; }
  .ld-pen { font-size: 15.5px; }
  /* The diamond keeps its shape on a phone: it takes the page's full width
     down to a 16px gutter, and its papers and type get smaller. */
  .ld-stage--tree { width: calc(100% + 24px); max-width: none; margin: 0 -12px; }
  .ld-tree { column-gap: 10px; }
  .ld-tree__item--top { width: 190px; }
  .ld-grammar-sec .ld-tree__item--top, .ld-grammar-sec .ld-tree__item--join { width: 230px; }
  .ld-tree__item--join { width: 300px; }
  .ld-tree__item[data-from] .ld-tree__room { --drop: 74px; }
  .ld-card--small {
    --word: 32px; --word-back: 28px; --line: 14px; --say: 12.5px; --read: 13.5px; --meaning: 16px;
    --piece: 13.5px; --en: 12.5px; --gap: 12px;
    padding: 18px 8px 12px;
  }
  /* Review's line runs down: "today" at the top, the labels to the right
     of the line, every one on its stop's row, 何 on it, its hops bowing out
     to the left. Tall enough that 何 on "today" clears "later today". */
  .ld-recall__holder { width: 210px; }
  .ld-hops { --spine: 40%; max-width: 330px; margin-top: 40px; padding: 0; }
  .ld-hops__track { height: 400px; margin: 22px 0 34px; }
  .ld-hops__track::before {
    left: var(--spine); right: auto; top: -16px; bottom: -52px; width: 1.5px; height: auto; margin: 0 0 0 -0.75px;
    background: linear-gradient(180deg, transparent, var(--ld-cream-thread) 16px, var(--ld-cream-thread) calc(100% - 72px), transparent);
  }
  .ld-hops__stop { left: var(--spine); top: calc(var(--at) * 100%); }
  .ld-hops__when, .ld-hops__stop--low .ld-hops__when { left: 30px; top: 0; transform: translateY(-50%); }
  .ld-hops__stop--low::after { display: none; }
  .ld-hops__word { left: var(--spine); top: 100%; }
  .ld-kanji-sec .ld-grow { margin-top: 30px; }
  /* Kanji: one paper per row, with room between them for the tree's note. */
  .ld-kanji-sec .ld-tree { grid-template-columns: 1fr; row-gap: 74px; }
  .ld-grammar-sec .ld-tree { row-gap: 0; }
  .ld-kanji-sec .ld-card--small { padding: 20px 18px 18px; }
  .ld-foot { padding: 48px 24px 36px; }
  .ld-foot__in { flex-direction: column; gap: 30px; }
  /* Even rows: research (long links) on its own row, then shows + blog, legal + account. */
  .ld-foot__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .ld-foot__cols > :first-child { grid-column: 1 / -1; }
  .ld-cta-row { gap: 18px; }
}
/* ── Sign-up call to action ── */
.ld-signup { margin: 0 auto 26px; text-align: center; }
/* The page's one solid button, in coral. On
   hover it rises a little and settles with a small overshoot; a press sinks it. */
.ld-signup__btn {
  display: inline-block; text-decoration: none;
  font-family: var(--ld-fui); font-weight: 600; font-size: 16px; letter-spacing: 0.03em;
  background: var(--ld-coral-solid); color: #fff;
  padding: 15px 46px; border-radius: 999px;
  box-shadow: var(--ld-shadow-btn);
  transition: background 0.25s, box-shadow 0.25s,
              transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.ld-signup__btn:hover {
  background: var(--ld-coral-solid-deep); transform: translateY(-2px);
  box-shadow: 0 12px 26px -8px rgba(10,6,28,0.55);
}
.ld-signup__btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.1s; }
/* Cream, not the page's coral focus ring: coral on a coral button barely shows. */
.ld-signup__btn:focus-visible { outline: 2px solid rgba(245,226,217,0.75); outline-offset: 3px; }
.ld-signup__login {
  margin: 16px 4px 0; font-size: 13.5px; font-weight: 400;
  color: var(--ld-cream-soft); letter-spacing: 0.01em; text-shadow: var(--ld-txt-glow);
}
.ld-signup__login a {
  white-space: nowrap; color: var(--ld-cream-90); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--ld-scene-soft);
  transition: text-decoration-color 0.2s;
}
.ld-signup__login a:hover, .ld-signup__login a:focus-visible { text-decoration-color: var(--ld-scene); }
@media (prefers-reduced-motion: reduce) {
  .ld-signup__btn, .ld-signup__btn:hover, .ld-signup__btn:active { transform: none; }
}
.ld-final .ld-signup { margin-top: 6px; }
