/* Tokens and components follow belderbos.dev (sass/style.scss) so the demo reads as part of the site. */
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/lora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/lora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #F6F3EE;
  --bg-alt: #EAF0EC;
  --surface: #FFFFFF;
  --text: #2A3340;
  --heading: #1B2633;
  --text-muted: #4F5966;
  --text-faint: #646C78;
  --accent: #B9502E;
  --accent-dark: #9A3F22;
  --accent-glow: #FCF2EC;
  --border: #DDD6CB;
  --border-strong: #C6BDAF;
  --nav-bg: rgba(246, 243, 238, 0.92);
  --band-bg: #1E2A38;
  --band-text: #F5F2EE;
  --urgent: #A8321F;
  --urgent-bg: #FBE9E4;
  --card-shadow: 0 1px 2px rgba(27, 38, 51, 0.06), 0 4px 16px rgba(27, 38, 51, 0.05);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Lora", Georgia, serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-heading); color: var(--heading); line-height: 1.3; }

/* Nav, as on the site */
.nav { background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-logo { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; color: var(--text); }
.nav-logo:hover { text-decoration: none; }
.nav-logo .accent { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
.nav-right > a { color: var(--text-muted); font-weight: 500; }
.nav-right > a:hover { color: var(--accent); text-decoration: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem 4rem; display: grid; gap: 2rem; }

header { display: grid; gap: 0.25rem; max-width: 760px; }
.section-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.5rem; }
h1 { font-size: 2.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 0.75rem; text-wrap: balance; }
header p { font-size: 1.1rem; color: var(--text-muted); }
h2 { font-size: 1.35rem; font-weight: 700; }

/* Cards */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.75rem; display: grid; gap: 1.1rem; min-width: 0; box-shadow: var(--card-shadow); }
.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; align-items: start; }

/* Who does what: three columns on the alt band, no card */
.split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; background: var(--bg-alt); border-radius: 10px; padding: 1.5rem 1.75rem; }
.split div { display: grid; gap: 0.5rem; align-content: start; }
.split p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

/* Role tags: AI = accent, CODE = slate, HUMAN = navy band */
.tag { display: inline-block; width: fit-content; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.2rem 0.6rem; border-radius: 6px; line-height: 1.5; }
.tag.ai { background: var(--accent-glow); color: var(--accent); border: 1px solid #F1D3C5; }
.tag.code { background: var(--surface); color: var(--heading); border: 1px solid var(--border-strong); }
.tag.human { background: var(--band-bg); color: var(--band-text); border: 1px solid var(--band-bg); }

/* Buttons, as on the site */
button { font: inherit; cursor: pointer; }
.primary { background: var(--accent); color: #fff; border: none; padding: 0.6rem 1.4rem; border-radius: 6px; font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 16px var(--accent-glow); transition: background 0.2s; }
.primary:hover { background: var(--accent-dark); }
#reject { background: transparent; color: var(--accent); border: 2px solid var(--accent); padding: 0.5rem 1.2rem; border-radius: 6px; font-weight: 600; font-size: 0.95rem; transition: background 0.2s; }
#reject:hover { background: var(--accent); color: #fff; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.samples { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); padding: 0.3rem 0.8rem; font-size: 0.85rem; font-weight: 500; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.lang { display: flex; gap: 0.25rem; }
.lang button { background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); padding: 0.15rem 0.55rem; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; }
.lang button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* Form */
label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); display: grid; gap: 0.35rem; }
textarea, input { font: inherit; font-size: 0.95rem; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.75rem; width: 100%; line-height: 1.55; }
textarea { min-height: 160px; resize: vertical; }
input[readonly] { color: var(--text-muted); }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.note { font-size: 0.85rem; color: var(--text-faint); }

/* Pipeline: a ruled list like the site's .steps */
.steps { display: grid; }
.step { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step[data-state="idle"] { opacity: 0.5; }
.step[data-state="active"] h3 { color: var(--accent); }
.step .tag { justify-self: start; margin-top: 0.15rem; }
.step h3 { font-family: var(--font-sans); font-size: 0.98rem; font-weight: 600; margin-bottom: 0.1rem; }
.step .out { font-size: 0.9rem; color: var(--text-muted); overflow-wrap: anywhere; line-height: 1.55; }
.step .out b { color: var(--heading); font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }

/* Call sheet */
.sheet { display: grid; gap: 1rem; padding-top: 1.25rem; border-top: 2px solid var(--border); }
.sheet[hidden] { display: none; }
.banner { padding: 0.7rem 1rem; border-radius: 6px; font-weight: 600; font-size: 0.95rem; }
.banner.urgent { background: var(--urgent-bg); color: var(--urgent); border-left: 3px solid var(--urgent); }
.banner.routine { background: var(--bg-alt); color: var(--heading); border-left: 3px solid var(--border-strong); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.fields .full { grid-column: 1 / -1; }
.missing { color: var(--urgent); font-size: 0.8rem; font-weight: 500; }
.reply { white-space: pre-wrap; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 0.9rem 1rem; font-size: 0.95rem; line-height: 1.6; margin-top: 0.35rem; }

/* Agenda */
.agenda { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.day { display: grid; gap: 0.4rem; align-content: start; }
.day h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 0.15rem; }
.slot { font-size: 0.82rem; padding: 0.35rem 0.6rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; white-space: pre; }
.slot.taken { color: var(--text-faint); background: var(--bg); }
.slot.emergency { border-style: dashed; border-color: var(--border-strong); }
.slot.new { border-color: var(--heading); background: var(--band-bg); color: var(--band-text); font-weight: 600; }
.slot.proposed { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); font-weight: 600; }

/* What it's worth */
.hero-link { font-weight: 600; margin-top: 0.75rem; width: fit-content; }
.value-intro { color: var(--text-muted); margin-top: 0.35rem; }
.value-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; align-items: start; }
.inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1rem; }
.inputs label { align-content: end; font-weight: 500; line-height: 1.4; }
.inputs input { font-variant-numeric: tabular-nums; }
.results { display: grid; background: var(--bg-alt); border-radius: 10px; padding: 1.5rem 1.75rem; }
.headline { display: grid; padding-bottom: 1rem; border-bottom: 1px solid var(--border-strong); margin-bottom: 0.25rem; }
.headline-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.headline-figure { font-family: var(--font-heading); font-size: 2.8rem; font-weight: 700; color: var(--heading); line-height: 1.15; font-variant-numeric: tabular-nums; }
.headline-sub { color: var(--text-muted); font-size: 0.95rem; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
.result-row:last-child { border-bottom: none; }
.result-row b { display: block; color: var(--heading); font-weight: 600; font-size: 0.95rem; }
.formula { display: block; font-size: 0.82rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.amount { font-weight: 700; font-size: 1.05rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.minus { color: var(--text-muted); }

footer { font-size: 0.9rem; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 1.5rem; }

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .value-grid { grid-template-columns: minmax(0, 1fr); }
  .agenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  h1 { font-size: 2rem; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 2rem 1rem 3rem; }
  .nav-inner { padding: 0 1rem; }
  .nav-right > a { display: none; }
}
@media (max-width: 520px) {
  .fields, .inputs { grid-template-columns: minmax(0, 1fr); }
  .agenda { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 1.25rem; }
}
@media (prefers-reduced-motion: no-preference) { .step { transition: opacity 0.2s; } }
