/* ==========================================================================
   Robert K. Tracy, CPA — Design Tokens & Site Styles
   Concept: ledger meets field — a CPA's professional record paired with
   long-form writing on hemp economics. Organic serif display + clean sans
   body, warm paper surfaces, deep hemp-green accent.
   ========================================================================== */

/* ---- Fonts ---- */
@import url('https://api.fontshare.com/v2/css?f[]=erode@400,500,600&f[]=general-sans@400,500,600,700&display=swap');

:root {
  /* Type scale — fluid clamp() */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1rem + 4vw, 4.5rem);
  --text-hero: clamp(2.75rem, 0.8rem + 6vw, 6rem);

  /* Spacing — 4px system */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.3rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.85rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Motion */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Erode', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ---- Light mode (default) ---- */
:root,
[data-theme='light'] {
  --color-bg: #f7f5ee;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf4;
  --color-surface-offset: #efece0;
  --color-surface-offset-2: #e5e1cf;
  --color-surface-dynamic: #ddd9c5;
  --color-divider: #ddd8c5;
  --color-border: #d0cab1;

  --color-text: #23261e;
  --color-text-muted: #676650;
  --color-text-faint: #a5a189;
  --color-text-inverse: #f7f5ee;

  --color-primary: #3c5a34;
  --color-primary-hover: #2c4326;
  --color-primary-active: #21331d;
  --color-primary-highlight: #dbe3cc;

  --color-navy: #223d5c;
  --color-navy-hover: #172b41;
  --color-navy-highlight: #d7e0e9;

  --color-gold: #a1741e;
  --color-gold-hover: #7d5a16;
  --color-gold-highlight: #ecdfc0;

  --color-warning: #93551d;
  --color-warning-highlight: #e3d3bf;
  --color-error: #93372f;
  --color-error-highlight: #e4d2ce;
  --color-success: #3c5a34;
  --color-success-highlight: #dbe3cc;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 110 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 110 / 0.09);
  --shadow-lg: 0 16px 36px oklch(0.2 0.02 110 / 0.14);

  color-scheme: light;
}

/* ---- Dark mode ---- */
[data-theme='dark'] {
  --color-bg: #14150f;
  --color-surface: #191a13;
  --color-surface-2: #1d1e16;
  --color-surface-offset: #1c1d15;
  --color-surface-offset-2: #23241a;
  --color-surface-dynamic: #2b2c20;
  --color-divider: #292a1f;
  --color-border: #35362a;

  --color-text: #e7e4d5;
  --color-text-muted: #a09d87;
  --color-text-faint: #6c6a56;
  --color-text-inverse: #191a13;

  --color-primary: #8bb977;
  --color-primary-hover: #a2c890;
  --color-primary-active: #b8d6a9;
  --color-primary-highlight: #2b3624;

  --color-navy: #7fa1c4;
  --color-navy-hover: #97b3d1;
  --color-navy-highlight: #26333f;

  --color-gold: #cfa54c;
  --color-gold-hover: #ddba6d;
  --color-gold-highlight: #3a3120;

  --color-warning: #c98a4f;
  --color-warning-highlight: #3c3020;
  --color-error: #c56b62;
  --color-error-highlight: #3a2723;
  --color-success: #8bb977;
  --color-success-highlight: #2b3624;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 36px oklch(0 0 0 / 0.5);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #14150f;
    --color-surface: #191a13;
    --color-surface-2: #1d1e16;
    --color-surface-offset: #1c1d15;
    --color-surface-offset-2: #23241a;
    --color-surface-dynamic: #2b2c20;
    --color-divider: #292a1f;
    --color-border: #35362a;
    --color-text: #e7e4d5;
    --color-text-muted: #a09d87;
    --color-text-faint: #6c6a56;
    --color-text-inverse: #191a13;
    --color-primary: #8bb977;
    --color-primary-hover: #a2c890;
    --color-primary-active: #b8d6a9;
    --color-primary-highlight: #2b3624;
    --color-navy: #7fa1c4;
    --color-navy-highlight: #26333f;
    --color-gold: #cfa54c;
    --color-gold-highlight: #3a3120;
    --color-warning: #c98a4f;
    --color-warning-highlight: #3c3020;
    --color-error: #c56b62;
    --color-error-highlight: #3a2723;
    --color-success: #8bb977;
    --color-success-highlight: #2b3624;
    color-scheme: dark;
  }
}

/* ==========================================================================
   Global elements
   ========================================================================== */

body {
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

p,
li {
  max-width: 70ch;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
}

.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container--wide {
  max-width: var(--content-wide);
}
.container--narrow {
  max-width: var(--content-narrow);
}

section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 62ch;
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}
/* Blur lives on a pseudo-element (not the .header box itself) because
   backdrop-filter on an ancestor creates a containing block for
   position:fixed descendants — that broke the full-viewport mobile
   nav overlay, which relies on .nav-links being fixed to the viewport. */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.header--hidden {
  transform: translateY(-100%);
}
.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
}
.brand:hover {
  color: var(--color-text);
}
.brand svg {
  width: 30px;
  height: 30px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name small {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}
.nav-links a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding-block: var(--space-1);
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] {
  color: var(--color-text);
  border-color: var(--color-primary);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: transparent;
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    inset: 64px 0 0 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: var(--space-8) var(--space-6);
    gap: var(--space-5);
    transform: translateX(100%);
    transition: transform 0.32s var(--ease-out);
    overflow-y: auto;
  }
  .nav-links.is-open {
    transform: translateX(0);
  }
  .nav-links a {
    font-size: var(--text-lg);
  }
  .nav-toggle {
    display: inline-flex;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  border-color: color-mix(in oklab, var(--color-text) 18%, transparent);
  color: var(--color-text);
}
.btn-ghost:hover {
  background: var(--color-surface-offset);
  border-color: color-mix(in oklab, var(--color-text) 28%, transparent);
}
.btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32)) clamp(var(--space-12), 8vw, var(--space-20));
  position: relative;
}
.hero-grid {
  display: grid;
  gap: var(--space-10);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid--split {
    grid-template-columns: 1.15fr 0.85fr;
  }
}
.hero h1 {
  font-size: var(--text-hero);
  line-height: 1.03;
}
.hero .lede {
  margin-top: var(--space-5);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.hero-figure {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
}
.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-full {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-full img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-full::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in oklab, var(--color-bg) 92%, transparent) 4%,
    transparent 62%
  );
}
.hero-full-content {
  position: relative;
  z-index: 1;
  padding-block: clamp(var(--space-12), 8vw, var(--space-20)) clamp(var(--space-8), 5vw, var(--space-12));
  width: 100%;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card-grid {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.path-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid color-mix(in oklab, var(--color-text) 8%, transparent);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.32s var(--ease-out),
    box-shadow 0.32s var(--ease-out);
}
.path-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.path-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.path-card-icon svg {
  width: 24px;
  height: 24px;
}
.path-card h3 {
  font-size: var(--text-xl);
}
.path-card p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}
.path-card .card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-primary);
}
.path-card .card-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-out);
}
.path-card:hover .card-link svg {
  transform: translateX(3px);
}

.essay-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid color-mix(in oklab, var(--color-text) 8%, transparent);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.32s var(--ease-out),
    box-shadow 0.32s var(--ease-out);
}
.essay-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.essay-card figure {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.essay-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.essay-card-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.essay-card-body h3 {
  font-size: var(--text-lg);
}
.essay-card-body p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ==========================================================================
   Stat blocks
   ========================================================================== */

.stat-strip {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  padding-block: var(--space-10);
}
@media (min-width: 720px) {
  .stat-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat-item .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-primary);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
}
.stat-item .stat-label {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 22ch;
}

/* ==========================================================================
   Timeline (résumé)
   ========================================================================== */

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--color-divider);
}
.timeline-item {
  position: relative;
  padding-left: var(--space-8);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-6);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
}
.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}
.timeline-role {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
}
.timeline-org {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
}
.timeline-dates {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.timeline-body {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.timeline-body li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-2);
}
.timeline-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-faint);
}

/* ==========================================================================
   Competency tags
   ========================================================================== */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tag {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   Section headers
   ========================================================================== */

.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-10);
}
.section-head h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-3);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* ==========================================================================
   Prose (essays)
   ========================================================================== */

.prose {
  max-width: 68ch;
  margin-inline: auto;
  font-size: var(--text-base);
  line-height: 1.7;
}
.prose h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}
.prose h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.prose p {
  margin-bottom: var(--space-5);
  color: var(--color-text);
}
.prose ul,
.prose ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
  color: var(--color-text);
}
.prose li {
  margin-bottom: var(--space-2);
}
.prose strong {
  font-weight: 600;
}
.prose a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--color-primary) 40%, transparent);
  text-underline-offset: 2px;
}

.byline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}
.byline .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-faint);
}

.pull-quote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.35;
  color: var(--color-text);
  border-left: 3px solid var(--color-primary);
  padding-left: var(--space-6);
  margin-block: var(--space-10);
  max-width: 60ch;
}
.pull-quote cite {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

.figure-bleed {
  margin-block: var(--space-12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.figure-bleed img {
  width: 100%;
  display: block;
}
.figure-bleed figcaption {
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface-offset);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: none;
}

/* ==========================================================================
   Data tables
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  margin-block: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
table.data-table {
  width: 100%;
  min-width: 480px;
  font-size: var(--text-sm);
  background: var(--color-surface);
}
table.data-table caption {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-inverse);
  background: var(--color-primary);
  padding: var(--space-3) var(--space-5);
}
table.data-table th,
table.data-table td {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
  font-variant-numeric: tabular-nums lining-nums;
}
table.data-table thead th {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-border);
}
table.data-table tbody tr:last-child td {
  border-bottom: none;
}
table.data-table tbody tr:hover {
  background: var(--color-surface-2);
}
table.data-table td.num,
table.data-table th.num {
  text-align: right;
}
table.data-table tfoot td {
  font-weight: 600;
  border-top: 2px solid var(--color-border);
  border-bottom: none;
}
.table-caption {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  max-width: 68ch;
}

/* ==========================================================================
   Winners / losers columns
   ========================================================================== */

.wl-grid {
  display: grid;
  gap: var(--space-6);
  margin-block: var(--space-8);
}
@media (min-width: 700px) {
  .wl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.wl-col {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.wl-col-head {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-inverse);
}
.wl-col--win .wl-col-head {
  background: var(--color-primary);
}
.wl-col--lose .wl-col-head {
  background: var(--color-navy);
}
.wl-col ul {
  list-style: none;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
}
.wl-col li {
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--color-divider);
  font-size: var(--text-sm);
}
.wl-col li:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Applications flowchart (CSS diagram)
   ========================================================================== */

.flow {
  margin-block: var(--space-10);
}
.flow-plant {
  text-align: center;
  margin-bottom: var(--space-6);
  color: var(--color-primary);
}
.flow-plant svg {
  width: 64px;
  height: 64px;
  margin-inline: auto;
}
.flow-branches {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 720px) {
  .flow-branches {
    grid-template-columns: repeat(4, 1fr);
  }
}
.flow-branch {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
}
.flow-branch-head {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-inverse);
  background: var(--color-primary);
  text-align: center;
}
.flow-branch-body {
  padding: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.flow-branch-body strong {
  display: block;
  color: var(--color-text);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-1);
}

/* ==========================================================================
   Cultivation comparison strip
   ========================================================================== */

.cultivar-grid {
  display: grid;
  gap: var(--space-4);
  margin-block: var(--space-8);
}
@media (min-width: 720px) {
  .cultivar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.cultivar-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: var(--space-5);
}
.cultivar-card h4 {
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}
.cultivar-card dl {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-xs);
}
.cultivar-card dt {
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cultivar-card dd {
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Chart containers
   ========================================================================== */

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
  margin-block: var(--space-8);
}
.chart-card h3 {
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
}
.chart-card .chart-caption {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-3);
}
.chart-wrap {
  position: relative;
  height: 320px;
  margin-top: var(--space-4);
}
.chart-wrap--short {
  height: 220px;
}

/* ==========================================================================
   Related / footer CTA
   ========================================================================== */

.related {
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-10);
  margin-top: var(--space-16);
}
.related h3 {
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-xs);
  margin-bottom: var(--space-5);
}

.cta-band {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-8), 6vw, var(--space-12));
  text-align: center;
}
.cta-band h2 {
  color: var(--color-text-inverse);
  font-size: var(--text-xl);
}
.cta-band p {
  color: color-mix(in oklab, var(--color-text-inverse) 82%, transparent);
  margin-block: var(--space-4) var(--space-6);
  margin-inline: auto;
}
.cta-band .btn-primary {
  background: var(--color-text-inverse);
  color: var(--color-primary);
}
.cta-band .btn-primary:hover {
  background: color-mix(in oklab, var(--color-text-inverse) 85%, transparent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
  margin-top: var(--space-16);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-8);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  color: var(--color-text);
}
.footer-brand svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  list-style: none;
}
.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.footer-links a:hover {
  color: var(--color-text);
}
.footer-meta {
  margin-top: var(--space-8);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.mt-0 {
  margin-top: 0;
}
.text-center {
  text-align: center;
}
.visually-hidden-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
}
.skip-link:focus {
  top: var(--space-4);
}
