/*
 * Scenes A — the two structural surfaces: the dark hero and the light
 * product stage (segmented control + the draggable decision deck).
 */

.scene { position: relative; scroll-margin-top: calc(var(--topbar-h) + 14px); }

.scene-night {
  background: radial-gradient(120% 90% at 50% -20%, #141a26 0%, var(--night-2) 40%, var(--night) 100%);
  color: var(--on-night);
  isolation: isolate;
  overflow: hidden;
}

.scene-light {
  background:
    radial-gradient(circle at 52% -20%, rgba(255, 255, 255, 0.98), transparent 46%),
    var(--app);
}

.h-dark { color: var(--on-night); }
.accent-soft { color: #6ea3ff; }

/* ─────────── HERO ─────────── */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--topbar-h) + 3vh) 0 14vh;
  text-align: center;
}

.hero-inner { position: relative; z-index: 5; }

.hero h1 { margin: 16px 0 0; }
.hero h1 .line { display: block; }

.hero-lede {
  max-width: 39ch;
  margin: 20px auto 0;
  transition-delay: 320ms;
}

.hero-lede strong { color: var(--on-night); font-weight: 640; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 4vw, 54px);
  margin-top: 34px;
  padding: 18px 26px;
  width: fit-content;
  margin-inline: auto;
  border: 1px solid var(--night-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition-delay: 420ms;
}

.stat b {
  display: block;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 620;
  letter-spacing: 0.02em;
  color: var(--on-night-3);
}

.stat-accent b { color: #6ea3ff; }

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
  flex-wrap: wrap;
  transition-delay: 500ms;
}

.hero-foot {
  margin-top: 16px;
  font-size: 0.72rem;
  color: var(--on-night-3);
  transition-delay: 580ms;
}

/* Ambience: stars, orb bloom, message stream. All decorative, all reduced-motion aware. */
.stars {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 78% 16%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 62% 68%, rgba(255, 255, 255, 0.34), transparent),
    radial-gradient(1.1px 1.1px at 28% 74%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.3px 1.3px at 88% 52%, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1px 1px at 42% 36%, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.85;
}

.orb {
  position: absolute;
  z-index: 1;
  top: 4%;
  left: 50%;
  width: min(1100px, 130vw);
  aspect-ratio: 1;
  translate: -50% 0;
  background: radial-gradient(circle, rgba(18, 101, 242, 0.34) 0%, rgba(18, 101, 242, 0.1) 34%, transparent 62%);
  filter: blur(18px);
  opacity: 0;
  animation: bloom 1900ms var(--spring-out) 160ms forwards;
  pointer-events: none;
}

@keyframes bloom {
  from { opacity: 0; scale: 0.82; }
  to { opacity: 1; scale: 1; }
}

.stream { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.mote {
  position: absolute;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(180, 205, 255, 0), rgba(180, 205, 255, 0.7));
  opacity: 0;
  will-change: transform, opacity;
}

.hero-seam {
  position: absolute;
  inset: auto 0 0;
  height: 200px;
  /* Resolves to the page colour before the section ends, but stays clear of the
     copy above it so the disclaimer line remains readable. */
  background: linear-gradient(180deg, transparent 0%, rgba(247, 248, 245, 0.2) 52%, var(--app) 88%, var(--app) 100%);
  z-index: 4;
  pointer-events: none;
}

/* ─────────── STAGE ─────────── */
.stage { padding: clamp(40px, 5vh, 66px) 0 clamp(60px, 8vh, 96px); }

.stage-head { text-align: center; max-width: 50ch; margin-inline: auto; }
.stage-head h2 { margin-top: 12px; }
.stage-lede { margin: 16px auto 0; max-width: 44ch; transition-delay: 140ms; }

/* Segmented control — the app's own nav, with a spring-driven indicator. */
.segmented {
  position: relative;
  display: flex;
  gap: 2px;
  width: fit-content;
  margin: 24px auto 20px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 2px 10px rgba(20, 22, 26, 0.05), inset 0 1px 0 #fff;
  transition-delay: 200ms;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar { display: none; }

.seg-indicator {
  position: absolute;
  z-index: 0;
  top: 5px;
  left: 0;
  height: calc(100% - 10px);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(20, 22, 26, 0.1), 0 1px 2px rgba(20, 22, 26, 0.06);
  will-change: transform, width;
}

.seg {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding-inline: 17px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  font-size: 0.83rem;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  transition: color 220ms var(--spring);
}

.seg[aria-selected="true"] { color: var(--ink); }
.seg:hover { color: var(--ink-2); }

.seg-badge {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.b-red { background: #b0473f; }
.b-amber { background: #a9740c; }
.seg-badge.is-zero { background: var(--green); }

/* Panels share one stage height so switching never jumps the page.
   The deck's peeked card is clipped at the column edge — the same way the app
   frame clips it — with a little room left for card shadows. */
.panels {
  position: relative;
  /* The stage springs to each panel's own height, so Today isn't padded out to
     the tallest space. The floor only keeps the deck from ever collapsing. */
  min-height: 400px;
  overflow: hidden;
  margin-inline: -44px;
  padding: 44px;
  margin-top: -44px;
}

.panel { position: relative; }
.panel[hidden] { display: none; }

.panel.is-entering {
  animation: panel-in 480ms var(--spring-out) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.988); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ─────────── DECK — the product's card, measure and physics ─────────── */
.deck {
  position: relative;
  width: 100%;
  height: 400px;
  touch-action: pan-y;
  user-select: none;
}

.deck.is-grabbing { cursor: grabbing; }
.deck.is-cleared { height: auto; }

.deck-slide {
  position: absolute;
  left: 50%;
  top: 0;
  will-change: transform, opacity;
  transform-origin: 50% 60%;
}

.deck-slide.is-peek { cursor: pointer; }
.deck:not(.is-grabbing) .deck-slide:not(.is-peek) .dc { cursor: pointer; }

/* The card itself: 22px radius, hairline border, solid white, product padding. */
.dc {
  position: relative;
  padding: 26px 30px 24px;
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(20, 20, 30, 0.05),
    0 12px 32px rgba(20, 20, 30, 0.08),
    0 40px 90px rgba(20, 20, 30, 0.08);
  transition: box-shadow 220ms var(--spring);
}

.is-peek .dc {
  box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px rgba(20, 20, 30, 0.05);
}

/* Peeks are washed back so the focused card is unambiguous. */
.is-peek .dc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: rgba(247, 246, 243, 0.5);
  pointer-events: none;
}

/* ── Header: round gradient avatar, name, company · kicker · when, tone chip ── */
.dc-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }

.dc-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(150deg, #3b3b4e, #6d6a8c);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dc-id { min-width: 0; flex: 1; }
.dc-id b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.008em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-id > span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 24px;
  padding-inline: 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.dc-chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.t-now { background: #fbefe9; color: #b4552f; }
.t-soon { background: #eeedfb; color: #4f47d6; }
.t-later { background: #e8f4ee; color: #2e7a5b; }

.dc-lead { margin: 0; font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; }
.dc-context { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* ── Recommendation: the product's gray-lilac tile with a violet sparkle ── */
.dc-rec {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8f8fc, #f3f3fa);
}

.dc-spark {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  background: linear-gradient(150deg, #26263a, #4f47d6);
}

/* The envelope is the solid plane and the X is cut through it in Xaviour blue —
   the same figure/ground relationship as the master mark, legible at 13px. */
.dc-spark svg { width: 13px; height: 13px; fill: #fff; }
.dc-spark .s-x {
  fill: none;
  stroke: #4f47d6;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.dc-rec b { display: block; font-size: 14px; font-weight: 600; }
.dc-rec p { margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }

/* ── Actions: ink primary, 5% secondary, quiet More on the right ── */
.dc-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

.dc-primary, .dc-secondary {
  height: 40px;
  padding-inline: 18px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 110ms ease-out, background 180ms var(--spring);
}

.dc-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.dc-primary:hover { background: #1b1f28; }
.dc-secondary { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.dc-secondary:hover { background: rgba(0, 0, 0, 0.08); }
.dc-primary:active, .dc-secondary:active { transform: scale(0.97); }

.dc-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  margin-left: auto;
  padding-inline: 6px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  transition: color 180ms var(--spring);
}

.dc-more:hover { color: var(--ink); }
.dc-more svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ── Completion: the card's content lifts out, the outcome line takes its place ── */
.dc.is-done > *:not(.dc-outcome) {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 260ms var(--spring-out), transform 260ms var(--spring-out);
}

.dc-outcome {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-inline: 30px;
  text-align: center;
  font-size: 15px;
  color: var(--ink-2);
  animation: fade-in 320ms var(--spring-out) 120ms both;
}

.dc-outcome i {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8f4ee;
}

.dc-outcome svg { width: 13px; height: 13px; fill: none; stroke: #2e7a5b; stroke-width: 2.6; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Edge arrows: circular, at the card's edge, vertically centred ── */
.deck-arrow {
  position: absolute;
  top: 50%;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  translate: 0 -50%;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
  box-shadow: 0 2px 10px rgba(20, 20, 30, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 180ms var(--spring), background 180ms var(--spring), color 180ms var(--spring);
}

.deck-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.deck-arrow:hover { background: #fff; color: var(--ink); }
.a-prev:hover { transform: translate(-2px, -50%); }
.a-next:hover { transform: translate(2px, -50%); }

/* ── Completion card ── */
.deck-done {
  position: relative;
  display: grid;
  place-items: center;
  gap: 12px;
  max-width: 600px;
  margin-inline: auto;
  padding: 52px 40px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.035);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 12px 32px rgba(20, 20, 30, 0.08);
  animation: panel-in 520ms var(--spring-out) both;
}

.deck-done p { max-width: 44ch; font-size: 15px; line-height: 1.55; color: var(--muted); }

.done-tick {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e8f4ee;
  color: #2e7a5b;
  font-size: 1.15rem;
  font-weight: 700;
}

.done-tick.sm { width: 30px; height: 30px; font-size: 0.85rem; }

/* ── Deck footer: dots, then the product's own hint line ── */
.deck-foot { margin-top: 10px; display: grid; justify-items: center; gap: 12px; }
.deck-dots { display: flex; height: 6px; gap: 6px; }

.deck-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--faint);
  opacity: 0.45;
  transition: width 300ms var(--spring), background 300ms var(--spring), opacity 300ms var(--spring);
}

.deck-dots i.on { width: 18px; background: var(--ink-2); opacity: 1; }
.deck-dots i.done { background: #2e7a5b; opacity: 0.6; }

.deck-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.deck-hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: 0 1px 1px rgba(22, 24, 29, 0.05);
}

/* ─────────── PROACTIVE ALERTS — a supporting capability, after the stage ─────────── */
.alerts {
  position: relative;
  z-index: 4;
  max-width: 860px;
  margin: clamp(30px, 4vh, 46px) auto 0;
  padding: 20px 22px 16px;
  border: 1px solid rgba(18, 101, 242, 0.12);
  border-radius: 24px;
  background:
    radial-gradient(120% 160% at 50% -30%, rgba(18, 101, 242, 0.07), transparent 62%),
    rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(18, 101, 242, 0.06),
    0 16px 40px rgba(20, 34, 62, 0.07);
}

/* A hairline rule above it, so it reads as a follow-on rather than a new section. */
.alerts::before {
  content: "";
  position: absolute;
  top: calc(-1 * clamp(15px, 2vh, 23px));
  left: 22%;
  width: 56%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(18, 101, 242, 0.2), transparent);
}

.alerts-head { text-align: center; }
.alerts-line {
  margin: 5px 0 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.alerts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 15px;
}

.live-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  transition: transform 220ms var(--spring), border-color 220ms var(--spring),
    box-shadow 220ms var(--spring), background 220ms var(--spring);
}

.live-btn:hover, .live-btn.is-on {
  transform: translateY(-2px);
  border-color: rgba(18, 101, 242, 0.32);
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 101, 242, 0.12);
}

.lb-icon {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(18, 101, 242, 0.11), rgba(18, 101, 242, 0.04));
  color: var(--blue);
}

.lb-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.lb-text { min-width: 0; }
.lb-text b { display: block; font-size: 0.79rem; font-weight: 660; letter-spacing: -0.01em; }
.lb-text > span { display: block; margin-top: 1px; font-size: 0.68rem; color: var(--muted); }

.alerts-foot {
  margin: 13px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}

.ping {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-sizing: content-box;
}

.ping-ok { background: var(--green); animation: ping-pulse 1.6s ease-in-out infinite; }
.ping-soon { background: var(--blue); }

@keyframes ping-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}


/* The glance opens inside the alerts band, not over the page. Nothing below it
   is ever covered — the stage simply moves down as the module grows. */
.live-pop {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(18, 101, 242, 0.16);
  border-radius: 19px;
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(18, 101, 242, 0.055), transparent 60%),
    #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 30px rgba(20, 34, 62, 0.09);
  transform-origin: 50% 0;
  animation: glance-in 360ms var(--spring-out) both;
}

/* Materialise rather than fade — the surface arrives as a real panel. */
@keyframes glance-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .live-pop { animation: none; transform: none; }
}

.live-pop .lp-type {
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.live-pop h4 { margin: 7px 0 0; font-size: 19px; font-weight: 660; letter-spacing: -0.03em; }
.live-pop .lp-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

.lp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }

.lp-facts > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
}

.lp-facts span { display: block; font-size: 9px; font-weight: 740; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.lp-facts b { display: block; margin-top: 5px; font-size: 13px; line-height: 1.35; }
.lp-facts .is-code { font-size: 17px; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }

.lp-excerpt {
  margin-top: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.lp-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.lp-note { margin-top: 9px; font-size: 10.5px; color: var(--faint); }

@media (max-width: 900px) {
  .deck { height: 460px; }
  .dc { padding: 22px 20px 20px; }
  .dc-lead { font-size: 17.5px; }
  .dc-actions { flex-wrap: wrap; }
  .dc-more { margin-left: 0; }
  .deck-arrow { display: none; }
  .panels { min-height: 470px; }
  .lp-facts { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .seg { padding-inline: 12px; font-size: 0.79rem; }
  .segmented { width: 100%; justify-content: flex-start; }
}

/* The product's nav is five fixed spaces — all five must be reachable without
   a hidden horizontal scroll, so the control tightens rather than clipping. */
@media (max-width: 440px) {
  .segmented { gap: 0; padding: 4px; border-radius: 15px; justify-content: space-between; }
  .seg { height: 36px; padding-inline: 7px; font-size: 0.72rem; gap: 4px; letter-spacing: -0.01em; }
  .seg-badge { min-width: 15px; height: 15px; font-size: 0.58rem; }
}
