@font-face { font-family: "Geist"; src: url("fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #07080c; --bg2: #0d1017;
  --ink: #f3f1ea; --ink2: rgba(243,241,234,.72); --muted: rgba(243,241,234,.48); --rule: rgba(243,241,234,.14);
  --signal: #FF4A1C; --glow: #4ee0ff; --male: #4c8dff; --female: #ff6b9d; --gold: #ffb547;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(18px, 2.4vw, 40px);
}
html[data-theme="light"] {
  --bg: #ECECE7; --bg2: #f3f3ef;
  --ink: #111111; --ink2: rgba(17,17,17,.74); --muted: #77776F; --rule: rgba(17,17,17,.14);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; }

.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.mono, .pill, .line, .opts button, .small { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.chrome { position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; padding: var(--pad); pointer-events: none; z-index: 30; }
.chrome > * { pointer-events: auto; }
.mark { font-weight: 650; font-size: 18px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.mark span { color: var(--muted); font-weight: 500; margin-left: .4em; }
.tools { display: flex; gap: 20px; align-items: center; }

.pill { background: none; border: 1px solid var(--rule); color: var(--ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: border-color .2s, color .2s; }
.pill:hover { border-color: var(--ink); }
.tools .pill { white-space: nowrap; }
@media (max-width: 430px) { .chrome:has(.tools .pill) .mark span { display: none; } .tools { gap: 14px; } }
.pill.on { border-color: var(--signal); color: var(--signal); }
.pill.busy { color: var(--muted); }
.pill:disabled { color: var(--muted); cursor: default; }

.helpwrap { position: relative; }
.help { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); background: none; color: var(--ink2); cursor: pointer; font-family: var(--mono); font-size: 13px; padding: 0; display: grid; place-items: center; transition: border-color .2s, color .2s; }
.help:hover, .helpwrap.open .help { border-color: var(--ink); color: var(--ink); }
.tip { position: absolute; top: calc(100% + 12px); right: 0; width: min(92vw, 440px); background: var(--bg2); border: 1px solid var(--rule); padding: 20px 22px 22px; display: none; z-index: 40; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.helpwrap.open .tip { display: block; }
.tip h3 { margin: 0 0 10px; font-size: 18px; font-weight: 650; letter-spacing: -.03em; }
.tip p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--ink2); }
.tip p:last-child { margin-bottom: 0; }
.tip b { font-weight: 600; color: var(--ink); }
@media (max-width: 640px) { .tip { position: fixed; left: 18px; right: 18px; top: 70px; width: auto; } }
.theme { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--ink2); }
.theme:hover { color: var(--ink); }
.theme svg { display: block; }
.theme .moon { display: none; }
html[data-theme="light"] .theme .sun { display: none; }
html[data-theme="light"] .theme .moon { display: block; }

.foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: var(--pad); gap: 24px; z-index: 5; pointer-events: none; }
.foot > * { pointer-events: auto; }
.line { color: var(--ink2); line-height: 1.6; max-width: 48vw; transition: color .2s; }
.line.warn { color: var(--signal); }

.opts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 18px; align-items: baseline; }
.opts button { background: none; border: 0; padding: 0 0 3px; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; white-space: nowrap; }
.opts button:hover { color: var(--ink); }
.opts button.on { color: var(--ink); border-bottom-color: var(--signal); }
.opts button:disabled { color: var(--rule); cursor: default; border-bottom-color: transparent; }
.opts .sep { width: 1px; height: 12px; background: var(--rule); align-self: center; }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.note { margin: 0; color: var(--muted); font-size: 10.5px; }

.big { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; z-index: 3; }
.big h1 { font-size: clamp(44px, 9vw, 150px); font-weight: 650; letter-spacing: -.05em; line-height: .95; margin: 0; }
.big small { display: block; margin-top: 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.big.a h1 { color: var(--ink); } .big.b h1 { color: var(--signal); }

.hide { display: none !important; }
.fade { transition: opacity .6s; } .fade.out { opacity: 0; }

@media (max-width: 640px) {
  :root { --pad: 18px; }
  .mark { font-size: 16px; }
  .pill { padding: 6px 10px; font-size: 11px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .side { align-items: flex-start; }
  .line { max-width: 100%; }
  .opts { flex-wrap: wrap; gap: 10px 14px; }
  .big h1 { font-size: 20vw; }
}

/* The demo's name, bottom left, with its one line under it. */
.title { display: flex; flex-direction: column; gap: 10px; max-width: 48vw; flex: 0 1 auto; }
.title h1 { font-size: 22px; font-weight: 620; letter-spacing: -.03em; margin: 0; line-height: 1; }
@media (max-width: 640px) { .title { max-width: 100%; } .title h1 { font-size: 18px; } }

/* The card: what a demo needs, before it starts. */
.veil { position: fixed; inset: 0; background: rgba(5,6,10,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 20; padding: var(--pad); }
html[data-theme="light"] .veil { background: rgba(236,236,231,.7); }
.card { --cp: clamp(24px, 4vw, 40px); width: min(100%, 600px); max-height: calc(100vh - 2 * var(--pad)); max-height: calc(100dvh - 2 * var(--pad)); display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--rule); padding: var(--cp) 0 0; }
.card h2 { font-size: 28px; font-weight: 650; letter-spacing: -.04em; line-height: 1.05; margin: 0 var(--cp) 16px; flex-shrink: 0; }
.card .body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.card .scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 var(--cp); scrollbar-width: thin; }
.card .body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(to bottom, transparent, var(--bg2)); pointer-events: none; opacity: 0; transition: opacity .25s; }
.card .body.over::after { opacity: 1; }
.card .more { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rule); background: var(--bg2); color: var(--ink); display: none; place-items: center; padding: 0; cursor: pointer; z-index: 2; animation: nudge 1.4s ease-in-out infinite; }
.card .body.over .more { display: grid; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); opacity: .75; } 50% { transform: translate(-50%, 5px); opacity: 1; } }
.card .actions { flex-shrink: 0; padding: 20px var(--cp) var(--cp); }
.card .preview { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 34vh; margin: 0 0 20px; background: var(--bg); border: 1px solid var(--rule); overflow: hidden; }
.card .preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card p, .card li { font-size: 16px; line-height: 1.5; color: var(--ink2); margin: 0 0 12px; }
.card ol { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; }
.card ol li { position: relative; padding-left: 36px; }
.card ol li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--signal); }
.card code { display: block; margin-top: 4px; font-family: var(--mono); font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.card .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pill.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.primary:hover { opacity: .9; }
.card .why { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--signal); margin: 0 0 10px; }
