/*
 * Ember & Ash. One Tuesday morning at the roaster, told down the page.
 * Light theme is Ash (warm ash-grey paper), dark theme is Ember (charcoal).
 * The 3D roaster (roastery.js) is a fixed layer under the content; the stacking rules are at the end.
 * Motion tokens come from MOTION.md (Standard tier); use only these.
 */
:root {
  color-scheme: light;
  --page: #efebe5;
  --sky-1: #f4f0ea;
  --sky-2: #ebe5dc;
  --sky-3: #e3dbcf;
  --kiln-1: #e3dbcf;
  --kiln-2: #ddd1c1;
  --hero-glow: radial-gradient(52% 62% at 74% 56%, rgba(255, 252, 246, 0.9), rgba(255, 252, 246, 0) 72%);
  --night-1: #19120f;
  --night-2: #0c0908;
  --ink: #1d1714;
  --ink-2: #5a4f47;
  --ink-3: #8b7e72;
  --line: rgba(29, 23, 20, 0.14);
  --card: rgba(255, 252, 248, 0.68);
  --card-solid: #f8f5f0;
  --card-line: rgba(29, 23, 20, 0.09);
  --accent: #b23f17;
  --accent-ink: #fff7ef;
  --em: #a33a14;
  --ember: #f06322;
  --ember-dot: #e2541b;
  --ash: #9a9088;
  --close-1: #e6ddd1;
  --close-2: #d8c9b6;
  --readout-bg: rgba(27, 21, 18, 0.88);
  --readout-ink: #f3eadf;

  /* Drawn stand-ins (the same machine in both themes; only the light around it changes) */
  --si-enamel: #6a1f15;
  --si-enamel-2: #521710;
  --si-iron: #2b2522;
  --si-iron-2: #3d3430;
  --si-brass: #c4924c;
  --si-brass-2: #a5763a;
  --si-steel: #b6b1aa;
  --si-face: #efe6d6;
  --si-shadow: rgba(52, 36, 26, 0.16);
  --si-bean: #6b4226;
  --si-bean-2: #8a5a33;
  --si-tray-floor: #3a332f;
  --si-glow-1: #ffbf80;
  --si-glow-2: #c9622a;
  --si-glow-3: #3e1c10;

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page-width: 1200px;
  --gutter: clamp(18px, 4vw, 48px);
  --header-h: 82px;

  /* Motion tokens (MOTION.md) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-hover: 240ms;
  --dur-reveal: 520ms;
  --dur-section: 600ms;
  --dur-load: 900ms;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark; --page: #100c0a; --sky-1: #0d0a08; --sky-2: #140f0c; --sky-3: #1b130f; --kiln-1: #1b130f; --kiln-2: #140d0a; --night-1: #100c0a; --night-2: #100c0a;
    --hero-glow: radial-gradient(48% 58% at 74% 60%, rgba(150, 58, 20, 0.3), rgba(150, 58, 20, 0) 72%);
    --ink: #f3eadf; --ink-2: #b9aa9b; --ink-3: #8a7c70; --line: rgba(255, 236, 218, 0.13); --card: rgba(30, 22, 18, 0.72); --card-solid: #1a1411; --card-line: rgba(255, 236, 218, 0.08);
    --accent: #ff7a3a; --accent-ink: #1b0e07; --em: #ff9058; --ember-dot: #ff7a3a; --close-1: #26160e; --close-2: #170d09; --readout-bg: rgba(12, 9, 7, 0.82);
    --si-shadow: rgba(0, 0, 0, 0.5); --si-glow-1: #ffcf8e; --si-glow-2: #e8692a; --si-glow-3: #4c1d0c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark; --page: #100c0a; --sky-1: #0d0a08; --sky-2: #140f0c; --sky-3: #1b130f; --kiln-1: #1b130f; --kiln-2: #140d0a; --night-1: #100c0a; --night-2: #100c0a;
  --hero-glow: radial-gradient(48% 58% at 74% 60%, rgba(150, 58, 20, 0.3), rgba(150, 58, 20, 0) 72%);
  --ink: #f3eadf; --ink-2: #b9aa9b; --ink-3: #8a7c70; --line: rgba(255, 236, 218, 0.13); --card: rgba(30, 22, 18, 0.72); --card-solid: #1a1411; --card-line: rgba(255, 236, 218, 0.08);
  --accent: #ff7a3a; --accent-ink: #1b0e07; --em: #ff9058; --ember-dot: #ff7a3a; --close-1: #26160e; --close-2: #170d09; --readout-bg: rgba(12, 9, 7, 0.82);
  --si-shadow: rgba(0, 0, 0, 0.5); --si-glow-1: #ffcf8e; --si-glow-2: #e8692a; --si-glow-3: #4c1d0c;
}
/* Night keeps its own ink in both themes */
.on-night { --ink: #f3eadf; --ink-2: rgba(243, 234, 223, 0.74); --line: rgba(255, 236, 218, 0.13); color: var(--ink); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.0625rem/1.6 var(--font-body); overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2 { font-family: var(--font-display); font-weight: 400; margin: 0; letter-spacing: -0.015em; line-height: 0.98; text-wrap: balance; }
h1 { font-size: clamp(3rem, 1.3rem + 5vw, 6.1rem); }
h2 { font-size: clamp(2.4rem, 1.4rem + 3.1vw, 4.3rem); }
h1 em, h2 em { font-style: italic; color: var(--em); }
h3 { margin: 0; font: 400 clamp(1.7rem, 1.4rem + 0.8vw, 2.1rem)/1.05 var(--font-display); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: calc(var(--page-width) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font: 500 0.74rem/1.3 var(--font-mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); }
.lead { font-size: clamp(1.08rem, 1rem + 0.3vw, 1.22rem); color: var(--ink-2); max-width: 33em; }
.lead b { color: var(--ink); font-weight: 500; }
.section { --pad: clamp(88px, 11vw, 160px); padding-block: var(--pad); }
.stack { display: grid; gap: 20px; justify-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.section-head { margin-bottom: clamp(32px, 5vw, 64px); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--page); text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons: a pill with a round knob */
.button { display: inline-flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 7px 0 1.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; transition: background-color var(--dur-hover) var(--ease-out), transform var(--dur-hover) var(--ease-out); }
.button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button:active { transform: scale(0.98); }
.knob-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-ink); color: var(--accent); transition: transform var(--dur-hover) var(--ease-out); }
.button:hover .knob-dot { transform: translateX(3px); }
.button-small { min-height: 44px; gap: 10px; padding-left: 1.1rem; font-size: 0.95rem; }
.button-small .knob-dot { width: 32px; height: 32px; }
.text-link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 5px; transition: text-decoration-color var(--dur-hover) var(--ease-out); }
.text-link:hover { text-decoration-color: var(--accent); }
.text-link, .footer-grid a { display: inline-flex; align-items: center; min-height: 44px; } /* phone-sized hit targets */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 8px; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; padding-block: 12px; }
.bar { display: flex; align-items: center; gap: 18px; min-height: 58px; padding: 7px 7px 7px 16px; border-radius: 999px; background: var(--card); -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2); box-shadow: inset 0 0 0 1px var(--card-line), 0 10px 30px -18px rgba(30, 18, 10, 0.35); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; color: var(--ink); text-decoration: none; }
.brand-name { font: 400 1.45rem/1 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.brand-name i { color: var(--em); }
.mark { width: 32px; height: 32px; overflow: visible; }
.mark-ring { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark-bed { fill: var(--ink); }
.mark-ember { fill: var(--ember-dot); transform-box: fill-box; transform-origin: center; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 10px 12px; border-radius: 999px; color: var(--ink-2); font-size: 0.95rem; text-decoration: none; transition: color var(--dur-hover) var(--ease-out), background-color var(--dur-hover) var(--ease-out); }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.theme-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: color var(--dur-hover) var(--ease-out), background-color var(--dur-hover) var(--ease-out); }
.theme-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle circle { fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-toggle path { fill: currentColor; }
.js .theme-toggle { display: grid; place-items: center; }
/* Pause for the roaster's loops (drum, beans, embers, flames): only while the 3D scene runs */
.motion-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: color var(--dur-hover) var(--ease-out), background-color var(--dur-hover) var(--ease-out); }
.motion-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.motion-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.motion-toggle .i-play, .motion-toggle[aria-pressed="true"] .i-pause { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: inline; }
.has-scene .motion-toggle { display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .has-scene .motion-toggle { display: none; } }

/* Hero · Tuesday 06:00 */
.hero { margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h); background: var(--hero-glow), linear-gradient(180deg, var(--sky-1), var(--sky-2) 62%, var(--sky-3)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(24px, 4vw, 64px); align-items: center; min-height: calc(100svh - var(--header-h)); padding-block: clamp(24px, 4vh, 56px) clamp(40px, 6vh, 80px); }
.hero-copy { gap: 24px; }
.hero-stage { position: relative; height: clamp(420px, 76svh, 800px); }
.readout { position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 9px 13px; border-radius: 10px; background: var(--readout-bg); color: var(--readout-ink); font: 500 0.7rem/1.25 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.readout b { font-weight: 500; color: #ffb27e; }
.readout .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px rgba(240, 99, 34, 0.25); }
.readout-a { top: 8%; right: 0; }
.readout-b { bottom: 3%; left: -3%; }

/* The roast · 06:00 to 06:11: the stage holds while the steps are read */
.kiln { background: linear-gradient(180deg, var(--kiln-1), var(--kiln-2)); }
.drop { background: linear-gradient(180deg, var(--kiln-2), var(--page)); }
.roast-grid { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); grid-template-areas: "head stage" "steps stage"; column-gap: clamp(32px, 6vw, 96px); align-items: start; }
.roast-head { grid-area: head; margin-bottom: clamp(16px, 4vh, 40px); }
.roast-stage { grid-area: stage; position: sticky; top: calc(var(--header-h) + 8px); height: calc(100svh - var(--header-h) - 32px); min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; }
.port-anchor { position: relative; min-height: 0; }
.steps { grid-area: steps; list-style: none; margin: 0; padding: 0; }
.step { display: grid; align-content: center; gap: 12px; min-height: 64svh; padding-block: 28px; border-top: 1px solid var(--line); }
.step:last-child { min-height: 52svh; }
@media (min-width: 861px) { .steps { padding-bottom: 24svh; } } /* the stage stays pinned while the last step is read */
.step p:last-child { color: var(--ink-2); max-width: 30em; }
.step-meta { display: flex; gap: 14px; align-items: center; font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.step-meta span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.step-meta span:first-child::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); transition: background-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out); }
.step.is-active .step-meta span:first-child::before { background: var(--ember); box-shadow: 0 0 0 3px rgba(240, 99, 34, 0.22); }
.profile { margin: 0; padding: 14px 16px 8px; border-radius: 18px; background: var(--card); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--card-line); }
.profile figcaption { display: flex; justify-content: space-between; gap: 12px; font: 500 0.68rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.profile .tag { color: var(--ink-3); }
.profile-chart { width: 100%; height: auto; max-height: 190px; margin-top: 4px; overflow: visible; }
.profile .grid path { stroke: var(--line); stroke-width: 1; fill: none; }
.profile .axis text { fill: var(--ink-3); font: 500 10px var(--font-mono); }
.profile .curve { fill: none; stroke: var(--ember); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--drawn, 1)); transition: stroke-dashoffset var(--dur-reveal) var(--ease-out); }
.profile .mark-pt circle { fill: var(--card-solid); stroke: var(--ember); stroke-width: 2; transition: fill var(--dur-hover) var(--ease-out); }
.profile .mark-pt text { fill: var(--ink-2); font: 500 10px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; transition: opacity var(--dur-hover) var(--ease-out); }
.profile .mark-pt.on circle { fill: var(--ember); }
.js .profile[data-drawing] .mark-pt:not(.on) text { opacity: 0.35; }

/* The drop · 06:11 */
.drop-stage { position: relative; height: clamp(360px, 68svh, 700px); }
.facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; width: 100%; max-width: 34em; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.facts b { font: 400 1.35rem/1.15 var(--font-display); }
.facts span { color: var(--ink-2); }

/* The week */
.week { background: var(--page); }
.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.day { position: relative; padding: 30px 24px 0 0; }
.day::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--page); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.day.is-roast::before { background: var(--ember); box-shadow: 0 0 0 4px rgba(240, 99, 34, 0.2), 0 0 16px rgba(240, 99, 34, 0.7); }
.day-name { margin-bottom: 16px; font: 500 0.76rem/1 var(--font-mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-2); }
.day.is-roast .day-name { color: var(--em); }
.day h3 { margin-bottom: 10px; }
.day p:last-child { color: var(--ink-2); font-size: 0.98rem; }

/* This Tuesday's roast */
.coffees { background: var(--page); padding-top: 0; }
.coffees-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(32px, 5vw, 56px); }
.coffee-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.coffee { display: grid; grid-template-rows: auto auto auto 1fr auto auto; gap: 14px; padding: 26px; border-radius: 24px; background: var(--card-solid); box-shadow: inset 0 0 0 1px var(--card-line); }
.coffee-origin { font: 500 0.72rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.coffee h3 { font-size: clamp(2.2rem, 1.8rem + 1vw, 2.8rem); }
.notes { font: italic 400 1.3rem/1.25 var(--font-display); color: var(--em); }
.coffee-facts { display: grid; margin: 4px 0 0; border-top: 1px solid var(--line); }
.coffee-facts div { display: flex; justify-content: space-between; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.coffee-facts dt { color: var(--ink-2); }
.coffee-facts dd { margin: 0; text-align: right; }
.roast-level { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.roast-bar { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #8d9a68, #c6a865 25%, #a8703e 50%, #6e4426 75%, #3b2416); }
.roast-bar::after { content: ""; position: absolute; top: 50%; left: calc((var(--level, 3) - 0.5) * 20%); width: 14px; height: 14px; border-radius: 50%; background: var(--card-solid); box-shadow: inset 0 0 0 2.5px var(--ink); transform: translate(-50%, -50%); }
.roast-name { color: var(--ink); }
.coffee-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; }
.price { font: 400 1.9rem/1 var(--font-display); }
.price span { font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.07em; color: var(--ink-2); text-transform: uppercase; }

/* Night: the statement */
.night { background: linear-gradient(180deg, var(--night-1), var(--night-2)); }
.statement-band .eyebrow { margin-bottom: 26px; }
.statement { max-width: 21em; margin: 0; font: 400 clamp(2rem, 1.2rem + 2.8vw, 3.7rem)/1.12 var(--font-display); letter-spacing: -0.01em; }
.js .statement .word { color: color-mix(in srgb, var(--ink) 30%, transparent); transition: color var(--dur-hover) var(--ease-out); }
.js .statement .word.on { color: var(--ink); }

/* Numbers on hairlines */
.numbers { background: var(--page); padding-bottom: clamp(40px, 5vw, 80px); }
.figures { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.figures li { display: grid; align-content: start; gap: 14px; padding: 26px 26px 0 0; }
.figures li + li { padding-left: 26px; border-left: 1px solid var(--line); }
.figure { font: 400 clamp(4.2rem, 2rem + 6vw, 8.6rem)/0.86 var(--font-display); letter-spacing: -0.03em; }
.figure small { margin-left: 6px; font: 500 0.95rem/1 var(--font-mono); letter-spacing: 0.06em; color: var(--ink-2); text-transform: uppercase; }
.figures li p:last-child { color: var(--ink-2); max-width: 17em; }

/* Subscribe: the burner out, the batch resting */
.closing { background: var(--page); }
.backdrop { position: absolute; top: var(--pad); bottom: var(--pad); left: max(var(--gutter), calc((100% - var(--page-width)) / 2)); right: max(var(--gutter), calc((100% - var(--page-width)) / 2)); border-radius: 32px; background: radial-gradient(60% 70% at 75% 60%, color-mix(in srgb, var(--ember) 14%, transparent), transparent 70%), linear-gradient(160deg, var(--close-1), var(--close-2)); box-shadow: inset 0 0 0 1px var(--card-line); }
.closing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 24px; align-items: center; }
.cta { padding: clamp(28px, 5vw, 72px); gap: 20px; }
.close-stage { position: relative; height: clamp(380px, 66svh, 660px); margin-right: clamp(0px, 2vw, 32px); }
.plans { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; width: min(100%, 470px); }
.plan { display: flex; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
.plan b { font-weight: 500; }
.plan span { margin-left: auto; color: var(--ink-2); }
.plan em { order: 2; font: 500 0.66rem/1 var(--font-mono); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--em); }
.plan.is-pick { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fine { font-size: 0.92rem; color: var(--ink-2); }

/* Footer, with the wordmark that warms under the pointer */
.site-footer { overflow: hidden; padding-block: 64px 40px; background: var(--page); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 40px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 0.95rem; }
.footer-grid p + p { margin-top: 4px; }
.footer-title { color: var(--ink); font-weight: 500; }
.footer-mark { position: relative; z-index: 1; margin: 36px 0 0; text-align: center; white-space: nowrap; font: 400 clamp(3.6rem, 1rem + 14vw, 17rem)/0.8 var(--font-display); letter-spacing: -0.03em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 18%, transparent); background-image: radial-gradient(380px circle at var(--fx, 50%) var(--fy, 140%), var(--ember), transparent 60%); -webkit-background-clip: text; background-clip: text; user-select: none; }

/* Drawn stand-ins: shown without WebGL, and until the scene's first frame */
.stand-in { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity var(--dur-section) var(--ease-out), visibility 0s linear var(--dur-section); }
.has-scene .stand-in { opacity: 0; visibility: hidden; }
.si-enamel { fill: var(--si-enamel); } .si-enamel-2 { fill: var(--si-enamel-2); }
.si-iron { fill: var(--si-iron); } .si-iron-2 { fill: var(--si-iron-2); }
.si-brass { fill: var(--si-brass); } .si-brass-2 { fill: var(--si-brass-2); }
.si-steel { fill: var(--si-steel); } .si-face { fill: var(--si-face); } .si-shadow { fill: var(--si-shadow); }
.si-bean { fill: var(--si-bean); } .si-bean-2 { fill: var(--si-bean-2); } .si-tray-floor { fill: var(--si-tray-floor); }
.si-bolt circle { fill: var(--si-brass-2); }
.si-glow-1 { stop-color: var(--si-glow-1); } .si-glow-2 { stop-color: var(--si-glow-2); } .si-glow-3 { stop-color: var(--si-glow-3); }
.si-brass-line { fill: none; stroke: var(--si-brass); stroke-width: 3; }
.si-brass-ring { fill: none; stroke: var(--si-brass); stroke-width: 6; }
.si-ring-big { stroke-width: 12; }
.si-brass-thin { fill: none; stroke: var(--si-brass); stroke-width: 3; stroke-linecap: round; }
.si-thick { stroke-width: 5; }
.si-steel-line { fill: none; stroke: var(--si-steel); stroke-width: 3; }
.si-grille { fill: none; stroke: var(--si-iron); stroke-width: 3; }
.si-needle { fill: none; stroke: #9b2c16; stroke-width: 2.5; stroke-linecap: round; }
.si-glint { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 4; stroke-linecap: round; }
.si-glint-big { stroke-width: 7; }
.si-arms { fill: none; stroke: var(--si-iron); stroke-width: 4; stroke-linecap: round; }
.si-arms-big { stroke-width: 7; }

/* Small screens */
@media (max-width: 1080px) {
  .nav { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 74px; }
  .site-header { padding-block: 8px; }
  .split, .hero-grid, .closing-grid, .coffees-head { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { min-height: 0; gap: 8px; padding-top: 24px; }
  .hero-stage { height: clamp(300px, 52svh, 520px); }
  .readout-a { top: 2%; right: 0; }
  .readout-b { bottom: 2%; left: 0; }
  /* Only the drum sticks; the steps pass under it one at a time; the profile follows the steps */
  .roast-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "steps" "profile"; }
  .roast-stage { display: contents; }
  .port-anchor { grid-area: stage; position: sticky; top: calc(var(--header-h) + 4px); height: 46svh; }
  .profile { grid-area: profile; margin-top: 8px; }
  .step { min-height: 0; margin-bottom: 34svh; padding: 20px 20px 22px; border: 0; border-radius: 20px; background: var(--card); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--card-line); }
  .step:last-child { min-height: 0; margin-bottom: 0; }
  .plan { flex-wrap: wrap; row-gap: 2px; }
  .plan em { order: 3; flex-basis: 100%; }
  .drop-stage { height: clamp(280px, 48svh, 460px); }
  .days { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 1px solid var(--line); margin-left: 4px; }
  .day { padding: 0 0 30px 26px; }
  .day::before { top: 2px; left: -5px; }
  .coffee-grid { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .figures li + li { padding-left: 0; border-left: 0; }
  .figures li:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .close-stage { height: clamp(280px, 46svh, 440px); margin: 0 12px 12px; }
  .cta { padding: 28px 22px 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .facts li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (max-width: 520px) {
  h1 { font-size: 2.75rem; }
  .hero-copy { gap: 18px; }
  .button-small .knob-dot { display: none; }
  .button-small { padding-right: 1.1rem; }
  .brand { gap: 8px; }
  .brand-name { font-size: 1.22rem; }
  .bar { gap: 4px; padding-left: 12px; }
  .button-small { padding-inline: 0.95rem; }
}
/* Short desktop windows: keep the hero on one screen */
@media (min-width: 861px) and (max-height: 640px) {
  h1 { font-size: clamp(2.4rem, 8.4vh, 3.8rem); }
  .hero-copy { gap: 16px; }
  .lead { font-size: 1.02rem; }
  .hero-stage { height: calc(100svh - var(--header-h) - 40px); }
  .profile { padding: 10px 14px 4px; }
  .profile-chart { max-height: 104px; }
  .profile .mark-pt text { display: none; }
}

/* Header mark, once on load (under a second): the porthole ring draws, the drum turns
   (the bed of beans inside rolls up the wall and settles), and the ember flares */
.mark-bed { transform-box: view-box; transform-origin: 24px 24px; }
@media (prefers-reduced-motion: no-preference) {
  .js .mark-ring { animation: ring-draw var(--dur-section) var(--ease-out) both; }
  .js .mark-bed { animation: bed-turn var(--dur-load) var(--ease-out) both; }
  .js .mark-ember { animation: ember-flare var(--dur-load) var(--ease-out) both; }
}
@keyframes ring-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bed-turn { 0% { transform: rotate(0deg); } 40% { transform: rotate(34deg); } 100% { transform: rotate(0deg); } }
@keyframes ember-flare {
  0% { fill: var(--ash); transform: scale(0.5); }
  45% { fill: #ffc58a; transform: scale(1.35); }
  100% { fill: var(--ember-dot); transform: scale(1); }
}

/* Stacking: section skies under the scene, content over it. Keep these. */
.hero, .section, .site-footer { position: relative; }
.wrap { position: relative; z-index: 1; }
.scene-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
