/* ═══════════════════════════════════════════════════════════════
   Brew & Note — Semantic CSS (element / attribute selectors only)
   ═══════════════════════════════════════════════════════════════ */

/* ── Self-hosted fonts (merged in so the whole site is one request
   instead of two — latin subset only) ────────────────────────── */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300 500;
  font-display: optional;
  src: url("../fonts/dm-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("../fonts/playfair-display.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url("../fonts/playfair-display-italic.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #f8f2eb;
  --fg: #2c1408;
  --card: #f5ede2;
  --alt: #eee8d8;
  --dark: #2c1408;
  --dark2: #3d1c02;
  --accent: #a35135;
  --warm: #725c3a;
  --muted: #896040;
  --tan: #c4a882;
  --teal: #4a7b9d;
  --green: #879970;
  --border: rgba(61, 28, 2, 0.1);
  --bordlt: rgba(61, 28, 2, 0.06);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --r: 1rem;
  --rpill: 999px;
  --maxw: 1100px;
  --px: clamp(1.25rem, 5vw, 2.5rem);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}
summary {
  list-style: none;
  cursor: pointer;
}
summary::-webkit-details-marker {
  display: none;
}

/* ── Typography ───────────────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  line-height: 1.15;
  font-weight: 700;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}
h2 {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
}
h3 {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}
h4 {
  font-size: 1rem;
}
p {
  font-size: 1rem;
  color: var(--warm);
  line-height: 1.75;
  font-weight: 300;
}

/* A leading <strong> label inside a paragraph reads darker than the
   lighter paragraph text around it (e.g. "Taste Profile:", "Fonts."). */
main > section > p > strong {
  color: var(--dark);
}

/* Inline contact-email links (Privacy / Accessibility pages) — the only
   plain-text links inside body copy, so they need their own underline
   to read as clickable. */
main > section > p > a[data-email-user] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
main > section > p > a[data-email-user]:hover {
  color: var(--dark);
}

/* small as eyebrow label */
main small {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
main > section[data-theme="dark"] small,
main > section[data-theme="cta"] small,
main > section[data-theme="hero"] small {
  color: var(--tan);
}

/* ── Main & Section Defaults ─────────────────────────────────────── */
main > section {
  background: var(--bg);
  padding-block: 4.5rem;
  padding-inline: var(--px);
}
main > section > * {
  max-width: var(--maxw);
  margin-inline: auto;
}
main > section > small + h2,
main > section > small + h1 {
  margin-top: 0.4rem;
}
main > section > h2 + p,
main > section > h1 + p {
  margin-top: 1rem;
}
main > section > p + p,
main > section > p + ul,
main > section > p + ol,
main > section > p + dl {
  margin-top: 1.1rem;
}
main > section > h2 + h2,
main > section > h2 + h3 {
  margin-top: 2.25rem;
}

/* ── Section themes ──────────────────────────────────────────────── */
main > section[data-theme="hero"] {
  background: var(--dark);
  padding-block: 5rem;
}
main > section[data-theme="hero"] h1 {
  color: #f8f2eb;
}
main > section[data-theme="hero"] h1 em {
  color: var(--tan);
}
main > section[data-theme="hero"] > p {
  color: rgba(248, 242, 235, 0.6);
  max-width: 44ch;
}
main > section[data-theme="hero"] a {
  color: rgba(248, 242, 235, 0.65);
}

main > section[data-theme="page-hero"] {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding-block: 3rem;
}
main > section[data-theme="page-hero"] h1 em {
  font-style: italic;
}

/* Per-chapter hero accent colour — one colour per page, set once via
   the body class WordPress already adds for the page slug, instead of
   a repeated inline style on every page's <h1><em>. */
body.page-history main > section[data-theme="page-hero"] h1 em,
body.page-glossary main > section[data-theme="page-hero"] h1 em,
body.page-quiz main > section[data-theme="page-hero"] h1 em {
  color: #c4694a;
}
body.page-beans main > section[data-theme="page-hero"] h1 em {
  color: #725c3a;
}
body.page-brewing main > section[data-theme="page-hero"] h1 em {
  color: #657453;
}
body.page-flavour main > section[data-theme="page-hero"] h1 em {
  color: #896040;
}
body.page-health main > section[data-theme="page-hero"] h1 em {
  color: #4a7b9d;
}
body.page-recipes main > section[data-theme="page-hero"] h1 em {
  color: #2c1408;
}
body.page-quiz main > section[data-theme="page-hero"] > span {
  color: #c4694a;
  display: inline-block;
  margin-bottom: 0.75rem;
}

main > section[data-theme="dark"] {
  background: var(--dark);
}
main > section[data-theme="dark"] h2,
main > section[data-theme="dark"] h3 {
  color: #f8f2eb;
}
main > section[data-theme="dark"] > p {
  color: rgba(248, 242, 235, 0.6);
}

main > section[data-theme="cream"] {
  background: var(--card);
}
main > section[data-theme="alt"] {
  background: var(--alt);
}

main > section[data-theme="cta"] {
  background: var(--dark2);
  padding-block: 3rem;
}
main > section[data-theme="cta"] > article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}
main > section[data-theme="cta"] h2,
main > section[data-theme="cta"] h3 {
  font-family: var(--serif);
  color: #f8f2eb;
  font-size: 1.5rem;
}

/* ── Stats strip ─────────────────────────────────────────────────── */
main > section[data-theme="stats"] {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding-block: 2.5rem;
}
main > section[data-theme="stats"] > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
main > section[data-theme="stats"] > ul > li > data {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
main > section[data-theme="stats"] > ul > li > small {
  color: var(--warm);
  margin-top: 0.25rem;
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
main > section > nav[aria-label="Breadcrumb"] {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
main > section > nav[aria-label="Breadcrumb"] ol {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
main > section > nav[aria-label="Breadcrumb"] li + li::before {
  content: "/";
  margin-right: 0.4rem;
}
main > section > nav[aria-label="Breadcrumb"] a:hover {
  color: var(--fg);
}

/* ── Hero CTA nav ────────────────────────────────────────────────── */
main > section[data-theme="hero"] > nav[aria-label="CTA"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
main > section[data-theme="hero"] > nav[aria-label="CTA"] > a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--rpill);
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.2s;
}
main > section[data-theme="hero"] > nav[aria-label="CTA"] > a:first-child {
  background: linear-gradient(135deg, #f4763a 0%, #e8622b 100%);
  color: #2c1408;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232, 98, 43, 0.35);
}
main
  > section[data-theme="hero"]
  > nav[aria-label="CTA"]
  > a:first-child:hover {
  background: linear-gradient(135deg, #f6885a 0%, #ee7038 100%);
  box-shadow: 0 6px 22px rgba(232, 98, 43, 0.5);
  transform: translateY(-2px);
}
main > section[data-theme="hero"] > nav[aria-label="CTA"] > a:last-child {
  border: 1px solid rgba(196, 168, 130, 0.35);
  color: var(--tan);
}
main > section[data-theme="hero"] > nav[aria-label="CTA"] > a:last-child:hover {
  border-color: var(--tan);
  color: #f8f2eb;
}

/* ── Generic data-btn links ──────────────────────────────────────── */
a[data-btn] {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--rpill);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
a[data-btn="primary"] {
  background: linear-gradient(135deg, #f4763a 0%, #e8622b 100%);
  color: #2c1408;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(232, 98, 43, 0.35);
}
a[data-btn="primary"]:hover {
  background: linear-gradient(135deg, #f6885a 0%, #ee7038 100%);
  box-shadow: 0 6px 22px rgba(232, 98, 43, 0.5);
  transform: translateY(-2px);
}
a[data-btn="ghost"] {
  border: 1px solid rgba(196, 168, 130, 0.35);
  color: var(--tan);
}
a[data-btn="ghost"]:hover {
  border-color: var(--tan);
  color: #f8f2eb;
}
a[data-btn="outline"] {
  border: 1.5px solid var(--border);
  color: var(--fg);
}
a[data-btn="outline"]:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Chapter cards grid ──────────────────────────────────────────── */
main > section > ul[aria-label="Chapters"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Chapters"] > li {
  height: 100%;
}
main > section > ul[aria-label="Chapters"] > li > a {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.08);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  height: 100%;
}
main > section > ul[aria-label="Chapters"] > li > a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(44, 20, 8, 0.12);
}
main > section > ul[aria-label="Chapters"] > li > a > figure {
  height: 5px;
  flex-shrink: 0;
  background: var(--chapter-bar, var(--accent));
}
main > section > ul[aria-label="Chapters"] > li > a > article {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
main > section > ul[aria-label="Chapters"] > li > a > article > small {
  margin-bottom: 0.3rem;
  color: var(--chapter-accent, var(--muted));
}
main > section > ul[aria-label="Chapters"] > li > a > article > h3 {
  color: var(--fg);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
main > section > ul[aria-label="Chapters"] > li > a > article > p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--warm);
  margin-bottom: 1rem;
  flex: 1;
}
main > section > ul[aria-label="Chapters"] > li > a > article > em {
  font-size: 0.78rem;
  font-weight: 600;
  font-style: normal;
  margin-top: auto;
  color: var(--chapter-accent, var(--muted));
}

/* ── Journey steps (dark ol) ─────────────────────────────────────── */
main > section[data-theme="dark"] > ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
  margin-top: 2.5rem;
  counter-reset: step;
}
main > section[data-theme="dark"] > ol > li {
  padding: 1.5rem 2rem;
  counter-increment: step;
}
main > section[data-theme="dark"] > ol > li::before {
  content: "0" counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 2px solid rgba(196, 168, 130, 0.3);
  background: var(--dark);
  margin-inline: auto;
  margin-bottom: 1.25rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tan);
}
main > section[data-theme="dark"] > ol > li > h3 {
  color: #f8f2eb;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
main > section[data-theme="dark"] > ol > li > p {
  font-size: 1rem;
  color: rgba(248, 242, 235, 0.5);
  margin-bottom: 1rem;
}
main > section[data-theme="dark"] > ol > li > a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--tan);
  border-bottom: 1px solid rgba(196, 168, 130, 0.4);
  padding-bottom: 0.1rem;
  transition: all 0.18s;
}
main > section[data-theme="dark"] > ol > li > a:hover {
  color: #f8f2eb;
  border-color: #f8f2eb;
}

/* ── About grid (cream) ──────────────────────────────────────────── */
main > section[data-theme="cream"] > article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
main > section[data-theme="cream"] > article > section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-content: start;
}
main > section[data-theme="cream"] > article > section > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main > section[data-theme="cream"] > article > section > article > svg {
  margin-bottom: 0.6rem;
}
main > section[data-theme="cream"] > article > section > article > h3 {
  font-size: 0.88rem;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
main > section[data-theme="cream"] > article > section > article > p {
  font-size: 1rem;
  margin: 0;
}
@media (max-width: 680px) {
  main > section[data-theme="cream"] > article {
    grid-template-columns: 1fr;
  }
}

/* ── Dark era/narrative cards ────────────────────────────────────── */
main > section[data-theme="dark"] > ul[aria-label="Eras"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
main > section[data-theme="dark"] > ul[aria-label="Eras"] > li > article {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r);
  padding: 1.5rem;
  height: 100%;
}
main
  > section[data-theme="dark"]
  > ul[aria-label="Eras"]
  > li
  > article
  > small {
  color: var(--tan);
  margin-bottom: 0.4rem;
}
main > section[data-theme="dark"] > ul[aria-label="Eras"] > li > article > h3 {
  color: #f8f2eb;
  margin-bottom: 0.6rem;
}
main > section[data-theme="dark"] > ul[aria-label="Eras"] > li > article > p {
  color: var(--tan);
  font-size: 1rem;
}

/* ── Generic card grid ───────────────────────────────────────────── */
main > section > ul[aria-label="Cards"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.75rem;
  margin-top: 2.25rem;
}
main > section > ul[aria-label="Cards"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  height: 100%;
}
main > section > ul[aria-label="Cards"] > li > article > h3 {
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 0.65rem;
}
body.page-accessibility
  main
  > section
  > ul[aria-label="Cards"]
  > li
  > article
  > h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body.page-accessibility
  main
  > section
  > ul[aria-label="Cards"]
  > li
  > article
  > h3
  > svg {
  flex-shrink: 0;
}
main > section > ul[aria-label="Cards"] > li > article > p {
  font-size: 1rem;
  line-height: 1.7;
}
main > section > ul[aria-label="Cards"] > li > article > p + p {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--accent);
}

/* ── Timeline (coffee.html) ──────────────────────────────────────── */
main > section > figure[aria-label="Timeline"] {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2rem;
  margin-top: 2rem;
}
main > section > figure[aria-label="Timeline"] > nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
main > section > figure[aria-label="Timeline"] > nav > button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-align: left;
  width: 100%;
  transition: all 0.18s;
}
main > section > figure[aria-label="Timeline"] > nav > button:hover {
  background: rgba(61, 28, 2, 0.05);
}
main
  > section
  > figure[aria-label="Timeline"]
  > nav
  > button[aria-pressed="true"] {
  background: var(--dark);
}
main > section > figure[aria-label="Timeline"] > nav > button > abbr {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
  font-style: normal;
}
main > section > figure[aria-label="Timeline"] > nav > button > span {
  display: flex;
  flex-direction: column;
}
main > section > figure[aria-label="Timeline"] > nav > button > span > em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
main
  > section
  > figure[aria-label="Timeline"]
  > nav
  > button[aria-pressed="true"]
  > span
  > em {
  color: var(--tan);
}
main > section > figure[aria-label="Timeline"] > nav > button > span > strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
}
main
  > section
  > figure[aria-label="Timeline"]
  > nav
  > button[aria-pressed="true"]
  > span
  > strong {
  color: #f8f2eb;
}

main > section > figure[aria-label="Timeline"] > article > section {
  border-radius: var(--r);
  padding: 2rem;
  border: 1px solid transparent;
  display: none;
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > section[aria-hidden="false"] {
  display: block;
  animation: panelFade 0.3s ease;
}
@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
main > section > figure[aria-label="Timeline"] > article > section > small {
  margin-bottom: 0.4rem;
  font-weight: 600;
}
main > section > figure[aria-label="Timeline"] > article > section > h3 {
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 0.75rem;
}
main > section > figure[aria-label="Timeline"] > article > section > p {
  font-size: 1rem;
  line-height: 1.75;
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > nav[aria-label="Panel controls"] {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  align-items: center;
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > nav[aria-label="Panel controls"]
  > button {
  padding: 0.45rem 1rem;
  border-radius: var(--rpill);
  font-size: 0.75rem;
  border: 1px solid var(--border);
  transition: all 0.18s;
  color: var(--muted);
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > nav[aria-label="Panel controls"]
  > button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > nav[aria-label="Panel controls"]
  > button:disabled {
  opacity: 0.3;
  cursor: default;
}
main
  > section
  > figure[aria-label="Timeline"]
  > article
  > nav[aria-label="Panel controls"]
  > em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 680px) {
  main > section > figure[aria-label="Timeline"] {
    grid-template-columns: 1fr;
  }
}

/* ── Species — illustration panel + two cards (beans.html) ───────── */
main > section > article[data-layout="species"] {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: start;
}
main > section > article[data-layout="species"] > figure {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 3 / 4;
  background: var(--card);
}
main > section > article[data-layout="species"] > figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

main > section > article[data-layout="species"] > ul[aria-label="Species"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  height: 100%;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > header
  > abbr {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  text-decoration: none;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > header
  > section
  > h3 {
  font-size: 1.5rem;
  margin: 0;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > header
  > section
  > p {
  font-size: 0.78rem;
  margin: 0;
  font-style: italic;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > header
  > data {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 700;
  opacity: 0.1;
  margin-left: auto;
  color: var(--muted);
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > p
  + p {
  margin-top: 0.75rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > p
  + p
  > strong {
  color: var(--dark);
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > ul
  > li {
  border-radius: 0.75rem;
  padding: 0.75rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > ul
  > li
  > strong {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li
  > article
  > ul
  > li
  > span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark);
}

/* Per-species colour — Arabica (warm orange) vs Robusta (deep brown) */
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="arabica"]
  > article
  > header
  > abbr {
  background: rgba(196, 98, 45, 0.12);
  color: #c4622d;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="arabica"]
  > article
  > header
  > section
  > h3 {
  color: #c4622d;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="arabica"]
  > article
  > ul
  > li {
  background: rgba(196, 98, 45, 0.07);
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="robusta"]
  > article
  > header
  > abbr {
  background: rgba(107, 61, 30, 0.1);
  color: #6b3d1e;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="robusta"]
  > article
  > header
  > section
  > h3 {
  color: #6b3d1e;
}
main
  > section
  > article[data-layout="species"]
  > ul[aria-label="Species"]
  > li[data-species="robusta"]
  > article
  > ul
  > li {
  background: rgba(107, 61, 30, 0.06);
}

/* ── Roast grid ──────────────────────────────────────────────────── */
main > section > ul[aria-label="Roasts"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Roasts"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main > section > ul[aria-label="Roasts"] > li > article > figure {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  margin-inline: auto;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
main > section > ul[aria-label="Roasts"] > li > article > figure > img {
  width: 1.6rem;
  height: auto;
}
main > section > ul[aria-label="Roasts"] > li > article > h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
main > section > ul[aria-label="Roasts"] > li > article > small {
  color: var(--muted);
  letter-spacing: 0.15em;
}
main > section > ul[aria-label="Roasts"] > li > article > p {
  font-size: 1rem;
  margin-top: 0.75rem;
}
main > section > ul[aria-label="Roasts"] > li > article > p + p {
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
@media (max-width: 560px) {
  main > section > ul[aria-label="Roasts"] {
    grid-template-columns: 1fr;
  }
}

/* ── Troubleshooting dl ──────────────────────────────────────────── */
main > section > dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 2.25rem;
}
main > section > dl > dt {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  padding: 1.35rem 1.5rem 0.4rem;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  margin-top: 1.5rem;
}
main > section > dl > dt:first-child {
  margin-top: 0;
}
main > section > dl > dd {
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  padding: 0.4rem 1.5rem 1.35rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--warm);
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}

/* ── Brew method accordions ──────────────────────────────────────── */
main > section > details {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  margin-bottom: 1rem;
}
main > section > details:first-of-type {
  margin-top: 1.5rem;
}
main > section > details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}
main > section > details > summary > h3 {
  font-size: 1.1rem;
  color: var(--fg);
  margin: 0;
}
main > section > details > summary::after {
  content: "⌄";
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.25s;
  flex-shrink: 0;
}
main > section > details[open] > summary::after {
  transform: rotate(180deg);
}
main > section > details > article {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid rgba(61, 28, 2, 0.06);
  padding-top: 1.25rem;
}
main > section > details > article > p {
  font-size: 1rem;
}
main > section > details > article > ul {
  margin-top: 1rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
main > section > details > article > ul > li {
  font-size: 0.8rem;
  color: var(--warm);
}
main > section > details > article > ul > li > strong {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 0.15rem;
}
main > section > details > article > blockquote {
  background: var(--card);
  border-radius: 0.5rem;
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--warm);
  margin-top: 1rem;
}

/* ── Principles numbered list ────────────────────────────────────── */
main > section > ol[aria-label="Principles"] {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
  counter-reset: principle;
}
main > section > ol[aria-label="Principles"] > li {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  counter-increment: principle;
}
main > section > ol[aria-label="Principles"] > li::before {
  content: counter(principle);
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}
main > section > ol[aria-label="Principles"] > li > section > h3 {
  color: var(--fg);
  margin-bottom: 0.3rem;
}
main > section > ol[aria-label="Principles"] > li > section > p {
  font-size: 1rem;
}

/* ── Flavour categories ──────────────────────────────────────────── */
main > section > ul[aria-label="Flavours"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Flavours"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  height: 100%;
}
main > section > ul[aria-label="Flavours"] > li > article > h3 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
main > section > ul[aria-label="Flavours"] > li > article > p {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
main > section > ul[aria-label="Flavours"] > li > article > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
main > section > ul[aria-label="Flavours"] > li > article > ul > li {
  background: var(--card);
  border-radius: var(--rpill);
  padding: 0.25rem 0.7rem;
  font-size: 0.73rem;
  color: var(--warm);
  font-weight: 500;
}
main > section > ul[aria-label="Flavours"] > li > article > footer {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.75rem;
  border-top: 1px solid var(--bordlt);
  padding-top: 0.5rem;
}

/* ── Palate steps ────────────────────────────────────────────────── */
main > section > ol[aria-label="Palate"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
  counter-reset: palate;
}
main > section > ol[aria-label="Palate"] > li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  counter-increment: palate;
}
main > section > ol[aria-label="Palate"] > li::before {
  content: "0" counter(palate);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1;
}
main > section > ol[aria-label="Palate"] > li > h3 {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
main > section > ol[aria-label="Palate"] > li > p {
  font-size: 1rem;
}

/* ── Benefits grid (and the Health "Tips" grid, same component) ──── */
main > section > ul[aria-label="Benefits"],
main > section > ul[aria-label="Tips"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Benefits"] > li > article,
main > section > ul[aria-label="Tips"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  height: 100%;
}
main > section > ul[aria-label="Benefits"] > li > article > h3,
main > section > ul[aria-label="Tips"] > li > article > h3 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
main > section > ul[aria-label="Benefits"] > li > article > p,
main > section > ul[aria-label="Tips"] > li > article > p {
  font-size: 1rem;
}

/* ── Two-column article layout ───────────────────────────────────── */
main > section > article[data-layout="two-col"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}
main > section > article[data-layout="two-col"] > section > h2 {
  margin-bottom: 0.75rem;
}
main > section > article[data-layout="two-col"] > section > p {
  margin-bottom: 0.75rem;
}
main > section > article[data-layout="two-col"] > section > ul {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
main > section > article[data-layout="two-col"] > section > ul > li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main > section > article[data-layout="two-col"] > section > ul > li > strong {
  display: block;
  font-size: 0.85rem;
  color: var(--dark);
}
main > section > article[data-layout="two-col"] > section > ul > li > p {
  font-size: 0.8rem;
  margin: 0.2rem 0 0;
}
main > section > article[data-layout="two-col"] > section > aside {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main > section > article[data-layout="two-col"] > section > aside > h3 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}
main > section > article[data-layout="two-col"] > section > aside > p {
  font-size: 1rem;
}

/* ── Limitation cards ────────────────────────────────────────────── */
main > section > ul[aria-label="Limits"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Limits"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main > section > ul[aria-label="Limits"] > li > article > h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
main > section > ul[aria-label="Limits"] > li > article > p {
  font-size: 1rem;
}

/* ── Bottom-line dark section ────────────────────────────────────── */
main > section[data-theme="dark"] > article {
  max-width: 680px;
}
main > section[data-theme="dark"] > article > p {
  color: rgba(248, 242, 235, 0.7);
  font-size: 1rem;
  line-height: 1.75;
  margin-top: 1rem;
}
main > section[data-theme="dark"] > article > em {
  display: block;
  color: var(--tan);
  margin-top: 1rem;
  font-size: 1rem;
}

/* ── Recipe grid ─────────────────────────────────────────────────── */
main > section > ul[aria-label="Recipes"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
main > section > ul[aria-label="Recipes"] > li {
  flex: 0 1 calc((100% - 2 * 1.5rem) / 3);
  min-width: min(300px, 100%);
}
main > section > ul[aria-label="Recipes"] > li > article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
main > section > ul[aria-label="Recipes"] > li > article:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(44, 20, 8, 0.12);
}
main > section > ul[aria-label="Recipes"] > li > article > figure {
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
main > section > ul[aria-label="Recipes"] > li > article > section {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
main > section > ul[aria-label="Recipes"] > li > article > section > h3 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}
main > section > ul[aria-label="Recipes"] > li > article > section > mark {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(196, 105, 74, 0.1);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: var(--rpill);
  margin-bottom: 0.6rem;
}
main > section > ul[aria-label="Recipes"] > li > article > section > p {
  font-size: 1rem;
  flex: 1;
}
main > section > ul[aria-label="Recipes"] > li > article > section > details {
  margin-top: 0.75rem;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > summary::after {
  display: none;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ol,
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ul {
  list-style-type: disc;
  padding-left: 1.2rem;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ol {
  list-style-type: decimal;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ol
  > li,
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ul
  > li {
  font-size: 0.8rem;
  color: var(--warm);
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0.75rem 0 0.35rem;
}

/* ── Glossary A–Z nav ────────────────────────────────────────────── */
nav[aria-label="A–Z"] {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 50;
  padding: 0.75rem var(--px);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
nav[aria-label="A–Z"] > a {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
  background: rgba(61, 28, 2, 0.07);
  padding: 0.2rem 0.6rem;
  border-radius: 0.4rem;
  transition: background 0.18s;
}
nav[aria-label="A–Z"] > a:hover {
  background: rgba(61, 28, 2, 0.16);
}

/* Quiz and Quiz-result styling is defined once, further down, in the
   QUIZ section below (keeping only one, more complete declaration). */

/* ── Footer ──────────────────────────────────────────────────────── */
body > footer {
  background: var(--dark);
  color: rgba(248, 242, 235, 0.6);
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  padding: 3.5rem var(--px) 0;
}
body > footer > div > a {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #f8f2eb;
  display: block;
  margin-bottom: 0.75rem;
}
body > footer > div > a em {
  color: var(--tan);
}
body > footer > div > p {
  font-size: 0.82rem;
  color: var(--tan);
  font-weight: 300;
  max-width: 22ch;
  line-height: 1.65;
}
body > footer > nav > h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(248, 242, 235, 0.5);
  margin-bottom: 1rem;
}
body > footer > nav > ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
body > footer > nav > ul > li > a {
  font-size: 0.85rem;
  color: rgba(248, 242, 235, 0.6);
  transition: color 0.18s;
}
body > footer > nav > ul > li > a:hover {
  color: var(--tan);
}
body > footer > nav[aria-label="Legal"] {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 1rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}
body > footer > nav[aria-label="Legal"] > a {
  font-size: 0.75rem;
  color: rgba(248, 242, 235, 0.5);
  letter-spacing: 0.05em;
  transition: color 0.18s;
}
body > footer > nav[aria-label="Legal"] > a:hover {
  color: var(--tan);
}
body > footer > small {
  grid-column: 1 / -1;
  padding-block: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(248, 242, 235, 0.5);
  letter-spacing: 0.05em;
  text-transform: none;
}

/* ============================================================
   COOKIE CONSENT NOTICE
   ============================================================ */
[data-cookie-notice] {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 150;
  background: var(--dark, #2c1408);
  border-top: 2px solid var(--accent, #c4694a);
  padding: 1rem clamp(1.25rem, 5vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
[data-cookie-notice][hidden] {
  display: none;
}
[data-cookie-notice] > p {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(248, 242, 235, 0.85);
}
[data-cookie-notice] > p > a {
  color: var(--tan, #c4a882);
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-cookie-notice] > div {
  display: flex;
  flex-shrink: 0;
  gap: 0.75rem;
}
[data-cookie-notice] button {
  padding: 0.55rem 1.1rem;
  border-radius: var(--rpill, 999px);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.18s;
}
[data-cookie-notice] > div > button[data-cookie-decline] {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(248, 242, 235, 0.8);
}
[data-cookie-notice] > div > button[data-cookie-decline]:hover {
  background: rgba(255, 255, 255, 0.08);
}
[data-cookie-notice] > div > button[data-cookie-accept] {
  background: var(--accent, #c4694a);
  color: #f8f2eb;
}
[data-cookie-notice] > div > button[data-cookie-accept]:hover {
  background: #8b452d;
}
@media (max-width: 560px) {
  [data-cookie-notice] {
    flex-direction: column;
    align-items: stretch;
  }
  [data-cookie-notice] > div {
    justify-content: flex-end;
  }
}
@media (max-width: 760px) {
  body > footer {
    grid-template-columns: 1fr 1fr;
  }
  body > footer > div {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  body > footer {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PAGE LOADER
   ============================================================ */

[data-page-loader] {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: var(--dark, #2c1408);
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
[data-page-loader] > div[data-beans] {
  display: flex;
  gap: 0.6rem;
}
[data-page-loader] > div[data-beans] > svg {
  width: 26px;
  height: 26px;
  animation: ban-bean-bounce 1s ease-in-out infinite;
}
[data-page-loader] > div[data-beans] > svg:nth-child(2) {
  animation-delay: 0.15s;
}
[data-page-loader] > div[data-beans] > svg:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ban-bean-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-10px);
    opacity: 1;
  }
}
[data-page-loader] > small {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(248, 242, 235, 0.55);
}
body[data-loaded] > [data-page-loader] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================
   SITE HEADER
   ============================================================ */

body > header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark, #2c1408);
  border-bottom: 2px solid var(--accent, #c4694a);
  display: flex;
  align-items: center;
  padding: 0.75rem clamp(1.25rem, 5vw, 2.5rem);
  gap: 2rem;
  min-height: 60px;
}
body > header > section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
body > header > section > a {
  font-family: var(--serif, "Playfair Display", serif);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  line-height: 1;
  font-weight: 700;
  color: #f8f2eb;
  letter-spacing: -0.01em;
}
body > header > section > a em {
  color: var(--tan, #c4a882);
  font-style: italic;
}

body > header > nav[aria-label="Primary"] {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.1rem;
}
body > header > nav[aria-label="Primary"] > a {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(248, 242, 235, 0.6);
  padding: 0.32rem 0.6rem;
  border-radius: 0.5rem;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body > header > nav[aria-label="Primary"] > a:hover,
body > header > nav[aria-label="Primary"] > a[aria-current="page"] {
  color: #f8f2eb;
  background: rgba(196, 105, 74, 0.18);
}
body > header > nav[aria-label="Primary"] > a[data-quiz] {
  margin-left: auto;
  background: var(--accent, #c4694a);
  color: #f8f2eb;
  border-radius: 999px;
}
body > header > nav[aria-label="Primary"] > a[data-quiz]:hover {
  background: #8b452d;
}
body > header > details {
  display: none;
}

@media (max-width: 820px) {
  body > header {
    position: sticky;
  }
  body > header > nav[aria-label="Primary"] {
    display: none;
  }
  body > header > details {
    display: block;
    margin-left: auto;
  }
  body > header > details > summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
  }
  body > header > details > summary::marker,
  body > header > details > summary::-webkit-details-marker {
    display: none;
  }
  body > header > details > summary > span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f8f2eb;
    border-radius: 2px;
  }
  body > header > details > nav {
    position: fixed;
    inset: 0;
    width: 100%;
    background: #1a0a02;
    padding: 1.5rem clamp(1.25rem, 6vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 200;
    animation: ban-slide-in 0.22s ease;
    overflow-y: auto;
  }
  body > header > details > nav > div[data-menu-head] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
  }
  body
    > header
    > details
    > nav
    > div[data-menu-head]
    > button[data-menu-close] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    color: #f8f2eb;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.18s;
  }
  body
    > header
    > details
    > nav
    > div[data-menu-head]
    > button[data-menu-close]:hover {
    background: rgba(255, 255, 255, 0.16);
  }
  @keyframes ban-slide-in {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  body > header > details > nav > a {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(248, 242, 235, 0.75);
    padding: 0.85rem 1rem;
    border-radius: 0.6rem;
    transition: all 0.18s;
  }
  body > header > details > nav > a:hover {
    color: #f8f2eb;
    background: rgba(196, 105, 74, 0.2);
  }
  body:has(> header > details[open]) {
    overflow: hidden;
  }
}

/* A–Z sticky nav offset — matches the single-row header's height (same at every breakpoint) */
nav[aria-label="A–Z"] {
  top: 60px;
}

/* ============================================================
   GLOSSARY
   ============================================================ */

nav[aria-label="A–Z"] {
  background: #f8f2eb;
  border-bottom: 1px solid rgba(61, 28, 2, 0.08);
  position: sticky;
  z-index: 50;
  padding: 0.65rem clamp(1.25rem, 5vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
nav[aria-label="A–Z"] > a {
  font-family: "Playfair Display", serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2c1408;
  background: rgba(61, 28, 2, 0.07);
  padding: 0.28rem 0.7rem;
  border-radius: 0.4rem;
  text-decoration: none;
  transition:
    background 0.18s,
    transform 0.15s;
  min-width: 2.1rem;
  text-align: center;
}
nav[aria-label="A–Z"] > a:hover {
  background: rgba(61, 28, 2, 0.15);
  transform: translateY(-1px);
}

main > section[data-glossary] {
  background: #f8f2eb !important;
  padding-block: 4.5rem;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
main > section[data-glossary] > dl {
  max-width: 1100px;
  margin-inline: auto;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
main > section[data-glossary] > dl > dt {
  font-family: "Playfair Display", serif !important;
  font-size: 3rem !important;
  font-weight: 700 !important;
  color: #c4694a !important;
  background: none !important;
  border: none !important;
  border-bottom: 2px solid rgba(196, 105, 74, 0.2) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 0.5rem !important;
  margin: 3.5rem 0 0 !important;
  scroll-margin-top: 130px;
}
main > section[data-glossary] > dl > dt:first-child {
  margin-top: 0 !important;
}
main > section[data-glossary] > dl > dd {
  background: none !important;
  border: none !important;
  border-bottom: 1px solid rgba(61, 28, 2, 0.07) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 1.4rem 0 !important;
  margin: 0 !important;
  display: block !important;
  transition: background 0.15s;
}
main > section[data-glossary] > dl > dd:hover {
  background: rgba(196, 105, 74, 0.03) !important;
}
main > section[data-glossary] > dl > dd:last-child {
  border-bottom: none !important;
}
main > section[data-glossary] > dl > dd > dfn {
  font-family: "Playfair Display", serif !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  font-style: normal !important;
  color: #2c1408 !important;
  display: block !important;
  margin-bottom: 0.4rem !important;
}
main > section[data-glossary] > dl > dd > p {
  font-size: 1rem !important;
  font-weight: 300 !important;
  color: #725c3a !important;
  line-height: 1.72 !important;
  margin: 0 !important;
}

/* ============================================================
   FLAVOUR WHEEL
   ============================================================ */

main > section > figure[data-wheel-wrap] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 2.5rem auto;
  max-width: 1000px;
}
main > section > figure[data-wheel-wrap] > svg {
  width: min(600px, 100%);
  cursor: pointer;
  display: block;
}
main > section > figure[data-wheel-wrap] > output {
  width: min(600px, 100%);
  padding: 1.5rem;
  background: #f5ede2;
  border-radius: 1rem;
  border-left: 3px solid #c4694a;
  font-style: normal;
  transition: border-color 0.2s;
}
main > section > figure[data-wheel-wrap] > output > p {
  color: #725c3a;
  font-size: 0.9rem;
  font-style: italic;
}
main > section > figure[data-wheel-wrap] > output > h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Playfair Display", serif;
  color: #2c1408;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
main > section > figure[data-wheel-wrap] > output > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0.8rem;
}
main > section > figure[data-wheel-wrap] > output > ul > li {
  background: #d8e3ce;
  color: #2c1408;
  font-size: 0.73rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-weight: 500;
}
main > section > figure[data-wheel-wrap] > output > footer {
  font-size: 0.78rem;
  color: #896040;
  font-style: italic;
  background: none;
  padding: 0;
  margin-top: 0.6rem;
}
svg g[data-segment] {
  cursor: pointer;
  outline: none !important;
  transition: opacity 0.2s;
}
svg g[data-segment]:hover {
  opacity: 0.82;
}
svg g[aria-pressed="true"] {
  filter: drop-shadow(0 0 8px rgba(44, 20, 8, 0.35));
}
/* Keyboard focus ring, shaped to the wedge instead of a boxy native
   outline — a rectangle never looked right over a pie slice, and
   relying on outline:auto here is what let some browsers draw one on
   an ordinary mouse click in the first place. */
svg g[data-segment]:focus-visible path {
  stroke: #2c1408;
  stroke-width: 3;
}
svg g[data-segment] text {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  fill: #f8f2eb;
  pointer-events: none;
  text-anchor: middle;
}

/* ============================================================
   RECIPE EXPAND/CLOSE
   ============================================================ */

main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  user-select: none;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details[open]
  > summary::before {
  content: "Close ";
  font-size: 0.78rem;
  font-weight: 600;
  color: #896040;
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details[open]
  > summary {
  color: #896040;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(61, 28, 2, 0.08);
}
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > h4,
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ul,
main
  > section
  > ul[aria-label="Recipes"]
  > li
  > article
  > section
  > details
  > ol {
  animation: recipeReveal 0.25s ease;
}
@keyframes recipeReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   ANIMATIONS & SCROLL REVEAL
   ============================================================ */

@keyframes ban-fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ban-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes ban-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes ban-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(196, 105, 74, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(196, 105, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(196, 105, 74, 0);
  }
}
body {
  animation: ban-fade-in 0.3s ease forwards;
}
main > section {
  opacity: 0;
  animation: ban-fade-up 0.55s ease forwards;
  animation-play-state: paused;
}
main > section[data-visible] {
  animation-play-state: running;
}
main > section:nth-child(1) {
  animation-delay: 0.05s;
}
main > section:nth-child(2) {
  animation-delay: 0.12s;
}
main > section:nth-child(3) {
  animation-delay: 0.19s;
}
main > section:nth-child(4) {
  animation-delay: 0.26s;
}
main > section:nth-child(5) {
  animation-delay: 0.33s;
}
main > section:nth-child(6) {
  animation-delay: 0.4s;
}
main > section[aria-label="Result"] {
  animation: ban-scale-in 0.4s ease forwards;
}
main > section[aria-label="Result"] > data {
  animation: ban-fade-up 0.5s 0.1s ease forwards;
  opacity: 0;
}
main > section[aria-label="Quiz"] > blockquote {
  transition:
    opacity 0.3s ease,
    max-height 0.35s ease;
}
main > section[aria-label="Quiz"] > blockquote[aria-hidden="true"] {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
main > section[aria-label="Quiz"] > blockquote[aria-hidden="false"] {
  opacity: 1;
  max-height: 200px;
}
a[data-btn="primary"]:focus-visible {
  animation: ban-pulse 0.6s ease;
}
html {
  scroll-behavior: smooth;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet and below: collapse two-up layouts to a single column */
@media (max-width: 820px) {
  main > section > figure[aria-label="Timeline"] {
    grid-template-columns: 1fr;
  }
  main > section > figure[aria-label="Timeline"] > nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  main > section > figure[aria-label="Timeline"] > nav > button {
    flex: 1;
    min-width: 80px;
    justify-content: center;
  }
  main > section > figure[aria-label="Timeline"] > nav > button > span {
    display: none;
  }

  main > section > article[data-layout="species"] {
    grid-template-columns: 1fr;
  }
  main > section > article[data-layout="species"] > figure {
    aspect-ratio: 16 / 9;
    max-width: 400px;
    margin-inline: auto;
    width: 100%;
  }
  main
    > section
    > article[data-layout="species"]
    > ul[aria-label="Species"]
    > li
    > article
    > ul {
    grid-template-columns: 1fr;
  }

  main > section[data-theme="cream"] > article {
    grid-template-columns: 1fr;
  }
  main > section > ul[aria-label="Roasts"] {
    grid-template-columns: 1fr;
  }

  main > section[data-glossary] > dl > dt,
  main > section[data-glossary] > dl > dd {
    max-width: 100%;
  }

  main > section > figure[data-wheel-wrap] {
    align-items: stretch;
  }
  main > section > figure[data-wheel-wrap] > svg {
    width: 100%;
  }
  main > section > figure[data-wheel-wrap] > output {
    width: 100%;
  }

  main > section > article[data-layout="two-col"] {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  main > section[data-theme="stats"] > ul {
    grid-template-columns: repeat(2, 1fr);
  }
  main > section > ul[aria-label="Chapters"] {
    grid-template-columns: 1fr;
  }
  main > section[data-theme="dark"] > ol {
    grid-template-columns: 1fr;
  }

  body > footer {
    grid-template-columns: 1fr 1fr;
  }
  body > footer > div {
    grid-column: 1 / -1;
  }

  main > section {
    padding-block: 3rem;
  }
  main > section[data-theme="page-hero"] {
    padding-block: 2rem;
  }
  main > section[data-theme="hero"] {
    padding-block: 3rem;
  }

  nav[aria-label="A–Z"] {
    top: 90px;
  }
}

/* Phone: tighten spacing further and switch a few remaining grids to one column */
@media (max-width: 560px) {
  main > section[data-theme="page-hero"] h1 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
  }

  main > section > ol[aria-label="Palate"],
  main > section > ul[aria-label="Benefits"],
  main > section > ul[aria-label="Limits"] {
    grid-template-columns: 1fr;
  }

  main > section[data-theme="stats"] > ul {
    gap: 1rem;
  }

  main > section > figure[aria-label="Timeline"] > nav > button {
    min-width: calc(50% - 0.25rem);
  }

  main > section > ol[aria-label="Principles"] > li {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  body > footer {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   RECIPE FILTER (Hot / Iced)
   ============================================================ */

main > section nav[aria-label="Filter recipes"] {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
}
main > section nav[aria-label="Filter recipes"] > button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1.5px solid rgba(61, 28, 2, 0.15);
  background: none;
  font-family: "DM Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #725c3a;
  cursor: pointer;
  transition: all 0.2s;
}
main > section nav[aria-label="Filter recipes"] > button > svg {
  flex-shrink: 0;
}
main > section nav[aria-label="Filter recipes"] > button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
main > section nav[aria-label="Filter recipes"] > button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Hidden recipe items — smooth fade/scale transition + display:none
   rules live together further down, next to the [data-leaving]
   entrance/exit state they pair with. */

/* ============================================================
   GLOSSARY — ACTIVE LETTER INDICATOR
   ============================================================ */

nav[aria-label="A–Z"] > a {
  position: relative;
  transition:
    color 0.18s,
    background 0.18s;
}
nav[aria-label="A–Z"] > a[aria-current="true"] {
  background: none !important;
  color: var(--accent) !important;
  font-weight: 700;
}
nav[aria-label="A–Z"] > a[aria-current="true"]::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================================
   HEALTH — BENEFIT CARD ICONS
   ============================================================ */

main > section > ul[aria-label="Benefits"] > li > article > figure,
main > section > ul[aria-label="Tips"] > li > article > figure {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  background: rgba(135, 153, 112, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

/* ============================================================
   PAGE ICONS
   ============================================================ */

/* Brewing accordion icons */
main > section > details > summary > span[data-icon] {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 28, 2, 0.06);
  border-radius: 0.5rem;
  flex-shrink: 0;
  color: var(--accent);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
main > section > details[open] > summary > span[data-icon] {
  background: var(--accent);
  color: #f8f2eb;
}

/* History timeline flag icons */
main > section > figure[aria-label="Timeline"] > nav > button > abbr {
  font-size: 1.1rem;
  font-style: normal;
  text-decoration: none;
}

/* Homepage chapter card icons */
main > section > ul[aria-label="Chapters"] > li > a > article > svg {
  display: block;
  margin-bottom: 0.75rem;
  transition: transform 0.22s ease;
}
main > section > ul[aria-label="Chapters"] > li > a:hover > article > svg {
  transform: translateY(-2px) scale(1.05);
}

/* ============================================================
   QUIZ
   ============================================================ */

main > section[aria-label="Quiz"] {
  padding-block: 3rem;
}
main > section[aria-label="Quiz"] > p {
  color: var(--muted);
  font-size: 0.9rem;
}
main > section[aria-label="Quiz"] > meter {
  display: block;
  width: 100%;
  height: 5px;
  margin-bottom: 2.5rem;
  border-radius: 3px;
  accent-color: #c4694a;
}
main > section[aria-label="Quiz"] > small {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
main > section[aria-label="Quiz"] > h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: #2c1408;
  font-weight: 700;
  margin: 0.6rem 0 1.75rem;
  line-height: 1.3;
  max-width: 680px;
}
main > section[aria-label="Quiz"] > ol {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 780px;
}
main > section[aria-label="Quiz"] > ol > li > button {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid rgba(61, 28, 2, 0.12);
  border-radius: 0.75rem;
  font-size: 0.92rem;
  color: #2c1408;
  background: #fff;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition:
    border-color 0.18s,
    background 0.18s,
    transform 0.1s;
  font-family: "DM Sans", sans-serif;
}
main > section[aria-label="Quiz"] > ol > li > button:hover:not(:disabled) {
  border-color: #c4694a;
  background: rgba(196, 105, 74, 0.04);
  transform: translateX(3px);
}
main > section[aria-label="Quiz"] > ol > li > button > abbr {
  min-width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #f5ede2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
  font-style: normal;
  color: #2c1408;
  transition: background 0.18s;
}
main
  > section[aria-label="Quiz"]
  > ol
  > li
  > button:hover:not(:disabled)
  > abbr {
  background: var(--accent);
  color: #fff;
}
main > section[aria-label="Quiz"] > ol > li > button[data-state="correct"] {
  border-color: #5a9e5a;
  background: rgba(90, 158, 90, 0.07);
  color: #3d6b3d;
}
main > section[aria-label="Quiz"] > ol > li > button[data-state="wrong"] {
  border-color: var(--accent);
  background: rgba(196, 105, 74, 0.07);
  color: var(--accent);
}
main > section[aria-label="Quiz"] > ol > li > button:disabled {
  cursor: default;
}
main > section[aria-label="Quiz"] > blockquote {
  background: #f5ede2;
  border-radius: 0.75rem;
  border-left: 3px solid #c4694a;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: #725c3a;
  margin-top: 1.5rem;
  max-width: 780px;
}
main > section[aria-label="Quiz"] > blockquote > strong {
  color: #2c1408;
  font-weight: 600;
}
main > section[aria-label="Quiz"] > nav {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  max-width: 780px;
}
main > section[aria-label="Quiz"] > nav > button {
  padding: 0.65rem 1.75rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #f4763a 0%, #e8622b 100%);
  color: #2c1408;
  font-family: "DM Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(232, 98, 43, 0.35);
  transition:
    background 0.2s,
    opacity 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}
main > section[aria-label="Quiz"] > nav > button:hover:not(:disabled) {
  background: linear-gradient(135deg, #f6885a 0%, #ee7038 100%);
  box-shadow: 0 6px 22px rgba(232, 98, 43, 0.5);
  transform: translateY(-2px);
}
main > section[aria-label="Quiz"] > nav > button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Quiz result section */
main > section[aria-label="Result"] {
  padding-block: 4rem;
  text-align: center;
}
main > section[aria-label="Result"] > data {
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 1rem;
}
main > section[aria-label="Result"] > h2 {
  font-size: 1.8rem;
  color: #2c1408;
  margin-bottom: 0.75rem;
}
main > section[aria-label="Result"] > p {
  font-size: 0.95rem;
  color: #725c3a;
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: 2rem;
}
main > section[aria-label="Result"] > nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   HEALTH — TWO-COLUMN SECTION
   ============================================================ */

main > section[data-theme="alt"] {
  padding-block: 3.5rem;
}
main > section[data-theme="alt"] + section {
  padding-block-start: 3.5rem;
}

/* Sub-heading alignment */
main > section > article[data-layout="two-col"] > section > h2 {
  font-size: 1.25rem !important;
  color: #2c1408;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid rgba(61, 28, 2, 0.08);
}

/* Caffeine list items */
main > section > article[data-layout="two-col"] > section > ul > li {
  border-left: 3px solid rgba(196, 105, 74, 0.25) !important;
  border-radius: 0 0.75rem 0.75rem 0 !important;
}
main > section > article[data-layout="two-col"] > section > ul > li > strong {
  font-size: 0.9rem !important;
  color: #2c1408 !important;
  font-weight: 600 !important;
}
main > section > article[data-layout="two-col"] > section > ul > li > p {
  font-size: 0.82rem !important;
  color: #725c3a !important;
}

/* ============================================================
   SECTION SPACING — tighten consecutive same-theme sections
   ============================================================ */

main > section[data-theme="page-hero"] + section {
  padding-block-start: 3.5rem;
}
main > section + section[data-theme="cta"] {
  padding-block-start: 2.5rem;
  padding-block-end: 2.5rem;
}

/* ============================================================
   PHOTOGRAPHY & HERO IMAGES
   ============================================================ */

/* Hero images on inner pages */
section[data-theme="page-hero"][data-has-image] {
  position: relative;
  overflow: hidden;
}
figure[data-hero-image] {
  position: absolute;
  inset: 0;
  margin: 0;
  max-width: none;
  width: 100%;
  z-index: 0;
}
figure[data-hero-image] > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: grayscale(20%);
}
section[data-theme="page-hero"][data-has-image] > *:not(figure) {
  position: relative;
  z-index: 1;
}
section[data-theme="page-hero"][data-has-image] > nav {
  position: relative;
  z-index: 1;
}

/* Homepage hero overlay image — must escape the generic
   `main > section > *` max-width:1100px rule so the background
   truly runs edge to edge, not just across the text column. */
main > section[data-theme="hero"] > figure {
  position: absolute;
  inset: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  z-index: 0;
}
section[data-theme="hero"] figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

/* ============================================================
   SITE HEADER — MOBILE REFINEMENTS
   ============================================================ */

/* Mobile hamburger — show Menu label */
body > header > details > summary > small {
  font-size: 0.72rem;
  color: rgba(248, 242, 235, 0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
  text-align: center;
}
body > header > details > summary {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
}

/* ============================================================
   FLAVOUR WHEEL — SEGMENT LABEL CONTRAST
   ============================================================ */

/* Make SVG segment labels readable on both light and dark backgrounds */
svg g[data-segment] text {
  fill: #f8f2eb !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* On mobile, increase segment text readability */
@media (max-width: 480px) {
  svg g[data-segment] text {
    font-size: 9px !important;
  }
}

/* ============================================================
   HOMEPAGE — QUIZ CTA & ABOUT SECTION
   ============================================================ */

/* Quiz CTA — dark coffee background with high contrast text */
main > section[data-theme="quiz-cta"] {
  background: #2c1408;
  padding-block: 4rem;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
main > section[data-theme="quiz-cta"] > article {
  max-width: 1100px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}
main > section[data-theme="quiz-cta"] > article > section > small {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #c4a882;
  font-weight: 500;
  display: block;
  margin-bottom: 0.6rem;
}
main > section[data-theme="quiz-cta"] > article > section > h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: #f8f2eb;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
main > section[data-theme="quiz-cta"] > article > section > p {
  font-size: 0.95rem;
  color: rgba(248, 242, 235, 0.65);
  line-height: 1.7;
  max-width: 540px;
}

/* About section — "Made for curious beginners" */
main > section[data-theme="cream"] > article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  max-width: 1100px;
  margin-inline: auto;
}
main > section[data-theme="cream"] > article > section:first-child > small {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: block;
  margin-bottom: 0.75rem;
}
main > section[data-theme="cream"] > article > section:first-child > h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #2c1408;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
main > section[data-theme="cream"] > article > section:first-child > p {
  font-size: 0.92rem;
  color: #725c3a;
  line-height: 1.75;
  margin-bottom: 0.8rem;
}
main > section[data-theme="cream"] > article > section:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
main > section[data-theme="cream"] > article > section:last-child > article {
  background: #fff;
  border: 1px solid rgba(61, 28, 2, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(44, 20, 8, 0.06);
}
main
  > section[data-theme="cream"]
  > article
  > section:last-child
  > article
  > h3 {
  font-size: 0.95rem;
  color: #2c1408;
  margin-bottom: 0.35rem;
  font-family: "Playfair Display", serif;
}
main
  > section[data-theme="cream"]
  > article
  > section:last-child
  > article
  > p {
  font-size: 0.8rem;
  color: #725c3a;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 720px) {
  main > section[data-theme="cream"] > article {
    grid-template-columns: 1fr;
  }
  main > section[data-theme="quiz-cta"] > article {
    flex-direction: column;
  }
}

/* ============================================================
   HOMEPAGE HERO
   ============================================================ */

main > section[data-theme="hero"] {
  position: relative;
  overflow: hidden;
  background: #3e1f0d;
  min-height: 520px;
  width: 100%;
  padding: 5rem clamp(1.25rem, 5vw, 3rem);
}
main > section[data-theme="hero"] > div {
  position: relative;
  z-index: 1;
}
main > section[data-theme="hero"] > div > small {
  color: rgba(228, 205, 176, 0.8);
  font-weight: 600;
}
main > section[data-theme="hero"] > div > h1 {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
main > section[data-theme="hero"] > div > p {
  color: rgba(228, 205, 176, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   QUIZ — CENTRED LAYOUT
   ============================================================ */

main > section[aria-label="Quiz"] {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
main > section[aria-label="Quiz"] > h2 {
  text-align: center;
  margin-inline: auto;
  max-width: 100%;
}
main > section[aria-label="Quiz"] > ol {
  text-align: left;
  max-width: 100%;
}
main > section[aria-label="Quiz"] > meter {
  max-width: 100%;
}
main > section[aria-label="Quiz"] > nav {
  justify-content: center;
  max-width: 100%;
}
main > section[aria-label="Quiz"] > blockquote {
  text-align: left;
  max-width: 100%;
}

/* ============================================================
   GLOSSARY — CENTRED A–Z NAV
   ============================================================ */

nav[aria-label="A–Z"] {
  justify-content: center !important;
}
main > section[data-glossary] > dl > dt {
  text-align: center !important;
  border-bottom: 1.5px solid rgba(196, 105, 74, 0.2) !important;
  padding-bottom: 0.75rem !important;
}
main > section[data-glossary] > dl > dd > dfn {
  font-size: 1rem !important;
}

/* ============================================================
   "TEST YOURSELF" BANNER
   ============================================================ */

/* Warm beige-to-tan gradient with dark typography — chosen for
   strong, easy contrast against both the heading and body text. */
main > section[data-theme="quiz-cta"] {
  background: linear-gradient(135deg, #f3e6d2 0%, #e7c9a0 100%) !important;
  border-top: 1px solid rgba(61, 28, 2, 0.06);
  border-bottom: 1px solid rgba(61, 28, 2, 0.06);
}
main > section[data-theme="quiz-cta"] > article > section > small {
  color: #7a3010 !important;
}
main > section[data-theme="quiz-cta"] > article > section > h2 {
  color: #2c1408 !important;
}
main > section[data-theme="quiz-cta"] > article > section > p {
  color: #5c4327 !important;
}
main > section[data-theme="quiz-cta"] a[data-btn="primary"] {
  box-shadow: 0 4px 16px rgba(61, 28, 2, 0.18);
}

/* ============================================================
   RECIPE FILTER — ALIGNED TO GRID
   ============================================================ */

main > section nav[aria-label="Filter recipes"] {
  justify-content: flex-start !important;
  margin-bottom: 0 !important;
}

/* ============================================================
   RECIPE TOOLBAR — filter pills + search + grid/list toggle
   ============================================================ */

main > section > div[data-recipe-toolbar] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem auto 0;
}
main > section > div[data-recipe-toolbar] > nav[aria-label="Filter recipes"] {
  margin: 0 !important;
}
main > section > div[data-recipe-toolbar] > div[data-recipe-tools] {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

main label[data-search] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1.5px solid rgba(61, 28, 2, 0.15);
  border-radius: var(--rpill);
  background: #fff;
  color: var(--muted);
  transition: border-color 0.2s;
}
main label[data-search]:focus-within {
  border-color: var(--accent);
  color: var(--accent);
}
main label[data-search] > svg {
  flex-shrink: 0;
}
/* The label's accessible name comes from this text, not from the search
   icon (aria-hidden) or a placeholder (which isn't a substitute for a
   label) — kept visually hidden since the icon already communicates it
   sighted users. */
main label[data-search] > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
main label[data-search] > input {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--fg);
  width: 11rem;
  max-width: 40vw;
  line-height: normal;
}
main label[data-search] > input::placeholder {
  color: rgba(114, 92, 58, 0.55);
}
/* Firefox/Safari draw a native "clear" control inside type="search"
   inputs that Chrome doesn't — remove it so the box matches across
   browsers instead of gaining extra width/height on some of them. */
main label[data-search] > input::-webkit-search-cancel-button,
main label[data-search] > input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

main div[data-view-toggle] {
  display: flex;
  gap: 0.15rem;
  border: 1.5px solid rgba(61, 28, 2, 0.15);
  border-radius: 0.6rem;
  padding: 0.2rem;
  background: #fff;
}
main div[data-view-toggle] > button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  color: var(--muted);
  transition: all 0.18s;
}
main div[data-view-toggle] > button:hover {
  color: var(--accent);
}
main div[data-view-toggle] > button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 640px) {
  main > section > div[data-recipe-toolbar] > div[data-recipe-tools] {
    margin-left: 0;
    width: 100%;
  }
  main label[data-search] {
    flex: 1;
  }
  main label[data-search] > input {
    width: 100%;
    max-width: none;
  }
}

/* List view — compact horizontal rows instead of a card grid */
main > section > ul[aria-label="Recipes"][data-view="list"] {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
main > section > ul[aria-label="Recipes"][data-view="list"] > li {
  flex: auto;
  min-width: 0;
  width: 100%;
}
main > section > ul[aria-label="Recipes"][data-view="list"] > li > article {
  flex-direction: row;
  align-items: flex-start;
}
main
  > section
  > ul[aria-label="Recipes"][data-view="list"]
  > li
  > article
  > figure {
  height: auto;
  width: 4.5rem;
  align-self: stretch;
  flex-shrink: 0;
}
main
  > section
  > ul[aria-label="Recipes"][data-view="list"]
  > li
  > article
  > figure
  > svg {
  width: 32px;
  height: 32px;
}

/* ============================================================
   HEALTH — TWO-COLUMN CARD PANELS
   (data-theme="alt" scoping makes this specific to the Health
   page, distinct from the Beans page's own two-col treatment)
   ============================================================ */

main > section[data-theme="alt"] > article[data-layout="two-col"] {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 3rem !important;
  padding: 0 !important;
}
main > section[data-theme="alt"] > article[data-layout="two-col"] > section {
  background: #fff;
  border: 1px solid rgba(61, 28, 2, 0.08);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(44, 20, 8, 0.06);
}
main
  > section[data-theme="alt"]
  > article[data-layout="two-col"]
  > section
  > h2 {
  font-size: 1.3rem !important;
  padding-bottom: 0.75rem !important;
  margin-bottom: 1rem !important;
  border-bottom: 2px solid rgba(196, 105, 74, 0.15) !important;
}

/* ============================================================
   HOVER & INTERACTION STATES
   ============================================================ */

main > section > ul[aria-label="Chapters"] > li > a {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease !important;
}
main > section > ul[aria-label="Chapters"] > li > a:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 32px rgba(44, 20, 8, 0.13) !important;
}

/* Brewing accordion hover */
main > section > details {
  transition: box-shadow 0.2s ease !important;
}
main > section > details:hover {
  box-shadow: 0 4px 20px rgba(44, 20, 8, 0.1) !important;
}

/* History timeline button animations */
main > section > figure[aria-label="Timeline"] > nav > button {
  transition: all 0.22s ease !important;
}
main > section > figure[aria-label="Timeline"] > nav > button:hover {
  transform: translateX(4px) !important;
}

/* Flavour wheel hover pulse */
@keyframes ban-wheel-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
}
main > section > figure[data-wheel-wrap] > svg {
  animation: ban-wheel-breathe 4s ease infinite;
}

/* CTA section links hover */
a[data-btn="primary"] {
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease !important;
}
a[data-btn="primary"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(196, 105, 74, 0.35) !important;
}

/* Glossary term hover */
main > section[data-glossary] > dl > dd {
  transition:
    padding-left 0.18s ease,
    background 0.18s ease !important;
}
main > section[data-glossary] > dl > dd:hover {
  padding-left: 0.75rem !important;
  background: rgba(196, 105, 74, 0.04) !important;
}

/* Quiz option bounce on select */
main > section[aria-label="Quiz"] > ol > li > button:active:not(:disabled) {
  transform: scale(0.98) translateX(2px) !important;
}

/* Health cards hover */
main > section > ul[aria-label="Benefits"] > li > article,
main > section > ul[aria-label="Limits"] > li > article,
main > section > ul[aria-label="Tips"] > li > article {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease !important;
}
main > section > ul[aria-label="Benefits"] > li > article:hover,
main > section > ul[aria-label="Limits"] > li > article:hover,
main > section > ul[aria-label="Tips"] > li > article:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(44, 20, 8, 0.1) !important;
}

/* Recipe card hover */
main > section > ul[aria-label="Recipes"] > li > article:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 28px rgba(44, 20, 8, 0.13) !important;
}

/* ============================================================
   SCROLL-REVEAL STAGGER (chapter cards, stats)
   ============================================================ */

/* Chapter cards */
main > section > ul[aria-label="Chapters"] > li {
  opacity: 0;
  animation: ban-fade-up 0.5s ease forwards;
  animation-play-state: paused;
}
main > section[data-visible] > ul[aria-label="Chapters"] > li {
  animation-play-state: running;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(1) {
  animation-delay: 0.05s;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(2) {
  animation-delay: 0.12s;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(3) {
  animation-delay: 0.19s;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(4) {
  animation-delay: 0.26s;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(5) {
  animation-delay: 0.33s;
}
main > section > ul[aria-label="Chapters"] > li:nth-child(6) {
  animation-delay: 0.4s;
}

/* Stats counter animation */
main > section[data-theme="stats"] > ul > li {
  opacity: 0;
  animation: ban-fade-up 0.5s ease forwards;
  animation-play-state: paused;
}
main > section[data-theme="stats"][data-visible] > ul > li {
  animation-play-state: running;
}
main > section[data-theme="stats"] > ul > li:nth-child(1) {
  animation-delay: 0.05s;
}
main > section[data-theme="stats"] > ul > li:nth-child(2) {
  animation-delay: 0.15s;
}
main > section[data-theme="stats"] > ul > li:nth-child(3) {
  animation-delay: 0.25s;
}
main > section[data-theme="stats"] > ul > li:nth-child(4) {
  animation-delay: 0.35s;
}

@media (max-width: 720px) {
  main > section[data-theme="alt"] > article[data-layout="two-col"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   BEANS — ALTITUDE BARS & FRESHNESS TIMELINE
   ============================================================ */

/* Each feature panel is an elegant white card — not a generic
   dashboard tile: single soft border, generous padding, one accent
   rule under the icon+heading row instead of a boxed icon badge. */
main
  > section
  > article[data-layout="two-col"]:has([data-feature-head])
  > section {
  background: #fff;
  border: 1px solid rgba(61, 28, 2, 0.08);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(44, 20, 8, 0.05);
}
[data-feature-head] {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid rgba(61, 28, 2, 0.08);
}
[data-feature-head] > h3 {
  border: 0 !important;
  padding: 0 !important;
}
[data-feature-head] > span {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: rgba(61, 28, 2, 0.06);
  border-radius: 0.65rem;
}
@supports not selector(:has(*)) {
  /* Fallback for browsers without :has() support — panel styling
     still degrades gracefully to the plain two-column layout. */
  main
    > section[data-theme="cream"]
    > article[data-layout="two-col"]
    > section {
    background: #fff;
    border: 1px solid rgba(61, 28, 2, 0.08);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(44, 20, 8, 0.05);
  }
}

/* Altitude bars */
ul[data-altitude] {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
ul[data-altitude] > li > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
ul[data-altitude] > li > header > strong {
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  color: #2c1408;
}
ul[data-altitude] > li > header > span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #896040;
  font-weight: 600;
}
ul[data-altitude] > li > data {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(61, 28, 2, 0.08);
  position: relative;
  overflow: hidden;
}
ul[data-altitude] > li > data::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #c4a882, #c4694a);
  transform-origin: left center;
  transform: scaleX(0);
  animation: ban-bar-fill 0.8s ease forwards;
  animation-play-state: paused;
}
main > section[data-visible] ul[data-altitude] > li > data::before {
  animation-play-state: running;
}
@keyframes ban-bar-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
ul[data-altitude] > li > p {
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

/* Freshness timeline */
ol[data-freshness] {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  position: relative;
}
ol[data-freshness]::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, #879970, #c4a882, #c4694a, #3d1c02);
  border-radius: 2px;
}
ol[data-freshness] > li {
  position: relative;
  padding: 0 0 1.4rem 2rem;
}
ol[data-freshness] > li:last-child {
  padding-bottom: 0;
}
ol[data-freshness] > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--stage-color, #c4694a);
  border: 2px solid #f5ede2;
  box-shadow: 0 0 0 1px rgba(61, 28, 2, 0.12);
}
ol[data-freshness] > li > strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  color: #2c1408;
  margin-bottom: 0.2rem;
}
ol[data-freshness] > li > p {
  font-size: 0.82rem;
  margin: 0;
}

@media (max-width: 720px) {
  main > section[data-theme="alt"] > article[data-layout="two-col"] {
    grid-template-columns: 1fr !important;
  }
}

/* Caffeine comparison bars (Health page) */
ul[data-caffeine] {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
ul[data-caffeine] > li {
  display: grid;
  grid-template-columns: 11rem 1fr 3.6rem;
  align-items: center;
  gap: 0.9rem;
}
ul[data-caffeine] > li > span[data-drink] {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
ul[data-caffeine] > li > data {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(61, 28, 2, 0.08);
  position: relative;
  overflow: hidden;
}
ul[data-caffeine] > li > data::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #c4a882, #4a7b9d);
  transform-origin: left center;
  transform: scaleX(0);
  animation: ban-bar-fill 0.8s ease forwards;
  animation-play-state: paused;
}
main > section[data-visible] ul[data-caffeine] > li > data::before {
  animation-play-state: running;
}
ul[data-caffeine] > li > output {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--warm);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) {
  ul[data-caffeine] > li {
    grid-template-columns: 7.5rem 1fr 3rem;
    gap: 0.55rem;
  }
  ul[data-caffeine] > li > span[data-drink] {
    font-size: 0.76rem;
  }
}

/* ============================================================
   KEYBOARD FOCUS STATES
   ============================================================ */

/* One consistent, brand-coloured focus ring for every interactive
   element, shown only for keyboard/AT users (not mouse clicks). */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid #c4694a;
  outline-offset: 3px;
  border-radius: 4px;
}
/* Pill-shaped controls get a pill-shaped ring so it doesn't look boxy */
a[data-btn]:focus-visible,
main > section nav[aria-label="Filter recipes"] > button:focus-visible,
nav[aria-label="A–Z"] > a:focus-visible,
main > section[aria-label="Quiz"] > nav > button:focus-visible {
  outline-offset: 3px;
  border-radius: 999px;
}
main > section[aria-label="Quiz"] > ol > li > button:focus-visible {
  outline-offset: 2px;
  border-radius: 0.75rem;
}
main > section > details > summary:focus-visible {
  outline-offset: -2px;
  border-radius: 1rem;
}
body > header > nav[aria-label="Primary"] > a:focus-visible,
body > header > details > nav > a:focus-visible {
  outline-color: #f8f2eb;
}

/* ============================================================
   QUIZ PROGRESS METER & NAV UNDERLINE
   ============================================================ */

/* Progress meter fill — native <meter> needs vendor pseudo-elements
   for a reliable animated transition across browsers */
main > section[aria-label="Quiz"] > meter::-webkit-meter-bar {
  background: rgba(61, 28, 2, 0.12);
}
main > section[aria-label="Quiz"] > meter::-webkit-meter-optimum-value {
  background: #c4694a;
  transition: width 0.4s ease;
}
main > section[aria-label="Quiz"] > meter::-moz-meter-bar {
  background: #c4694a;
  transition: width 0.4s ease;
}

/* Nav link active/hover underline */
body
  > header
  > nav[aria-label="Primary"]
  > a:not([data-quiz]) {
  position: relative;
}
body
  > header
  > nav[aria-label="Primary"]
  > a:not([data-quiz])::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1.5px;
  background: var(--tan, #c4a882);
  transition:
    width 0.22s ease,
    left 0.22s ease;
}
body
  > header
  > nav[aria-label="Primary"]
  > a:not([data-quiz]):hover::after,
body > header > nav[aria-label="Primary"] > a[aria-current="page"]::after {
  width: 100%;
  left: 0;
}

/* Flavour wheel — invite interaction with a one-off hint pulse on the
   first segment shortly after the page settles */
@keyframes ban-wheel-hint {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
svg g[data-segment]:first-child {
  animation: ban-wheel-hint 1.8s ease 1s 2;
}

/* Quiz question / options fade in on each render (CSS animation, not
   transition, so it replays automatically on the freshly-mounted
   elements innerHTML swaps in — no JS timing needed) */
main > section[aria-label="Quiz"] > h2,
main > section[aria-label="Quiz"] > ol,
main > section[aria-label="Quiz"] > small {
  animation: ban-fade-up 0.4s ease;
}

/* ============================================================
   RECIPE FILTER — SMOOTH SHOW/HIDE
   ============================================================ */

main > section > ul[aria-label="Recipes"] > li {
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}
main > section > ul[aria-label="Recipes"] > li[data-leaving] {
  opacity: 0;
  transform: scale(0.94);
}
main > section > ul[aria-label="Recipes"] > li[data-hidden] {
  display: none;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Elements that rely on an animation to reach opacity:1 must still
     end up visible — near-zero duration above already achieves this
     since animation-fill-mode: forwards holds the end state, but the
     rules below make that explicit and remove transform offsets too. */
  main > section,
  main > section > ul[aria-label="Chapters"] > li,
  main > section[data-theme="stats"] > ul > li,
  main > section > ul[aria-label="Recipes"] > li {
    opacity: 1 !important;
    transform: none !important;
  }
  svg g[data-segment]:first-child,
  main > section > figure[data-wheel-wrap] > svg {
    animation: none !important;
  }
}
