/* home.css — the home page: the mountain story (home.jsx, js/summit.js) and
   the sections below it. Uses the tokens from styles.css. */

/* ---------- the story: the mountain is the hero; small cards dock at its bottom edge ---------- */
/* starts under the sticky nav (70px + its 1px border), so the stage and the hero card line up from the first frame */
.summit { position: relative; background: var(--bg); }
.summit__stage { position: sticky; top: 0; z-index: 0; height: 100vh; height: 100svh; overflow: hidden; background: linear-gradient(180deg, #2a1338 0%, #1a0b24 65%, #13041e 100%); }
.summit__scene { position: absolute; inset: 0; }
.summit__gl, .summit__still { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.summit__gl { opacity: 0; transition: opacity 1s var(--ease); }
.summit.is-live .summit__gl { opacity: 1; }
.summit__still { opacity: 0; transition: opacity .8s var(--ease); }
.summit.is-stills .summit__still { opacity: 1; }
.summit__tags { position: absolute; inset: 0; pointer-events: none; }

/* labels pinned to the scene: a tag above its point, joined by a short stem */
.stag {
  position: absolute; left: 0; top: 0; opacity: 0; transform: translate(-9999px, 0);
  translate: -50% calc(-100% - 16px);
  white-space: nowrap; font: 600 0.78rem/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: #ffffff; padding: 8px 12px; border-radius: 999px;
  background: rgba(24,8,34,0.86); border: 1px solid rgba(230,180,107,0.55);
  transition: opacity .35s var(--ease);
}
/* the stem runs from the tag to its point, leaning when the tag has been slid clear of a card or an edge */
.stag i { position: absolute; left: 50%; top: 100%; width: 1px; height: 16px; height: hypot(var(--lean, 0px), 16px); background: var(--gold-bright);
  transform-origin: 50% 0; transform: rotate(calc(-1 * atan2(var(--lean, 0px), 16px))); }
.stag i::after { content: ""; position: absolute; left: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); }
.summit.is-stills .stag { display: none; }

/* story controls */
/* the controls ride along the bottom of the screen for the whole story */
.summit__hud {
  position: sticky; z-index: 4; bottom: 0; margin-top: -88px; height: 88px;
  max-width: 1240px; margin-left: auto; margin-right: auto; padding: 0 var(--gutter); box-sizing: border-box;
  display: flex; align-items: center; gap: 22px;
}
.hud__btn {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; box-sizing: border-box;
  font: 600 0.74rem var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  color: #ffffff; background: rgba(24,8,34,0.72); border: 1px solid rgba(255,255,255,0.24); border-radius: 999px; cursor: pointer;
}
.hud__btn:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.hud__btn:focus-visible, .hud__rail a:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.hud__rail { flex: 1 1 auto; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hud__rail a { display: flex; flex-direction: column; gap: 9px; padding: 8px 0; text-decoration: none; color: #c4b6cc; font: 600 0.68rem var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; }
.hud__rail a:hover { color: #ffffff; }
.hud__rail i { display: block; height: 2px; background: rgba(255,255,255,0.18); overflow: hidden; }
.hud__rail b { display: block; height: 100%; background: var(--gold-bright); transform: scaleX(0); transform-origin: 0 50%; }
.hud__pct { flex: none; min-width: 4ch; font: 600 0.74rem var(--font-sans); letter-spacing: 0.1em; color: #c4b6cc; font-variant-numeric: tabular-nums; }

/* chapters */
.summit__chapters { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.summit__ch {
  min-height: 100vh; min-height: 100svh; box-sizing: border-box; display: flex; align-items: flex-end;
  max-width: 1240px; margin: 0 auto; padding: 110px var(--gutter) 108px;
}
.summit__ch > * { pointer-events: auto; }

/* the cards: near-opaque, small enough that the scene stays the subject.
   No backdrop blur: blurring a live WebGL canvas recomposites every frame. */
.spanel {
  width: min(440px, 100%); box-sizing: border-box; padding: 26px; border-radius: 18px;
  background: rgba(24,8,34,0.9); border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 14px;
}
/* the story rail below says the same on wide screens */

.skicker { margin: 0; font: 600 0.74rem var(--font-sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-bright); }
.skicker span { color: #c4b6cc; }
.stitle { margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: clamp(1.5rem, 2vw, 1.9rem); line-height: 1.06; letter-spacing: -0.02em; }
.stitle__n { color: var(--gold-bright); }
.sbody { margin: 0; font-size: 0.98rem; line-height: 1.55; color: #e0d6e4; }
/* open detail scrolls inside the card, so the card never grows over the scene; the offer list replaces the chips */

/* ---------- below the story ---------- */
.hsec { padding: var(--section-y) 0; background: var(--bg); }
.hsec--alt { background: #180822; border-top: 1px solid rgba(255,255,255,0.06); }
.hsec .container { display: flex; flex-direction: column; gap: var(--space-block); }
.hsec .shead, .hsplit .shead { margin-bottom: 0; }
.hgrid { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 18px; }
.hgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hcard { padding: 26px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.1); background: #1f0d2c; display: flex; flex-direction: column; gap: 10px; }
.hcard--gold { border-color: rgba(230,180,107,0.35); }
.hcard__n { font: 600 0.74rem var(--font-sans); letter-spacing: 0.12em; color: var(--gold-bright); }
.hcard h3 { margin: 0; font-family: var(--font-serif); font-size: 1.3rem; }
.hcard p { margin: 0; font-size: 0.97rem; line-height: 1.55; color: #d2c6d9; }
.hnot { margin: 6px 0 0; color: #d2c6d9; }
.hnot strong { color: #ffffff; }
.hcta { padding: var(--section-y) 0; background: var(--bg); border-top: 1px solid rgba(255,255,255,0.06); text-align: center; }
.hcta__in { display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 760px; }
.hcta__h2 { margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.02em; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  /* the longest headline line is ~8.9em in Space Grotesk; inside the card (gutter + padding = 72px) this keeps
     three lines in any font, so the swap never reflows */
  /* a tight card, so the mountain keeps the top half of the screen */
  /* phones: each stop gets a stretch of scene before its panel scrolls in from below */
  .summit__ch { align-items: flex-end; padding: 96px 16px 104px; min-height: 160vh; min-height: 160svh; }
  .spanel { width: 100%; border-radius: 16px; }
  .spanel { padding: 22px; }
  .summit__hud { gap: 10px; padding: 0 16px; margin-top: -72px; height: 72px; }
  .hud__rail span, .hud__pct { display: none; }
  .hud__btn { padding: 0 14px; font-size: 0.68rem; }
  .hgrid--4, .hgrid--3, .hsplit { grid-template-columns: 1fr; }
  .hsplit { gap: 22px; }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .hgrid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .summit__gl, .summit__still, .stag { transition: none; }
}

/* ---- mark hero ---- */
.mhero { position: relative; min-height: 100svh; display: grid; align-items: center; padding-block: 120px 80px; overflow: hidden;
  background: radial-gradient(55% 60% at 75% 45%, rgba(174,124,190,0.22), transparent 70%), radial-gradient(40% 40% at 15% 85%, rgba(244,228,0,0.06), transparent 70%), var(--bg); }
.mhero__glow { position: absolute; inset: 0; pointer-events: none; }
.mhero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.mhero__copy, .mhero__visual { min-width: 0; }
.mhero__h1 { font-family: var(--font-serif); font-size: clamp(2.3rem, 4.2vw, 3.6rem); line-height: 1.02; letter-spacing: -0.035em; margin-top: 18px; }
.mhero__em { color: var(--accent); }
.mhero__sub { color: var(--ink-2); font-size: var(--fs-lead); line-height: 1.6; max-width: 54ch; margin-top: 24px; }
.mhero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 36px; }
.mhero__how { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); border-bottom: 1px solid var(--line-2); padding-bottom: 4px; }
.mhero__how:hover { color: var(--accent); border-color: var(--accent); }
.mhero__visual .mark { max-width: 560px; margin-inline: auto; }
.mhero__visual { position: relative; }
.mhero__visual .mark--live { cursor: pointer; }
/* keyboard-only: out of sight until focused, then a small pill under the mark */
.mhero__pause { position: absolute; left: 50%; bottom: 0; translate: -50% 0; font: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--surface-solid); border: 1px solid var(--glass-line); border-radius: 999px; padding: 8px 16px; cursor: pointer; white-space: nowrap; }
.mhero__pause:not(:focus-visible) { clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; border: 0; }
.mhero__pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mhero__scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font-size: var(--fs-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 860px) {
  .mhero { min-height: auto; padding-block: 104px 56px; }
  .mhero__in { grid-template-columns: 1fr; }
  .mhero__visual { max-width: 300px; width: 100%; margin-inline: auto; }
  .mhero__scroll { display: none; }
}

/* ---- pillars + why ---- */
.why { list-style: none; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: 0; }
.why__i { border-top: 1px solid var(--gold-line); padding-top: 18px; }
.why__n { color: var(--accent); font-weight: 700; font-family: var(--font-serif); }
.why__i h3 { font-family: var(--font-serif); font-size: var(--fs-h4); margin-top: 10px; }
.why__i p { color: var(--ink-2); margin-top: 8px; line-height: 1.6; }

/* the HUD rides 88px above its normal box (negative margin + sticky); clip it to the climb so it never shows over the hero */
.summit { overflow: clip; }

.mhero:not(.mark-ready) .mhero__pause { display: none; }
.hcta .hlead { max-width: 56ch; margin-inline: auto; }
.hcta .fx-zoom__rest { display: grid; justify-items: center; gap: 22px; margin-top: 28px; }
