@font-face { font-family: 'Space Grotesk'; font-weight: 400; src: url('/fonts/space-grotesk-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; src: url('/fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; src: url('/fonts/space-grotesk-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; src: url('/fonts/space-grotesk-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; src: url('/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --navy: #0F1B2D; --navy-2: #1B2B44; --navy-3: #2C3F5E;
  --paper: #F6F4EF; --card: #FFFDF9; --line: #E3DED3; --ink: #0F1B2D; --muted: #5B6676;
  --blue: #1F5BD8; --orange: #F28C28; --orange-d: #A64D05; --teal: #2BB3A3;
  --tint-blue: #E5ECFB; --tint-orange: #FBEBDC; --ok: #1E8E5A; --bad: #C2413B;
  --A: #4C8DF6; --B: #F28C28; --C: #2BB3A3; --D: #F2C94C;
  --radius: 14px;
  --font: 'IBM Plex Sans', system-ui, sans-serif; --display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; }
.muted { color: var(--muted); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange-d); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* buttons */
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.orange { background: var(--orange); color: var(--navy); }
.btn.blue { background: var(--blue); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px dashed var(--line); }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid #f0c9c6; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.icon-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; background: var(--tint-blue); color: var(--navy); }
.pill.orange { background: var(--tint-orange); color: var(--orange-d); }
.pill.ok { background: #DDF2E6; color: var(--ok); }
.pill.bad { background: #F8DEDC; color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.on { background: #33B26B; } .dot.off { background: #C9CED6; }
input[type=text], input[type=password], textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 16px; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(31, 91, 216, .25); border-color: var(--blue); }
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }

/* letter chips */
.letter { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--navy); flex: none; }
.letter.A { background: var(--A); } .letter.B { background: var(--B); } .letter.C { background: var(--C); } .letter.D { background: var(--D); }

/* option chips for boards */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 500; min-height: 40px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip:disabled { cursor: default; }
.chip.right { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }

/* bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 40px 1fr 44px; gap: 10px; align-items: center; }
.bar .track { height: 14px; background: #ECE8DF; border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--orange); color: var(--navy); text-align: center; font-weight: 600; font-size: 14px; padding: 6px; z-index: 90; }

/* slide stage */
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); border-radius: 12px; }
.stage-inner { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
.stage-inner * { box-sizing: border-box; margin: 0; }
.stage-inner section { position: relative; width: 1920px; height: 1080px; overflow: hidden; }
.stage-inner table { border-collapse: collapse; width: 100%; }
.stage-inner th { text-align: left; padding: 12px 16px; border-bottom: 2px solid #0F1B2D; font-weight: 600; }
.stage-inner td { padding: 12px 16px; border-bottom: 1px solid #E3DED3; vertical-align: top; }
.stage-inner ul, .stage-inner ol { padding-left: 1.2em; }
.stage-inner li { margin-bottom: .4em; }
.stage-inner [data-built] { animation: built-pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.stage-inner [data-built="rise"] { animation: built-rise .5s ease-out both; }
@keyframes built-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes built-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stage-inner [data-built] { animation: none; } }
