/* Platform page: the fixed 3D stage behind the scrolling decision journey, its panels, labels, chapter rail and no-3D fallback. */
/* ============================== STAGE ============================== */
.scene { position: fixed; inset: 0; z-index: 0; display: block; width: 100vw; height: 100vh; height: 100lvh; outline: none; touch-action: pan-y; }
.scene.is-dragging { cursor: grabbing; }
/* Legibility: a quiet scrim on the text side only; the 3D stays clear on the right */
.scene-scrim { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(90deg, var(--surface-000) 0%, color-mix(in srgb, var(--surface-000) 70%, transparent) 26%, transparent 52%); }
.labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.lbl {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity; opacity: 0;
  font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); padding: 3px 8px; background: color-mix(in srgb, var(--surface-100) 82%, transparent); border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
}
.lbl-accent { color: var(--accent-text); border-color: var(--accent); }
.lbl-decision { color: var(--ink); border-color: var(--decision-lime); }
.lbl-layer { font-size: 10.5px; letter-spacing: 0.08em; }
.tip {
  position: fixed; z-index: 3; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity var(--duration-hover) var(--ease-standard);
  min-width: 220px; padding: var(--space-3) var(--space-4); background: var(--surface-100); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  font-size: 13px; line-height: 20px;
}
.tip.is-on { opacity: 1; }
.tip .mono-label { display: block; margin-bottom: 2px; }
.tip-name { display: block; font-family: var(--font-display); font-size: 18px; line-height: 24px; margin-bottom: 6px; }
.tip-row { display: flex; justify-content: space-between; gap: var(--space-4); color: var(--ink-muted); }
.tip-row b { color: var(--ink); font-weight: 500; font-family: var(--font-mono); }

/* ============================== STORY ============================== */
main { position: relative; z-index: 1; }
.story { pointer-events: none; }                 /* the stage under the story stays draggable */
.chapter { position: relative; min-height: 150vh; }
.chapter-arrival { min-height: 130vh; }
.panel {
  position: sticky; top: 22vh; pointer-events: auto;
  max-width: 520px; margin-left: max(var(--space-8), calc((100vw - 1280px) / 2 + var(--space-8)));
  padding: var(--space-5) 0;
}
.chapter-arrival .panel { top: 18vh; max-width: 640px; }
.panel-h1 { margin: var(--space-4) 0 var(--space-5); font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 6vw, 84px); line-height: 1.04; letter-spacing: -0.01em; }
.panel-h2 { margin: var(--space-3) 0 var(--space-4); font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.1; }
.panel-lead { max-width: 520px; margin: 0 0 var(--space-6); font-size: 19px; line-height: 30px; color: var(--ink-muted); }
.panel-text { max-width: 460px; margin: 0 0 var(--space-5); font-size: 17px; line-height: 28px; color: var(--ink-muted); }
.panel-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.panel-ctas .hk-btn { text-decoration: none; }
.panel-meta { margin: var(--space-4) 0 0; }
.scroll-cue { margin-top: var(--space-7); }

.legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 22px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.sw { width: 14px; height: 3px; border-radius: 2px; }
.sw-a { background: #03eabf; } .sw-b { background: var(--accent); } .sw-c { background: #188dec; }

.shortlist { display: grid; gap: 0; max-width: 420px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.shortlist li { display: grid; grid-template-columns: 96px 1fr auto; align-items: baseline; gap: var(--space-3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.shortlist li:first-child span:nth-child(2) { color: var(--ink); font-weight: 500; }
.shortlist .score { font-family: var(--font-display); font-size: 22px; }

.decide-record { max-width: 460px; margin-top: var(--space-2); background: color-mix(in srgb, var(--surface-100) 92%, transparent); }
.decide-record .record-title { margin: var(--space-3) 0 var(--space-4); font-family: var(--font-display); font-size: 24px; line-height: 30px; }
.decide-record .record-fields div { grid-template-columns: 110px minmax(0, 1fr); }
/* In the journey the 3D node is this view's one lime decision node, so the record's rail node takes the accent */
.decide-record .record-node { background: var(--accent); box-shadow: var(--shadow-node); }
.chapter.is-current .decide-record .record-node { transform: scale(1); }
.no-3d .decide-record .record-node { background: var(--decision-lime); transform: scale(1); }

/* Only the current chapter's text is shown over the stage; the others fade as you scroll between them */
.js:not(.no-3d) .chapter .panel { opacity: 0; transition: opacity 360ms var(--ease-standard); }
.js:not(.no-3d) .chapter.is-current .panel { opacity: 1; }

.fallback-fig { display: none; margin: var(--space-5) 0 0; }
.fallback-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-100); }

/* ============================== RAIL ============================== */
.rail { position: fixed; z-index: 3; right: var(--space-5); top: 50%; transform: translateY(-50%); transition: opacity var(--duration-standard) var(--ease-standard); }
.rail.is-off { opacity: 0; pointer-events: none; }
.rail ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
.rail a { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-3); flex-direction: row-reverse; text-decoration: none; color: var(--ink-muted); }
.rail-dot { width: 10px; height: 10px; box-sizing: border-box; border: 2px solid var(--line-control); border-radius: var(--radius-full); background: var(--surface-000); transition: border-color var(--duration-node) var(--ease-standard), background-color var(--duration-node) var(--ease-standard), box-shadow var(--duration-node) var(--ease-standard); }
.rail-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0; transform: translateX(6px); transition: opacity var(--duration-standard) var(--ease-standard), transform var(--duration-standard) var(--ease-standard); }
.rail a:hover .rail-label, .rail a:focus-visible .rail-label { opacity: 1; transform: none; }
.rail a.is-past .rail-dot { border-color: var(--accent); }
.rail a.is-current .rail-dot { border-color: var(--accent); background: var(--accent); box-shadow: var(--shadow-node); }
.rail a.is-current { color: var(--accent-text); }

/* ============================== AFTER THE JOURNEY ============================== */
.after { position: relative; z-index: 1; background: var(--surface-000); }
.after .section:first-child { border-top: 1px solid var(--line); }
.after .trust-grid { align-items: center; }
.foot-home { text-decoration: none; }
.foot-home:hover { color: var(--ink); }

/* ============================== NO-3D FALLBACK ============================== */
/* Reduced motion, Save-Data, low memory or no WebGL2: the same story, with the existing plates as figures */
.no-3d .scene, .no-3d .scene-scrim, .no-3d .labels, .no-3d .tip, .no-3d .rail, .no-3d .hint-3d { display: none !important; }
.no-3d .story { pointer-events: auto; }
.no-3d .chapter, .no-3d .chapter-arrival { min-height: 0; padding: var(--space-8) 0; border-top: 1px solid var(--line); }
.no-3d .chapter-arrival { padding-top: calc(72px + var(--space-8)); border-top: 0; }
.no-3d .panel { position: static; max-width: 760px; }
.no-3d .fallback-fig { display: block; }
.no-3d .scroll-cue { display: none; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 900px) {
  .scene-scrim { background: linear-gradient(0deg, var(--surface-000) 0%, color-mix(in srgb, var(--surface-000) 80%, transparent) 38%, transparent 62%); }
  .panel { position: sticky; top: auto; bottom: 0; margin: 0; padding: var(--space-5); max-width: none; }
  .chapter { display: flex; flex-direction: column; justify-content: flex-end; }
  .chapter .panel { position: sticky; bottom: var(--space-4); top: auto; }
  .chapter-arrival .panel { top: auto; }
  .panel-text { font-size: 16px; line-height: 26px; }
  .rail { right: var(--space-2); }
  .rail-label { display: none; }
  .decide-record .record-fields { display: none; }
  .no-3d .panel { padding: 0 var(--space-5); }
}
@media (max-width: 720px) {
  .panel-ctas .hk-btn { width: 100%; }
  .shortlist li { grid-template-columns: 84px 1fr auto; }
}
.panel-ctas .hk-btn-ghost:first-child { padding-left: 0; padding-right: 0; }   /* the only link left in the arrival panel lines up with the text */
