/* ==========================================================================
   sloprun.dev — platform stylesheet
   Identity: instrument panel. Machine facts in mono, human words in sans.
   Green (--run) is EARNED: it appears only where something actually ran.
   Amber (--accent) is brand + interaction.
   ========================================================================== */

/* --- design tokens (verbatim from demos/tokens.css) ---------------------- */
:root {
  --bg: #F6F6F3;          /* neutral paper, not cream */
  --surface: #FFFFFF;
  --ink: #1A1D21;
  --muted: #5A6068;
  --line: #E3E2DC;
  --accent: #C05600;      /* phosphor amber, darkened for light bg */
  --accent-soft: #FFF3E6;
  --run: #1A7F37;         /* earned green */
  --run-soft: #E7F4EA;
  --danger: #C93C37;
  --radius: 10px;
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161A; --surface: #1C1F26; --ink: #E8E6E1; --muted: #9AA0A8;
    --line: #2A2E36; --accent: #FFB454; --accent-soft: #2A2118;
    --run: #3FB950; --run-soft: #16281B; --danger: #F47067;
  }
}
:root[data-theme="dark"] {
  --bg: #14161A; --surface: #1C1F26; --ink: #E8E6E1; --muted: #9AA0A8;
  --line: #2A2E36; --accent: #FFB454; --accent-soft: #2A2118;
  --run: #3FB950; --run-soft: #16281B; --danger: #F47067;
}

/* --- platform-only derived tokens ---------------------------------------- */
:root {
  --space: 4px;
  --shell: 1180px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 28px -18px rgba(20, 22, 26, .28);
  --danger-soft: #FDECEB;
}
:root[data-theme="dark"], :root:not([data-theme="light"]) { }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.7); --danger-soft: #2C1918; }
}
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.7); --danger-soft: #2C1918; }

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, iframe { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.021em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); letter-spacing: -0.026em; }
h3 { font-size: 1.09rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code, kbd, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* --- layout shell --------------------------------------------------------- */
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 20px; }
.shell--narrow { max-width: 760px; }
/* The demo is the star: give it a wider stage than the reading column so demos
   render in their intended desktop two-column layout (main + side controls)
   instead of collapsing to the stacked mobile layout and hiding controls below
   the fold. */
.shell--demo { max-width: 1140px; }
main { display: block; min-height: 60vh; padding-bottom: 72px; }
.stack > * + * { margin-top: 12px; }

/* --- header --------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__row { display: flex; align-items: center; gap: 18px; height: 60px; }
/* The mark is a shell command: `$ sloprun.dev` with a blinking cursor. Same
   three tokens as the favicon and the OG card (see lib/logo.js). */
.brand { display: inline-flex; align-items: baseline; font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.brand__prompt { color: var(--run); margin-right: .5ch; }
.brand__word { color: var(--ink); }
.brand__dot { color: var(--accent); font-weight: 600; }
.brand__cursor {
  display: inline-block; width: .5ch; height: 1em; margin-left: .35ch;
  background: var(--accent); transform: translateY(.14em);
  animation: brand-blink 1.1s steps(1, end) infinite;
}
@keyframes brand-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .brand__cursor { animation: none; } }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button { font-size: .89rem; }
.navlink {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 520; white-space: nowrap;
}
.navlink:hover { color: var(--ink); background: var(--surface); }
.navlink[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* --- theme toggle: a 3-position instrument switch ------------------------- */
.theme-switch { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme-switch button {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 5px 8px; border-radius: 999px;
}
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.theme-switch button:hover { color: var(--ink); }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: .92rem; font-weight: 560; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { padding: 6px 11px; font-size: .84rem; }
.btn--mono { font-family: var(--font-mono); font-weight: 500; }

/* --- chips: the instrument legend ---------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1; letter-spacing: .02em;
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); white-space: nowrap;
}
.chip--domain { color: var(--ink); background: var(--bg); }
/* Provenance is metadata, never a verdict: same neutral treatment for all three. */
.chip--prov { color: var(--muted); background: transparent; border-style: dashed; }
.chip--live { color: var(--run); border-color: color-mix(in srgb, var(--run) 30%, var(--line)); background: var(--run-soft); }
.chip--warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

/* The signature: proof chip. Runs are neutral; ✓ worked earns the green. */
.proof {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1; letter-spacing: .01em;
  padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.proof__runs { color: var(--ink); }
.proof__sep { opacity: .45; }
.proof__worked { color: var(--muted); }
.proof__worked--earned { color: var(--run); }
.proof b { font-weight: 600; }

.legend {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- cards ---------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.card--pad { padding: 20px; }

/* ==========================================================================
   HERO — the thesis: the story, and a demo already running beside it
   ========================================================================== */
.hero { padding: 56px 0 8px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 48px; align-items: start; }
.hero__eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.hero__eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hero h1 { margin-bottom: 22px; }
.story { font-size: 1.03rem; color: var(--ink); max-width: 56ch; }
.story p { margin-bottom: 1.05em; }
.story em { font-style: italic; color: var(--ink); }
.story strong { font-weight: 640; }
.story .story__lede { font-size: 1.16rem; line-height: 1.5; color: var(--ink); }
.story .story__kicker {
  font-family: var(--font-mono); font-size: .95rem; color: var(--ink);
  border-left: 2px solid var(--accent); padding: 4px 0 4px 14px; margin-top: 26px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* weekly-challenge hero card — mirrors the promptbar accent language so the
   whole "this week" system reads as one thing */
.hero__tagline { font-family: var(--font-mono); font-size: .9rem; color: var(--accent); margin: -14px 0 18px; letter-spacing: .01em; }
.challenge { border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); background: var(--accent-soft); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 26px; }
.challenge__tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.challenge__title { margin: 12px 0 6px; font-size: 1.3rem; line-height: 1.25; color: var(--ink); }
.challenge__blurb { margin: 0 0 16px; color: var(--muted); font-size: .95rem; max-width: 52ch; }
.challenge__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.challenge__see { color: var(--accent); text-decoration: none; font-weight: 500; font-size: .88rem; white-space: nowrap; }
.challenge__see:hover { text-decoration: underline; }

/* the demo bezel — a screen with a readout above it */
.bezel { position: sticky; top: 78px; }
.bezel__frame { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.bezel__bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--bg);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.bezel__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--run); box-shadow: 0 0 0 3px color-mix(in srgb, var(--run) 18%, transparent); }
.bezel__title { color: var(--ink); font-weight: 500; }
.bezel__spacer { flex: 1; }
.bezel__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }

/* "expand" — hand a control-heavy demo the whole viewport without letting the
   inline frame grow tall enough to bury the run/vote/share row. */
.bezel__expand {
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; white-space: nowrap;
}
.bezel__expand:hover { color: var(--ink); border-color: var(--muted); }
.bezel__expand:focus-visible { outline: 2px solid var(--run); outline-offset: 2px; }

/* the full-screen demo overlay */
.demo-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: var(--surface); }
.demo-overlay__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.demo-overlay__title { color: var(--ink); font-weight: 500; }
.demo-overlay__spacer { flex: 1; }
.demo-overlay__frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: var(--surface); }
html.demo-locked, html.demo-locked body { overflow: hidden; }

/* --- the sandbox banner: same everywhere a demo appears ------------------- */
.sandbox-note {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .01em; color: var(--muted);
  padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.sandbox-note::before { content: "🛡"; color: var(--run); }
.demo-frame { display: block; width: 100%; border: 0; background: var(--surface); }
.demo-frame--hero { height: 420px; }
/* Viewport-capped so the demo never eats the whole screen — the run buttons and
   share row always fit on one screen — while staying tall enough to be usable.
   Wide two-column demos (via .shell--demo) mostly fit; a control-heavy few keep a
   short internal scroll, and every demo has an "⛶ expand" button (in the bar
   above) that hands it the whole viewport, so nothing is ever trapped. */
.demo-frame--post { height: clamp(340px, 52vh, 520px); }
.demo-missing { padding: 40px 20px; text-align: center; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }

/* --- section rhythm ------------------------------------------------------- */
.section { padding: 64px 0 0; }
.section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.section__head .legend { margin-left: auto; }

/* --- how it works: a real 3-step sequence -------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--surface); padding: 22px 20px; }
.step__n { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: .1em; }
.step h3 { margin: 10px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* --- feed ----------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 8px 0 4px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; text-decoration: none;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab__hint { display: block; font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }

.postlist { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.postlist--grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.postlist--grid .postcard { grid-template-columns: 1fr; }
.postlist--grid .postcard__side { grid-column: 1; grid-row: auto; flex-direction: row; align-self: start; }
.postlist--grid .votebox { flex-direction: row; gap: 6px; min-width: 0; padding: 5px 10px; }
.viewtoggle { display: inline-flex; gap: 2px; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.viewtoggle a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 6px; font-size: 13px; color: var(--muted); text-decoration: none; font-family: var(--font-mono); }
.viewtoggle a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.feed-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* search + domain browse */
.searchbar { display: flex; gap: 10px; margin: 20px 0 14px; }
.searchbar__input { flex: 1; }
.domainrail { display: flex; flex-wrap: wrap; gap: 7px; }
.domainchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px; font-family: var(--font-mono); color: var(--muted);
  text-decoration: none; background: var(--surface); transition: border-color .12s ease, color .12s ease; }
.domainchip:hover { border-color: var(--accent); color: var(--accent); }
.domainchip--on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.domainchip__n { font-size: 11px; opacity: .7; }
.postcard {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; transition: border-color .12s ease, transform .12s ease;
}
.postcard:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.postcard__title { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.02em; margin: 0 0 5px; }
.postcard__title a { color: var(--ink); text-decoration: none; }
.postcard__title a:hover { color: var(--accent); }
.postcard__excerpt { color: var(--muted); font-size: .94rem; margin: 0 0 12px; }
.postcard__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; grid-column: 1; }
.postcard__side { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: center; gap: 2px; }

.votebox {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 54px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.votebox__count { font-family: var(--font-mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.votebox__label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* --- empty states --------------------------------------------------------- */
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 28px; text-align: center; background: var(--surface); }
.empty__mark { font-family: var(--font-mono); font-size: 26px; color: var(--accent); }
.empty h3 { margin: 12px 0 8px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 18px; }

/* --- post page ------------------------------------------------------------ */
.post-head { padding: 22px 0 0; }
/* Smaller than a landing hero: the demo is the star here, so the title stays
   compact and lifts the runnable frame (and its run/share row) up the page. */
.post-head h1 { font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem); margin-bottom: 10px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.byline { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; color: var(--muted); }
.byline img { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.writeup { font-size: 1.02rem; max-width: 68ch; }
.writeup h2, .writeup h3 { margin: 1.6em 0 .5em; }
.writeup ul, .writeup ol { padding-left: 1.15em; }
.writeup li { margin-bottom: .35em; }
.writeup code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .88em; }
.writeup pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
.writeup pre code { background: none; border: 0; padding: 0; font-size: .86em; }
.writeup blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 2px solid var(--accent); color: var(--muted); }

/* the run deck: everything you can do about this demo, in one instrument row */
.rundeck { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; row-gap: 12px; }
.rundeck__group { display: flex; align-items: center; gap: 10px; }
.rundeck__spacer { flex: 1 1 20px; }
.react-btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); background: var(--bg); }
.react-btn--worked[aria-pressed="true"] { color: var(--run); border-color: color-mix(in srgb, var(--run) 45%, var(--line)); background: var(--run-soft); }
.react-btn--broke[aria-pressed="true"] { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }

/* --- comments -------------------------------------------------------------- */
.comments { margin-top: 40px; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow: hidden; }
.comment__avatar img { width: 100%; height: 100%; }
.comment__head { display: flex; gap: 10px; align-items: baseline; font-size: .88rem; }
.comment__who { font-weight: 600; }
.comment__body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- forms ---------------------------------------------------------------- */
label { display: block; }
.field { margin-bottom: 16px; }
.field > .legend { display: block; margin-bottom: 6px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: .95rem;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--accent); }
.checkline { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-family: var(--font-mono); font-size: 12.5px; }
.checkline input { accent-color: var(--accent); }
.checkline small { color: var(--muted); }

/* new-post form */
.flabel { font-weight: 560; font-size: .95rem; margin-bottom: 6px; }
.flabel .legend { font-weight: 400; margin-left: 6px; }
.input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: .95rem; }
.input.mono { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; white-space: pre; }
.input:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.postbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr; } }
.suggestrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* share wall */
.sharewall { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px 4px; }
.sharebtn { display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 12.5px; font-family: var(--font-mono); color: var(--muted);
  text-decoration: none; background: var(--surface); transition: border-color .12s ease, color .12s ease; }
.sharebtn:hover { border-color: var(--accent); color: var(--accent); }
.sharebtn--icon { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 10px; }
.sharebtn--icon svg { display: block; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft); color: var(--ink);
  border-radius: var(--radius); padding: 12px 14px; font-size: .9rem;
}
.banner__mark { font-family: var(--font-mono); color: var(--accent); font-weight: 600; }
.banner--danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-soft); }
.banner--ok { border-color: color-mix(in srgb, var(--run) 40%, var(--line)); background: var(--run-soft); }

/* --- weekly challenge strip (home + feed) -------------------------------- */
.promptbar { background: var(--accent-soft); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
/* padding-top/bottom only — leave the .shell horizontal padding (20px) intact so
   the WEEKLY pill and the CTA sit off the edge, aligned with the page content. */
.promptbar__row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.promptbar__tag {
  flex: none;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); text-transform: uppercase; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; padding: 4px 10px;
}
.promptbar__body { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.promptbar__body strong { color: var(--ink); font-size: .96rem; }
.promptbar__blurb { color: var(--muted); font-size: .86rem; }
.promptbar__cta { flex: none; display: flex; align-items: center; gap: 16px; margin-left: auto; }
.promptbar__see { color: var(--muted); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.promptbar__see:hover { color: var(--accent); text-decoration: underline; }
.promptbar__cta .btn { white-space: nowrap; }
@media (max-width: 700px) {
  .promptbar__blurb { display: none; }
  .promptbar__cta { width: 100%; margin-left: 0; justify-content: flex-start; }
}

/* challenge-entry chip — a demo posted under a weekly prompt */
.chip--prompt { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); text-decoration: none; }
.chip--prompt:hover { background: var(--accent-soft); }

/* --- maker profile ------------------------------------------------------- */
.profile__head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile__avatar { border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.profile__avatar--blank {
  width: 72px; height: 72px; display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent); font: 700 2rem/1 var(--font-mono);
}
.profile__id { flex: 1; min-width: 240px; }
.profile__name { font-size: 1.7rem; margin: 0; }
.profile__handle { color: var(--muted); font-family: var(--font-mono); font-size: .92rem; margin-top: 2px; }
.profile__bio { margin: 12px 0 0; max-width: 60ch; }
.profile__row { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.profile__link { color: var(--accent); text-decoration: none; font-weight: 600; }
.profile__link:hover { text-decoration: underline; }
.profile__stats { display: flex; gap: 22px; }
.profile__stats div { text-align: center; }
.profile__stats b { display: block; font-size: 1.35rem; font-family: var(--font-mono); }
.profile__stats span { color: var(--muted); font-size: .8rem; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft);
}
.badge__icon { font-size: .95rem; }

.checkrow { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; }

.dangerzone { margin-top: 40px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: var(--radius); padding: 18px 20px; background: var(--danger-soft); }
.dangerzone h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--danger); }

.legal h1 { margin-bottom: 4px; }
.legal h2 { margin: 30px 0 8px; font-size: 1.18rem; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; }
.legal li { margin: 7px 0; }
.legal code { background: var(--bg); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: .88em; }

.emailcard { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); }
.emailcard .input { width: auto; }
.emailcard__msg { color: var(--muted); }

/* account avatar + dropdown menu (header, top-right) */
.usermenu { position: relative; display: inline-flex; }
.usermenu__btn {
  width: 32px; height: 32px; padding: 0; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; overflow: hidden; display: grid; place-items: center;
}
.usermenu__btn:hover { border-color: var(--accent); }
.usermenu__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.usermenu__initial { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: .9rem; }
.usermenu__pop {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}
.usermenu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.usermenu__pop a, .usermenu__pop button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0;
  background: none; color: var(--ink); text-decoration: none; font: inherit; font-size: .9rem; cursor: pointer;
}
.usermenu__pop a:hover, .usermenu__pop button:hover { background: var(--accent-soft); color: var(--accent); }

.avataredit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avataredit__img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.avataredit__img--blank { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 1.6rem/1 var(--font-mono); }

/* sortable / filterable admin tables */
.tablectl { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; flex-wrap: wrap; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--accent); }
.th-sort::after { content: "⇅"; opacity: .35; margin-left: 5px; font-size: .85em; }
.th-sort[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--accent); }
.th-sort[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--accent); }

/* --- admin console: left sidebar + main -------------------------------- */
.adminlayout { display: flex; align-items: flex-start; gap: 0; min-height: calc(100vh - 60px); }
.adminnav {
  flex: 0 0 216px; position: sticky; top: 60px; align-self: flex-start;
  height: calc(100vh - 60px); overflow-y: auto; padding: 22px 14px;
  border-right: 1px solid var(--line); background: var(--surface);
}
.adminnav__brand { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 12px; }
.adminnav nav { display: flex; flex-direction: column; gap: 2px; }
.adminnav a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.adminnav a:hover { background: var(--accent-soft); color: var(--accent); }
.adminnav__exit { margin-top: 14px; color: var(--muted) !important; border-top: 1px solid var(--line); border-radius: 0; padding-top: 14px; }
.adminmain { flex: 1; min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 80px; }
.adminmain__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.adminmain__head h1 { font-size: 1.9rem; margin: 0; }
.adminsec { scroll-margin-top: 74px; padding-top: 26px; }
.adminstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.adminstat {
  display: flex; flex-direction: column; gap: 3px; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink);
}
a.adminstat:hover { border-color: var(--accent); }
.adminstat__n { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.adminstat__l { color: var(--muted); font-size: .8rem; }
@media (max-width: 760px) {
  .adminlayout { flex-direction: column; }
  .adminnav { position: static; height: auto; width: 100%; flex-basis: auto; display: block;
    border-right: 0; border-bottom: 1px solid var(--line); }
  .adminnav nav { flex-direction: row; flex-wrap: wrap; }
  .adminnav__exit { border-top: 0; padding-top: 9px; margin-top: 0; }
}

/* embed panel on the post page */
.embedcard > summary { cursor: pointer; padding: 14px 16px; list-style: none; }
.embedcard > summary::-webkit-details-marker { display: none; }
.embedcard__code {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  overflow-x: auto; font-size: .8rem; margin: 0 0 12px; white-space: pre-wrap; word-break: break-all;
}

/* --- tables (tokens, audit) ---------------------------------------------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; }

.tokenshow { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 16px; }
.tokenshow code { display: block; font-size: .9rem; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
.countdown { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.countdown--expired { color: var(--danger); }

/* --- dialog ---------------------------------------------------------------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  padding: 22px; max-width: 460px; width: calc(100% - 32px); box-shadow: var(--shadow);
}
dialog::backdrop { background: color-mix(in srgb, var(--ink) 45%, transparent); }

/* --- footer ---------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 26px 0 40px; }
.site-foot__row { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot__tag { margin-left: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 10px; z-index: 100; background: var(--surface); border: 1px solid var(--accent); padding: 8px 12px; border-radius: 8px; }

/* --- responsive ------------------------------------------------------------ */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .bezel { position: static; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero { padding-top: 34px; }
  .section { padding-top: 44px; }
  .postcard { grid-template-columns: 1fr; }
  .postcard__side { grid-column: 1; grid-row: auto; flex-direction: row; align-items: center; }
  .votebox { flex-direction: row; gap: 7px; min-width: 0; }
  .demo-frame--post { height: clamp(340px, 60vh, 480px); }
  .demo-frame--hero { height: 340px; }
  .site-foot__tag { margin-left: 0; width: 100%; }
  .nav .navlink--hide-sm { display: none; }
}
@media (max-width: 400px) {
  .shell { padding: 0 14px; }
  .postcard { padding: 15px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- source disclosure: always available, collapsed by default ----------- */
.source { overflow: hidden; }
.source > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 16px 18px; cursor: pointer; list-style: none; user-select: none;
}
.source > summary::-webkit-details-marker { display: none; }
.source > summary::before {
  content: "▸"; color: var(--accent); font-family: var(--font-mono); transition: transform .12s ease;
}
.source[open] > summary::before { content: "▾"; }
.source > summary:hover { background: var(--bg); }
.source > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.source__label { font-weight: 580; font-size: 1.02rem; }
.source__chips { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.source__bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.source__body {
  display: flex; align-items: flex-start; gap: 0;
  max-height: 70vh; overflow: auto; border-top: 1px solid var(--line); background: var(--surface);
}
.source__nums, .source__pre {
  margin: 0; padding: 14px 0; font-size: 12.5px; line-height: 1.7; tab-size: 2;
}
.source__nums {
  position: sticky; left: 0; z-index: 1; flex: none;
  padding-right: 12px; padding-left: 14px; min-width: 3.4em;
  text-align: right; color: var(--muted); opacity: .65; user-select: none;
  background: var(--surface); border-right: 1px solid var(--line);
}
.source__pre { flex: 1; padding-left: 14px; padding-right: 18px; overflow: visible; white-space: pre; }
.source__pre code { display: block; }
@media (max-width: 720px) {
  .source__nums, .source__pre { font-size: 11.5px; }
  .source__nums { min-width: 2.6em; padding-left: 8px; padding-right: 8px; }
  .source__chips { margin-left: 0; }
}

/* --- share affordances ---------------------------------------------------- */
.sharerow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; row-gap: 10px; }
.btn.is-copied { color: var(--run); border-color: color-mix(in srgb, var(--run) 45%, var(--line)); background: var(--run-soft); }
.iconbtn {
  appearance: none; border: 1px solid transparent; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; line-height: 1; padding: 5px 7px; border-radius: 6px;
}
.iconbtn:hover { color: var(--ink); background: var(--bg); border-color: var(--line); }
.iconbtn.is-copied { color: var(--run); background: var(--run-soft); border-color: color-mix(in srgb, var(--run) 40%, var(--line)); }
.postcard__meta .iconbtn { margin-left: 2px; }

/* --- embed page ----------------------------------------------------------- */
body.embed { height: 100%; }
html:has(body.embed) { height: 100%; }
.embed__shell {
  display: flex; flex-direction: column; height: 100vh; min-height: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.embed__bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 13px; border-bottom: 1px solid var(--line); background: var(--bg);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.embed__title { color: var(--ink); font-weight: 500; text-decoration: none; }
.embed__title:hover { color: var(--accent); }
.embed__frame { flex: 1; width: 100%; border: 0; background: var(--surface); min-height: 200px; }
.embed__foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 13px; border-top: 1px solid var(--line); background: var(--bg);
  font-family: var(--font-mono); font-size: 11px;
}
.embed__foot a { color: var(--muted); text-decoration: none; }
.embed__foot a:hover { color: var(--accent); }
.embed__foot strong { color: var(--accent); font-weight: 600; }
.embed__tag { margin-left: auto; color: var(--muted); }
.embed__cta { margin-left: auto; color: var(--accent) !important; font-weight: 600; }
@media (max-width: 480px) { .embed__tag { display: none; } }

/* --- analytics dashboard -------------------------------------------------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat__value { font-size: 1.9rem; font-weight: 600; line-height: 1.1; margin: 4px 0 6px; letter-spacing: -0.02em; }
.spark { display: block; overflow: visible; }
.minibar { display: block; height: 6px; width: var(--w); border-radius: 3px; background: var(--accent); opacity: .75; min-width: 2px; }
.analytics-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .analytics-cols { grid-template-columns: 1fr; } }
