/* Shared deck styles: tokens (dark-first, light via data-theme / prefers-color-scheme), stage, components, chrome. */
/* Layout: a fixed 1600×900 stage scaled to fit; dark-first "night shift" palette, one colour per lifecycle stage. */
:root {
  color-scheme: dark;
  --bg: #0e1320;
  --bg-2: #141b2c;
  --panel: #1a2236;
  --line: #2a3550;
  --fg: #e8ecf5;
  --fg-dim: #9aa6bf;
  --fg-faint: #5e6a85;
  --villain: #ff6b7a;
  --ok: #5fd39a;
  --st-analysis: #f2b84b;
  --st-shaping: #b993f5;
  --st-planning: #4fd1c5;
  --st-development: #6aa8ff;
  --st-maintenance: #ff8a65;
  --st-core: #c9d2e6;
  --term-bg: #0a0e17;
  --term-fg: #d6dde9;
  --shadow: 0 30px 80px -30px rgba(0,0,0,.6);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f1ec; --bg-2: #e9e6df; --panel: #ffffff; --line: #d5d0c5;
    --fg: #1a2030; --fg-dim: #4e5870; --fg-faint: #8a92a6;
    --villain: #d0334a; --ok: #1f8f5a;
    --st-analysis: #b07a00; --st-shaping: #7a4fd0; --st-planning: #0f8a80;
    --st-development: #2a63c9; --st-maintenance: #cc4f26; --st-core: #4e5870;
    --term-bg: #151a26; --term-fg: #d6dde9;
    --shadow: 0 30px 60px -30px rgba(40,40,60,.35);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f1ec; --bg-2: #e9e6df; --panel: #ffffff; --line: #d5d0c5;
  --fg: #1a2030; --fg-dim: #4e5870; --fg-faint: #8a92a6;
  --villain: #d0334a; --ok: #1f8f5a;
  --st-analysis: #b07a00; --st-shaping: #7a4fd0; --st-planning: #0f8a80;
  --st-development: #2a63c9; --st-maintenance: #cc4f26; --st-core: #4e5870;
  --term-bg: #151a26; --term-fg: #d6dde9;
  --shadow: 0 30px 60px -30px rgba(40,40,60,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--f-body); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--c, var(--st-development)); outline-offset: 3px; }

/* ---------- viewport & stage ---------- */
#viewport { position: fixed; inset: 0; overflow: hidden; touch-action: pan-y; }
#viewport .stage { position: absolute; left: 50%; top: 50%; transform-origin: center center; }
.stage {
  width: 1600px; height: 900px; position: relative; flex: none;
  transform-origin: center center; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 100% 0%, color-mix(in srgb, var(--c, var(--st-core)) 9%, transparent), transparent 70%),
    var(--bg);
}
.stage::before { /* faint engineering grid */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; opacity: .18;
  mask-image: linear-gradient(180deg, #000 0%, transparent 60%);
}

/* ---------- slide typography ---------- */
.slide {
  position: absolute; inset: 0; padding: 72px 96px 96px;
  display: flex; flex-direction: column; gap: 28px;
  font-size: 24px; line-height: 1.45;
}
.slide.center { justify-content: center; }
.slide > * { flex-shrink: 0; }
.slide > .fill { flex-shrink: 1; }
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 18px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c, var(--fg-dim));
}
.eyebrow::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--c, var(--fg-dim)); }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: 104px; line-height: .98; font-weight: 800; }
h2 { font-size: 60px; line-height: 1.05; font-weight: 800; }
h3 { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.lead { font-size: 30px; line-height: 1.4; color: var(--fg-dim); max-width: 1180px; }
.dim { color: var(--fg-dim); }
.small { font-size: 20px; }
.mono { font-family: var(--f-mono); }
code, .code { font-family: var(--f-mono); font-size: .88em; background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .08em .35em; border-radius: 6px; }
b, strong { font-weight: 600; color: var(--fg); }
em.hl { font-style: normal; color: var(--c, var(--st-core)); }
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
ul.clean li { position: relative; padding-left: 34px; }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--fg-dim)); }
ul.clean.x li::before { content: "✕"; top: 0; width: auto; height: auto; background: none; color: var(--villain); font-weight: 600; }
ul.clean.ok li::before { content: "✓"; top: 0; width: auto; height: auto; background: none; color: var(--ok); font-weight: 600; }

.grid { display: grid; gap: 28px; min-height: 0; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2-wide { grid-template-columns: 1.25fr 1fr; }
.fill { flex: 1; min-height: 0; }
.row.tight .chip { font-size: 16px; padding: 4px 10px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.panel.tint { background: color-mix(in srgb, var(--c, var(--st-core)) 10%, var(--panel)); border-color: color-mix(in srgb, var(--c, var(--st-core)) 40%, var(--line)); }
.label { font-family: var(--f-mono); font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-faint); }
.tag {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 15px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-dim);
  white-space: nowrap;
}
.tag.user { border-color: color-mix(in srgb, var(--st-analysis) 60%, transparent); color: var(--st-analysis); }
.tag.model { border-color: color-mix(in srgb, var(--st-planning) 60%, transparent); color: var(--st-planning); }

/* ---------- skill chips ---------- */
.chip {
  --cc: var(--c, var(--st-core));
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 20px; font-weight: 500;
  padding: 7px 14px; border-radius: 10px; cursor: pointer;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
  transition: transform .15s, background .2s, box-shadow .3s, opacity .3s;
  white-space: nowrap;
}
.chip:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--cc) 22%, transparent); }
.chip.model::after { content: "◦"; opacity: .7; }
.chip.big { font-size: 28px; padding: 10px 18px; border-radius: 12px; }
.chip.dimmed { opacity: .28; }
.chip.lit { background: var(--cc); color: var(--bg); box-shadow: 0 0 0 6px color-mix(in srgb, var(--cc) 25%, transparent), 0 0 40px color-mix(in srgb, var(--cc) 60%, transparent); }

/* ---------- fragments ---------- */
[data-f] { transition: opacity .45s ease, transform .45s ease, filter .45s; }
[data-f]:not(.on) { opacity: 0; transform: translateY(14px); pointer-events: none; }
.stage.all [data-f] { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- lifecycle map ---------- */
.map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; position: relative; }
.map-col {
  --c: var(--st);
  border-radius: 16px; padding: 18px 16px 20px; min-height: 250px;
  background: color-mix(in srgb, var(--st) 7%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--st) 30%, var(--line));
  display: flex; flex-direction: column; gap: 12px; position: relative;
  transition: opacity .4s, transform .4s;
}
.map-col:not(:last-child)::after { /* flow arrow */
  content: ""; position: absolute; right: -14px; top: 34px; width: 14px; height: 2px; background: var(--st);
}
.map-col h4 { margin: 0; font-family: var(--f-display); font-size: 26px; font-weight: 800; color: var(--st); }
.map-col .sub { font-size: 16px; color: var(--fg-dim); line-height: 1.35; min-height: 44px; }
.map-col .chips { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.map-col .chip { font-size: 17px; padding: 5px 10px; }
.map.focus .map-col:not(.on) { opacity: .35; }
.map-under { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.map-under .band {
  border: 1px dashed var(--line); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.map-under .band .label { margin-right: 6px; }
.map-under .chip { font-size: 17px; padding: 5px 10px; }
.loopback {
  margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 17px; color: var(--st-maintenance);
  font-family: var(--f-mono);
}
.loopback .bar { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--st-maintenance) 0 10px, transparent 10px 18px); }

/* ---------- terminal ---------- */
.term {
  background: var(--term-bg); color: var(--term-fg); border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid #253049; font-family: var(--f-mono); font-size: 19px; line-height: 1.5;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #253049; color: #7f8aa3; font-size: 15px; }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; background: #3a4560; display: inline-block; }
.term-bar span { margin-left: 10px; }
.term-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ln { white-space: pre-wrap; }
.t-compact .term { font-size: 17px; line-height: 1.42; }
.t-compact .term-body { gap: 6px; padding: 14px 20px; }
.ln.cmd { color: #ffffff; }
.ln.cmd::before { content: "❯ "; color: #6aa8ff; }
.ln.q { color: #f2b84b; }
.ln.q::before { content: "agent  "; color: #7f8aa3; }
.ln.a { color: #c9d2e6; }
.ln.a::before { content: attr(data-who) "  "; color: #b993f5; }
.ln.fl { color: #4fd1c5; }
.ln.red { color: #ff6b7a; }
.ln.warn { color: #f2b84b; }
.ln.green { color: #5fd39a; }
.ln.mut { color: #7f8aa3; }
.ln.done { color: #5fd39a; font-weight: 600; }
.ln.on.type { animation: type .6s steps(28) both; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- villain cards ---------- */
.flip { perspective: 1400px; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; height: 100%; }
.flip-in { position: relative; height: 100%; min-height: 470px; transition: transform .7s cubic-bezier(.3,.7,.2,1); transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; padding: 28px 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.face.front {
  background: linear-gradient(170deg, color-mix(in srgb, var(--villain) 18%, var(--panel)), var(--panel) 60%);
  border: 1px solid color-mix(in srgb, var(--villain) 45%, var(--line));
}
.face.back {
  transform: rotateY(180deg); background: color-mix(in srgb, var(--ok) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line));
}
.face .num { font-family: var(--f-display); font-weight: 800; font-size: 80px; line-height: 1; color: var(--villain); opacity: .9; }
.face.back .num { color: var(--ok); font-size: 22px; font-family: var(--f-mono); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.face h3 { font-size: 32px; }
.face p { font-size: 20px; color: var(--fg-dim); }
.face .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.face .chip { font-size: 16px; padding: 5px 10px; }
.face .hint { margin-top: auto; font-family: var(--f-mono); font-size: 14px; color: var(--fg-faint); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- quote slides ---------- */
.quote { font-family: var(--f-display); font-weight: 600; font-size: 76px; line-height: 1.05; letter-spacing: -.025em; max-width: 1300px; text-wrap: balance; }
.quote::before { content: "“"; color: var(--qc, var(--villain)); }
.quote::after { content: "”"; color: var(--qc, var(--villain)); }
.rv { position: relative; padding: 12px 0 12px 38px; font-size: 21px; border-top: 1px solid var(--line); }
.rv::before { position: absolute; left: 4px; top: 12px; font-weight: 700; }
.rv.ok::before { content: "✓"; color: var(--ok); }
.rv.warn::before { content: "⚠"; color: var(--st-analysis); }
.rv.bad::before { content: "✕"; color: var(--villain); }
.cite { font-family: var(--f-mono); font-size: 20px; color: var(--fg-dim); }
.villain-tag {
  align-self: flex-start; display: inline-flex; gap: 12px; align-items: center;
  font-family: var(--f-mono); font-size: 18px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--villain); border: 1px solid color-mix(in srgb, var(--villain) 50%, transparent);
  padding: 8px 16px; border-radius: 999px;
}

/* ---------- story bubbles ---------- */
.story { display: grid; grid-template-columns: 220px 1fr; gap: 18px 28px; align-items: start; }
.story .when { font-family: var(--f-mono); font-size: 17px; color: var(--fg-faint); padding-top: 14px; text-align: right; }
.bubble {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px;
  padding: 14px 20px; font-size: 24px; max-width: 1050px;
}
.bubble .who { display: block; font-family: var(--f-mono); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.bubble.sofie .who { color: var(--st-analysis); }
.bubble.karim .who { color: var(--st-development); }
.bubble.agent .who { color: var(--st-shaping); }
.bubble.bad { border-color: color-mix(in srgb, var(--villain) 55%, var(--line)); }
.punch { font-family: var(--f-display); font-size: 48px; font-weight: 800; letter-spacing: -.02em; }
.punch span { color: var(--villain); }

/* ---------- code file ---------- */
.file {
  background: var(--term-bg); color: var(--term-fg); border-radius: 14px; border: 1px solid #253049;
  font-family: var(--f-mono); font-size: 17px; line-height: 1.5; overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.file .fname { padding: 10px 16px; border-bottom: 1px solid #253049; color: #7f8aa3; font-size: 14px; display: flex; justify-content: space-between; }
.file pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; font: inherit; }
.file.compact { font-size: 15px; line-height: 1.42; }
.file .k { color: #b993f5; } .file .s { color: #f2b84b; } .file .c { color: #6c7894; } .file .h { color: #6aa8ff; font-weight: 600; }
.file .mark { background: rgba(242,184,75,.16); border-radius: 4px; }

/* ---------- misc components ---------- */
.callout { display: flex; gap: 16px; align-items: center; padding: 16px 22px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--st-core)) 12%, transparent); border-left: 4px solid var(--c, var(--st-core)); font-size: 22px; }
.callout.sm { font-size: 20px; padding: 12px 18px; }
.ring .r { font-size: 18px; }
.arrow { color: var(--fg-faint); font-family: var(--f-mono); }
.pipe { display: flex; align-items: stretch; gap: 0; }
.pipe .step {
  flex: 1; padding: 20px 18px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; position: relative; min-width: 0;
}
.pipe .step:first-child { border-radius: 16px 0 0 16px; }
.pipe .step:last-child { border-radius: 0 16px 16px 0; }
.pipe .step + .step { border-left: 0; }
.pipe .step .n { font-family: var(--f-mono); font-size: 15px; color: var(--fg-faint); }
.pipe .step p { font-size: 19px; color: var(--fg-dim); }
.pipe .step.key { background: color-mix(in srgb, var(--c) 12%, var(--panel)); }

.slices { display: grid; grid-template-columns: 110px repeat(4, 1fr); gap: 6px; font-size: 17px; }
.slices .lay { font-family: var(--f-mono); color: var(--fg-dim); display: flex; align-items: center; font-size: 15px; }
.slices .cell { height: 54px; border-radius: 8px; background: color-mix(in srgb, var(--fg) 7%, transparent); transition: background .4s, box-shadow .4s; }
.slices .colh { font-family: var(--f-mono); font-size: 14px; color: var(--fg-faint); text-align: center; }
.slices[data-mode="v"] .cell[data-col="1"] { background: color-mix(in srgb, var(--st-planning) 70%, transparent); }
.slices[data-mode="v"] .cell[data-col="2"] { background: color-mix(in srgb, var(--st-planning) 40%, transparent); }
.slices[data-mode="h"] .cell[data-row="1"] { background: color-mix(in srgb, var(--villain) 60%, transparent); }
.slices[data-mode="h"] .cell[data-row="2"] { background: color-mix(in srgb, var(--villain) 30%, transparent); }
.toggle { align-self: flex-start; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.toggle button { background: none; border: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 17px; color: var(--fg-dim); }
.toggle button.on { background: var(--c, var(--st-core)); color: var(--bg); font-weight: 600; }

.tix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; align-items: center; position: relative; }
.tix .colum { display: flex; flex-direction: column; gap: 16px; }
.tix .colum .label { text-align: center; }
.ticket {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--st-planning);
  border-radius: 10px; padding: 12px 14px; font-size: 18px; position: relative;
}
.ticket .id { font-family: var(--f-mono); font-size: 14px; color: var(--st-planning); display: block; }
.ticket .by { font-family: var(--f-mono); font-size: 13px; color: var(--fg-faint); display: block; margin-top: 4px; }
.tix .colum + .colum .ticket::before { content: "→"; position: absolute; left: -28px; top: 50%; transform: translateY(-50%); color: var(--fg-faint); font-size: 20px; }

.module-viz { display: flex; gap: 60px; align-items: flex-end; justify-content: center; }
.module-viz figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.module-viz .iface { height: 18px; border-radius: 6px 6px 0 0; background: var(--st-maintenance); }
.module-viz .impl { border-radius: 0 0 10px 10px; background: color-mix(in srgb, var(--st-maintenance) 25%, var(--panel)); border: 1px solid color-mix(in srgb, var(--st-maintenance) 45%, var(--line)); }
.module-viz figcaption { font-family: var(--f-mono); font-size: 16px; color: var(--fg-dim); text-align: center; }

.sm { width: 100%; height: auto; }
.sm text { font-family: var(--f-mono); fill: var(--fg); }
.sm .node rect { fill: var(--panel); stroke: var(--line); stroke-width: 2; }
.sm .node.hot rect { stroke: var(--st-maintenance); fill: color-mix(in srgb, var(--st-maintenance) 14%, var(--panel)); }
.sm .node.good rect { stroke: var(--ok); }
.sm .node.bad rect { stroke: var(--fg-faint); }
.sm .edge { stroke: var(--fg-faint); stroke-width: 2; fill: none; }
.sm .ah { fill: var(--fg-faint); }

.ring { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ring .r { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 19px; }
.ring .r.first { background: color-mix(in srgb, var(--st-maintenance) 20%, var(--panel)); border-color: var(--st-maintenance); font-weight: 600; }

.table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.3; }
.table th { text-align: left; font-family: var(--f-mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 4px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; color: var(--fg-dim); }
.table td:first-child { white-space: nowrap; }
.table .chip { font-size: 14px; padding: 2px 8px; }
.table .stg { font-family: var(--f-mono); font-size: 14px; color: var(--c); white-space: nowrap; }

.poll { display: grid; gap: 14px; }
.poll .opt { display: grid; grid-template-columns: 340px 1fr 60px 52px; gap: 16px; align-items: center; }
.poll .opt .name { font-size: 24px; font-weight: 600; }
.poll .opt .bar { height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--fg) 7%, transparent); overflow: hidden; }
.poll .opt .bar i { display: block; height: 100%; width: 0; background: var(--villain); border-radius: 10px; transition: width .5s cubic-bezier(.3,.7,.2,1); }
.poll .opt .cnt { font-family: var(--f-mono); font-size: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.btn {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; font-size: 18px; transition: background .2s;
}
.btn:hover { background: color-mix(in srgb, var(--c, var(--fg)) 14%, var(--panel)); }
.btn.round { width: 52px; height: 52px; padding: 0; font-size: 26px; border-radius: 50%; }

.phase { display: flex; flex-direction: column; gap: 12px; }
.phase .when { font-family: var(--f-mono); font-size: 16px; color: var(--c); letter-spacing: .08em; text-transform: uppercase; }

.journey-cap {
  min-height: 74px; display: flex; align-items: center; gap: 18px; font-size: 26px;
  padding: 14px 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
.journey-cap .n { font-family: var(--f-display); font-weight: 800; font-size: 40px; color: var(--c, var(--st-core)); min-width: 50px; }

.title-bars { display: flex; gap: 10px; margin-top: 10px; }
.title-bars i { height: 10px; flex: 1; border-radius: 6px; background: var(--st); transform-origin: left; animation: grow .9s cubic-bezier(.3,.7,.2,1) both; }
.title-bars i:nth-child(2) { animation-delay: .1s; } .title-bars i:nth-child(3) { animation-delay: .2s; }
.title-bars i:nth-child(4) { animation-delay: .3s; } .title-bars i:nth-child(5) { animation-delay: .4s; }
@keyframes grow { from { transform: scaleX(0); } }
.title-legend { display: flex; gap: 10px; }
.title-legend span { flex: 1; font-family: var(--f-mono); font-size: 16px; color: var(--st); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- modal (skill card) ---------- */
.modal-wrap { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 20; animation: fade .25s both; }
.modal {
  --c: var(--st-core);
  width: 980px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--c) 50%, var(--line));
  border-radius: 22px; padding: 40px 44px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px;
  animation: pop .35s cubic-bezier(.3,.7,.2,1.2) both;
}
.modal .top { display: flex; align-items: flex-start; gap: 24px; }
.modal .top .btn { margin-left: auto; flex: none; }
.modal .tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.modal h2 { font-family: var(--f-mono); font-size: 42px; line-height: 1.1; color: var(--c); letter-spacing: -.01em; flex: 1; min-width: 0; text-wrap: balance; }
.modal .purpose { font-size: 26px; }
.modal dl { display: grid; grid-template-columns: 200px 1fr; gap: 12px 24px; margin: 0; font-size: 21px; }
.modal dt { font-family: var(--f-mono); font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); padding-top: 5px; }
.modal dd { margin: 0; color: var(--fg-dim); }
.modal dd .chip { font-size: 16px; padding: 4px 9px; margin: 0 6px 6px 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } }

/* ---------- chrome (outside the stage) ---------- */
.chrome { position: fixed; z-index: 30; display: flex; gap: 8px; align-items: center; transition: opacity .4s; }
body.idle .chrome { opacity: 0; }
#topbar { top: calc(14px + env(safe-area-inset-top, 0px)); right: 16px; }
#navbar { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 16px; }
.chrome button {
  background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; cursor: pointer; font-family: var(--f-mono); font-size: 13px; color: var(--fg-dim);
}
.chrome button.on { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.chrome .count { font-family: var(--f-mono); font-size: 13px; color: var(--fg-faint); padding: 0 6px; font-variant-numeric: tabular-nums; }
#progress { position: fixed; left: 0; right: 0; bottom: 0; height: 6px; display: flex; gap: 2px; z-index: 30; }
#progress .seg { flex: var(--w); background: color-mix(in srgb, var(--fg) 10%, transparent); position: relative; overflow: hidden; cursor: pointer; }
#progress .seg i { position: absolute; inset: 0; width: var(--p, 0%); background: var(--st); transition: width .4s; }
#progress .seg:hover::after { content: attr(data-name); position: absolute; }

#blackout { position: fixed; inset: 0; background: #000; z-index: 50; }
@media (pointer: coarse) { .chrome button { min-width: 40px; min-height: 40px; font-size: 14px; } }
#rotate {
  position: fixed; z-index: 35; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--fg); font-size: 15px; box-shadow: var(--shadow);
}
#rotate span { flex: 1; min-width: 0; }
#rotate button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--fg-dim); }
#rotate[hidden] { display: none; }
@media not ((orientation: portrait) and (max-width: 700px)) { #rotate { display: none; } }

/* ---------- overview ---------- */
#overview { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow: auto; padding: 60px 16px 40px; }
#overview .og { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 18px; max-width: 1700px; margin: 0 auto; }
#overview .th { cursor: pointer; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--bg); position: relative; aspect-ratio: 16/9; max-width: 100%; }
#overview .th.cur { border-color: var(--fg); }
#overview .th .stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; }
#overview .th .n { position: absolute; left: 8px; bottom: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--fg-dim); z-index: 2; background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* ---------- presenter ---------- */
body.presenter { overflow: auto; }
body.presenter #presenter { padding-top: 64px; }
#presenter { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto 1fr; gap: 20px; padding: 20px; height: 100%; }
#presenter .pv { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: var(--bg); max-width: 100%; }
#presenter .pv .stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
#presenter .side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#presenter .clock { display: flex; gap: 24px; align-items: baseline; font-family: var(--f-mono); }
#presenter .clock .big { font-size: 56px; font-variant-numeric: tabular-nums; }
#presenter .pace { font-size: 18px; padding: 4px 10px; border-radius: 8px; }
#presenter .pace.ahead { color: var(--ok); } #presenter .pace.behind { color: var(--villain); }
#presenter .notes { grid-column: 1 / -1; font-size: 26px; line-height: 1.5; background: var(--panel); border-radius: 12px; padding: 24px 28px; overflow: auto; min-height: 0; }
#presenter .notes .ch { font-family: var(--f-mono); font-size: 15px; color: var(--fg-faint); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
#presenter .nextlbl { font-family: var(--f-mono); font-size: 13px; color: var(--fg-faint); letter-spacing: .1em; text-transform: uppercase; }
#presenter .pbtns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1000px) {
  #presenter { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  #presenter .pv#pvNext { width: 100% !important; }
  #presenter .notes { font-size: 20px; }
  #presenter .clock .big { font-size: 40px; }
}

/* ---------- print (?print) ---------- */
body.print { overflow: visible; }
body.print .stage { margin: 0 auto 20px; page-break-after: always; break-after: page; }
@media print {
  @page { size: 1600px 900px; margin: 0; }
  body.print .stage { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ---------- workflow tags (OpenSpec-style decks) ---------- */
.tag.core { border-color: color-mix(in srgb, var(--st-analysis) 60%, transparent); color: var(--st-analysis); }
.tag.optional { border-color: color-mix(in srgb, var(--st-planning) 60%, transparent); color: var(--st-planning); }

/* ---------- file browser: tree left, file right ---------- */
.fb { display: grid; grid-template-columns: 330px 1fr; gap: 20px; min-height: 0; flex: 1; }
.fb-tree { display: flex; flex-direction: column; gap: 2px; padding: 18px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-family: var(--f-mono); font-size: 17px; min-width: 0; }
.fb-tree .label { margin-bottom: 8px; }
.fb-dir { color: var(--fg-faint); padding: 6px 0; }
.fb-file {
  text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; cursor: pointer;
  color: var(--fg-dim); font-family: var(--f-mono); font-size: 17px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
}
.fb-file small { font-family: var(--f-body); font-size: 13px; color: var(--fg-faint); }
.fb-file:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.fb-file.on { color: var(--c); border-color: color-mix(in srgb, var(--c) 50%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.fb-view { min-height: 0; overflow: auto; }
.fb-hint { margin-top: auto; padding-top: 12px; font-family: var(--f-body); font-size: 15px; color: var(--fg-faint); }
.fb-view.compact { font-size: 14.5px; line-height: 1.38; }
.fb-view pre { padding-block: 12px; }
.file .ok { color: #5fd39a; } .file .warn { color: #f2b84b; } .file .del { color: #ff6b7a; } .file .add { color: #5fd39a; }

/* ---------- folder tree diagram ---------- */
.tree { font-family: var(--f-mono); font-size: 19px; line-height: 1.55; white-space: pre; color: var(--fg-dim); margin: 0; }
.tree b { color: var(--c, var(--fg)); font-weight: 500; }
.tree i { color: var(--fg-faint); font-style: normal; }
.tree .hl { color: var(--ok); }

/* ---------- artifact chain (schema order) ---------- */
.arts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.art { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); min-width: 150px; transition: background .4s, border-color .4s, opacity .4s; }
.art .mono { font-size: 14px; color: var(--fg-faint); }
.art b { font-family: var(--f-mono); font-weight: 500; color: var(--c, var(--fg)); }
.art small { font-size: 15px; color: var(--fg-dim); }
.arts[data-mode="one"] .art { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 12%, var(--panel)); }
.arts[data-mode="step"] .art { border-style: dashed; opacity: .55; }
.arts[data-mode="step"] .art:first-child { border-style: solid; opacity: 1; border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel)); }

/* ---------- effort scale ---------- */
.effort { display: flex; align-items: center; gap: 14px; font-family: var(--f-mono); font-size: 15px; color: var(--fg-dim); }
.effort .bar { flex: 1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--st-analysis), var(--st-planning), var(--st-maintenance)); }

/* ---------- growth line (specs over time) ---------- */
.grow-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: end; flex: 1; padding-bottom: 8px; }
.grow-line .tree { font-size: 19px !important; }

/* ---------- comparison table ---------- */
.table.cmp { font-size: 17px; }
.table.cmp td:first-child { color: var(--fg); font-weight: 600; white-space: normal; width: 19%; }
.table.cmp td { white-space: normal; width: 40.5%; padding: 8px 12px; }
.table.cmp th:nth-child(2) { color: var(--st-propose); }
.table.cmp th:nth-child(3) { color: var(--st-analysis); }
