/* ═══════════════════════════════════════════════════════════════════
   Lamma — the front door: the live hero and the scroll story.

   design/identity/HANDOFF.md › Upgrade › "First launch, the live hero" and
   Platforms › "Site, lamma.cc". The motion and colour are the board sources
   (design/identity/reference/HeroLive.dc.html, Reply.dc.html), built only
   from the three durations and the three easings, which tokens.generated.css
   zeroes under reduce-motion. Occasion colour comes from the generated
   .occ-* palettes, never from a literal here.
   ═══════════════════════════════════════════════════════════════════ */

/* ── The hero ────────────────────────────────────────────────────────── */
.hl {
  --mx: 72%;
  --my: 34%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(72px + var(--space-7)) max(var(--pad-screen), calc((100vw - var(--maxw)) / 2)) var(--space-10);
}
[dir="rtl"] .hl { --mx: 28%; }

/* The lantern: a soft light that follows the pointer (handoff question 14).
   The craft layer (design/craft/FrontDoor.dc.html) gives Day one too, a
   warm one behind the invitation; Evening's stays the thread's glow. */
.hl__lamp {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  --lamp: color-mix(in srgb, var(--tonal) 80%, transparent);
  background: radial-gradient(640px 480px at var(--mx) var(--my), var(--lamp), transparent 70%);
}
:root[data-theme="dark"] .hl__lamp { --lamp: color-mix(in srgb, var(--thread) 20%, transparent); }

.hl__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "intro stage" "form stage" "cta stage";
  grid-template-rows: auto auto 1fr;
  column-gap: var(--space-9);
  row-gap: var(--space-6);
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
}
.hl__intro { grid-area: intro; }
.hl__form { grid-area: form; display: grid; gap: var(--space-5); }
.hl__stage { grid-area: stage; }
.hl__cta { grid-area: cta; display: flex; align-items: center; gap: var(--space-3) var(--space-5); flex-wrap: wrap; }

.hl__title {
  font-size: clamp(2.75rem, 1.5rem + 4.6vw, 4.75rem);
  font-weight: 360;
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin-bottom: var(--space-5);
}
.hl__title em { font-style: italic; color: var(--brand); transition: color var(--dur-long) var(--ease-standard); }
/* Nothing is italicised outside Latin. */
:lang(ar) .hl__title em, :lang(fa) .hl__title em, :lang(ur) .hl__title em,
:lang(zh) .hl__title em, :lang(ja) .hl__title em, :lang(hi) .hl__title em { font-style: normal; }
:lang(ar) .hl__title, :lang(fa) .hl__title { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.4rem); line-height: 1.35; }
:lang(ur) .hl__title { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); line-height: 2; }
:lang(zh) .hl__title, :lang(ja) .hl__title { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem); line-height: 1.25; }
:lang(hi) .hl__title { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem); line-height: 1.3; }

.hl__lede {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 30em;
}
:lang(ar) .hl__lede, :lang(fa) .hl__lede, :lang(ur) .hl__lede,
:lang(zh) .hl__lede, :lang(ja) .hl__lede, :lang(hi) .hl__lede { font-family: inherit; font-size: 18px; }
:lang(ur) .hl__lede { line-height: 2.1; }

.hl__label { display: block; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--ink); margin-bottom: var(--space-2); }

/* The name is the display face, the way the card will write it. */
.hl__input {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--control);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  transition: background-color var(--dur-long) var(--ease-standard), box-shadow var(--dur-short) var(--ease-standard);
}
.hl__input::placeholder { color: var(--ink-soft); opacity: 1; font-style: italic; }
.hl__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.hl__input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
:lang(ar) .hl__input, :lang(fa) .hl__input { font-family: var(--font-display-ar); font-size: 24px; }
:lang(ur) .hl__input { font-family: var(--font-display-ur); font-size: 20px; min-height: 72px; }
:lang(ar) .hl__input::placeholder, :lang(fa) .hl__input::placeholder, :lang(ur) .hl__input::placeholder,
:lang(zh) .hl__input::placeholder, :lang(ja) .hl__input::placeholder, :lang(hi) .hl__input::placeholder { font-style: normal; }
:lang(zh) .hl__input { font-family: var(--font-cjk); }
:lang(ja) .hl__input { font-family: var(--font-cjk-ja); }
:lang(hi) .hl__input { font-family: var(--font-deva); }

/* Occasion chips: 40 tall in a 48 hit area, pill, a radiogroup. Each wears
   its occasion: the motif in the occasion accent at rest; chosen, the
   occasion paper, a 2 px accent ring and a check (never colour alone). */
.hl__chips { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); }
.hl-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-block: 4px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--control);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-standard),
              color var(--dur-short) var(--ease-standard),
              box-shadow var(--dur-short) var(--ease-standard),
              transform var(--dur-short) var(--ease-standard);
}
.hl-chip::after { content: ''; position: absolute; inset: -4px 0; }
.hl-chip:hover { background: color-mix(in srgb, var(--occ-accent) 7%, transparent); }
.hl-chip:active { transform: scale(0.98); }
.hl-chip svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--occ-accent); }
.hl-chip .hl-chip__check { display: none; width: 18px; height: 18px; margin-inline: 2px; }
.hl-chip[aria-checked="true"] {
  background: var(--occ-paper);
  color: var(--occ-ink);
  box-shadow: inset 0 0 0 2px var(--occ-accent);
  font-weight: 500;
}
.hl-chip[aria-checked="true"] .hl-chip__motif { display: none; }
.hl-chip[aria-checked="true"] .hl-chip__check { display: block; }

/* Day · Evening: a two-way choice, so it is chip-shaped. */
.hl-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--control);
}
.hl-seg button {
  min-height: 44px;
  min-width: 96px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-medium) var(--ease-standard), color var(--dur-medium) var(--ease-standard);
}
.hl-seg button[aria-checked="true"] { background: var(--tonal); color: var(--on-tonal); }
.hl-seg button:not([aria-checked="true"]):hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

.hl__cta .btn { min-height: 56px; padding: 0 26px; }
.hl__reassure { font-size: 14px; line-height: 20px; color: var(--ink-soft); max-width: 24em; }

/* ── The invitation, composing itself ────────────────────────────────── */
.hl__stage {
  align-self: center;
  display: grid;
  place-items: center;
  perspective: 1100px;
}
.hl__tilt {
  width: 100%;
  max-width: 440px;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--dur-short) var(--ease-standard);
  transform-style: preserve-3d;
}
/* The envelope: the occasion's deep paper with its liner, card standing in it. */
.hl-env {
  position: relative;
  overflow: hidden;
  min-height: 538px;
  padding: 52px 30px 0;
  border-radius: var(--radius-xl);
  background: var(--occ-paper-deep);
  color: var(--occ-accent);
  box-shadow: 0 30px 80px rgba(20, 30, 45, 0.20), 0 2px 6px rgba(20, 30, 45, 0.08);
  transition: background-color var(--dur-long) var(--ease-standard);
}
:root[data-theme="dark"] .hl-env { box-shadow: 0 0 0 1px var(--hairline), 0 30px 80px rgba(0, 0, 0, 0.45); }
.hl-env__liner { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.36; }
:root[data-theme="dark"] .hl-env__liner { opacity: 0.3; }
/* The gold thread stitched round the envelope's edge, over the liner and
   under the card (design/craft › Thread: light, never text). */
.hl-env::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1.2px dashed var(--thread);
  border-radius: calc(var(--radius-xl) - 10px);
  opacity: .9;
  pointer-events: none;
}

.hl-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 500px;
  margin-bottom: -14px;
  padding: 30px 28px 40px;
  border-radius: var(--radius-lg);
  background: var(--occ-paper);
  color: var(--occ-ink);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.10);
  text-align: start;
  transition: background-color var(--dur-long) var(--ease-standard), color var(--dur-long) var(--ease-standard);
}
.hl-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); width: 100%; }
.hl-card__invited {
  padding-top: 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--occ-accent);
}
:lang(ar) .hl-card__invited, :lang(fa) .hl-card__invited, :lang(ur) .hl-card__invited,
:lang(zh) .hl-card__invited, :lang(ja) .hl-card__invited, :lang(hi) .hl-card__invited {
  font-size: 14px; letter-spacing: 0; text-transform: none;
}
/* The motif, top-end, in a round seal; never under text. Embossed into the
   card (design/craft/Invitation.dc.html): the paper raised, lit from the
   top left, a fine edge of shade and one of light. */
.hl-card__seal {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--occ-paper-deep) 50%, var(--occ-paper)), color-mix(in srgb, var(--occ-paper-deep) 92%, var(--occ-ink)));
  box-shadow: 1px 1px 0 color-mix(in srgb, var(--occ-paper) 45%, white), inset 0 0 0 1px color-mix(in srgb, var(--occ-ink) 16%, transparent);
  color: var(--occ-accent);
}
.hl-card__seal svg { width: 80px; height: 80px; }
.hl-card__title {
  width: 100%;
  min-height: 2.16em;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hl-card__title.is-long { font-size: 32px; }
:lang(ar) .hl-card__title, :lang(fa) .hl-card__title { font-family: var(--font-display-ar); font-weight: 700; font-size: 44px; line-height: 1.35; letter-spacing: 0; }
:lang(ar) .hl-card__title.is-long, :lang(fa) .hl-card__title.is-long { font-size: 36px; }
:lang(ur) .hl-card__title { font-family: var(--font-display-ur); font-weight: 400; font-size: 34px; line-height: 1.9; letter-spacing: 0; }
:lang(zh) .hl-card__title { font-family: var(--font-cjk); font-weight: 600; letter-spacing: 0; font-size: 36px; line-height: 1.3; }
:lang(ja) .hl-card__title { font-family: var(--font-cjk-ja); font-weight: 600; letter-spacing: 0; font-size: 36px; line-height: 1.3; }
:lang(hi) .hl-card__title { font-family: var(--font-deva); font-weight: 600; letter-spacing: 0; font-size: 36px; line-height: 1.35; }
.hl-card__rule { width: 48px; height: 2px; border-radius: 1px; background: var(--thread); }
.hl-card__meta { font-size: 15px; line-height: 1.5; color: var(--occ-ink-muted); }

/* "I'll be there": the reply pill, and inside it the circle closing
   (Reply.dc.html, smaller; tokens.json › replyYes). */
.hl-yes {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin-top: var(--space-2);
  padding: 0 24px 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--occ-accent);
  color: var(--occ-on-accent);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-short) var(--ease-standard), background-color var(--dur-long) var(--ease-standard);
}
.hl-yes:focus-visible { outline: 2px solid var(--occ-ink); outline-offset: 3px; }
.hl-yes svg { width: 26px; height: 26px; flex-shrink: 0; overflow: visible; }
.hl-yes .ring { fill: none; stroke: currentColor; stroke-width: 15; stroke-linecap: round; stroke-dasharray: 81.67 18.33; stroke-dashoffset: -9.17; }
.hl-yes .dot { fill: var(--thread); transform-box: fill-box; transform-origin: center; }
.hl-yes .disc { fill: var(--thread); opacity: 0; transform-box: fill-box; transform-origin: center; }
.hl-yes .chk { fill: none; stroke: var(--check-ink); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hl-yes .breath { fill: none; stroke: var(--thread); stroke-width: 8; opacity: 0; transform-box: fill-box; transform-origin: center; }
.hl-yes__lbl { display: inline-grid; }
.hl-yes__lbl > span { grid-area: 1 / 1; }
.hl-yes__lbl .l1 { opacity: 0; }
.hl-card__after {
  min-height: 1.4em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--occ-ink-muted);
  opacity: 0;
}
:lang(ar) .hl-card__after, :lang(fa) .hl-card__after, :lang(ur) .hl-card__after,
:lang(zh) .hl-card__after, :lang(ja) .hl-card__after, :lang(hi) .hl-card__after { font-family: inherit; font-style: normal; }

.hl-yes[aria-pressed="true"] { animation: hl-press var(--dur-short) var(--ease-standard) both; }
.hl-yes[aria-pressed="true"] .ring { animation: hl-close var(--dur-long) var(--ease-standard) 160ms both; }
.hl-yes[aria-pressed="true"] .dot { animation: hl-arrive var(--dur-long) var(--ease-standard) 160ms both; }
.hl-yes[aria-pressed="true"] .disc { animation: hl-fill var(--dur-long) var(--ease-enter) 480ms both; }
.hl-yes[aria-pressed="true"] .chk { animation: hl-draw var(--dur-medium) var(--ease-standard) 640ms both; }
.hl-yes[aria-pressed="true"] .breath { animation: hl-breath var(--dur-long) var(--ease-enter) 800ms both; }
.hl-yes[aria-pressed="true"] .l0 { animation: hl-out var(--dur-short) var(--ease-exit) 480ms both; }
.hl-yes[aria-pressed="true"] .l1 { animation: hl-in var(--dur-medium) var(--ease-enter) 640ms both; }
.hl-yes[aria-pressed="true"] ~ .hl-card__after { animation: hl-in var(--dur-medium) var(--ease-enter) 880ms both; }

@keyframes hl-press { 0% { transform: scale(1); } 40% { transform: scale(0.97); } 100% { transform: scale(1); } }
@keyframes hl-close { to { stroke-dasharray: 100 0; stroke-dashoffset: 0; stroke: var(--thread); } }
@keyframes hl-arrive { 0% { transform: scale(1); opacity: 1; } 55% { opacity: 1; } 100% { transform: scale(0.4); opacity: 0; } }
@keyframes hl-fill { from { transform: scale(0.25); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes hl-draw { to { stroke-dashoffset: 0; } }
@keyframes hl-breath { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.32); opacity: 0; } }
@keyframes hl-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes hl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Arrival: the words, then the rest, then the card ───────────────────
   The headline's words stagger 80 ms (tokens.json › heroLive). hero-live.js
   splits them once the language is known; until it does, the headline waits
   behind a fallback so it never flashes, and it lands on its own if the
   script never runs. */
@keyframes hl-word { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes hl-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hl-swap { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes hl-show { to { opacity: 1; } }
.hl__title { opacity: 0; animation: hl-show 1ms linear 1200ms both; }
.hl__title.is-split { opacity: 1; animation: none; }
.hl__title .w { display: inline-block; animation: hl-word var(--dur-long) var(--ease-enter) both; }
.hl__title.is-settled .w { animation: none; }
.hl__lede { animation: hl-rise var(--dur-long) var(--ease-enter) 560ms both; }
.hl__form { animation: hl-rise var(--dur-long) var(--ease-enter) 640ms both; }
.hl__cta { animation: hl-rise var(--dur-long) var(--ease-enter) 720ms both; }
.hl__stage { animation: hl-rise var(--dur-long) var(--ease-enter) 400ms both; }
/* The card composes: on arrival, and again whenever the occasion changes. */
.hl-env.is-composing { animation: hl-swap var(--dur-medium) var(--ease-enter) both; }
.hl-env.is-composing .c1, .hl-env.is-composing .c2,
.hl-env.is-composing .c3, .hl-env.is-composing .c4 { animation: hl-rise var(--dur-medium) var(--ease-enter) both; }
.hl-env.is-composing .c1 { animation-delay: 80ms; }
.hl-env.is-composing .c2 { animation-delay: 120ms; }
.hl-env.is-composing .c3 { animation-delay: 160ms; }
.hl-env.is-composing .c4 { animation-delay: 200ms; }
/* On arrival the card waits for its stage (400 ms) before it composes. */
.hl-env.is-arriving { animation-delay: 400ms; }
.hl-env.is-arriving .c1 { animation-delay: 480ms; }
.hl-env.is-arriving .c2 { animation-delay: 520ms; }
.hl-env.is-arriving .c3 { animation-delay: 560ms; }
.hl-env.is-arriving .c4 { animation-delay: 600ms; }

/* Phones and narrow tablets: one column, and the card comes straight after
   the choices it answers, before the way in. */
@media (max-width: 899px) {
  .hl { padding-top: calc(72px + var(--space-5)); padding-bottom: var(--space-9); }
  .hl__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "form" "stage" "cta"; grid-template-rows: none; row-gap: var(--space-6); }
  .hl__tilt { max-width: 400px; }
  .hl-env { min-height: 0; padding: 36px 18px 0; }
  .hl-card { min-height: 420px; padding: 24px 22px 36px; }
  .hl-card__seal { width: 84px; height: 84px; }
  .hl-card__seal svg { width: 64px; height: 64px; }
  .hl-card__title { font-size: 34px; }
  .hl-card__title.is-long { font-size: 28px; }
  :lang(ar) .hl-card__title, :lang(fa) .hl-card__title { font-size: 38px; }
  :lang(ar) .hl-card__title.is-long, :lang(fa) .hl-card__title.is-long { font-size: 30px; }
  .hl__cta .btn { width: 100%; }
}
@media (max-width: 359px) {
  .hl-seg button { min-width: 0; padding: 0 14px; }
  .hl-card { padding-inline: 18px; }
}

/* ── The scroll story: Open → Drawing closer → Whole → Bloom ────────────
   Without script, or on a phone, or under reduce-motion, each chapter
   carries its own still drawing. On a wide screen with script the drawing
   stays in place and changes state as the text passes it, crossfading over
   durLong. */
.story {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad-section) var(--pad-screen);
}
.story .section-head { margin-bottom: var(--space-9); }
.story__body { display: grid; grid-template-columns: minmax(0, 1fr); }
.story__visual { display: none; }
.story__chapters { list-style: none; display: grid; gap: var(--space-6); }
/* Still, each chapter is a card of its own: card stock at rest, how it holds
   together (design/craft/FrontDoor.dc.html). Live, the words pass the circle
   bare. */
.story__chapter { display: grid; justify-items: center; gap: var(--space-3); width: 100%; max-width: 34rem; margin-inline: auto; padding: var(--space-6) var(--space-5); border-radius: 24px; background: var(--card); box-shadow: var(--e1); text-align: center; }
.story__mini { display: block; width: min(240px, 66vw); height: auto; margin-bottom: var(--space-4); }
.story__chapter h3 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.6rem); text-wrap: balance; }
.story__chapter p { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 30em; text-wrap: pretty; }
.story__chapter .btn { margin-top: var(--space-4); }
[dir="rtl"] .st-svg--closer { transform: scaleX(-1); }

@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .story--live .story__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-10); }
  .story--live .story__visual {
    display: block;
    position: sticky;
    top: calc(50vh - min(220px, 21vw));
    align-self: start;
    width: min(440px, 42vw);
    aspect-ratio: 1;
    justify-self: center;
  }
  .story--live .story__visual .st-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--dur-long) var(--ease-standard);
  }
  .story--live .story__visual[data-state="open"] .st-svg--open,
  .story--live .story__visual[data-state="closer"] .st-svg--closer,
  .story--live .story__visual[data-state="whole"] .st-svg--whole,
  .story--live .story__visual[data-state="bloom"] .st-svg--bloom { opacity: 1; }
  .story--live .story__mini { display: none; }
  .story--live .story__chapters { gap: 0; }
  .story--live .story__chapter { min-height: 66vh; align-content: center; justify-items: start; text-align: start; margin: 0; padding: 0; background: none; box-shadow: none; }
}

/* Reduce motion: every arrival lands at once, the card stops tilting, the
   headline is simply there. (base.css zeroes durations and delays too.) */
@media (prefers-reduced-motion: reduce) {
  .hl__title { opacity: 1; animation: none; }
  .hl__title .w { animation: none; }
  .hl__tilt { transform: none; transition: none; }
}
