/* The landing page: the hero and the pinned scenes the scroll drives.
   Colours are the --lp-* tokens in glade.css (light, and Charcoal by night);
   components live in their own files beside this one. */

/* --lp-screen: one screen, the smallest a phone's toolbars leave (svh)
   where the browser knows it. */
.lp { --lp-pin-gap: 72px; --lp-screen: 100vh; }
@supports (height: 100svh) { .lp { --lp-screen: 100svh; } }

/* Type, chips, the launch ground: glade.css (shared by every page). */
.lp-launch.lp-hero-track { --lp-fade-top: 0px; }

/* ── The hero: the words, then the app's window rising into view. ───────── */
.lp-hero-stage { position: relative; padding: 150px 0 72px; }
.lp-hero-copy { text-align: center; }
.lp-hero-copy .lp-lede { margin: 24px auto 0; max-width: 36em; }
.lp-hero-copy .fineprint { margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.lp-hero-win {
  width: min(calc(100% - 64px), 1560px, calc((100vh - 190px) * 1.6)); margin: 60px auto 0;
  transform-origin: 50% 0;
}
.lp-below { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.lp-below .pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ── Scenes the scroll drives ─────────────────────────────────────────────
   On a big enough screen a scene pins (sticky) and its track gives the
   scroll room; assets/landing/scroll.js turns that room into one progress
   number. Elsewhere the scene simply sits in the page and plays by itself. */
.lp-scene { position: relative; }
.lp-pin { position: relative; }
.lp-scene .lp-pin { padding: 110px 0; }

/* Pinned on a desk, and on a phone or tablet held upright: the same two
   cases as scroll.js's `pinning` (and the stacked one in scenes.css). */
@media (min-width: 960px) and (min-height: 680px) and (prefers-reduced-motion: no-preference),
       (max-width: 959px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  .lp-scene { height: calc(var(--lp-screen) + var(--lp-scroll, 150vh)); }
  .lp-scene .lp-pin { position: sticky; top: 0; height: var(--lp-screen); display: flex; overflow: hidden; }
  .lp-scene .lp-pin > .lp-wrap { width: 100%; }
}
/* The hero pins only at a desk, with a mouse (hero.js asks this stage): in
   the hand it's a plain page, scrolling under the finger. */
@media (min-width: 960px) and (min-height: 680px) and (prefers-reduced-motion: no-preference) and (hover: hover),
       (min-width: 960px) and (min-height: 680px) and (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .lp-hero-track { height: calc(var(--lp-screen) * 1.7); }
  .lp-hero-track .lp-hero-stage {
    position: sticky; top: 0; height: var(--lp-screen); padding: 0; overflow: hidden;
    perspective: 1800px;
  }
  .lp-hero-track .lp-hero-copy { position: absolute; left: 0; right: 0; top: 0; padding-top: 128px; will-change: transform, opacity; }
  .lp-hero-track .lp-hero-win { position: absolute; left: 0; right: 0; top: var(--lp-win-top, 120px); margin-top: 0; }
  /* hero.js fades the pills in with the scroll: their own layer. */
  .lp-hero-track .lp-below { will-change: opacity; }
}
/* Side by side, on a desk. */
@media (min-width: 960px) and (min-height: 680px) and (prefers-reduced-motion: no-preference) {
  .lp-scene .lp-pin { padding: var(--lp-pin-gap) 0 0; align-items: center; }
  /* Pinned, a scene's words have one screen: a smaller heading, and only the
     lit step tells its line. */
  .lp-scene .lp-h2 { font-size: clamp(32px, min(3.2vw, 5.2vh), 66px); }
  .lp-scene .lp-lede { margin-top: 16px; font-size: clamp(17px, min(1.1vw, 1.75vh), 22px); }
  .lp-scene .lp-step b { font-size: clamp(17px, min(1.05vw, 1.7vh), 21px); }
  .lp-scene .lp-step span { font-size: clamp(15px, min(.95vw, 1.5vh), 18px); }
  .lp-scene .lp-split { gap: clamp(48px, 4vw, 96px); }
  .lp-scene .lp-steps { margin-top: 22px; }
  .lp-steps.is-live .lp-step { padding: 12px 18px; }
  .lp-steps.is-live .lp-step > span > span { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
  .lp-steps.is-live .lp-step.is-on > span > span { max-height: 5em; opacity: 1; }
}

/* The split every scene uses: words on one side, the stage on the other. */
.lp-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: center; }
.lp-split.is-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* Numbered steps beside a stage; the lit one carries the scene's progress. */
.lp-steps { display: grid; gap: 4px; margin-top: 28px; }
.lp-step {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px;
  width: 100%; padding: 15px 18px; border: 0; border-radius: 16px; overflow: hidden;
  background: transparent; color: var(--body); text-align: left; cursor: pointer; font: inherit;
  transition: background .25s, box-shadow .25s;
}
.lp-step:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.lp-step.is-on { background: var(--lp-card-2); box-shadow: inset 0 0 0 1px var(--lp-hair); }
.lp-step i {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 99px; font-style: normal;
  background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 13px; font-weight: 600;
  transition: background .25s, color .25s;
}
.lp-step.is-on i { background: var(--sage); color: var(--ink-dark); }
.lp-step b { display: block; font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.lp-step span { display: block; margin-top: 3px; font-size: 15px; line-height: 1.5; }
.lp-step > span { margin-top: 0; }
.lp-step .bar {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; margin: 0;
  background: var(--sage); transform: scaleX(var(--t, 0)); transform-origin: 0 50%;
}
.lp-step:not(.is-on) .bar { visibility: hidden; }

/* A stage, the framed area a scene plays in. */
.lp-stage {
  position: relative; border-radius: 24px; overflow: hidden; container-type: inline-size;
  background: var(--lp-ground-2); box-shadow: var(--lp-win-lift);
}
.lp-stage-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: var(--lp-dotgrid); background-size: 20px 20px;
}

@media (max-width: 959px) {
  .lp-split, .lp-split.is-flip { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .lp-split .lp-text { order: -1; }
}
@media (max-width: 640px) {
  .lp-scene .lp-pin { padding: 84px 0; }
  /* A phone's first screen: the words, short, and the canvas under them. */
  .lp-hero-stage { padding-top: 108px; }
  .lp-hero-copy .lp-actions { margin-top: 26px; }
  .lp-hero-copy .fineprint { margin-top: 12px; font-size: 13px; }
  .lp-hero-win { width: calc(100% - 32px); margin-top: 30px; }
  /* The groves as one row that slides, edge to edge. */
  .lp-below { margin-top: 16px; }
  .lp-below .pills {
    flex-wrap: nowrap; width: calc(100% + 32px); margin: 0 -16px; padding: 2px 16px; overflow-x: auto;
    scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
  .lp-below .pills::-webkit-scrollbar { display: none; }
  .lp-below .pills > * { flex: none; }
}
/* The overview needs a window to open in; a phone's is a picture. */
.lp-win.is-static + .lp-below #lpAllGroves { display: none; }

/* Stacked, on a phone or tablet held upright: the words, then the stage
   taking the rest of the screen (scenes.css fits each stage's parts).
   After the narrow rules above, whose padding it replaces. */
@media (max-width: 959px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  .lp-scene .lp-pin { padding: 84px 0 24px; }
  .lp-scene .lp-pin > .lp-wrap { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
  .lp-scene .lp-pin > .lp-wrap > .lp-stage { flex: 1; min-height: 0; width: 100%; aspect-ratio: auto; margin: 0; }
}


/* Notes and spacing the landing's sections share. */
.lp-stepsnote { margin: 18px 0 0 18px; }
.lp-split.is-top { align-items: start; }
.lp-section.is-near { padding-top: 60px; }

/* A row of choices, one picked (role="radio" buttons; dom.js G.radios). */
.lp-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 26px; background: var(--chip-bg); box-shadow: inset 0 0 0 1px var(--lp-hair); }
.lp-seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--body); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.lp-seg button:hover { color: var(--ink); }
.lp-seg button[aria-checked="true"] { background: var(--button); color: var(--button-ink); }
.lp-seg small { padding: 3px 7px; border-radius: 99px; background: color-mix(in srgb, var(--sage) 22%, transparent); color: var(--sage-text); font-size: 12px; font-weight: 700; }
.lp-seg button[aria-checked="true"] small { background: color-mix(in srgb, var(--button-ink) 16%, transparent); color: inherit; }

/* Words that differ on a phone or tablet (dom.js G.touch asks the same):
   ⌘⇧M at a desk, the share sheet in the hand. */
@media (min-width: 761px) and (hover: hover), (min-width: 761px) and (pointer: fine) { .lp-touch { display: none !important; } }
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .lp-desk { display: none !important; }
  /* The hero's light comes in under the browser's top bar, which Safari
     paints the page's own ground, so the two meet without a line. */
  .lp-launch.lp-hero-track { --lp-fade-top: 180px; }
}
/* Inside a step, the two wordings are the step's own title and line. */
.lp-steps .lp-step b > span { display: inline; margin: 0; font-size: inherit; line-height: inherit; }
.lp-steps .lp-step > span > span > span { margin-top: 0; font-size: inherit; }

/* On a phone, or pinned stacked, a scene keeps to one screen: its heading,
   short steps, the stage. The longer words are for the desk; here they're
   only read out (the stages themselves are aria-hidden). */
@media (max-width: 760px), (max-width: 959px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  .lp-hero-copy .lp-lede, .lp-scene .lp-lede, .lp-scene .lp-points, .lp-scene .lp-stepsnote, .lp-arrange-bar .lp-small, .lp-steps .lp-step > span > span {
    position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .lp-scene .lp-h2 { font-size: clamp(30px, 4.6vw, 40px); }
  .lp-scene .lp-split { gap: 16px; }
  .lp-scene .lp-eyebrow { margin-bottom: 10px; }
  .lp-steps { grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
  .lp-step { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; }
  .lp-step i { width: 24px; height: 24px; font-size: 11.5px; }
  .lp-step b { font-size: 13.5px; line-height: 1.25; }
}
