/* Rick's demo player, full-screen layout: a thin control bar, the REAL product
   filling the rest of the viewport, a small floating guide (Rick's lines + try
   it; collapsible to a pill, draggable) and a slide-out stop drawer. */
:root {
  --ink: #0d1424; --panel: #141c2e; --panel-2: #1b2539; --line: #283550;
  --text: #edf1f8; --mute: #9aa6bd; --amber: #f3a73b; --amber-ink: #241603;
  --good: #5fc89a; --bar-h: 48px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 15px/1.5 var(--body); overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 6px 11px; border: 1px solid var(--line); background: transparent; text-decoration: none; cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--ink); }
.btn.link { border-color: transparent; color: var(--mute); font-weight: 500; padding: 4px 6px; }
.btn.icon { padding: 6px; border-color: transparent; }
.btn.sm { font-size: 12.5px; }
.btn:disabled { opacity: .4; cursor: default; }

/* thin control bar */
.bar { position: fixed; top: 0; left: 0; right: 0; height: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0; display: flex; align-items: center; gap: 10px; background: #090e1a; border-bottom: 1px solid var(--line); z-index: 30; min-width: 0; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 15px var(--display); white-space: nowrap; }
.where { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 auto; }
.chip { flex: 0 0 auto; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); border: 1px solid rgba(243, 167, 59, .4); border-radius: 999px; padding: 1px 8px; }
.where-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.step { color: var(--mute); font-size: 12px; white-space: nowrap; }
.stepper, .bar-cta { display: flex; gap: 6px; flex-shrink: 0; }

/* the product: everything under the bar */
.stage { position: fixed; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0; background: #fff; }
.stage-body { position: absolute; inset: 0; }
.stage-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
#altStage { position: absolute; inset: 0; overflow: auto; background: var(--ink); }

/* floating guide */
.guide { position: fixed; left: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - var(--bar-h) - 40px); display: flex; flex-direction: column; background: rgba(14, 20, 34, .96); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); z-index: 25; }
.guide-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 12px; cursor: grab; user-select: none; touch-action: none; }
.guide-head:active { cursor: grabbing; }
.grip { color: var(--mute); font-size: 12px; letter-spacing: -2px; }
.guide h2 { flex: 1; margin: 0; font: 700 17px/1.2 var(--display); text-wrap: balance; }
.guide-body { padding: 0 14px 12px; overflow-y: auto; display: grid; gap: 8px; }
.what { margin: 0; color: #c9d2e3; font-size: 13.5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs:empty { display: none; }
.tabs button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--ink); border-color: var(--text); font-weight: 600; }
.rick { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.rick li { font-style: italic; color: #dfe5f0; font-size: 13.5px; }
.rick li::before { content: "“"; color: var(--amber); font-style: normal; }
.rick li::after { content: "”"; color: var(--amber); font-style: normal; }
.try { margin: 0; background: rgba(243, 167, 59, .1); border: 1px solid rgba(243, 167, 59, .35); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; }
.try b { color: var(--amber); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-right: 4px; }
.guide-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mute); }
.stage-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.guide-foot a { color: var(--text); text-decoration: none; white-space: nowrap; }
.guide-foot #restart { margin-left: auto; }
.pill { position: fixed; left: 16px; bottom: 16px; z-index: 25; border: 1px solid rgba(243, 167, 59, .5); background: rgba(14, 20, 34, .96); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

/* stop drawer */
.rail { position: fixed; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); left: 0; bottom: 0; width: min(340px, 88vw); overflow-y: auto; padding: 18px 14px 24px; background: var(--panel); border-right: 1px solid var(--line); z-index: 40; box-shadow: 20px 0 50px rgba(0, 0, 0, .4); }
.scrim { position: fixed; inset: 0; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); background: rgba(4, 7, 14, .5); z-index: 35; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.rail h1 { font: 700 21px/1.15 var(--display); margin: 6px 0 4px; text-wrap: balance; }
.rail-sub, .rail-note { margin: 0 0 8px; color: var(--mute); font-size: 13px; }
.stops { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.stops li button { width: 100%; text-align: left; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; }
.stops li button:hover { background: var(--panel-2); }
.stops .n { font: 600 12px/22px var(--body); width: 22px; height: 22px; text-align: center; border-radius: 50%; background: var(--panel-2); color: var(--mute); }
.stops .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.stops .s { display: block; color: var(--mute); font-size: 12px; font-weight: 400; }
.stops li[aria-current="step"] button { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--amber); }
.stops li[aria-current="step"] .n { background: var(--amber); color: var(--amber-ink); }
.stops li.done .n { background: rgba(95, 200, 154, .18); color: var(--good); }

/* recordings */
.rec { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: #05080f; }
.rec video { max-width: 100%; max-height: calc(100% - 40px); border-radius: 10px; background: #000; }
.rec p { margin: 0; color: var(--mute); font-size: 13px; text-align: center; max-width: 70ch; }

/* phone */
.phone-wrap { height: 100%; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 18px; background: radial-gradient(ellipse at center, #1b2539, #0d1424 70%); flex-wrap: wrap; }
.phone { position: relative; box-sizing: content-box; height: min(calc(100% - 24px), 844px); width: auto; aspect-ratio: 390 / 844; max-width: calc(100vw - 56px); border-radius: 44px; background: #000; padding: 12px; box-shadow: 0 30px 60px rgba(0, 0, 0, .5), inset 0 0 0 2px #2a2f3a; }
.phone .screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #fff; position: relative; }
.phone .screen img { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.phone .screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.phone .app-screen iframe { position: absolute; width: 390px; height: 844px; transform-origin: 0 0; }
.phone-side { max-width: 260px; color: var(--mute); font-size: 13px; display: grid; gap: 8px; }
.phone-side .pager { display: flex; gap: 6px; flex-wrap: wrap; }
.phone-side .pager button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.phone-side .pager button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 600; }

/* pricing */
.pricing { padding: 28px clamp(16px, 4vw, 48px); color: var(--text); display: grid; gap: 18px; max-width: 980px; margin: 0 auto; }
.pricing h3 { font: 700 26px var(--display); margin: 0; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tier.pop { border-color: var(--amber); }
.tier b { display: block; font: 700 28px var(--display); }
.tier span { color: var(--mute); font-size: 13px; }
.tier ul { margin: 10px 0 0; padding-left: 18px; color: #c9d2e3; font-size: 14px; }
.addons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; color: #c9d2e3; font-size: 14px; }
.addons div { border-bottom: 1px dashed var(--line); padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
.close-steps { counter-reset: c; list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.close-steps li { counter-increment: c; padding-left: 30px; position: relative; color: #c9d2e3; }
.close-steps li::before { content: counter(c); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel-2); color: var(--amber); font-size: 12px; text-align: center; line-height: 20px; font-weight: 600; }
.pricing .row { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1100px) { .hide-md { display: none; } .step { display: none; } }
@media (max-width: 768px) {
  :root { --bar-h: 52px; }
  .brand span, .chip, .hide-sm { display: none; }
  .stepper .btn { padding: 6px 9px; }
  #prev { font-size: 0; } #prev::before { content: "←"; font-size: 15px; }
  #next { font-size: 0; } #next::before { content: "Next →"; font-size: 13.5px; }
  /* the guide becomes a bottom sheet */
  .guide { left: 0 !important; right: 0; top: auto !important; bottom: 0 !important; width: 100%; max-height: 55vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .guide-head { cursor: default; }
  .grip { display: none; }
  .pill { left: auto !important; right: 0 !important; bottom: auto; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; border-radius: 10px 0 0 10px; border-right: 0; padding: 12px 6px; font-size: 12px; font-size: 0; }
  .pill::before { content: "Rick's notes"; font-size: 12px; }
  .tiers, .addons { grid-template-columns: minmax(0, 1fr); }
  .phone-side { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Calmer bar (Rick 10/10: "overall UI here is a bit chaotic"): one line of
   context (stop title + n/16), Back/Next, one call to action. */
.bar .chip#cardSegment { display: none; }
.bar { gap: 14px; }
.bar .where-title { font-weight: 600; }
.bar .step { opacity: .6; font-variant-numeric: tabular-nums; }
.rail-foot { padding: 12px 16px 20px; }
.rail-foot .btn { width: 100%; justify-content: center; }
