/* Layout: one narrow column like a bag label; cards stack; the stage card is the one loud thing. */
:root {
  --espresso: #17130F; --parchment: #FBF7EF; --cream: #F2ECE0; --red: #D8281C; --oxblood: #B41F15; --gold: #C9A961; --kraft: #C19A6B;
  --bg: var(--parchment); --surface: #FFFDF8; --fg: var(--espresso); --muted: #6B5F52; --line: #E3D9C8; --accent: var(--red); --on-accent: #FFFDF8;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: "Spectral", Georgia, "Times New Roman", serif;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: var(--espresso); --surface: #211B16; --fg: #F2ECE0; --muted: #B8A992; --line: #3A3028; --accent: #E2453A; --on-accent: #17130F; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.55; padding: env(safe-area-inset-top, 0) 16px env(safe-area-inset-bottom, 0); -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
h2 { font-size: 1.05rem; letter-spacing: .08em; }
p { margin: 0; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--muted); }
.lede { color: var(--muted); max-width: 36ch; }

.top { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding-block: 18px 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); text-transform: uppercase; letter-spacing: .22em; font-size: .9rem; }
.brand-mark { width: 26px; height: auto; filter: invert(var(--invert, 1)); }
@media (prefers-color-scheme: dark) { .brand-mark { --invert: 0; } }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 0; }

main { max-width: 560px; margin: 0 auto; padding-block: 8px 48px; }
section { display: grid; gap: 18px; }
.loading p { color: var(--muted); padding-block: 40px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.field { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.field span, .inline span { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.inline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; }
.inline select { width: auto; padding: 6px 10px; }
textarea { resize: vertical; min-height: 84px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }

.primary, .secondary { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; border-radius: 999px; padding: 13px 20px; text-align: center; text-decoration: none; cursor: pointer; border: 1px solid var(--accent); }
.primary { background: var(--accent); color: var(--on-accent); }
.secondary { background: transparent; color: var(--fg); border-color: var(--fg); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .primary { flex: 1 1 220px; }
.actions select { flex: 0 1 180px; width: auto; }

.choose .coffees { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.coffee-btn { width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; color: inherit; font: inherit; cursor: pointer; }
.coffee-btn:hover { border-color: var(--kraft); }
.coffee-btn img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--cream); }
.coffee-btn b { font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; display: block; }
.coffee-btn small { color: var(--muted); font-size: .85rem; display: block; }

.bag-head { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.bag-img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r); background: var(--cream); }
.notes { color: var(--muted); font-style: italic; margin-top: 4px; }

.stage { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.stage .eyebrow { color: var(--gold); }
.stage-name { font-size: 2rem; color: var(--parchment); }
.stage-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.stage-line, .late { color: #E6DCCB; }
.late { border-top: 1px solid #3A3028; padding-top: 10px; font-style: italic; }
.meter { list-style: none; display: flex; gap: 5px; margin: 0; padding: 0; }
.meter li { width: 22px; height: 6px; border-radius: 3px; background: #3A3028; }
.meter li.on { background: var(--gold); }
@media (prefers-color-scheme: dark) { .stage { border-color: var(--line); background: #0F0C09; } }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; border: 0; background: none; color: var(--muted); padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.method { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--muted); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.why { color: var(--muted); font-size: .88rem; list-style: none; margin-left: -20px; padding-top: 4px; }
.supply-line { font-size: 1.05rem; }
.supply-line strong { font-weight: 500; }
audio { width: 100%; }
.form-msg { font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding-top: 8px; }

.timer { text-align: center; justify-items: center; padding-top: 24px; }
.clock { font-family: var(--display); font-size: clamp(4rem, 22vw, 7rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.step-detail { color: var(--muted); max-width: 32ch; min-height: 3em; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width: 100%; text-align: left; }
.timeline li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li.now { color: var(--fg); font-weight: 500; }
.timeline li.done { text-decoration: line-through; }
.timer .actions { width: 100%; justify-content: center; }
@media (prefers-reduced-motion: no-preference) { section { animation: rise .35s ease both; } @keyframes rise { from { opacity: .001; transform: translateY(6px); } } }
