:root {
  --bg: #f6f4f0;
  --bg-2: #efece6;
  --ink: #1c1c1e;
  --ink-2: #48484a;
  --muted: #6e6e73;
  --line: rgba(28, 28, 30, 0.08);
  --card: rgba(255, 255, 255, 0.78);
  --card-solid: #ffffff;
  --accent: #ff6b4a;        /* coral, matches Orrin's light ring */
  --accent-soft: #ffe3da;
  --ok: #2f9e6b;
  --ok-soft: #dff3e8;
  --warn: #c9821a;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(40,30,20,.08);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 24px 60px rgba(40,30,20,.12);
  --r: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --orb: 168px;
  --orbit-r: 230px;
  --chip: 44px;
  --board-w: 520px;
  --gap: 48px;
  --glide: cubic-bezier(.45,.05,.2,1);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { overflow-x: clip; }  /* the 3D ring may poke past the edge when centred; never show a sideways scroll */
body {
  background: radial-gradient(1200px 700px at 25% 35%, #fffaf6 0%, var(--bg) 55%, var(--bg-2) 100%);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }

.demo {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) var(--board-w);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top top" "stage board" "foot foot";
  gap: 0 var(--gap);
  padding: 20px 40px 16px;
  max-width: 1280px;
  margin: 0 auto;
}

/* Top bar */
.topbar { grid-area: top; display: flex; justify-content: space-between; align-items: center; height: 44px; }
.brand { font-weight: 600; letter-spacing: -.01em; }
.back { display: none; text-decoration: none; color: var(--ink); font-weight: 500; }
.back span { font-size: 18px; line-height: 1; margin-right: 2px; }
.standalone .back { display: inline-flex; align-items: center; }
.standalone .topbar { gap: 10px; }
.standalone .brand { flex: 1; }
.controls { display: flex; gap: 8px; }
.ctl {
  border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(12px);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-2);
  transition: background .2s var(--ease);
}
.ctl:hover { background: var(--card-solid); }
.ctl:focus-visible, .btn-quiet-pill:focus-visible, .btn-primary:focus-visible, .btn-quiet:focus-visible, .btn-approve:focus-visible, .link-projects:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Stage: orb + orbit */
.stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 0; isolation: isolate;
  align-self: start; position: sticky; top: 64px; min-height: calc(100vh - 150px);
  transition: transform 1.6s var(--glide); will-change: transform; }
/* Opening: orb and text centred on the page. When the action starts they glide left and the board fades in. */
.demo[data-layout="center"] .stage { transform: translateX(calc((var(--board-w) + var(--gap)) / 2)); }

/* Narration, written out word by word as it is spoken */
.say { margin: 18px 0 0; width: min(100%, 30ch); min-height: 4.4em; display: grid; text-align: center; font-size: 22px; line-height: 1.45; font-weight: 400; letter-spacing: -.012em; color: var(--ink); transition: opacity .6s var(--ease); }
/* Lines stack in one cell: the old line fades up and out while the next one writes in. */
.say .line { grid-area: 1 / 1; transition: opacity .45s var(--ease), transform .45s var(--ease), filter .45s var(--ease); }
.say .line.out { opacity: 0; transform: translateY(-8px); filter: blur(4px); }
.say.fade { opacity: 0; }
.say .w { opacity: 0; filter: blur(6px); display: inline-block; transform: translateY(4px); transition: opacity .45s var(--ease), filter .45s var(--ease), transform .45s var(--ease); }
.say .w.on { opacity: 1; filter: none; transform: none; }
.orbit-wrap { position: relative; width: min(100%, calc(var(--orbit-r) * 2 + var(--chip) + 24px)); height: calc(var(--orb) + var(--chip) * 2 + 40px); }
.orbit { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.orbit li { position: absolute; left: 0; top: 0; width: var(--chip); height: var(--chip); will-change: transform; pointer-events: auto; }
.track { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.track path { fill: none; stroke: rgba(255,107,74,.28); stroke-width: 1.2; stroke-dasharray: 2 5; }
.track.back { z-index: 2; } .track.front { z-index: 30; }
.orb { z-index: 10; position: absolute; left: 50%; top: 50%; margin: calc(var(--orb) / -2) 0 0 calc(var(--orb) / -2); }
.chip {
  width: 100%; height: 100%; border-radius: 14px; display: grid; place-items: center;
  background: var(--card-solid); box-shadow: var(--shadow); border: 1px solid var(--line);
  position: relative; transition: box-shadow .5s var(--ease);
}
.chip img, .chip svg { width: 58%; height: 58%; object-fit: contain; border-radius: 5px; }
.chip.lit { outline: 2px solid var(--accent); outline-offset: 0; box-shadow: var(--shadow-lg); }
.chip.used::after {
  content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--card-solid); opacity: 0; transition: opacity .4s;
}
.chip.used.lit::after, .chip.used.done::after, .demo.show-used .chip.used::after { opacity: 1; }
.chip .tip {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; color: var(--ink-2); background: var(--card-solid);
  padding: 2px 8px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; pointer-events: none;
}
.chip:hover .tip { opacity: 1; }

/* Voice: radial bars driven by the loudness of the narration */
.voice { position: absolute; left: 50%; top: 50%; width: calc(var(--orb) * 2.1); height: calc(var(--orb) * 2.1); transform: translate(-50%, -50%); z-index: 9; pointer-events: none; }
.orb-core-wrap { position: absolute; inset: 0; }

/* Speaking ripple: shows when the voice is talking, in any state */
.orb::before, .orb::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(255,107,74,.45);
  opacity: 0; pointer-events: none;
}
.orb.talking::before { animation: ripple 1.6s ease-out infinite; }
.orb.talking::after { animation: ripple 1.6s ease-out .8s infinite; }
@keyframes ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* Glossy orb */
.orb { width: var(--orb); height: var(--orb); border-radius: 50%; }
.orb-core {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff 0%, rgba(255,255,255,.0) 34%),
    radial-gradient(circle at 70% 78%, rgba(255,107,74,.55) 0%, rgba(255,107,74,0) 55%),
    conic-gradient(from 210deg, #ffd9cc, #ffb39e, #ffe8de, #f7c3b3, #ffd9cc);
  box-shadow:
    inset -14px -18px 36px rgba(170, 70, 40, .28),
    inset 10px 12px 24px rgba(255,255,255,.7),
    0 30px 60px rgba(255, 107, 74, .22),
    0 8px 18px rgba(80, 40, 20, .12);
  animation: breathe 5s ease-in-out infinite;
}
.orb-shine {
  position: absolute; left: 18%; top: 10%; width: 46%; height: 30%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.95), rgba(255,255,255,0) 70%);
  filter: blur(2px); pointer-events: none;
}
.orb-ring { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid transparent; transition: border-color .4s; }

.demo[data-state="working"] .orb-core {
  background:
    radial-gradient(circle at 34% 28%, #fff 0%, rgba(255,255,255,0) 34%),
    conic-gradient(from 0deg, #ffd0c1, #ff9d82, #ffe5db, #ffb8a3, #ffd0c1);
  animation: breathe 2.4s ease-in-out infinite, hue 3s linear infinite;
}
.demo[data-state="needs-you"] .orb-ring { border-color: var(--accent); animation: ping 1.6s ease-out infinite; }
.demo[data-state="needs-you"] .orb-core { box-shadow: inset -14px -18px 36px rgba(170,70,40,.3), inset 10px 12px 24px rgba(255,255,255,.7), 0 30px 60px rgba(255,107,74,.35); }

@keyframes breathe { 50% { transform: scale(1.025); } }
@keyframes talk { from { transform: scale(1); } to { transform: scale(1.045); } }
@keyframes hue { to { filter: hue-rotate(18deg); } }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

.orb-now { margin: 0 0 8px; font-size: 13px; color: var(--ink); min-height: 1.4em; font-weight: 500; }
.orb-status { margin: 14px 0 0; font-size: 13px; letter-spacing: .02em; color: var(--ink-2); text-transform: uppercase; }
.legend { margin: 0; font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d8d6d1; display: inline-block; margin-left: 8px; }
.dot.used { background: var(--ok); margin-left: 0; }

/* Board */
.board { grid-area: board; padding: 24px 0 8px; height: max(400px, calc(100dvh - 150px)); overflow: hidden; transition: opacity 1s var(--ease) .5s, transform 1.6s var(--glide); }
.demo[data-layout="center"] .board { opacity: 0; transform: translateX(40px); pointer-events: none; transition: opacity .3s, transform .3s; }
/* Scenes stack in one grid cell so the old one fades out in place while the new one fades in. Nothing shifts. */
.scenes { display: grid; }
.scene { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 72px;
  /* Scaled down to fit the screen height when a scene is taller than the board (set by app.js). */
  scale: var(--fit, 1); transform-origin: top left; width: calc(100% / var(--fit, 1)); transition: scale .5s var(--ease), width .5s var(--ease); align-self: start; animation: sceneIn .7s var(--ease) both; }
.scene.leaving { animation: sceneOut .5s var(--ease) both; pointer-events: none; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-10px); filter: blur(4px); } }
.scene-head { margin-bottom: 2px; }
.scene-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #a63b1c; margin: 0 0 4px; }
.scene-title { font-size: 22px; font-weight: 500; letter-spacing: -.015em; margin: 0; }
.scene-sub { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }

/* Which connector does which job */
.connectors { padding: 12px 14px; }
.conn { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; transition: background .4s var(--ease); }
.conn + .conn { border-top: 1px solid var(--line); }
.conn.on { background: #fff4f0; }
.conn .task { font-size: 13.5px; color: var(--ink-2); }
.conn.on .task { color: var(--ink); font-weight: 500; }
.conn .logos { display: flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.connectors .logo { flex: none; width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.connectors .logo img, .connectors .logo svg { width: 14px; height: 14px; object-fit: contain; border-radius: 3px; }
.badge { font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.badge.real { background: var(--ok-soft); color: #1f7a50; }
.badge.ill { background: #ecebe8; color: #5e5e62; }
.conn-summary { display: none; gap: 6px; flex-wrap: wrap; }
.cs { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--card-solid); border: 1px solid var(--line); }
.connectors { transition: padding .4s var(--ease); }
.connectors.compact { padding: 10px 14px; }
.connectors.compact .conn, .connectors.compact .also { display: none; }
.connectors.compact .conn-summary { display: flex; animation: fadeOnly .4s var(--ease) both; }
.connectors.compact h3 { margin-bottom: 6px; }
.also { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); padding: 8px 4px 2px; }
.cards { display: grid; gap: 12px; }

.card {
  background: var(--card); backdrop-filter: blur(16px); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px;
  animation: cardIn .55s var(--ease) both;
}
.card.out { animation: cardOut .35s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes cardOut { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.card.absorb { animation: absorb .7s cubic-bezier(.5,0,.75,0) both; }
@keyframes absorb { to { opacity: 0; transform: translateX(-160px) scale(.6); filter: blur(3px); } }

/* Hand-off cards that fill the pauses between acts */
.handoff { display: grid; gap: 12px; }
.flow { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--card-solid); border: 1px solid var(--line); white-space: nowrap; }
.pill.to { background: var(--ink); color: #fff; border-color: var(--ink); }
.wire { position: relative; flex: 1; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.wire i { position: absolute; top: -2px; width: 34%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: travel 1s linear infinite; }
@keyframes travel { from { left: -34%; } to { left: 100%; } }
.progress { height: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.timelapse { display: flex; align-items: baseline; gap: 16px; }
.timelapse .day { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timelapse .inbox { font-size: 14px; color: var(--ink-2); }
.timelapse .inbox b { font-variant-numeric: tabular-nums; color: var(--ink); }
.skeleton { display: grid; gap: 8px; }
.skeleton span { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-2), #fff, var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.receipt.print { animation: print .9s var(--ease) both; transform-origin: top; }
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-10px); } to { clip-path: inset(0 0 0 0); } }
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }

.tag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; }
.tag.m { background: var(--ok-soft); color: #1f7a50; }
.tag.e { background: #fff1d6; color: #8a5a10; }
.tag.i { background: #ecebe8; color: #5e5e62; }
.role { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--ink-2); background: var(--card-solid); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: var(--card-solid); border-radius: 12px; padding: 10px; border: 1px solid var(--line); }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); }

.rows { margin-top: 10px; display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 1.1fr 0.8fr 1fr 1.3fr; gap: 8px; font-size: 12.5px; padding: 8px 10px; background: var(--card-solid); border-radius: 10px; border: 1px solid var(--line); animation: cardIn .45s var(--ease) both; }
.row .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-2); }
.more { font-size: 12px; color: var(--muted); padding: 2px 10px; }
.segs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.seg { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: #9a3a22; }

.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.emails { position: relative; height: 140px; margin-top: 6px; }
.email { position: absolute; left: 0; right: 0; background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow); transition: transform .6s var(--ease); }
.email b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.email:nth-child(1) { transform: translateY(0) rotate(-1.2deg); }
.email:nth-child(2) { transform: translateY(26px) rotate(.6deg); }
.email:nth-child(3) { transform: translateY(52px) rotate(-.4deg); }
.visual img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; display: block; margin-top: 6px; }

.tray { border: 1.5px dashed rgba(255,107,74,.5); background: rgba(255,240,235,.7); }
.tray-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.btn-approve {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px;
  background: var(--ink); color: #fff; transition: transform .15s var(--ease), background .3s;
}
.btn-approve.pressed { transform: scale(.95); }
.btn-approve.sent { background: #1f7a50; }
.sent-note { font-size: 13px; color: #1f7a50; font-weight: 600; }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.col { background: var(--card-solid); border-radius: 12px; border: 1px solid var(--line); padding: 8px; min-height: 92px; }
.col h4 { margin: 0 0 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
.reply { font-size: 11.5px; background: var(--bg); border-radius: 8px; padding: 5px 7px; margin-bottom: 5px; animation: cardIn .4s var(--ease) both; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bar { height: 6px; border-radius: 6px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 1.2s var(--ease); }

.receipt { background: var(--card-solid); box-shadow: var(--shadow-lg); }
.receipt h3 { font-size: 16px; }
.rblock { border-top: 1px solid var(--line); padding: 10px 0; }
.rblock:first-of-type { border-top: 0; }
.rblock h4 { margin: 0 0 6px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.rline { display: flex; justify-content: space-between; font-size: 13.5px; padding: 2px 0; }
.rline b { font-variant-numeric: tabular-nums; }
.receipt details { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.receipt summary { cursor: pointer; color: var(--muted); }
.receipt ul { margin: 6px 0 0; padding-left: 18px; }
.fine { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.link-projects {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 11px 18px; border-radius: 999px;
  background: #b3401f; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
}


.foot { grid-area: foot; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 11.5px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Intro memo */
.memo { background: #fffdf9; padding: 22px 24px; }
.memo-meta { margin: 0 0 12px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.memo blockquote { margin: 0; font-size: 24px; line-height: 1.35; letter-spacing: -.015em; font-weight: 400; color: var(--ink); }
.memo-src { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); }
.memo-next { margin: 14px 0 0; font-size: 14px; color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.memo-next.on { opacity: 1; transform: none; }
.memo.mine .memo-lead { font-size: 20px; letter-spacing: -.01em; margin: 0 0 10px; }
.memo-steps { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 8px; font-size: 16px; }
.memo-steps li { opacity: 0; transform: translateX(-8px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.memo-steps li.on { opacity: 1; transform: none; }

/* Venture pipeline */
.chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 10px; }
.chain span { padding: 3px 9px; border-radius: 999px; background: var(--bg-2); }
.chain span:first-child { background: none; padding-left: 0; font-weight: 600; color: var(--ink); }
.chain b { font-size: 11px; color: #1f7a50; background: var(--ok-soft); border-radius: 999px; padding: 2px 8px; }
.vsteps { display: grid; gap: 6px; }
.vstep { display: grid; grid-template-columns: 150px auto 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-solid);
  opacity: .45; transition: opacity .45s var(--ease), background .45s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease); }
.vstep.seen { opacity: .85; }
.vstep.on { opacity: 1; background: #fff4f0; transform: translateX(4px); outline: 1.5px solid var(--accent); outline-offset: -1px; }
.vname { font-size: 14px; font-weight: 500; }
.vstep .logos { display: flex; gap: 4px; }
.vtools { font-size: 12px; color: var(--ink-2); }
.venture .logo, .plugs .logo { flex: none; width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.venture .logo img, .venture .logo svg, .plugs .logo img, .plugs .logo svg { width: 14px; height: 14px; object-fit: contain; border-radius: 3px; }
.plugs .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.gl { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-solid);
  opacity: 0; transform: scale(.92); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.gl.on { opacity: 1; transform: none; }
.gl em { font-style: normal; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Approval tray sits under the orb, next to what the voice is saying */
.stage-slot { width: min(100%, 380px); margin-top: 6px; min-height: 128px; }
.demo[data-layout="center"] .stage-slot { min-height: 0; }
.stage-slot .tray { animation: cardIn .55s var(--ease) both; text-align: left; }
.stage-slot .tray.leave { animation: cardOut .4s var(--ease) both; }

/* Closing end card under the orb */
.endcard { display: flex; gap: 10px; justify-content: center; margin-top: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.endcard.show { opacity: 1; transform: none; pointer-events: auto; }
.endcard .link-projects { margin-top: 0; }
.btn-quiet-pill { border: 1px solid var(--line); background: var(--card-solid); border-radius: 999px; padding: 11px 18px; font-size: 14px; color: var(--ink-2); }

/* Phones: a small orb with the current line stays on screen once the big orb scrolls away */
.mini { display: none; }
@media (max-width: 900px) {
  .mini { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 18px; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .35s var(--ease), transform .35s var(--ease); }
  .mini.show { opacity: 1; transform: none; }
  .mini-orb { flex: none; width: 34px; height: 34px; border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff 0%, rgba(255,255,255,0) 40%), conic-gradient(from 210deg, #ffd9cc, #ffb39e, #ffe8de, #f7c3b3, #ffd9cc);
    box-shadow: inset -4px -5px 10px rgba(170,70,40,.28), 0 6px 14px rgba(255,107,74,.25); }
  .mini-text { font-size: 14px; line-height: 1.35; color: var(--ink); }
  .scene .card:last-child { margin-bottom: 72px; }
}

/* Start overlay */
.start { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(246,244,240,.72); backdrop-filter: blur(10px); transition: opacity .5s var(--ease); padding: 16px; }
.start.gone { opacity: 0; pointer-events: none; }
.start-inner { max-width: 460px; text-align: center; }
.start h1 { font-size: 30px; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 10px; }
.start p { color: var(--ink-2); margin: 0 0 22px; }
.btn-primary { border: 0; border-radius: 999px; padding: 13px 24px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; }
.btn-quiet { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; }

/* Short laptop screens: smaller orb and text so the stage fits without scrolling */
@media (min-width: 901px) and (max-height: 840px) {
  :root { --orb: 124px; --chip: 34px; }
  .orbit-wrap { height: calc(var(--orb) + var(--chip) + 28px); }
  .orb-now { display: none; }
  .stage-slot { min-height: 96px; }
  .demo { padding: 12px 40px 6px; }
  .foot { padding-top: 4px; font-size: 11px; }
  .stage { padding: 8px 0; top: 56px; }
  .say { font-size: 18px; min-height: 2.6em; margin-top: 6px; }
  .orb-status { margin-top: 8px; }
  .stage-slot .tray { padding: 10px 14px; }
  .stage-slot .tray p { font-size: 13px; }
  .visual img { aspect-ratio: 16/10; }
  .emails { height: 118px; }
  .email { padding: 8px 10px; }
  .col { min-height: 70px; }
  .reply { padding: 3px 6px; margin-bottom: 3px; }
  .scene-sub, .scene .card:not(.receipt):not(.memo) .fine { display: none; }
  .scene-title { font-size: 19px; }
  .stats .stat { padding: 7px 9px; }
  .row { padding: 5px 8px; }
}

/* Mobile */
@media (max-width: 900px) {
  :root { --orb: 96px; --orbit-r: 150px; --chip: 32px; }
  .demo { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "board" "foot"; padding: 12px 16px; gap: 0; }
  .stage { position: relative; top: 0; min-height: 0; }
  .demo[data-layout="center"] .stage { transform: none; min-height: 70vh; }
  .demo[data-layout="center"] .board { display: none; }
  .say { font-size: 20px; min-height: 4.4em; }
  .demo[data-layout="split"] .say { font-size: 16px; min-height: 3em; margin-top: 8px; }
  .board { min-height: 0; height: auto; overflow: visible; padding-top: 8px; }
  .scene { scale: none; width: auto; }
  .stage-slot { width: 100%; }
  .scene-title { font-size: 19px; }
  .vstep { grid-template-columns: 1fr auto; }
  .vtools { display: none; }
  .memo blockquote { font-size: 20px; }
  .stage { padding: 8px 0 0; }
  .orb-status { margin-top: 12px; }
  .board { min-height: 0; padding: 12px 0; justify-content: flex-start; }
  .legend { font-size: 11px; }
  .brand { font-size: 14px; }
  .chip .tip { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr 1fr; }
  .split, .minis { grid-template-columns: 1fr; }
  .card, .row { scroll-margin-bottom: 96px; }
  @keyframes absorb { to { opacity: 0; transform: translateY(-120px) scale(.6); filter: blur(3px); } }
  .visual img { aspect-ratio: 16/9; }
  .ctl { padding: 6px 10px; }
}

/* Reduced motion: no spinning, no pulsing, fades only */
@media (prefers-reduced-motion: reduce) {
  .orb-core, .orb-ring, .orb::before, .orb::after, .wire i, .skeleton span { animation: none !important; }
  .card.absorb { animation: fadeOut .2s linear both !important; }
  .card, .row, .reply { animation: fadeOnly .2s linear both !important; }
  .bar i { transition: none; }
}
@keyframes fadeOnly { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* Phones (added for the site): one screen, no page jumps. In the split layout the big orb steps aside;
   the story scrolls inside its own panel and the caption bar at the bottom carries the narration.
   The approval tray (stage slot) stays visible above the story. */
@media (max-width: 900px) {
  html, body { height: 100%; }
  .demo { min-height: 0; height: 100svh; grid-template-rows: auto auto 1fr auto; padding: 10px 14px 0; overflow: hidden; }
  .topbar { height: 40px; gap: 8px; }
  .controls { gap: 6px; }
  .ctl { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
  .standalone .brand { visibility: hidden; } /* the Back button and controls need the room */
  .demo[data-layout="center"] .stage { min-height: 0; align-self: center; }
  .demo[data-layout="center"] { grid-template-rows: auto 1fr 0 auto; }
  .demo[data-layout="split"] .stage { padding: 0; }
  .demo[data-layout="split"] :is(.orbit-wrap, .orb-status, .say, .orb-now) { display: none; }
  .demo[data-layout="split"] .stage-slot { min-height: 0; }
  .demo[data-layout="split"] .stage-slot:empty { display: none; }
  .demo[data-layout="split"] .stage-slot .tray { margin: 6px 0 4px; }
  .board { height: auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 92px; scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .demo[data-layout="split"] .foot { display: none; }
  .foot { padding: 6px 0 10px; }
  .mini { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
