/* BLOOM. — design system. Tokens and rules are documented in DESIGN.md.
   Two families: Bricolage Grotesque (display, text) and IBM Plex Mono
   (labels, readouts, every number that is a measurement). One accent that
   means something: --stamp is only ever a date or a day count. */

:root {
  --ground: #0f0d0b;
  --raise: #171411;
  --line: #2b261f;
  --paper: #f2ebe0;
  --muted: #a89e90;
  --dim: #6f665b;          /* rules and ornament only — never text */
  --stamp: #f0603f;        /* dates and day counts, nothing else */
  --crema: #d6a571;        /* the fresh bag: foam, its curve */
  --stale: #8c877f;        /* the old bag: its curve */

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --head: 64px;

  --step--1: clamp(0.84rem, 0.8rem + 0.15vw, 0.94rem);
  --step-0: clamp(1.02rem, 0.96rem + 0.28vw, 1.2rem);
  --step-1: clamp(1.22rem, 1.1rem + 0.55vw, 1.6rem);
  --step-2: clamp(1.55rem, 1.3rem + 1.1vw, 2.35rem);
  --step-3: clamp(2rem, 1.5rem + 2.3vw, 3.6rem);
  --step-4: clamp(2.6rem, 1.7rem + 4.1vw, 5.6rem);
  --step-5: clamp(3.2rem, 1.8rem + 6.6vw, 8.4rem);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--paper);
  font-family: var(--display);
  font-size: var(--step-0);
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.02; letter-spacing: -0.01em; }
figure { margin: 0; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--crema); outline-offset: 3px; }

.u-vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--paper); color: var(--ground);
  font: 500 13px/1 var(--mono); padding: 12px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1680px; margin-inline: auto; padding-inline: var(--gutter); }

.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.label .n { color: var(--paper); margin-right: 0.9em; }

/* the stamp: a day or a date, in red, set like a rubber stamp on kraft */
.stamp {
  display: inline-block;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid currentColor;
  border-radius: 2px;
  padding: 0.38em 0.55em 0.34em;
  transform: rotate(-2deg);
  white-space: nowrap;
}
.stamp--inline { transform: none; font-size: 0.78em; padding: 0.24em 0.45em 0.2em; vertical-align: 0.12em; }

.link {
  display: inline-flex; align-items: center; gap: 0.6em;
  font: 500 13px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--paper);
  padding: 0.5em 0; border-bottom: 1px solid var(--dim);
  transition: border-color 0.2s, color 0.2s;
}
.link::after { content: "→"; transition: transform 0.25s; }
.link:hover { border-color: var(--crema); color: var(--crema); }
.link:hover::after { transform: translateX(4px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7em;
  min-height: 52px; padding: 0 1.5em;
  background: var(--paper); color: var(--ground);
  font: 500 13px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; border: 0; border-radius: 0; cursor: pointer;
  transition: background-color 0.2s;
}
.btn:hover { background: var(--crema); }

/* display-line reveals */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.line-inner { display: block; }

/* ─────────────────────────────  header  ───────────────────────────── */

.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.top.is-scrolled { background: var(--ground); border-color: var(--line); }

.wordmark {
  font-weight: 800; font-stretch: 75%; font-size: 24px; line-height: 1;
  letter-spacing: 0.01em; text-decoration: none;
}
.wordmark .dot { color: var(--paper); }

.top nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 36px); }
.top nav a {
  font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 10px 0;
  border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--paper); border-color: var(--paper); }
.top nav .nav-bag { color: var(--paper); border: 1px solid var(--dim); padding: 10px 12px; }
.top nav .nav-bag:hover, .top nav .nav-bag[aria-current="page"] { border-color: var(--paper); }
.nav-price { color: var(--muted); margin-left: 0.4em; }

@media (max-width: 560px) {
  :root { --head: 56px; }
  .wordmark { font-size: 21px; }
  .top nav { gap: 12px; }
  .top nav a { font-size: 11px; letter-spacing: 0.06em; }
  .top nav .nav-bag { padding: 8px 9px; }
  .nav-price { display: none; }
}
@media (max-width: 560px) {
  .top nav a[href="index.html"] { display: none; }
}

/* ──────────────────────────────  hero  ────────────────────────────── */

.hero {
  position: relative;
  min-height: max(640px, 100svh);
  overflow: hidden;
}
/* .bagshot (below) sets position: relative; the hero placement must win */
.bagshot.hero-bag {
  position: absolute; z-index: 1;
  right: max(var(--gutter), 3vw); top: calc(var(--head) + 1vh);
  width: min(48vw, calc((max(640px, 100svh) - var(--head) - 3vh) * 0.8333));
  aspect-ratio: 1500 / 1800;
}
.hero-bag img { width: 100%; height: 100%; }
.hero-copy {
  position: relative; z-index: 2;
  width: min(40%, 520px);
  padding: calc(var(--head) + 14vh) 0 0 var(--gutter);
  display: grid; gap: 1.6rem;
}
.hero-lede { font-size: var(--step-2); line-height: 1.12; font-weight: 600; letter-spacing: -0.015em; }
.hero-lede em { font-style: normal; color: var(--crema); }
.hero-shelf { color: var(--muted); font-size: var(--step--1); max-width: 34ch; }
.hero-shelf .stamp { margin-left: 0.2em; }

.hero-word {
  position: absolute; z-index: 2;
  left: var(--gutter); right: var(--gutter); bottom: 1.2vh;
  line-height: 0.78;
}
.giant {
  display: block; overflow: hidden;
  font-weight: 800; font-stretch: 75%;
  font-size: clamp(96px, 17.5vw, 330px);
  letter-spacing: -0.015em;
  padding-top: 0.06em;
}
.giant .ch { display: inline-block; }

.cue {
  position: absolute; z-index: 3; right: var(--gutter); bottom: calc(2vh + 0.5em);
  font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; writing-mode: vertical-rl;
  padding: 8px 0;
}
.cue::after { content: ""; display: inline-block; width: 1px; height: 48px; background: var(--dim); margin-top: 12px; }

@media (max-width: 899px) {
  .hero { display: flex; flex-direction: column; min-height: auto; padding-bottom: 28px; }
  .bagshot.hero-bag { position: relative; order: 1; right: auto; top: auto; width: min(88vw, 440px); margin: calc(var(--head) + 4px) auto 0; }
  .hero-word { position: relative; order: 2; left: auto; right: auto; bottom: auto; margin: -0.5em var(--gutter) 0; }
  .giant { font-size: 30vw; }
  .hero-copy { order: 3; width: 100%; padding: 22px var(--gutter) 0; gap: 1.1rem; }
  .cue { display: none; }
}

/* ─────────────────────────────  intro  ───────────────────────────── */

.intro {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding-block: clamp(96px, 16vh, 180px) clamp(48px, 8vh, 96px);
}
.intro .label { grid-column: 1 / -1; grid-row: 1; margin-bottom: 1.4rem; }
.intro h2 { grid-column: 1 / 8; grid-row: 2; font-size: var(--step-4); }
.intro-body { grid-column: 8 / -1; grid-row: 2; display: grid; gap: 1.1em; color: var(--muted); align-self: end; max-width: 46ch; }
.intro-body p:first-child { color: var(--paper); }

@media (max-width: 899px) {
  .intro h2, .intro-body { grid-column: 1 / -1; }
  .intro-body { grid-row: 3; margin-top: 1.6rem; }
}

/* ─────────────────────────  the bloom stage  ───────────────────────── */

.bloom { position: relative; height: 380vh; }
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-top: calc(var(--head) + 8px);
  background: var(--ground);
}
.bloom-gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.stage > :not(canvas) { position: relative; z-index: 1; }

.stage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 8px; }
.stage-title { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.015em; }
.stage-title span { color: var(--muted); font-weight: 500; }
.stage-clock { font: 500 var(--step-2)/1 var(--mono); font-variant-numeric: tabular-nums; }
.stage-clock .of { color: var(--muted); font-size: 0.5em; }

.beds {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(20px, 4vw, 72px);
  align-content: center; min-height: 0;
}
.bed { display: grid; grid-template-rows: auto auto; justify-items: center; align-content: start; min-width: 0; }
.bed-view {
  width: min(100%, calc(100svh - 430px)); min-width: 220px;
  aspect-ratio: 1; position: relative;
}
.bed-plate {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  filter: brightness(0.82) saturate(0.9);
  transition: opacity 0.4s;
}
.is-live .bed-plate { opacity: 0; }

.bed-data {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  grid-template-areas: "head head" "note note" "read spark";
  column-gap: 20px; row-gap: 8px;
  margin-top: 4px;
}
.bed-head { grid-area: head; display: flex; align-items: center; gap: 14px; }
.bed-name { font-size: var(--step-1); font-weight: 700; }
.bed-note { grid-area: note; color: var(--muted); font-size: var(--step--1); min-height: 1.5em; }

.readout { grid-area: read; margin: 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 22px; }
.readout div { min-width: 0; }
.readout dt { font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.readout dd { margin: 0; font: 500 clamp(22px, 2.1vw, 34px)/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.readout small { font-size: 0.42em; color: var(--muted); margin-left: 0.2em; letter-spacing: 0.04em; }

.spark { grid-area: spark; width: 100%; height: auto; align-self: end; overflow: visible; }
.spark-base { stroke: var(--line); stroke-width: 1; }
.spark-full { fill: none; stroke: var(--dim); stroke-width: 1; stroke-dasharray: 2 3; }
.spark-live { fill: none; stroke: var(--crema); stroke-width: 2; stroke-linejoin: round; }
.spark-head { fill: var(--crema); }
.bed--yours .spark-live { stroke: var(--stale); }
.bed--yours .spark-head { fill: var(--stale); }

.age { width: min(100%, 560px); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; margin-top: 10px; }
.age-l { font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.age-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--step--1); color: var(--muted); }

input[type="date"] {
  background: var(--raise); border: 1px solid var(--line); border-radius: 0;
  color: var(--paper); font: 500 14px/1 var(--mono); padding: 8px 10px; min-height: 40px;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.85); }

/* range inputs: a hairline and a disc */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--dim); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--dim); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -7.5px;
  border-radius: 50%; background: var(--paper); border: 0;
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 0; }

.stage-foot { padding-block: 6px 18px; }
.timeline-wrap { position: relative; max-width: 1180px; margin-inline: auto; }
.pourband {
  position: absolute; top: -15px; height: 47px;
  left: calc(2 / 50 * 100%); width: calc(5 / 50 * 100%);
  display: flex; align-items: flex-start; justify-content: center;
  font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border-inline: 1px solid var(--dim);
  pointer-events: none;
}
.ticks { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* reduced motion: no pin, no scrub; a still frame the slider can step */
.is-still { height: auto; }
.is-still .stage { position: relative; height: auto; min-height: 100svh; }

/* no WebGL: the plate stays, the numbers still tell it */
.no-gl .bed-plate { opacity: 1; }
.no-gl .bloom-gl { display: none; }

@media (max-width: 899px) {
  .bloom { height: 320vh; }
  .stage { padding-top: calc(var(--head) + 4px); }
  .stage-head { padding-bottom: 4px; }
  .stage-title span { display: none; }
  .beds { grid-template-columns: 1fr; row-gap: 10px; align-content: center; }
  .bed {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto;
    justify-items: stretch; align-items: center; column-gap: 14px;
  }
  .bed-view { width: min(50vw, calc((100svh - 330px) / 2)); min-width: 150px; }
  .bed-data {
    width: 100%; margin: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "note" "read" "spark";
    row-gap: 6px;
  }
  .bed-head { gap: 10px; flex-wrap: wrap; }
  .bed-name { font-size: 1.02rem; }
  .bed-note { display: none; }
  .readout { gap: 0 14px; }
  .readout dd { font-size: 20px; }
  .bed--yours { grid-template-areas: "view data" "age age"; }
  .bed--yours .bed-view { grid-area: view; }
  .bed--yours .bed-data { grid-area: data; }
  .bed--yours .age { grid-area: age; width: 100%; margin-top: 2px; }
}

/* ─────────────────────────  what you watched  ───────────────────────── */

.watched {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  padding-block: clamp(96px, 16vh, 180px);
  align-items: center;
}
.watched-copy { grid-column: 1 / 7; grid-row: 1; display: grid; gap: 1.2rem; align-content: start; max-width: 52ch; }
.watched-copy h2 { font-size: var(--step-3); margin-bottom: 0.4rem; }
.watched-copy > p { color: var(--muted); }
.watched-copy > p:nth-of-type(2) { color: var(--paper); }
.watched-copy .aside { border-left: 1px solid var(--stamp); padding-left: 1rem; color: var(--paper); }
.watched-copy .link { justify-self: start; margin-top: 0.6rem; }
.watched-photo { grid-column: 8 / -1; grid-row: 1; }
.watched-photo img { width: 100%; aspect-ratio: 1400 / 1306; object-fit: cover; }
figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.8rem; }
figcaption b { color: var(--paper); font-weight: 600; }

@media (max-width: 899px) {
  .watched-copy, .watched-photo { grid-column: 1 / -1; }
  .watched-photo { grid-row: 2; margin-top: 48px; }
}

/* ─────────────────────────────  bag band  ───────────────────────────── */

.bagband {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  align-items: center;
  padding-right: var(--gutter);
  background: var(--raise);
}
.bagband-photo { grid-column: 1 / 8; grid-row: 1; height: min(86vh, 860px); }
.bagband-photo img { width: 100%; height: 100%; object-fit: cover; }
.bagband-copy { grid-column: 9 / -1; grid-row: 1; display: grid; gap: 1.4rem; padding-block: 64px; }
.bagband-copy h2 { font-size: var(--step-5); font-stretch: 75%; font-weight: 800; line-height: 0.9; }

.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.spec dt { font: 500 11px/1.9 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 0; font-size: var(--step--1); line-height: 1.5; }
.next { color: var(--muted); font-size: var(--step--1); }
.bagband-copy .btn { justify-self: start; }

@media (max-width: 899px) {
  .bagband { padding-right: 0; }
  .bagband-photo { grid-column: 1 / -1; height: 52vh; }
  .bagband-copy { grid-column: 1 / -1; grid-row: 2; padding: 40px var(--gutter) 64px; }
}

/* ─────────────────────────────  lot band  ───────────────────────────── */

.lotband { position: relative; display: grid; min-height: 100svh; }
.lotband-photo { grid-area: 1 / 1; }
.lotband-photo img { width: 100%; height: 100%; object-fit: cover; }
.lotband-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(15, 13, 11, 0.92) 0%, rgba(15, 13, 11, 0.7) 38%, rgba(15, 13, 11, 0.1) 70%);
}
.lotband-copy {
  grid-area: 1 / 1; position: relative; z-index: 1; align-self: end;
  display: grid; gap: 1.3rem; padding-block: 18vh 12vh;
}
.lotband-copy > * { max-width: 44rem; }
.lotband-copy h2 { font-size: var(--step-4); }
.lotband-copy > p { max-width: 50ch; color: var(--paper); }
.pull { margin: 0.8rem 0 0; padding: 0; max-width: 40ch; }
.pull p { font-size: var(--step-2); line-height: 1.18; font-weight: 500; letter-spacing: -0.01em; }
.pull footer { margin-top: 0.8rem; font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lotband-copy .link { justify-self: start; }

@media (max-width: 899px) {
  .lotband-photo::after { background: linear-gradient(to top, rgba(15, 13, 11, 0.96) 30%, rgba(15, 13, 11, 0.45) 70%, rgba(15, 13, 11, 0.2) 100%); }
  .lotband-copy { padding-block: 40vh 64px; }
}

/* ───────────────────────  inner pages: shared parts  ─────────────────────── */

.page-hero { position: relative; display: grid; min-height: max(560px, 92svh); }
.page-hero > figure { grid-area: 1 / 1; position: relative; }
.page-hero > figure img { width: 100%; height: 100%; object-fit: cover; }
.page-hero > figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--ground) 0%, rgba(15, 13, 11, 0.55) 34%, rgba(15, 13, 11, 0.15) 62%, rgba(15, 13, 11, 0.4) 100%);
}
.page-hero-copy { grid-area: 1 / 1; position: relative; z-index: 1; align-self: end; display: grid; gap: 1.2rem; padding-block: 0 clamp(40px, 7vh, 88px); }
.page-hero h1 { font-size: var(--step-5); font-stretch: 75%; font-weight: 800; line-height: 0.88; max-width: 14ch; }
.page-hero .lede { font-size: var(--step-1); max-width: 40ch; line-height: 1.35; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts div { padding: 1.1rem 1.2rem 1.2rem 0; border-right: 1px solid var(--line); }
.facts div + div { padding-left: 1.2rem; }
.facts div:last-child { border-right: 0; }
.facts dt { font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.facts dd { margin: 0; font-size: var(--step-1); font-weight: 600; line-height: 1.2; }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
  .facts div:nth-child(odd) { border-right: 1px solid var(--line); }
  .facts div:nth-child(even) { padding-left: 1rem !important; }
  .facts div:nth-last-child(-n+2) { border-bottom: 0; }
}

.section { padding-block: clamp(88px, 14vh, 160px); }
.section-head { display: grid; gap: 1.2rem; margin-bottom: clamp(40px, 7vh, 80px); max-width: 60rem; }
.section-head h2 { font-size: var(--step-4); }
.section-head p:not(.label) { color: var(--muted); max-width: 56ch; }

/* a story row: a photograph and the words for it, alternating sides */
.story { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.story + .story { margin-top: clamp(72px, 12vh, 140px); }
.story figure { grid-column: 1 / 7; grid-row: 1; }
.story figure img { width: 100%; object-fit: cover; }
.story-copy { grid-column: 8 / -1; grid-row: 1; display: grid; gap: 1rem; max-width: 46ch; padding-bottom: 0.4rem; }
.story-copy h3 { font-size: var(--step-2); }
.story-copy p { color: var(--muted); }
.story-copy p.em { color: var(--paper); }
.story--flip figure { grid-column: 7 / -1; }
.story--flip .story-copy { grid-column: 1 / 6; }
.story--tall figure { grid-column: 2 / 7; }
.story--flip.story--tall figure { grid-column: 7 / 12; }

@media (max-width: 899px) {
  .story figure, .story--flip figure, .story--tall figure, .story--flip.story--tall figure { grid-column: 1 / -1; }
  .story-copy, .story--flip .story-copy { grid-column: 1 / -1; grid-row: 2; margin-top: 24px; }
}

.frame { position: relative; }
.frame img { width: 100%; height: min(88vh, 920px); object-fit: cover; }
.frame figcaption { position: absolute; left: var(--gutter); bottom: 1.2rem; margin: 0; color: var(--paper); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }

/* a ledger: numbers derived in a row, each from the one before */
.ledger { border-top: 1px solid var(--line); }
.ledger-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px; align-items: baseline;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.ledger-row .k { font: 500 12px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ledger-row .v { font: 500 var(--step-2)/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-row .v small { font-size: 0.45em; color: var(--muted); margin-left: 0.25em; }
.ledger-row .w { color: var(--muted); font-size: var(--step--1); }
.ledger-row--sum .v { color: var(--crema); }

@media (max-width: 720px) {
  .ledger-row { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .ledger-row .w { grid-column: 1 / -1; }
}

/* the degassing chart and table (monday.html) */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text, .chart .note { font: 500 11px var(--mono); fill: var(--muted); }
.chart .window { fill: rgba(214, 165, 113, 0.09); }
.chart .curve { fill: none; stroke: var(--crema); stroke-width: 2.25; stroke-linejoin: round; }
.chart .mark { fill: var(--ground); stroke: var(--crema); stroke-width: 2; }
.chart .mark-l { font: 500 12px var(--mono); fill: var(--paper); }
.chart .edge { stroke: var(--dim); stroke-dasharray: 3 4; }

.readings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.readings caption { text-align: left; font: 500 12px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-bottom: 1rem; }
.readings th, .readings td { text-align: right; padding: 0.8rem 0.6rem; border-bottom: 1px solid var(--line); }
.readings th:first-child, .readings td:first-child { text-align: left; padding-left: 0; }
.readings thead th { font: 500 11px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.readings td { font: 500 var(--step-0)/1.2 var(--mono); }
.readings tr.in td:first-child { color: var(--paper); }
.readings tr.out td { color: var(--muted); }
.readings .stamp { font-size: 11px; transform: none; padding: 0.3em 0.4em; margin-left: 0.6em; }

.chart-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.chart-grid .chart-wrap { grid-column: 1 / 8; }
.chart-grid .readings-wrap { grid-column: 9 / -1; overflow-x: auto; }
@media (max-width: 899px) {
  .chart-grid .chart-wrap, .chart-grid .readings-wrap { grid-column: 1 / -1; }
  .chart-grid .readings-wrap { margin-top: 48px; }
}

/* the brew recipe (bag.html) */
.recipe { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: none; }
.recipe li { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 16px; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.recipe .at { font: 500 var(--step-0)/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.recipe .do { color: var(--muted); }
.recipe .do b { color: var(--paper); font-weight: 600; }

/* ───────────────────────────  order panel  ─────────────────────────── */

.buy { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.buy-copy { grid-column: 1 / 7; display: grid; gap: 1.2rem; max-width: 48ch; }
.buy-copy h2 { font-size: var(--step-4); }
.buy-copy > p { color: var(--muted); }
.buy-copy > p.em { color: var(--paper); }
.order { grid-column: 8 / -1; background: var(--raise); border: 1px solid var(--line); padding: clamp(20px, 3vw, 36px); display: grid; gap: 1.3rem; }
.order-title { font-size: var(--step-2); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.order-title .price { font: 500 var(--step-1)/1 var(--mono); }
.order fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.order legend, .order .field-l { font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 0.6rem; }
.qty { display: inline-grid; grid-template-columns: 48px 64px 48px; border: 1px solid var(--line); }
.qty button { background: none; border: 0; min-height: 48px; font: 500 20px/1 var(--mono); cursor: pointer; color: var(--paper); }
.qty button:disabled { color: var(--muted); cursor: default; }
.qty input { width: 100%; text-align: center; background: none; border: 0; border-inline: 1px solid var(--line); font: 500 18px/1 var(--mono); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.methods { display: grid; gap: 8px; }
.method { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 0.8rem 0.9rem; border: 1px solid var(--line); cursor: pointer; }
.method:has(input:checked) { border-color: var(--paper); }
.method input { margin: 0.25em 0 0; accent-color: var(--crema); width: 18px; height: 18px; }
.method b { display: block; font-weight: 600; }
.method span { color: var(--muted); font-size: var(--step--1); }
.tally { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.tally div { display: flex; justify-content: space-between; gap: 16px; padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.tally dt { color: var(--muted); }
.tally dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tally .total dd { font-size: var(--step-1); color: var(--paper); }
.when { color: var(--muted); font-size: var(--step--1); }
.order .btn { width: 100%; }
.confirm { border: 1px solid var(--crema); padding: 1rem 1.1rem; display: grid; gap: 0.5rem; }
.confirm p { font-size: var(--step--1); }
.confirm button { justify-self: start; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

@media (max-width: 899px) {
  .buy-copy, .order { grid-column: 1 / -1; }
  .order { margin-top: 40px; }
}

/* questions */
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer; padding: 1.2rem 0;
  display: flex; justify-content: space-between; gap: 16px; align-items: baseline;
  font-size: var(--step-1); font-weight: 600;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-family: var(--mono); color: var(--muted); }
.qa details[open] summary::after { content: "–"; }
.qa details p { color: var(--muted); max-width: 62ch; padding-bottom: 1.3rem; }

/* ─────────────────────────────  footer  ───────────────────────────── */

.foot { border-top: 1px solid var(--line); padding-top: clamp(56px, 9vh, 96px); }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-h { font: 500 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: var(--step--1); }
.foot a { text-decoration-color: var(--dim); text-underline-offset: 3px; }
.foot a:hover { text-decoration-color: var(--paper); }
.colophon {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: clamp(56px, 9vh, 96px); padding-block: 1.3rem 1.6rem; border-top: 1px solid var(--line);
  font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ───────────────────────  inner pages: additions  ─────────────────────── */

.page-hero--short { min-height: max(520px, 78svh); }

.split-hero {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  min-height: 100svh; align-items: end;
  padding-right: var(--gutter);
}
.split-hero-photo { grid-column: 1 / 7; grid-row: 1; height: 100svh; position: relative; }
.split-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.split-hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, var(--ground) 0%, rgba(15, 13, 11, 0) 30%); }
.split-hero-copy { grid-column: 7 / -1; grid-row: 1; display: grid; gap: 1.3rem; padding-block: calc(var(--head) + 40px) clamp(40px, 8vh, 96px); }
.split-hero-copy h1 { font-size: var(--step-5); font-stretch: 75%; font-weight: 800; line-height: 0.88; }
.split-hero-copy .lede { font-size: var(--step-1); line-height: 1.35; max-width: 34ch; }
.facts--stack { grid-template-columns: 1fr 1fr; margin-top: 1rem; }
.facts--stack div { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
.facts--stack div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts--stack div:nth-child(even) { padding-left: 1.2rem !important; }
.facts--stack div:nth-last-child(-n+2) { border-bottom: 0; }

@media (max-width: 899px) {
  .split-hero { padding-right: 0; min-height: auto; }
  .split-hero-photo { grid-column: 1 / -1; height: 64svh; }
  .split-hero-photo::after { background: linear-gradient(to top, var(--ground) 0%, rgba(15, 13, 11, 0) 40%); }
  .split-hero-copy { grid-column: 1 / -1; grid-row: 2; padding: 8px var(--gutter) 24px; }
}

.measure { background: var(--raise); }
.readings-note { margin-top: 1rem; color: var(--muted); font-size: var(--step--1); }

.two { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.two > :first-child { grid-column: 1 / 6; display: grid; gap: 1.2rem; align-content: start; }
.two > :last-child { grid-column: 7 / -1; }
.two-body { display: grid; gap: 1.1rem; max-width: 52ch; color: var(--muted); }
.two-body .em { color: var(--paper); font-size: var(--step-1); line-height: 1.4; }
.h-mid { font-size: var(--step-4); }
@media (max-width: 899px) {
  .two > :first-child, .two > :last-child { grid-column: 1 / -1; }
  .two > :last-child { margin-top: 2rem; }
}

.story-copy .cup-h { font-size: var(--step-3); }
.story-copy .label { margin-bottom: 0.2rem; }
.story-copy .link { justify-self: start; margin-top: 0.4rem; }

.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.plain li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }

.buy-copy .spec { margin-top: 0.6rem; }

.brew { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: start; }
.brew-a { grid-column: 1 / 5; grid-row: 1 / 3; }
.brew-b { grid-column: 6 / -1; grid-row: 1; }
.brew-c { grid-column: 6 / 9; grid-row: 2; }
.brew-d { grid-column: 10 / -1; grid-row: 2; }
.brew img { width: 100%; object-fit: cover; }
@media (max-width: 899px) {
  .brew-a, .brew-b { grid-column: 1 / -1; grid-row: auto; }
  .brew-c { grid-column: 1 / 7; grid-row: auto; }
  .brew-d { grid-column: 7 / -1; grid-row: auto; }
}

/* ─────────────────────────  phone refinements  ───────────────────────── */

@media (max-width: 899px) {

  /* the stage: larger beds, readouts stacked beside them */
  .beds { row-gap: 14px; }
  .bed { column-gap: 12px; }
  .bed-view { width: min(56vw, calc((100svh - 290px) / 2)); min-width: 160px; }
  .readout { grid-template-columns: 1fr; gap: 2px; }
  .readout div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .readout dd { font-size: 19px; }
  .dt-long { display: none; }
  .bed-head { gap: 6px 10px; }
  .bed-head .stamp { font-size: 11px; }
  .bed--yours .bed-name { font-size: 0.95rem; }
  .spark { margin-top: 2px; }

  /* the chart keeps legible type when the SVG scales down */
  .chart .axis text, .chart .note { font-size: 20px; }
  .chart .mark-l { font-size: 21px; }
}

/* ─────────────────────────  critique round 1  ───────────────────────── */

/* the header always has something dark to stand on while it is over imagery */
.top::before {
  content: ""; position: absolute; inset: 0 0 -48px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 13, 11, 0.82), rgba(15, 13, 11, 0));
  transition: opacity 0.3s;
}
.top.is-scrolled::before { opacity: 0; }

/* the bag, with the date stamped on it live. The two boxes' positions come
   from tools/raw/bagmap.json, written by tools/bag.py when it prints the
   label: keep them in step if the label moves. */
.bagshot { position: relative; container-type: inline-size; margin: 0; }
.bagshot img { display: block; width: 100%; height: auto; }
.bag-stamp {
  position: absolute; margin: 0;
  display: grid; place-items: center;
  font: 500 3cqw/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  color: #d8452a; mix-blend-mode: multiply;
  pointer-events: none;
}
.bag-stamp > span {
  display: inline-block; padding: 0.34em 0.5em 0.28em;
  border: 0.13em solid currentColor; border-radius: 0.12em;
  transform: translate(4%, 12%) rotate(-4deg);
  filter: url(#ink);
  white-space: nowrap;
}
.bag-stamp--date { left: 27.46%; top: 67.96%; width: 29.98%; height: 7.75%; }
.bag-stamp--batch { left: 58.87%; top: 67.96%; width: 13.73%; height: 7.75%; font-size: 4.6cqw; }
.bag-stamp--batch > span { border: 0; padding: 0; transform: translate(6%, 14%) rotate(3deg); }

.bag-hero {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  min-height: max(620px, 100svh); align-items: center;
  padding: calc(var(--head) + 12px) var(--gutter) 16px;
}
.bag-hero-copy { grid-column: 1 / 6; grid-row: 1; display: grid; gap: 1.3rem; }
.bag-hero-copy h1 { font-size: var(--step-5); font-stretch: 75%; font-weight: 800; line-height: 0.88; }
.bag-hero-copy .lede { font-size: var(--step-1); line-height: 1.4; max-width: 34ch; }
.bag-hero-price { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bag-hero-price .price { font-size: var(--step-2); color: var(--paper); letter-spacing: 0; margin-right: 0.35em; }
.bag-hero-copy .btn { justify-self: start; }
.bag-hero-shot { grid-column: 6 / -1; grid-row: 1; justify-self: center; width: min(100%, calc((max(620px, 100svh) - var(--head) - 28px) * 0.8333)); }
@media (max-width: 899px) {
  .bag-hero { min-height: auto; row-gap: 12px; }
  .bag-hero-shot { grid-column: 1 / -1; grid-row: 1; width: min(88vw, 440px); }
  .bag-hero-copy { grid-column: 1 / -1; grid-row: 2; }
}

/* the steel rule each bed is read against */
.gauge {
  position: absolute; right: 0; top: 22%; bottom: 22%; width: 30px; pointer-events: none;
  border-right: 1px solid var(--dim);
  background: repeating-linear-gradient(to top, var(--dim) 0 1px, transparent 1px 8.3333%) right / 6px 100% no-repeat;
}
.gauge i {
  position: absolute; right: 11px; transform: translateY(50%);
  font: 500 10px/1 var(--mono); font-style: normal; color: var(--muted); white-space: nowrap;
}
.gauge .g0 { bottom: 0; }
.gauge .g5 { bottom: 41.667%; }
.gauge .g10 { bottom: 83.333%; }
.g-now, .g-peak { position: absolute; right: 0; bottom: 0; transform: translateY(50%); }
.g-now { width: 26px; height: 2px; background: var(--crema); }
.g-peak { width: 14px; height: 1px; background: var(--crema); opacity: 0.5; }
.bed--yours .g-now, .bed--yours .g-peak { background: var(--stale); }
.gauge .g0, .gauge .g5, .gauge .g10 { opacity: 1; }

/* the wet mill, as a pair: two steps, side by side, staggered */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(24px, 4vw, 72px); align-items: start; }
.pair-item { display: grid; gap: 0.9rem; align-content: start; }
.pair-item figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pair-item h3 { font-size: var(--step-2); margin-top: 0.8rem; }
.pair-item p { color: var(--muted); max-width: 48ch; }
.pair-item p.em { color: var(--paper); }
.pair-item:nth-child(2) { margin-top: clamp(48px, 12vh, 140px); }
@media (max-width: 720px) {
  .pair { grid-template-columns: 1fr; }
  .pair-item:nth-child(2) { margin-top: 24px; }
}

/* the recipe's two photographs share a height, so their captions align */
.brew-c img, .brew-d img { aspect-ratio: 1 / 1; }

/* the bag band's photograph runs the full height of the band */
.bagband { align-items: stretch; }
.bagband-photo { height: auto; min-height: min(86vh, 860px); }
.bagband-photo img { height: 100%; }
.bagband-copy { align-self: center; }

@media (max-width: 899px) {
  .section { padding-block: 72px; }
  .watched { padding-block: 72px; }
  .intro { padding-block: 72px 36px; }
  .story + .story { margin-top: 64px; }
  .section-head { margin-bottom: 36px; }
  .bagband-photo { min-height: 0; height: 52vh; }
  .gauge { width: 22px; }
  .gauge i { font-size: 9px; right: 8px; }
  .gauge .g0 { display: none; }
}
