/* Alpenglow Batch Works — "the bakehouse."
   Before it meant compute, a batch was a baking: one oven load of bread.
   Light mode is the bakery at ten in the morning (flour, parchment, crust);
   dark mode is the bakehouse at four, lit by the oven door (espresso, embers).
   Display: Hepta Slab (storefront signage) · Body: Karla · Tickets/logs: Space Mono. */

@font-face {
  font-family: 'Hepta Slab'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/hepta-slab-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Hepta Slab'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/fonts/hepta-slab-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/karla-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/karla-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/karla-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/space-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/space-mono-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg: #f7f1e5;            /* flour */
  --surface: #fffdf6;       /* parchment */
  --border: #e5d9c3;
  --border-strong: #d3c3a5;
  --ink: #2b1d12;           /* espresso */
  --ink-2: #5c4a38;
  --ink-3: #8a7460;
  --ember: #c2431c;         /* the coal bed */
  --ember-soft: #f9e2d3;
  --crust: #a06a1a;         /* a good bake */
  --crust-soft: #f3e4c4;
  --crust-edge: #c8871f;
  --char: #8a2f1b;          /* the burnt batch */
  --char-soft: #f4d9cd;
  --chip-bg: #f1e8d6;
  --brick: #b3552c;
  --mortar: #e8dfcc;
  --foot-bg: #221408;
  --display: 'Hepta Slab', Rockwell, 'Roboto Slab', serif;
  --body: 'Karla', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171009;          /* the bakehouse before dawn */
    --surface: #221812;
    --border: #392b1d;
    --border-strong: #4d3a26;
    --ink: #f4e9d6;
    --ink-2: #cdbba2;
    --ink-3: #98836c;
    --ember: #ff7a3d;
    --ember-soft: rgba(255, 122, 61, .14);
    --crust: #e0a83f;
    --crust-soft: rgba(224, 168, 63, .15);
    --crust-edge: #e0a83f;
    --char: #ff6b4a;
    --char-soft: rgba(255, 107, 74, .14);
    --chip-bg: #2b2015;
    --brick: #8c3d20;
    --mortar: #100a05;
    --foot-bg: #100a05;
  }
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ---- hero: the oven door ---- */
header.hero { position: relative; isolation: isolate; overflow: hidden; color: #f6ead3; padding: 64px 0 46px; background: #1c0f06; }
.hero-photo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 42%;
}
header.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(101deg, rgba(24, 12, 4, .95) 30%, rgba(24, 12, 4, .8) 58%, rgba(30, 13, 4, .48));
}
.eyebrow { font: 700 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: #ffb163; }
h1 { font: 800 clamp(32px, 5.5vw, 48px)/1.06 var(--display); margin-top: 14px; letter-spacing: -.01em; }
.hero-tag { margin-top: 10px; font: italic 400 17px var(--body); color: #ffc890; }
.hero .lede { margin-top: 14px; max-width: 660px; font-size: 16.5px; color: #f8f2e8; }
.hero .lede em { color: #ffc890; }
.hero-meta { margin-top: 28px; display: flex; gap: 12px 14px; flex-wrap: wrap; font-size: 12px; }
.hero-meta div {
  background: rgba(16, 8, 2, .55); border: 1px solid rgba(255, 177, 99, .25);
  border-radius: 10px; padding: 8px 14px 7px; color: #c9b193; backdrop-filter: blur(2px);
}
.hero-meta strong { display: block; color: #ffe9c9; font: 700 15px var(--mono); margin-bottom: 1px; }

/* ---- brick course dividers ---- */
.bricks {
  height: 20px; background-color: var(--mortar);
  background-image:
    repeating-linear-gradient(90deg, var(--brick) 0 44px, transparent 44px 48px),
    repeating-linear-gradient(90deg, var(--brick) 0 44px, transparent 44px 48px);
  background-size: 100% 8px, 100% 8px;
  background-position: 0 1px, 24px 11px;
  background-repeat: repeat-x, repeat-x;
}
footer .bricks-foot { background-color: var(--bg); }

/* ---- panels ---- */
main { padding: 36px 0 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px;
  box-shadow: 0 1px 0 rgba(43, 29, 18, .04);
}
.station {
  font: 700 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.station::after { content: ''; flex: 1; border-top: 1px dashed var(--border-strong); }
h2 { font: 800 22px/1.2 var(--display); margin-bottom: 8px; }
.muted { color: var(--ink-3); font-size: 14px; }
.muted.small { font-size: 12px; }
.error { color: var(--ember); font-size: 14px; font-weight: 700; margin-top: 10px; }
a { color: var(--ember); font-weight: 700; }
code { font-family: var(--mono); font-size: .82em; background: var(--chip-bg); padding: 1px 5px; border-radius: 5px; }
pre code { background: none; }

/* ---- launcher ---- */
.launch-row { margin-top: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.launch-row .muted.small { flex: 1 1 260px; }
button {
  font: 700 15px var(--body); padding: 10px 18px; border-radius: 10px; border: 0;
  background: linear-gradient(180deg, #e05a26, var(--ember)); color: #fff8ee; cursor: pointer;
  box-shadow: 0 1px 6px rgba(194, 67, 28, .35);
}
button.secondary { background: transparent; color: var(--ink-2); border: 1.5px solid var(--border-strong); box-shadow: none; }
button:hover { filter: brightness(1.08); }
button.secondary:hover { border-color: var(--ember); color: var(--ember); filter: none; }
button:disabled { opacity: .5; cursor: wait; }

/* ---- lifecycle + pipeline lanes ---- */
.map-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.map-head .muted { font-family: var(--mono); font-size: 12px; }
.lifecycle, .pipe { margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arr { color: var(--ink-3); font-size: 14px; }

.node {
  display: inline-grid; gap: 2px; padding: 8px 14px; border-radius: 10px;
  font: 700 12px var(--mono); letter-spacing: .02em;
  border: 1.5px solid var(--border); background: var(--chip-bg); color: var(--ink-3);
  transition: all .25s ease;
}
.node small { font: 400 11px/1.35 var(--body); letter-spacing: 0; color: var(--ink-3); max-width: 175px; }
.node.lit {
  border-color: var(--ember); color: var(--ink); background: var(--ember-soft);
  animation: ember 1.1s ease-in-out infinite;
}
.node.done { border-color: var(--crust-edge); background: var(--crust-soft); color: var(--ink); }
.node.done small { color: var(--crust); }
.node.fail { border-color: var(--char); background: var(--char-soft); color: var(--char); }
@keyframes ember { 50% { box-shadow: 0 0 0 5px var(--ember-soft), 0 0 18px rgba(224, 90, 38, .35); } }
@media (prefers-reduced-motion: reduce) { .node.lit { animation: none; } }

/* ---- the log terminal: the oven window (always dark, always lit from below) ---- */
.term {
  margin-top: 18px;
  background:
    radial-gradient(120% 85% at 50% 118%, rgba(255, 118, 43, .30), rgba(255, 140, 60, .08) 48%, transparent 72%),
    #150b05;
  border: 1px solid #4a3016; border-radius: 44px 44px 12px 12px;
  padding: 22px 20px 16px; min-height: 130px; max-height: 320px; overflow-y: auto;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, .55), inset 0 -14px 30px rgba(255, 118, 43, .08);
}
.term-empty { color: #8a6742; font: 400 13px var(--mono); }
.term pre {
  margin: 0; font: 12.5px/1.7 var(--mono);
  color: #eed0a7; white-space: pre-wrap; word-break: break-word;
}
.term pre .step { color: #ffb454; font-weight: 700; }
.term pre .fail { color: #ff7052; font-weight: 700; }

.result { margin-top: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.result-item { color: var(--ink-2); }

/* ---- badges ---- */
.badge {
  display: inline-block; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--ink-3);
}
.badge.ok { color: var(--crust); border-color: var(--crust-edge); background: var(--crust-soft); }
.badge.bad { color: var(--char); border-color: var(--char); background: var(--char-soft); }
.badge.sched { border-style: dashed; }

/* ---- scan severity counts: the inspection findings ---- */
.scan-counts { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sev {
  font: 700 11.5px var(--mono); padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--ink-2); background: var(--chip-bg);
}
.sev.hot { border-color: var(--ember); color: var(--ember); background: var(--ember-soft); }

/* ---- interlude photo ---- */
.interlude { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.interlude img { display: block; width: 100%; height: auto; }
.interlude figcaption {
  padding: 12px 18px; font: 400 12.5px/1.6 var(--mono); color: var(--ink-3);
  border-top: 1px dashed var(--border-strong);
}

/* ---- recent runs: the bake tickets ---- */
.feed { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.req-row {
  position: relative; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  text-align: left; font: inherit; min-width: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 10px 22px;
  color: var(--ink); cursor: pointer; justify-self: stretch; box-shadow: none;
}
.req-row::before {
  content: ''; position: absolute; left: 10px; top: 7px; bottom: 7px;
  border-left: 2px dashed var(--border-strong);
}
.req-row:hover { border-color: var(--crust-edge); }
.req-row.selected { border-color: var(--crust-edge); background: var(--crust-soft); }
.req-row.selected::before { border-color: var(--crust-edge); }
.req-row .id { font: 700 12.5px var(--mono); }
.req-row .desc { flex: 1 1 200px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.req-row .age { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }

ul.proof { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
ul.proof li::marker { color: var(--crust-edge); }
ul.proof strong { color: var(--ink); }

/* ---- launcher groups: counter, bake-off, failure museum ---- */
.launch-group { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.launch-group:first-of-type { border-top: 0; padding-top: 0; }
.launch-group h3 {
  font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-2); margin-bottom: 10px;
}
.tag2 {
  font: 400 11px var(--mono); text-transform: none; letter-spacing: .02em;
  color: var(--ember); border: 1px dashed var(--ember); border-radius: 999px; padding: 1px 9px; margin-left: 8px;
}
button.race-btn {
  background: transparent; color: var(--ember); border: 1.5px solid var(--ember);
  box-shadow: none;
}
button.race-btn:hover { background: var(--ember-soft); filter: none; }

/* ---- stop row: pull the batch early ---- */
.stoprow { margin-top: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- cold-start anatomy: the waterfall ---- */
.anatomy { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.sub-head { font: 800 16px/1.2 var(--display); margin-bottom: 6px; }
.waterfall { margin-top: 12px; }
.wf-bar {
  position: relative; height: 26px; border-radius: 8px; overflow: hidden;
  background: var(--chip-bg); border: 1px solid var(--border);
}
.wf-seg { position: absolute; top: 0; bottom: 0; display: block; }
.wf-seg.live { animation: wfpulse 1.2s ease-in-out infinite; }
@keyframes wfpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .wf-seg.live { animation: none; } }
.seg-cap  { background: var(--border-strong); }
.seg-pull { background: var(--crust-edge); }
.seg-boot { background: #d98e4a; }
.seg-job  { background: var(--ember); }
.seg-out  { background: var(--ink-3); }
.wf-legend {
  margin-top: 8px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center;
  font: 400 11.5px var(--mono); color: var(--ink-2);
}
.wf-key { display: inline-flex; align-items: center; gap: 5px; }
.wf-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wf-key b { font-weight: 700; }
.wf-total { margin-left: auto; color: var(--ink); }

/* ---- the bake ticket: per-run cost receipt ---- */
.receipt { margin-top: 14px; }
.rc {
  max-width: 420px; background: var(--chip-bg); border: 1.5px dashed var(--border-strong);
  border-radius: 10px; padding: 14px 16px; font: 400 12.5px/1.7 var(--mono); color: var(--ink-2);
}
.rc-head { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--crust); margin-bottom: 6px; }
.rc-live .rc-head { color: var(--ember); }
.rc-line { display: flex; align-items: baseline; gap: 8px; }
.rc-dots { flex: 1; border-bottom: 1.5px dotted var(--border-strong); transform: translateY(-3px); }
.rc-total { font-weight: 700; color: var(--ink); margin-top: 4px; }
.rc-note { margin-top: 8px; font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }

/* ---- the bake-off: two lanes, one wall clock ---- */
.race-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 760px) { .race-grid { grid-template-columns: 1fr 1fr; } }
.lane { min-width: 0; }
.lane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lane-name { font: 700 12.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.lane .term { margin-top: 10px; min-height: 110px; max-height: 220px; border-radius: 28px 28px 10px 10px; padding: 16px 14px 12px; }
.lane .term pre { font-size: 11px; }
.lane .receipt .rc { max-width: none; }
.race-verdict {
  margin-top: 16px; padding: 14px 18px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2);
  background: var(--crust-soft); border: 1.5px solid var(--crust-edge);
}
.race-verdict strong { color: var(--ink); font-family: var(--display); }
.badge.race { border-color: var(--ember); color: var(--ember); }

/* ---- slim vs fat: the health inspection ---- */
.compare { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.compare-scroll { overflow-x: auto; margin-top: 10px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
.compare-table th, .compare-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.compare-table th { font: 700 11.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.compare-table td:first-child { color: var(--ink-3); font-size: 12.5px; }
.compare-table td { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }

/* sigterm log lines: the bell */
.term pre .sig { color: #7ec8ff; font-weight: 700; }

/* ---- footer ---- */
footer { margin-top: 40px; background: var(--foot-bg); color: #cbb392; font-size: 13px; }
.foot-grid { display: grid; gap: 28px; padding: 34px 20px 28px; }
@media (min-width: 640px) { .foot-grid { grid-template-columns: repeat(3, 1fr); } }
.foot-brand { font: 800 15px var(--display); color: #f6ead3; }
.foot-desc { margin-top: 8px; font-size: 12px; line-height: 1.6; color: #9d876b; }
.foot-head { font-weight: 700; color: #f6ead3; }
.foot-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.foot-list a { color: #cbb392; font-weight: 400; text-decoration: none; }
.foot-list a:hover { color: #ffe9c9; text-decoration: underline; text-underline-offset: 2px; }
.foot-bar { border-top: 1px solid rgba(203, 179, 146, .18); padding: 14px 20px; text-align: center; font-size: 12px; color: #9d876b; }
