/* =============================================================================
   MAD BREWS — FERMENT
   -----------------------------------------------------------------------------
   Warm paper, forest green, copper. Fraunces for voice, Inter for everything
   that has to be read quickly. Rounded cards and pills, flat surfaces, no
   shadows. Light and dark themes from the same token set.

   What stays from the lab-notebook version is the part that was never
   decoration: every number is a reading, curves go only through readings that
   were taken, and the graduated rail still runs down the left edge.

   THE RULES THIS FILE KEEPS
     1  TOKENS ONLY. Every colour is an HSL triplet below, so the light theme,
        the dark theme and the inverted bands are one palette, not three.
        Small text uses --accent-text (AA on its ground); --accent is for
        fills, marks and large type.
     2  ONE ACCENT WORD per h1/h2 — the <em>. It is copper, not italic.
     3  NO SHADOWS. Depth is a 1px border and a change of surface.
     4  EVERY NUMBER IS A READING: tabular figures, slashed zero, unit in .u.
     5  ONLY THE RAIL FOLLOWS THE SCROLL. Reveals fire once and travel 12px.
   ============================================================================= */

/* ---------------------------------------------------------------- 01 TOKENS */

:root {
  --background: 36 40% 97%;
  --foreground: 24 10% 12%;
  --card:       0 0% 100%;
  --primary:    133 28% 24%;
  --primary-fg: 36 40% 97%;
  --secondary:  33 30% 92%;
  --muted:      33 25% 92%;
  --muted-fg:   24 8% 42%;       /* 4.9:1 on background */
  --accent:     29 56% 45%;      /* 3.7:1 — large type and marks only */
  --accent-text: 29 62% 36%;     /* 5.3:1 — small text */
  --accent-fg:  36 40% 97%;
  --border:     30 18% 86%;
  --band:       33 30% 94%;
  --honey:      38 68% 57%;
  --burgundy:   348 45% 34%;
  --forest:     133 28% 24%;
  --copper:     29 56% 45%;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  --wrap: 90rem;
  --gutter: 1.25rem;
  --rail: 0px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-settle: cubic-bezier(0.33, 0.02, 0.18, 1);
  --ease-needle: cubic-bezier(0.16, 1.06, 0.3, 1);

  --z-rail: 40;
  --z-head: 60;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 24 12% 8%;
    --foreground: 36 30% 94%;
    --card:       24 10% 12%;
    --primary:    133 26% 55%;
    --primary-fg: 24 12% 8%;
    --secondary:  24 8% 18%;
    --muted:      24 8% 16%;
    --muted-fg:   33 12% 64%;
    --accent:     29 60% 55%;
    --accent-text: 29 64% 64%;
    --accent-fg:  24 12% 8%;
    --border:     30 8% 22%;
    --band:       24 9% 11%;
    --honey:      38 70% 62%;
    --burgundy:   348 50% 64%;
    --forest:     133 26% 55%;
    --copper:     29 60% 55%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: 24 12% 8%;
  --foreground: 36 30% 94%;
  --card:       24 10% 12%;
  --primary:    133 26% 55%;
  --primary-fg: 24 12% 8%;
  --secondary:  24 8% 18%;
  --muted:      24 8% 16%;
  --muted-fg:   33 12% 64%;
  --accent:     29 60% 55%;
  --accent-text: 29 64% 64%;
  --accent-fg:  24 12% 8%;
  --border:     30 8% 22%;
  --band:       24 9% 11%;
  --honey:      38 70% 62%;
  --burgundy:   348 50% 64%;
  --forest:     133 26% 55%;
  --copper:     29 60% 55%;
  color-scheme: dark;
}

/* The inverted surfaces. They swap the tokens rather than restyle their
   children, so anything placed inside one — a plate, a table, a button —
   is already correct. */
.band, .foot, .card--dark {
  --background: 24 10% 12%;
  --foreground: 36 30% 94%;
  --card:       24 10% 15%;
  --primary:    133 26% 55%;
  --primary-fg: 24 12% 8%;
  --secondary:  24 8% 19%;
  --muted:      24 8% 17%;
  --muted-fg:   33 12% 68%;
  --accent:     29 60% 55%;
  --accent-text: 29 64% 64%;
  --accent-fg:  24 12% 8%;
  --border:     30 8% 24%;
  --band:       24 9% 14%;
  --honey:      38 70% 62%;
  --burgundy:   348 50% 66%;
  --forest:     133 26% 55%;
  --copper:     29 60% 55%;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  color-scheme: dark;
}

/* Older names still used by inline styles in the pages and by the scripts.
   Declared on every surface that swaps tokens, so they resolve against it. */
:root, .band, .foot, .card--dark {
  --rule: hsl(var(--border));
  --rule-strong: hsl(var(--border));
  --rule-d-strong: hsl(var(--border));
  --amber-hair: hsl(var(--accent) / 0.16);
  --mono: var(--sans);
  --s-5: 1.5rem;
}

@media (min-width: 1024px) { :root { --gutter: 2rem; } }
@media (min-width: 1200px) { :root { --rail: 4rem; } }

/* ------------------------------------------------------------ 02 BASE/RESET */

*, *::before, *::after { box-sizing: border-box; }
/* svg{display:block} below would otherwise beat the UA [hidden] rule */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* the rail gets its own column; nothing is ever drawn underneath it */
@media (min-width: 1200px) { body { padding-left: var(--rail); } }

img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.45em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.35rem, 1.55rem + 3.1vw, 3.75rem); line-height: 1.03; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.85rem, 1.35rem + 1.9vw, 3rem); line-height: 1.05; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.45rem); line-height: 1.2; letter-spacing: -0.012em; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; }

/* Rule 2: the accent word. */
h1 em, h2 em, h3 em, .display em, .statement em, .cat__title em, .quote em {
  font-style: normal;
  color: hsl(var(--accent));
}

p { margin: 0 0 0.75em; }
p:last-child { margin-bottom: 0; }

a { color: hsl(var(--accent-text)); text-decoration: none; }

.lnk {
  color: hsl(var(--accent-text));
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.3s var(--ease), color 0.15s linear;
}
.lnk:hover, .lnk:focus-visible { color: hsl(var(--foreground)); }

:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 3px; border-radius: 4px; }
::selection { background: hsl(var(--honey) / 0.4); color: hsl(var(--foreground)); }

/* --------------------------------------------------------------- 03 TYPE */

.display {
  font-family: var(--display);
  font-weight: 600;
  font-size: 3rem;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
@media (min-width: 640px)  { .display { font-size: 3.75rem; } }
@media (min-width: 1024px) { .display { font-size: 4.5rem; } }

/* Rule 4. Every figure on this site is a reading off an instrument. */
.readout, .tbl td, .field input, .field select, .cat__meta, .plate__cap {
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum" 1, "zero" 1;
}
.readout { font-weight: 500; }
.readout--xl {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.u {
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-left: 0.2em;
  color: hsl(var(--muted-fg));
}

.label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.label--amber { color: hsl(var(--accent-text)); letter-spacing: 0.14em; }
.label--teal { color: hsl(var(--primary)); }

.micro {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
  font-variant-numeric: tabular-nums slashed-zero;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.625;
  max-width: 38rem;
  color: hsl(var(--muted-fg));
}

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 0.75em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: hsl(var(--accent)); }
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid hsl(var(--accent));
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3em;
  line-height: 1.3;
}
.prose code {
  font-size: 0.88em;
  background: hsl(var(--secondary));
  padding: 0.1em 0.4em;
  border-radius: 0.35rem;
}

.statement {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 52rem;
  margin-inline: auto;
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--accent-text));
}

/* -------------------------------------------------------------- 04 LAYOUT */

.wrap, .shell {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 4.5vw, 3.5rem); }

/* The page opens on the same warm light the homepage hero has, and the
   sections after it alternate plain and tinted, the way the template does. */
main > .section:first-of-type:not(.band)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 36rem at 80% 12%, hsl(var(--honey) / 0.13), transparent 62%),
    radial-gradient(44rem 30rem at 6% 96%, hsl(var(--forest) / 0.09), transparent 60%);
}
main > .section > .shell { position: relative; }
main > .section:nth-of-type(even):not(.band) { background: hsl(var(--band)); }

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--lean   { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .grid--lean-r { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 3rem 0; }

/* Section kickers: the day, the gravity and the name, set as chips. */
.log {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.6rem;
}
/* inline-block, not inline-flex: flex would swallow the space in "DAY <span>98</span>" */
.log .micro {
  display: inline-block;
  line-height: 1.3;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.6);
  color: hsl(var(--foreground) / 0.72);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.log .log__day {
  background: hsl(var(--accent) / 0.12);
  border-color: hsl(var(--accent) / 0.25);
  color: hsl(var(--accent-text));
}
.log .log__name {
  margin-left: auto;
  border: 0;
  background: none;
  padding-inline: 0;
  color: hsl(var(--muted-fg));
  white-space: normal;
  text-align: right;
}

.section-head { margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); max-width: 46rem; }
.section-head h2 { margin-bottom: 0.3em; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

/* ------------------------------------------------------- 05 GRADUATED RAIL
   A specific-gravity scale down the left edge: the hydrometer that sinks as
   you read. Pure CSS ticks; only the scale translates, inside one rAF. */

.rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail);
  height: 100vh;
  z-index: var(--z-rail);
  pointer-events: none;
  display: none;
  overflow: hidden;
  background: hsl(var(--background));
  border-right: 1px solid hsl(var(--border));
}
@media (min-width: 1200px) { .rail { display: block; } }

.rail__scale {
  position: absolute;
  top: -50vh;
  left: 0;
  right: 0;
  height: 300vh;
  will-change: transform;
  background-image:
    repeating-linear-gradient(180deg, hsl(var(--muted-fg) / 0.55) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(180deg, hsl(var(--border)) 0 1px, transparent 1px 8px);
  background-size: 14px 40px, 7px 8px;
  background-position: right 0 top 0, right 0 top 0;
  background-repeat: repeat-y;
}
/* the stem of the float, fixed at the reading line */
.rail__head {
  position: absolute;
  top: 50vh;
  left: 0;
  right: 0;
  height: 2px;
  margin-top: -1px;
  background: hsl(var(--accent));
}
.rail__head::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--accent));
}
.rail__read {
  position: absolute;
  top: 50vh;
  left: 0.55rem;
  transform: translateY(-150%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: hsl(var(--accent-text));
  font-variant-numeric: tabular-nums slashed-zero;
}
.rail__unit {
  position: absolute;
  top: 50vh;
  left: 0.55rem;
  transform: translateY(45%);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: hsl(var(--muted-fg));
}

/* below 1200px the rail becomes a progress hairline */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: hsl(var(--accent) / 0.14);
  z-index: calc(var(--z-head) + 1);
  pointer-events: none;
}
.progress__bar { height: 100%; width: 0; background: hsl(var(--accent)); }
@media (min-width: 1200px) { .progress { display: none; } }

/* -------------------------------------------------------------- 06 HEADER */

.head {
  position: sticky;
  top: 0;
  z-index: var(--z-head);
  background: hsl(var(--background) / 0.84);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid hsl(var(--border) / 0.8);
}
.head__in { display: flex; align-items: center; gap: 1.25rem; height: 4rem; }

.logo { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; color: hsl(var(--foreground)); }
.logo__mark {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
  display: grid;
  place-items: center;
}
.logo__name { font-family: var(--display); font-weight: 600; font-size: 1.28rem; letter-spacing: -0.02em; white-space: nowrap; }

.nav { display: none; align-items: center; gap: 0.1rem; margin: 0 auto; }
.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  padding: 0.5rem 0.7rem;
  border-radius: 9999px;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary) / 0.8); }
.nav a.is-active, .nav a[aria-current="page"] { color: hsl(var(--accent-text)); font-weight: 600; }

.head__tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
@media (min-width: 1320px) { .nav { display: flex; } .head__tools { margin-left: 0; } }

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: hsl(var(--secondary)); }

/* the theme icon follows the painted theme, with or without JavaScript */
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: block; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme .i-moon { display: none; }
}

.lang {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-fg));
  padding: 0.45rem 0.55rem;
  border-radius: 9999px;
}
.lang:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.15s, background-color 0.15s, opacity 0.15s, border-color 0.15s;
}
.pill--sm { font-size: 0.875rem; padding: 0.45rem 1rem; }
.pill--lg { font-size: 1rem; padding: 0.75rem 1.5rem; min-height: 48px; }
.pill--primary { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.pill--primary:hover { opacity: 0.92; }
.pill--outline { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.pill--outline:hover { background: hsl(var(--secondary)); }
.pill--accent { background: hsl(var(--accent)); color: hsl(var(--accent-fg)); }
.pill--accent:hover { opacity: 0.92; }
.pill:active { transform: translateY(1px); }

/* Logo, theme, language, search and menu do not fit side by side on a phone:
   the search pill keeps its icon and gives up its word. */
@media (max-width: 520px) {
  .head__in { gap: 0.5rem; }
  .head__tools { gap: 0.15rem; }
  .pill--search { width: 2.25rem; height: 2.25rem; padding: 0; }
  .pill--search .pill__label { display: none; }
}
/* the narrowest phones: the language link moves into the menu */
@media (max-width: 360px) {
  .head__tools .lang { display: none; }
  .logo__name { font-size: 1.15rem; }
}

.burger { display: grid; }
@media (min-width: 1320px) { .burger { display: none; } }

.drawer { display: none; border-top: 1px solid hsl(var(--border)); }
.drawer[data-open="true"] { display: block; }
.drawer .wrap { padding-block: 0.5rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .drawer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; } }
.drawer a {
  display: block;
  padding: 0.7rem 0.2rem;
  font-size: 0.98rem;
  font-weight: 500;
  color: hsl(var(--foreground) / 0.8);
  border-bottom: 1px solid hsl(var(--border) / 0.7);
}
.drawer a:hover { color: hsl(var(--foreground)); }
.drawer a.is-active, .drawer a[aria-current="page"] { color: hsl(var(--accent-text)); font-weight: 600; }
.drawer .drawer__lang { color: hsl(var(--accent-text)); font-weight: 600; border-bottom: 0; }
@media (min-width: 1320px) { .drawer { display: none !important; } }

/* --------------------------------------------------------------- search */

.srch { border-top: 1px solid hsl(var(--border)); background: hsl(var(--background)); }
.srch__in {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter) 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem 0.75rem;
  align-items: center;
}
.srch__lbl {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.srch__q {
  font: inherit;
  font-size: 1.1rem;
  padding: 0.75rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  min-width: 0;
}
.srch__q::placeholder { color: hsl(var(--muted-fg)); }
.srch__q:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 1px; }
.srch__close {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
}
.srch__close:hover { background: hsl(var(--secondary)); }
.srch__hint, .srch__count, .srch__none {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: hsl(var(--muted-fg));
  margin: 0;
}
.srch__out { grid-column: 1 / -1; }
.srch__list { list-style: none; margin: 0.5rem 0 0; padding: 0; max-height: 58vh; overflow-y: auto; }
.srch__hit {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.8rem;
  color: hsl(var(--foreground));
}
.srch__hit:hover { background: hsl(var(--secondary)); }
.srch__hit:focus-visible { outline-offset: -2px; }
.srch__where {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--accent-text));
}
.srch__title { font-weight: 600; font-size: 1rem; }
.srch__snip { font-size: 0.88rem; color: hsl(var(--muted-fg)); }
.srch mark { background: hsl(var(--honey) / 0.35); color: inherit; padding: 0 0.1em; border-radius: 0.2rem; }
@media (max-width: 640px) {
  .srch__in { grid-template-columns: minmax(0, 1fr); }
  .srch__close { justify-self: start; }
}

/* -------------------------------------------------------------- 07 BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, background-color 0.15s;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn--ghost:hover { opacity: 1; background: hsl(var(--secondary)); }

/* --------------------------------------------------------------- 08 PLATES
   Every image slot is a mounted plate: card, window, caption. Only the
   contents of the window ever change. */

.plate { display: block; margin: 0; color: inherit; }

.plate__mount {
  position: relative;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 0.7rem;
}
.plate__win {
  position: relative;
  overflow: hidden;
  background: hsl(var(--muted) / 0.55);
  border-radius: 0.65rem;
  aspect-ratio: 16 / 10;
}
.plate__win--product { aspect-ratio: 4 / 5; }
.plate__win--recipe  { aspect-ratio: 1 / 1; }
.plate__win--article { aspect-ratio: 3 / 2; }
.plate__win--wide    { aspect-ratio: 21 / 9; }
.plate__win > svg, .plate__win > canvas { width: 100%; height: 100%; }

.plate__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate__win--has-photo > svg { position: absolute; inset: 0; }

.plate__cap {
  margin-top: 0.7rem;
  padding-inline: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.plate__cap span + span::before { content: "·"; margin-right: 0.5rem; opacity: 0.55; }
.plate__cap .is-illustrative { opacity: 0.8; }
.plate__cap .is-terminated { color: hsl(var(--burgundy)); }

/* Plate A — the gravity curve */
.curve { width: 100%; height: 100%; overflow: visible; }
.curve__grid { fill: none; stroke: hsl(var(--border)); stroke-width: 0.6; }
.curve__axis { fill: none; stroke: hsl(var(--border)); stroke-width: 1; }
.curve__area { fill: hsl(var(--primary)); opacity: 0.08; }
.curve__line {
  fill: none;
  stroke: hsl(var(--primary));
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.curve--terminated .curve__line { stroke: hsl(var(--burgundy)); stroke-dasharray: 4 3; }
.curve__tick {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  fill: hsl(var(--muted-fg));
  font-variant-numeric: tabular-nums;
}
.curve__head { fill: hsl(var(--accent)); }
/* Each dot is a reading that was actually taken. Nothing is claimed between them. */
.curve__pt { fill: hsl(var(--primary)); }
.curve--terminated .curve__pt { fill: hsl(var(--burgundy)); }
.curve__lead { fill: none; stroke: hsl(var(--muted-fg) / 0.6); stroke-width: 1; }

/* Plate E — the whole archive on one axis */
.arc { width: 100%; height: 100%; overflow: visible; }
.arc__grid { fill: none; stroke: hsl(var(--border)); stroke-width: 0.6; }
.arc__ref { stroke: hsl(var(--accent)); stroke-width: 1; }
.arc__axis { fill: none; stroke: hsl(var(--border)); stroke-width: 1; }
.arc__span {
  fill: none;
  stroke: hsl(var(--primary));
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}
.arc__b--up .arc__span { stroke: hsl(var(--burgundy)); opacity: 1; stroke-dasharray: 4 3; }
.arc__pt { fill: hsl(var(--primary)); }
.arc__pt--og { opacity: 0.4; }
.arc__b--up .arc__pt { fill: hsl(var(--burgundy)); opacity: 1; }
.arc__tick {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  fill: hsl(var(--muted-fg));
  font-variant-numeric: tabular-nums;
}
.arc__tick--foot { font-size: 6px; font-weight: 600; letter-spacing: 0.12em; }

/* self-inking on first sight */
.curve__line, .dwg-p { stroke-dasharray: 100; stroke-dashoffset: 100; }
.is-drawn .curve__line, .is-drawn .dwg-p {
  animation: ink 0.9s var(--ease-settle) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.curve__anno, .dwg-anno { opacity: 0; }
.is-drawn .curve__anno, .is-drawn .dwg-anno { animation: fade 0.3s var(--ease) 0.9s forwards; }
@keyframes ink { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* Plate B — technical drawings */
.dwg { width: 100%; height: 100%; color: hsl(var(--muted-fg)); overflow: visible; }
.dwg-p { fill: none; stroke: currentColor; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.dwg-dim { fill: none; stroke: hsl(var(--border)); stroke-width: 1; }
.dwg-fill { fill: hsl(var(--accent) / 0.14); stroke: none; }
.dwg-read { fill: none; stroke: hsl(var(--accent)); stroke-width: 1.5; }
.dwg-label {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: hsl(var(--muted-fg));
  stroke: none;
  text-transform: uppercase;
}
.dwg-label--lead { fill: hsl(var(--foreground) / 0.8); }
.dwg-label--em { fill: hsl(var(--accent-text)); }

/* Plates C and D */
.micro-plate { width: 100%; height: 100%; color: hsl(var(--primary)); }
.type-plate { width: 100%; height: 100%; color: hsl(var(--foreground)); }

/* --- the bench ------------------------------------------------------------ */
.bench { display: grid; gap: 1rem; }
.bench__b {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
}
.bench__b h3 { margin: 0.35rem 0 0.45rem; }
.bench__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  overflow: hidden;
}
.bench__list li {
  padding: 0.75rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  align-items: baseline;
}
.bench__list li + li { border-top: 1px solid hsl(var(--border)); }
/* The blank state carries real information, so it is set as prose. */
.bench__none {
  background: hsl(var(--secondary) / 0.65);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 0;
  max-width: 62ch;
  color: hsl(var(--foreground) / 0.82);
}

/* --- strains, as used ------------------------------------------------------ */
.strains { display: grid; gap: 1.4rem; }
.strain__name { margin: 0 0 0.5rem; }
.strain__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.9rem;
  overflow: hidden;
}
.strain__list li {
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
  align-items: baseline;
}
.strain__list li + li { border-top: 1px solid hsl(var(--border)); }
.strain__end {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.strain__gap {
  background: hsl(var(--secondary) / 0.65);
  border-radius: 0.9rem;
  padding: 0.9rem 1.2rem;
  margin: 0.2rem 0 0;
  max-width: 62ch;
  color: hsl(var(--foreground) / 0.82);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------- 09 CARDS */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  color: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
a.card { color: hsl(var(--foreground)); }
a.card:hover, .card:focus-within { border-color: hsl(var(--accent) / 0.45); }
a.card:hover { transform: translateY(-2px); }
a.card h3 { transition: color 0.15s linear; }
a.card:hover h3 { color: hsl(var(--accent-text)); }
.card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card__body > h3 { margin: 0; }
.card__spacer { flex: 1; }
.card p { color: hsl(var(--muted-fg)); }

/* ----------------------------------------------------- 10 THE CATALOGUE
   Rows in one rounded card, one open at a time. */

.cat {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  overflow: hidden;
}
.cat__row + .cat__row { border-top: 1px solid hsl(var(--border)); }

.cat__head {
  position: relative;
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) 9rem 5.5rem 5.5rem;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 3rem 1rem 1.25rem;
  min-height: 64px;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background-color 0.15s linear;
}
.cat__head::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.35rem;
  border-right: 2px solid hsl(var(--muted-fg));
  border-bottom: 2px solid hsl(var(--muted-fg));
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
}
.cat__row[data-open="true"] .cat__head::after { transform: rotate(-135deg); margin-top: -0.1rem; }
.cat__head:hover, .cat__row[data-open="true"] .cat__head { background: hsl(var(--secondary) / 0.6); }
.cat__no {
  justify-self: start;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: hsl(var(--accent) / 0.12);
  color: hsl(var(--accent-text));
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cat__title { font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.01em; }
.cat__meta {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.cat__abv { text-align: right; }

.cat__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-settle);
}
.cat__row[data-open="true"] .cat__panel { grid-template-rows: 1fr; }
.cat__panel > div { overflow: hidden; }
.cat__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem;
  padding: 1.25rem 1.25rem 2rem;
}
@media (max-width: 900px) {
  .cat__head { grid-template-columns: 4.5rem minmax(0, 1fr) 4.5rem; padding-right: 2.6rem; }
  .cat__style, .cat__date { display: none; }
  .cat__inner { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------- 11 DATA & TABLES */

.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
  text-align: left;
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}
.tbl td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.75);
  vertical-align: top;
}
.tbl td:first-child { white-space: nowrap; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

.batchline {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.55rem;
  margin-top: 0.7rem;
  font-variant-numeric: tabular-nums slashed-zero;
}

/* --------------------------------------------------------------- 12 FORMS */

.tool {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.tool + .tool { margin-top: 2rem; }

.fields { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1 1 10.5rem; min-width: 0; }
.field > label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-fg));
}
.field input, .field select {
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.7rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 46px;
  width: 100%;
  transition: border-color 0.2s;
}
.field input:hover, .field select:hover { border-color: hsl(var(--muted-fg) / 0.5); }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 1px; }
.field .hint { font-size: 0.8rem; color: hsl(var(--muted-fg)); }

.result { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid hsl(var(--border)); }
.result__value {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.3rem 0 0.5rem;
  color: hsl(var(--foreground));
}
.result__value .u { font-family: var(--sans); font-size: 0.4em; }
.result p { color: hsl(var(--muted-fg)); font-size: 0.92rem; }
.result.is-error { border-top-color: hsl(var(--burgundy)); }
.result.is-error .result__value { color: hsl(var(--burgundy)); }

/* the gauge */
.gauge { position: relative; margin-top: 1rem; height: 48px; }
.gauge__rule {
  position: absolute;
  left: 0; right: 0; top: 18px;
  height: 10px;
  background-image: repeating-linear-gradient(90deg, hsl(var(--border)) 0 1px, transparent 1px 5%);
}
.gauge__major {
  position: absolute;
  left: 0; right: 0; top: 14px;
  height: 14px;
  background-image: repeating-linear-gradient(90deg, hsl(var(--muted-fg) / 0.7) 0 1px, transparent 1px 25%);
}
.gauge__needle {
  position: absolute;
  top: 8px;
  width: 2px;
  height: 26px;
  border-radius: 2px;
  background: hsl(var(--accent));
  transition: transform 0.9s var(--ease-needle);
  will-change: transform;
}
.gauge__needle::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--accent));
}
.gauge__ceiling { position: absolute; top: 8px; width: 2px; height: 26px; background: hsl(var(--primary)); }
.gauge__scale {
  position: absolute;
  left: 0; right: 0; top: 34px;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- 13 CALLOUTS */

.note {
  background: hsl(var(--secondary) / 0.7);
  border: 1px solid hsl(var(--border));
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.95rem;
  color: hsl(var(--foreground) / 0.85);
}
.note .label { display: block; margin-bottom: 0.35rem; color: hsl(var(--primary)); }

/* --------------------------------------------------------- 14 MARGINALIA
   A person in the margin of every page. */

.withmargin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (min-width: 1280px) { .withmargin { grid-template-columns: minmax(0, 1fr) 17rem; gap: 2.5rem; } }
.withmargin > .aside:only-child { grid-column: 1 / -1; max-width: 52ch; }

.aside {
  font-size: 0.92rem;
  line-height: 1.55;
  color: hsl(var(--foreground) / 0.82);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
}
.aside .label { display: block; margin-bottom: 0.5rem; color: hsl(var(--accent-text)); }

/* --------------------------------------------------------------- 15 HOME */

.hero { position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 36rem at 78% 18%, hsl(var(--honey) / 0.14), transparent 62%),
    radial-gradient(44rem 30rem at 8% 92%, hsl(var(--forest) / 0.1), transparent 60%);
}
/* padding-block, not the shorthand: this element is also .wrap, and a
   shorthand here zeroes the side padding on a phone */
.hero__grid { position: relative; display: grid; gap: 3rem; padding-block: 4.5rem 5rem; align-items: center; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 4rem; padding-block: 6rem 6.5rem; } }

/* The template's exact steps. Fraunces picks its optical size from the
   rendered size, so a bigger headline also turns thinner. */
.hero h1 { font-size: 3rem; line-height: 1.02; letter-spacing: -0.025em; margin: 1.25rem 0 1.5rem; }
@media (min-width: 640px)  { .hero h1 { font-size: 3.75rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 4.5rem; } }
.hero__lede { font-size: 1.125rem; line-height: 1.625; color: hsl(var(--muted-fg)); max-width: 31rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.2rem; }

.stats { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; margin-top: 2.8rem; }
.stat { display: flex; align-items: center; gap: 0.65rem; }
.stat svg { color: hsl(var(--accent)); flex-shrink: 0; }
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; font-size: 0.8rem; color: hsl(var(--muted-fg)); margin-top: 0.15rem; }

.batch {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 40rem;
  width: 100%;
  border-radius: 2rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  background: linear-gradient(160deg, hsl(133 28% 24%) 0%, hsl(24 14% 12%) 100%);
  color: hsl(36 40% 97%);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  transition: transform 0.25s var(--ease);
}
a.batch:hover { transform: translateY(-3px); }
:root[data-theme="dark"] .batch { background: linear-gradient(160deg, hsl(133 26% 55%) 0%, hsl(40 30% 90%) 100%); color: hsl(24 12% 10%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .batch { background: linear-gradient(160deg, hsl(133 26% 55%) 0%, hsl(40 30% 90%) 100%); color: hsl(24 12% 10%); }
}
.batch__tag {
  position: absolute;
  top: 1.4rem;
  left: 1.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: hsl(0 0% 100% / 0.12);
  border: 1px solid hsl(0 0% 100% / 0.22);
}
.batch__ring {
  width: 10rem;
  height: 10rem;
  border-radius: 9999px;
  margin: 0 auto 1.8rem;
  display: grid;
  place-items: center;
  border: 2px solid hsl(38 68% 57% / 0.5);
  background: radial-gradient(circle, hsl(38 68% 57% / 0.28), hsl(38 68% 57% / 0.06) 70%);
  color: hsl(38 68% 62%);
}
.batch__title { font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
.batch__meta { font-size: 0.9rem; opacity: 0.75; margin: 0.45rem 0 0; }
.batch__read { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.3rem; }
.batch__read span {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  background: hsl(0 0% 100% / 0.1);
  border: 1px solid hsl(0 0% 100% / 0.18);
  font-variant-numeric: tabular-nums;
}

.sec { position: relative; padding-block: 5rem; }
.sec--band { background: hsl(var(--band)); }
.sec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
}
.sec__head h2 { font-size: 2.25rem; line-height: 1.05; letter-spacing: -0.025em; margin: 0.5rem 0 0; }
@media (min-width: 640px) { .sec__head h2 { font-size: 3rem; line-height: 1; } }
.sec__head p { font-size: 1.0625rem; line-height: 1.6; color: hsl(var(--muted-fg)); max-width: 34rem; margin-top: 0.8rem; }
.more { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; font-weight: 600; white-space: nowrap; color: hsl(var(--foreground)); }
.more:hover { color: hsl(var(--accent-text)); }

.tile, .rec, .shop { padding: 1.5rem; }
.swatch {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.7rem;
  margin-bottom: 1.4rem;
  display: grid;
  place-items: center;
  color: hsl(36 40% 97%);
}
.swatch--burgundy { background: hsl(var(--burgundy)); }
.swatch--honey { background: hsl(var(--honey)); }
.swatch--copper { background: hsl(var(--copper)); }
.swatch--forest { background: hsl(var(--forest)); }
.tile h3 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 0; }
.tile p { font-size: 0.875rem; color: hsl(var(--muted-fg)); margin: 0.3rem 0 0; }
/* eight tall tiles stacked one per row made a phone scroll through a menu;
   two to a row keeps the whole archive on one screen */
.grid--tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 1000px) { .grid--tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
@media (max-width: 619px) {
  .tile { padding: 1.1rem; }
  .tile .swatch { width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; margin-bottom: 0.9rem; }
  .tile h3 { font-size: 1.1rem; }
  .tile p { font-size: 0.8rem; }
}

.vid { padding: 0; overflow: hidden; }
.vid__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, hsl(40 30% 93%) 0%, hsl(133 24% 62%) 100%);
}
.vid__play {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: hsl(0 0% 100% / 0.88);
  display: grid;
  place-items: center;
  color: hsl(24 10% 20%);
}
.vid__badge {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: hsl(24 12% 10% / 0.78);
  color: hsl(36 40% 97%);
  padding: 0.3rem 0.5rem;
  border-radius: 0.35rem;
}
.vid__body { padding: 1.1rem 1.25rem 1.3rem; }
.vid__body h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; margin: 0; }
.vid__body p { font-size: 0.85rem; color: hsl(var(--muted-fg)); margin: 0.35rem 0 0; }

.rec__kind { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: hsl(var(--accent-text)); }
.rec__kind--fail { color: hsl(var(--burgundy)); }
.rec h3 { font-size: 1.45rem; letter-spacing: -0.015em; margin: 0.55rem 0 0; }
.rec__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-fg));
  margin: 1rem 0 0;
  font-variant-numeric: tabular-nums;
}
.rec__meta i { font-style: normal; opacity: 0.5; }

.quote { text-align: center; max-width: 52rem; margin: 0 auto; }
.quote .eyebrow { color: hsl(var(--honey)); }
.quote p {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 1.3rem 0 2rem;
  text-wrap: balance;
}
.quote a { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; color: hsl(var(--foreground)); }
.quote a:hover { color: hsl(var(--honey)); }

.signup { max-width: 44rem; border-radius: 1.5rem; padding: 2.2rem; }
.kitline { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.kitline span {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
}
.signup small { display: block; font-size: 0.8rem; color: hsl(var(--muted-fg)); margin-top: 0.9rem; }

/* a column, so the price row sits on the card's floor whatever the blurb length */
.shop h3 { font-size: 1.2rem; letter-spacing: -0.01em; margin: 0.55rem 0 0; }
.shop p { font-size: 0.875rem; color: hsl(var(--muted-fg)); margin: 0.4rem 0 1.3rem; line-height: 1.5; }
.shop__price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border));
}
.shop__price b { font-family: var(--display); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.shop__price span { font-size: 0.8rem; color: hsl(var(--muted-fg)); text-align: right; }

/* -------------------------------------------------------------- 16 FOOTER */

.foot { padding-block: 4rem 2.5rem; }
.foot__grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .foot__grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot .logo__mark { background: transparent; color: hsl(var(--honey)); width: auto; height: auto; }
.foot__about { font-size: 0.92rem; line-height: 1.6; color: hsl(var(--foreground) / 0.72); max-width: 26rem; margin: 1rem 0 0; }
.foot__social { display: flex; gap: 1rem; margin-top: 1.3rem; font-size: 0.9rem; }
.foot__h {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.55);
  margin: 0 0 1rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.92rem; }
.foot a { color: hsl(var(--foreground) / 0.78); }
.foot a:hover { color: hsl(var(--honey)); }
.foot__batch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.55);
  font-variant-numeric: tabular-nums;
}
.foot__base { text-align: center; font-size: 0.8rem; color: hsl(var(--foreground) / 0.55); margin: 1rem 0 0; }

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--accent));
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* -------------------------------------------------------------- 17 REVEAL
   Rule 5. A fade and 12px of lift. Fires once and never replays. */

.js .rv {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.rv.is-in { opacity: 1; transform: none; }
.js .rv-line { transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-settle); transition-delay: calc(var(--i, 0) * 70ms); }
.rv-line.is-in { transform: scaleX(1); }

/* ------------------------------------------------------- 18 REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .rv { opacity: 1; transform: none; }
  .rv-line { transform: scaleX(1); }
  .curve__line, .dwg-p { stroke-dasharray: none; stroke-dashoffset: 0; }
  .curve--terminated .curve__line { stroke-dasharray: 4 3; }
  .curve__anno, .dwg-anno { opacity: 1; }
}

/* ------------------------------------------------------------ 19 UTILITIES */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: hsl(var(--primary));
  color: hsl(var(--primary-fg));
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  transition: top 0.15s var(--ease);
}
.skip:focus { top: 1rem; }

@view-transition { navigation: auto; }
