/* The home page: one fixed 3D viewport under the page, scroll scenes over it, the program's status bar at the bottom. */
.stage-page { overflow-x: hidden; }
.mono { font-family: var(--font-mono); }

/* the viewport and its part labels */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; touch-action: pan-y; cursor: grab; transition: opacity .2s; }
.stage:active { cursor: grabbing; }
.stage-labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-mono); color: var(--text); white-space: nowrap; pointer-events: none; will-change: transform; opacity: 0; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag b { font-weight: 500; background: var(--tag-bg); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
.tag b span { color: var(--dim); }

/* a small labelled value, the program's read-only fields */
.cell { background: var(--field); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.cell span { font-size: 11px; color: var(--dim); }
.cell b { font: 600 14px var(--font-mono); }

/* scroll scenes over the viewport */
.scenes { position: relative; z-index: 2; pointer-events: none; }
.scene { position: relative; }
.scene .pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; padding: 80px clamp(16px, 4vw, 56px) 48px; box-sizing: border-box; }
.scene.s0 { height: 125vh; }
.scene.s1 { height: 230vh; }
.scene.s2 { height: 210vh; }
.scene.s3 { height: 230vh; }
.scene.s4 { height: 260vh; }
.scene.s5 { height: 260vh; }
.scene.s6 { height: 240vh; }
.scene.s7 { height: 70vh; }
.hero { pointer-events: auto; max-width: 540px; display: flex; flex-direction: column; gap: 22px; }
.kicker { display: flex; gap: 8px; align-items: center; font: 500 12px/1 var(--font-mono); color: var(--dim); letter-spacing: .06em; }
.kicker::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 84px); line-height: .95; font-weight: 800; letter-spacing: -.045em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(16px, 1.4vw, 18px); color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.tour { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.tour svg { width: 14px; height: 14px; fill: currentColor; }
.tour .stop, .tour[aria-pressed="true"] .play { display: none; }
.tour[aria-pressed="true"] .stop { display: inline; }
.facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--dim); }

.panel { pointer-events: auto; max-width: 400px; background: var(--glass-panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.step { font: 500 12px/1 var(--font-mono); color: var(--accent); }
.panel h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.panel p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.verbs { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.verbs span { display: flex; gap: 10px; }
.verbs b { font: 500 12px var(--font-mono); color: var(--dim); min-width: 46px; padding-top: 2px; }
.try { font-size: 13px; color: var(--dim); border-top: 1px solid var(--line-soft); padding-top: 12px; }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--field); border: 1px solid var(--line-soft); border-radius: var(--radius-md); }
.seg button { flex: 1; border: 0; border-radius: var(--radius-sm); padding: 9px 0; font: 600 13px var(--font-sans); cursor: pointer; background: transparent; color: var(--dim); }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.big { font: 700 clamp(34px, 3.6vw, 46px)/1 var(--font-mono); letter-spacing: -.03em; }
.note { font-size: 13px; color: var(--dim); }
.compare { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px 14px; font-size: 13px; align-items: baseline; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.compare .h { color: var(--dim); }
.compare .k { color: var(--muted); }
.compare .v { font-family: var(--font-mono); }
.compare .v.good { color: var(--success-text); }
input[type=range] { accent-color: var(--accent); width: 100%; }
.carswap { position: fixed; top: 72px; right: 16px; z-index: 15; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: opacity .25s, background .15s; }
.carswap:hover { background: var(--raise-hover); }
.carswap svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.past .carswap { opacity: 0; pointer-events: none; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.legend li { display: grid; grid-template-columns: 10px auto; column-gap: 8px; align-items: baseline; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.legend b { font: 700 16px var(--font-mono); letter-spacing: -.02em; }
.legend span { grid-column: 2; color: var(--dim); font-size: 12px; }
.tpl { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.tpl canvas { width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-md); display: block; }
.layers { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 110px; }
.layers li { padding: 6px 8px; border-radius: var(--radius-xs); background: var(--field); color: var(--faint); border-left: 2px solid transparent; transition: color .2s, border-color .2s; }
.layers li.on { color: var(--text); border-left-color: var(--accent); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: var(--radius-md); cursor: pointer; border: 2px solid var(--line); box-shadow: inset 0 0 0 2px var(--panel); }
.swatches button[aria-pressed="true"] { border-color: var(--accent); }

/* below the viewport: plain page */
.after { position: relative; z-index: 3; background: var(--bg); }
.block { max-width: 1240px; margin: 0 auto; padding: 96px clamp(16px, 4vw, 40px) 72px; display: flex; flex-direction: column; gap: 32px; }
.block > header { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.block h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.block > header p { font-size: 16px; line-height: 1.55; color: var(--muted); }
.spaces { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.spaces button { text-align: left; cursor: pointer; border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; font-family: var(--font-sans); background: var(--panel); border: 1px solid var(--line-soft); color: var(--text); }
.spaces button:hover { border-color: var(--line); }
.spaces button[aria-pressed="true"] { background: var(--pick-soft); border-color: var(--accent-line); }
.spaces .name { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 16px; font-weight: 700; }
.spaces kbd { font: 600 11px/1 var(--font-mono); padding: 3px 6px; color: var(--muted); background: none; }
.spaces .fmt { font: 500 10px/1.2 var(--font-mono); color: var(--dim); letter-spacing: .04em; }
.spaces .draw { width: 100%; height: auto; aspect-ratio: 36 / 17; display: block; border-radius: 6px; }
.spacebox { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 28px; align-items: start; }
.view { position: relative; border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; background: var(--field); aspect-ratio: 4 / 3; }
.view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.view .tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.view .vtop { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; font: 500 11px/1 var(--font-mono); }
.view .vtop span { background: var(--tag-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 9px; color: var(--text); }
.view .vtop span + span { color: var(--muted); }
.view .scrub { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 12px; }
.view .scrub b { font-size: 12px; font-weight: 600; white-space: nowrap; }
.view .scrub input { flex: 1; min-width: 0; }
.about { display: flex; flex-direction: column; gap: 14px; }
.about[hidden] { display: none; }
.about .more { font-weight: 600; font-size: 14px; }
.about h3 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.about > p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.bullets { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); font-size: 14px; margin: 0; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.bullets li::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--accent); border-radius: 1px; transform: translateY(-1px); }
.badge { font: 600 10px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: auto; flex: none; }
.badge.next { background: var(--panel-2); color: var(--dim); }

.numbers { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--band); }
.numbers .in { max-width: 1240px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 40px); display: flex; flex-direction: column; gap: 28px; }
.numbers .head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.numbers h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.03em; }
.numbers .src { font: 500 12px var(--font-mono); color: var(--dim); }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); overflow: hidden; }
.nums div { background: var(--band); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.nums b { font: 700 30px/1 var(--font-mono); letter-spacing: -.04em; }
.nums span { font-size: 13px; color: var(--muted); }

.start { max-width: 1240px; margin: 0 auto; padding: 88px clamp(16px, 4vw, 40px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; }
.start h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -.035em; }
.steps { display: flex; flex-direction: column; margin-top: 22px; }
.steps div { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.steps div:last-child { border-bottom: 1px solid var(--line-soft); }
.steps i { font: 600 13px var(--font-mono); color: var(--accent); font-style: normal; }
.steps b { display: block; font-weight: 600; }
.steps span { color: var(--muted); font-size: 14px; }
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.perks div { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.perks b { font-weight: 600; font-size: 15px; }
.perks span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.buy { border-top: 1px solid var(--line-soft); background: var(--band); }
.buy .in { max-width: 1240px; margin: 0 auto; padding: 88px clamp(16px, 4vw, 40px) 120px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 40px; align-items: center; }
.buy h2 { font-size: clamp(36px, 5vw, 64px); line-height: .98; font-weight: 800; letter-spacing: -.045em; }
.buy .in > div:first-child { display: flex; flex-direction: column; gap: 16px; }
.buy p { font-size: 16px; line-height: 1.55; color: var(--muted); max-width: 42ch; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plans div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plans div.best { background: var(--pick-soft); border-color: var(--accent-line); }
.plans .t { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; }
.plans .best .t { color: var(--accent); }
.plans .t i { font: 600 11px var(--font-mono); font-style: normal; }
.plans b { font: 700 34px/1 var(--font-mono); letter-spacing: -.04em; }
.plans span:last-child { font-size: 13px; color: var(--dim); }


/* phones: text over the bottom of the viewport, the car above it */
@media (max-width: 759px) {
  .scene.s0 .pin { align-items: flex-start; }
  .scene .pin { align-items: flex-end; padding-bottom: 44px; }
  /* the panels stay short so the 3D above them is seen: heading, numbers and controls only */
  .panel { padding: 16px; gap: 10px; max-width: none; width: 100%; background: var(--glass-panel); }
  .panel h2 { font-size: 22px; }
  .panel > p:not(.big), .panel .verbs:not(:has(.swatches)), .panel .try, .panel .compare, .panel .legend span { display: none; }
  .legend { grid-template-columns: 1fr 1fr 1fr; gap: 6px 10px; }
  .legend b { font-size: 13px; }
  .tpl { grid-template-columns: 120px 1fr; }
  .perks, .plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
