/* ═════════════════════════════════════════════════════════
   THE WALKTHROUGH
   A scripted demo. Nothing here computes anything: every
   number, file and verdict is written down, so it looks the
   same every time and can be driven at a talking pace.

   It borrows every component from site.css on purpose. The
   reason a scripted demo usually feels fake is that it is
   drawn separately from the product; this one is the product's
   own parts, arranged.
   ═════════════════════════════════════════════════════════ */

html, body { height: 100%; }
body.demo {
  background: var(--paper);
  overflow: hidden;               /* the stage never scrolls, it advances */
  display: flex; flex-direction: column;
}
body.demo::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(52% 40% at 14% 12%, rgba(194,96,58,.09), transparent 70%),
    radial-gradient(46% 36% at 88% 82%, rgba(217,138,74,.08), transparent 72%);
}

/* ── the bar ──────────────────────────────────────────────── */
.dbar {
  position: relative; z-index: 5; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px clamp(20px, 3.2vw, 46px);
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.dbar .left, .dbar .right { display: flex; align-items: center; gap: 14px; }

/* said plainly, and never removed. A scripted demo that does not say so is a lie. */
.scripted {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-3); padding: 6px 12px; border-radius: 100px; box-shadow: var(--sh-in);
  background: var(--paper-2); white-space: nowrap;
}
.scripted i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); flex: none; }

/* ── the rail ─────────────────────────────────────────────── */
.rail { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.rail button {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 100px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); background: none; border: 0; cursor: pointer;
  transition: color .4s ease, background .4s ease;
}
.rail button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 1px var(--line); transition: background .4s ease, box-shadow .4s ease;
}
.rail button:hover { color: var(--ink-2); }
.rail button[aria-current="true"] { color: var(--accent-tx); background: rgba(194,96,58,.08); }
.rail button[aria-current="true"]::before { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rail button.seen::before { background: var(--line); }
.rail .tick { width: 12px; height: 1px; background: var(--line); flex: none; }
@media (max-width: 1080px) { .rail button span { display: none; } .rail button { padding: 7px 6px; } }

/* ── the stage ────────────────────────────────────────────── */
.stage {
  position: relative; z-index: 2; flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(24px, 3.6vw, 60px);
  padding: clamp(22px, 3vw, 44px) clamp(20px, 3.2vw, 46px) clamp(18px, 2.4vw, 34px);
}
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
}

/* the reading column */
.beat { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.beat .n {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-tx);
}
.beat h2 {
  font-size: clamp(28px, 3.2vw, 46px); line-height: 1.04; letter-spacing: -.038em;
  margin: 14px 0 16px; max-width: 15ch;
}
.beat p { font-size: clamp(15px, 1.15vw, 17px); line-height: 1.6; color: var(--ink-2); max-width: 42ch; }
.beat .note {
  margin-top: 20px; padding-top: 16px; box-shadow: inset 0 1px 0 var(--line-2);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; line-height: 1.7;
  text-transform: uppercase; color: var(--ink-3); max-width: 40ch;
}
@media (max-width: 900px) {
  .beat h2 { max-width: none; font-size: clamp(24px, 6vw, 34px); }
  .beat p { max-width: none; }
  .beat .note { display: none; }
}

/* the window. One window for the whole walkthrough: the chrome persists and the
   body changes, so it reads as one product moving rather than seven pictures. */
/* the window keeps a screen-like proportion and sits centred, rather than
   stretching to whatever height the viewport happens to be. A panel with 400px
   of void under three rows reads as a page that failed to load. */
.win { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.win .ui {
  width: 100%; max-height: 100%; aspect-ratio: 16 / 10;
  display: flex; flex-direction: column; box-shadow: var(--sh-lg), var(--sh-in);
}
.win .ui-body { flex: 1; min-height: 0; overflow: hidden; padding: clamp(18px, 2vw, 28px); }
@media (max-width: 900px) {
  /* on a phone the window cannot hold the taller scenes at once, so its body
     scrolls rather than clipping them. The page itself still never scrolls. */
  .win .ui { aspect-ratio: auto; flex: 1; }
  .win .ui-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .scene { height: auto; justify-content: flex-start; }
}

.scene { display: none; height: 100%; flex-direction: column; justify-content: center; gap: 14px; min-height: 0; }
.scene.on { display: flex; }
.scene .lbl { flex: none; }
.scene .grow { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
/* the two scenes whose last line is a footnote push it to the floor instead */
/* the footnote gets a clear gap from the body rather than floating to a floor
   that no longer exists now the scene is centred */
.scene .grow > .drop-note:last-child,
.scene .grow > .tally:last-child { margin-top: 8px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line-2); }

/* every element that animates in starts here and is released by the script */
.q { opacity: 0; transform: translateY(10px); }
.q.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .6s cubic-bezier(.22,1,.36,1); }

/* ── the controls ─────────────────────────────────────────── */
.dfoot {
  position: relative; z-index: 5; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 clamp(20px, 3.2vw, 46px) clamp(18px, 2.4vw, 30px);
}
.caption {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); min-width: 0;
}
.caption b { color: var(--accent-tx); font-weight: 400; }
.ctrl { display: flex; align-items: center; gap: 9px; flex: none; }
.ctrl button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--paper-hi); box-shadow: var(--sh-sm), var(--sh-in);
  display: flex; align-items: center; justify-content: center;
  transition: transform .4s cubic-bezier(.22,1,.36,1), box-shadow .4s ease;
}
.ctrl button:hover { transform: translateY(-2px); box-shadow: var(--sh-md), var(--sh-in); }
.ctrl button:disabled { opacity: .38; cursor: default; transform: none; }
.ctrl button svg { width: 16px; height: 16px; stroke: var(--ink); fill: none; stroke-width: 1.9; }
.ctrl .play { width: auto; padding: 0 20px; border-radius: 100px; gap: 9px; background: var(--ink); }
.ctrl .play svg { stroke: var(--paper); }
.ctrl .play span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper);
}

/* the autoplay progress, drawn on the ring of the next button */
.ctrl .next { position: relative; }
.ctrl .next .ring { position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; }
.ctrl .next .ring circle { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .9; }

/* ── scene-specific pieces the site does not already have ── */

/* the count that ticks up during intake */
.tally { display: flex; align-items: baseline; gap: 9px; }
.tally b { font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.04em; color: var(--ink); }
.tally span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}

/* the two-up that shows the same brief with and without the lens */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; flex: 1; }
.vs > div { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.vs .cap {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
}
.vs .cap.acc { color: var(--accent-tx); }
.vs .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; min-height: 0; }
.vs .grid .tile { border-radius: 8px; min-height: 0; }
.vs .grid .tile.flat { background: #ddd8ce; }

/* the ship card that closes the walkthrough */
.ship { display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-radius: 12px;
  background: var(--paper-hi); box-shadow: var(--sh-sm), var(--sh-in); }
.ship .tk {
  width: 26px; height: 26px; border-radius: 50%; background: #4a6b57; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.ship .tk svg { width: 13px; height: 13px; stroke: #fff; fill: none; stroke-width: 2.6; }
.ship b { font-size: 14.5px; font-weight: 600; letter-spacing: -.02em; display: block; }
.ship span { font-size: 12.5px; color: var(--ink-3); display: block; margin-top: 2px; }
.ship .amt {
  margin-left: auto; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--accent-tx);
  white-space: nowrap;
}

/* the end card */
.endcard { position: absolute; inset: 0; z-index: 8; display: none;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(244,240,232,.92); backdrop-filter: blur(10px); }
.endcard.on { display: flex; }
.endcard .in { max-width: 46ch; padding: 0 24px; }
.endcard h2 { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.06; letter-spacing: -.04em; }
.endcard p { margin-top: 14px; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.endcard .row { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── no JavaScript, and reduced motion ────────────────────── */
.noscript-note { display: none; }
html.no-js .stage { display: block; overflow: auto; }
html.no-js .scene { display: flex !important; margin-bottom: 26px; }
html.no-js .q { opacity: 1; transform: none; }
html.no-js body.demo { overflow: auto; }

@media (prefers-reduced-motion: reduce) {
  .q, .q.in { opacity: 1; transform: none; transition: none; }
  .ctrl button { transition: none; }
}

/* one continuous rail across the fan, instead of a dash per branch */
.win .tree .fan { position: relative; }
.win .tree .fan::before {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: center; transition: transform .6s cubic-bezier(.22,1,.36,1) .45s;
}
.win .tree.on .fan::before { transform: scaleX(1); }
.win .tree .lb::before { content: none; }
