/* Self-hosted OFL fonts. URLs are relative to the built CSS/HTML (see build scripts). */
@font-face { font-family: 'Fraunces Display'; src: url('fonts/FrauncesDisplay-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: optional; }
@font-face { font-family: 'Fraunces Display'; src: url('fonts/FrauncesDisplay-Italic.woff2') format('woff2'); font-weight: 400 600; font-style: italic; font-display: optional; }
@font-face { font-family: 'Fraunces Text'; src: url('fonts/FrauncesText-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: optional; }
@font-face { font-family: 'Fraunces Text'; src: url('fonts/FrauncesText-Italic.woff2') format('woff2'); font-weight: 400 600; font-style: italic; font-display: optional; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('fonts/AtkinsonNext-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: optional; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('fonts/AtkinsonNext-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: optional; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('fonts/AtkinsonNext-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: optional; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; src: url('fonts/AtkinsonNext-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: optional; }

/*
 * Design tokens shared by the printable planner, the website and the planning tool.
 * Contrast (WCAG 2.x) on --paper: ink 12.9:1, ink-soft 7.3:1, fern 6.9:1, terra 5.0:1, water 5.9:1.
 * Cream text on --fern 7.5:1; on --terra 5.5:1.
 */
:root {
  /* Surfaces */
  --paper: #f4eee1;
  --card: #fbf8f2;
  --white: #ffffff;
  --sage-wash: #dce5cf;
  --sage-wash-2: #e9eedf;
  --marigold-wash: #f6e3b4;
  --terra-wash: #f1d9c9;
  --water-wash: #d8e6ee;

  /* Text and lines */
  --ink: #1e2a20;
  --ink-soft: #46503f;
  --muted: #5d6656;
  --line: #d6cbb5;
  --line-strong: #a99c80;
  --grid: #c9bda3;

  /* Brand */
  --fern: #2e5a36;
  --fern-2: #3f7346;
  --leaf: #6e9a5b;
  --terra: #a8481f;
  --terra-deep: #8e3b17;
  --clay: #c8714a;
  --marigold: #e6a532;
  --water: #335f7c;
  --water-2: #5d8aa8;
  --soil: #6b4e37;
  --soil-2: #8a6a4d;
  --wood: #c49a6c;
  --wood-dark: #9c7346;

  /* Type */
  --font-display: 'Fraunces Display', 'Fraunces Text', Georgia, 'Times New Roman', serif;
  --font-head: 'Fraunces Text', Georgia, 'Times New Roman', serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
}

/*
 * One Good Bed — website styles.
 *
 * One token system. Every spacing value comes from --space-*, every font size from --step-*,
 * corners from --radius-sm / --radius-lg, borders from --border, shadows from --shadow-1 / --shadow-2,
 * motion from --dur-* / --ease. tests/css-tokens.test.ts fails the build on any off-scale value.
 *
 * Contrast (WCAG): body text 13.3:1 (light) and 14.5:1 (dark); secondary text 8.3:1 / 10.6:1;
 * links 7.1:1 / 10.8:1; meta text ≥ 6.2:1; button text ≥ 5.6:1.
 */

/* Fallback faces with matched metrics, so swapping in the web fonts doesn't shift the layout. */
@font-face { font-family: 'Atkinson Fallback'; font-weight: 400; src: local('Arial'), local('ArialMT'), local('Helvetica'); size-adjust: 99.39%; ascent-override: 99.01%; descent-override: 31.8%; line-gap-override: 0%; }
@font-face { font-family: 'Atkinson Fallback'; font-weight: 600 700; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'); size-adjust: 99.91%; ascent-override: 98.49%; descent-override: 31.63%; line-gap-override: 0%; }
@font-face { font-family: 'Fraunces Display Fallback'; src: local('Georgia Bold'), local('Georgia-Bold'), local('Times New Roman Bold'); size-adjust: 86.15%; ascent-override: 113.52%; descent-override: 29.6%; line-gap-override: 0%; }
@font-face { font-family: 'Fraunces Text Fallback'; src: local('Georgia Bold'), local('Georgia-Bold'), local('Times New Roman Bold'); size-adjust: 92.86%; ascent-override: 105.32%; descent-override: 27.46%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;

  /* Spacing (rem; 1rem = 16px) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section: clamp(4rem, 3rem + 4vw, 7rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);

  /* Containers */
  --container: 72rem;
  --container-narrow: 46rem;
  /* About 70 characters of Atkinson at any size (ch would measure its wide zero). */
  --measure: 31em;
  --header-h: 4.5rem;

  /* Type scale (one scale; body 18px → 20px) */
  --step--1: 1.125rem;
  --step-0: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.33rem + 0.75vw, 1.875rem);
  --step-3: clamp(1.875rem, 1.55rem + 1.45vw, 2.75rem);
  --step-4: clamp(2.375rem, 1.85rem + 2.35vw, 3.75rem);
  --leading: 1.55;
  --leading-tight: 1.12;

  --font-display: 'Fraunces Display', 'Fraunces Display Fallback', Georgia, serif;
  --font-head: 'Fraunces Text', 'Fraunces Text Fallback', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Fallback', Arial, sans-serif;

  /* Shape */
  --radius-sm: 8px;
  --radius-lg: 16px;
  --border: 1px;
  --focus-width: 3px;

  /* Motion */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Colour — light */
  --bg: #f7f1e5;
  --bg-alt: #efe6d4;
  --surface: #fffdf8;
  --text: #1e2a20;
  --text-soft: #3f4a3b;
  --text-meta: #424c3e;
  --line: #ddd2bd;
  --line-strong: #b5a88c;
  --link: #285030;
  --link-hover: #1e3f25;
  --kicker: #7e3413;
  --accent: #a8481f;
  --accent-hover: #8e3b17;
  --accent-text: #fffaf2;
  --green: #285030;
  --green-text: #f4eedd;
  --focus: #1f6fb2;
  --stamp-bg: #fbe7a6;
  --stamp-text: #3d2f05;
  --shadow-1: 0 1px 2px rgb(30 42 32 / 0.06), 0 4px 12px rgb(30 42 32 / 0.06);
  --shadow-2: 0 2px 4px rgb(30 42 32 / 0.06), 0 18px 40px -12px rgb(30 42 32 / 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a15;
    --bg-alt: #19211a;
    --surface: #1c241d;
    --text: #efe8d8;
    --text-soft: #cfc8b8;
    --text-meta: #b3ad9e;
    --line: #34402f;
    --line-strong: #56634f;
    --link: #a9d5ae;
    --link-hover: #c9ecc9;
    --kicker: #e9a07b;
    --accent: #e3875c;
    --accent-hover: #f09b72;
    --accent-text: #1d130d;
    --green: #27382b;
    --green-text: #efe8d8;
    --focus: #8cc4ff;
    --stamp-bg: #4a3d12;
    --stamp-text: #fbecc0;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 12px rgb(0 0 0 / 0.25);
    --shadow-2: 0 2px 4px rgb(0 0 0 / 0.3), 0 18px 40px -12px rgb(0 0 0 / 0.6);
  }
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  interpolate-size: allow-keywords;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading);
  font-kerning: normal;
  font-variant-numeric: lining-nums;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-wrap: balance;
  color: var(--text);
}
h1 { font-family: var(--font-display); font-size: var(--step-4); letter-spacing: -0.015em; }
h2 { font-family: var(--font-display); font-size: var(--step-3); letter-spacing: -0.01em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h1 em, h2 em { font-style: italic; color: var(--link); }

p, ul, ol, dl, figure, blockquote, table, details { margin: 0; }
p, li, dd, figcaption, td { text-wrap: pretty; }
ul, ol { padding-left: var(--space-5); }
img, svg { display: block; max-width: 100%; height: auto; }
strong { font-weight: 700; }
small, .meta { font-size: var(--step--1); color: var(--text-meta); }

a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: from-font; text-underline-offset: 0.18em; transition: color var(--dur-1) var(--ease), text-decoration-color var(--dur-1) var(--ease); }
a:hover { color: var(--link-hover); text-decoration-thickness: 0.12em; }
a:active { color: var(--link-hover); text-decoration-thickness: 0.16em; }

:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--space-1); border-radius: var(--radius-sm); }
:target { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

.skip {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-9));
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  color: var(--text);
  border: var(--border) solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.skip:focus { top: var(--space-4); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Flow spacing inside text blocks */
.flow > * + * { margin-top: var(--flow, var(--space-4)); }
.flow > h2 + *, .flow > h3 + * { --flow: var(--space-3); }
.flow > * + h2 { --flow: var(--space-7); }
.flow > * + h3 { --flow: var(--space-6); }

/* ------------------------------------------------------------------ layout */

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: var(--measure); margin-bottom: var(--space-7); }
.section-head > * + * { margin-top: var(--space-4); }
.section-head.center { margin-inline: auto; text-align: center; }

.kicker {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kicker);
}
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--text-soft); max-width: var(--measure); }
.soft { color: var(--text-soft); }
.prose { max-width: var(--measure); }

.grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ preview stamp */

.stamp {
  background: var(--stamp-bg);
  color: var(--stamp-text);
  font-size: var(--step--1);
  padding-block: var(--space-2);
}
.stamp p { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* ------------------------------------------------------------------ header */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--border) solid var(--line);
  view-transition-name: site-head;
}
.site-head .container { display: flex; align-items: center; gap: var(--space-5); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--space-7); color: var(--text); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand svg { width: var(--space-7); height: var(--space-7); flex: none; border-radius: 50%; }
.brand svg { background: #f4eee1; padding: var(--space-1); }
.brand-name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: var(--leading-tight); }
.nav { display: none; }
.nav a { display: inline-flex; align-items: center; min-height: var(--space-7); padding-inline: var(--space-3); color: var(--text); text-decoration-color: transparent; border-radius: var(--radius-sm); }
.nav a:hover { text-decoration-color: currentColor; }
.nav a[aria-current='page'] { text-decoration-color: var(--accent); text-decoration-thickness: 0.12em; }
@media (min-width: 64rem) {
  .nav { display: flex; gap: var(--space-1); }
}
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--space-7); min-width: var(--space-7); padding-inline: var(--space-3); border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { flex: none; width: var(--space-5); height: var(--space-5); }
.menu[open] > summary { background: var(--surface); }
.menu-panel { position: absolute; right: 0; top: calc(100% + var(--space-2)); min-width: 16rem; padding: var(--space-3); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.menu-panel a { display: flex; align-items: center; min-height: var(--space-7); padding-inline: var(--space-3); color: var(--text); border-radius: var(--radius-sm); text-decoration-color: transparent; }
.menu-panel a:hover { background: var(--bg-alt); text-decoration-color: currentColor; }
@media (min-width: 64rem) {
  .menu { display: none; }
}
.head-buy { display: none; }
@media (min-width: 40rem) { .head-buy { display: inline-flex; } }
.h3 { font-family: var(--font-head); font-size: var(--step-2); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--space-7);
  padding: var(--space-2) var(--space-5);
  border: var(--border) solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; width: var(--space-5); height: var(--space-5); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn[aria-disabled='true'] { background: var(--bg-alt); color: var(--text-soft); border-color: var(--line-strong); box-shadow: none; cursor: not-allowed; }
.btn[aria-disabled='true']:active { transform: none; }
.btn-block { width: 100%; }
.site-head .btn { padding-inline: var(--space-4); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.cta-note { font-size: var(--step--1); color: var(--text-meta); }

/* ------------------------------------------------------------------ cards and frames */

.card { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.card > * + * { margin-top: var(--space-3); }
.card h3 { font-size: var(--step-1); }

/* A real page from the product, shown as paper. Same frame everywhere. */
.paper { background: #fff; border: var(--border) solid var(--line); box-shadow: var(--shadow-2); aspect-ratio: 17 / 22; overflow: hidden; }
.paper img { width: 100%; height: 100%; object-fit: cover; }

/* Drawings (plan maps, diagrams) sit on paper in both themes, as they do in the planner. */
.sheet { background: #fbf8f2; border: var(--border) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); color: #1e2a20; }

/* ------------------------------------------------------------------ hero */

.hero { padding-block: var(--space-8) var(--section); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); align-items: center; }
.hero-copy > * + * { margin-top: var(--space-5); }
.hero-copy .cta-row { margin-top: var(--space-6); }
/* The product name and category sit inside the h1, styled as the kicker above the headline. */
.hero h1 .kicker { display: block; line-height: var(--leading); margin-bottom: var(--space-5); }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: 0; list-style: none; font-size: var(--step--1); color: var(--text-soft); }
.hero-facts li { display: inline-flex; align-items: center; gap: var(--space-2); }
.hero-facts svg { width: var(--space-5); height: var(--space-5); flex: none; color: var(--link); }
.hero-art { position: relative; max-width: 34rem; margin-inline: auto; width: 100%; padding-bottom: var(--space-7); }
.hero-art .paper { width: 72%; }
.hero-art .paper:first-child { position: relative; z-index: 1; }
.hero-art .paper + .paper { position: absolute; right: 0; top: var(--space-7); }
@media (min-width: 64rem) {
  .hero { padding-block: var(--space-9) var(--section); }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: var(--space-9); }
}

/* ------------------------------------------------------------------ home sections */

.problem-grid { display: grid; gap: var(--space-5); }
@media (min-width: 48rem) { .problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .problem-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.problem { border-top: var(--border) solid var(--line-strong); padding-top: var(--space-4); }
.problem > * + * { margin-top: var(--space-2); }
.problem h3 { font-size: var(--step-1); }

.inside-grid { display: grid; gap: var(--space-7) var(--space-6); }
@media (min-width: 40rem) { .inside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .inside-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.inside-grid figure { display: grid; grid-template-rows: auto 1fr; gap: var(--space-4); }
.inside-grid figcaption > * + * { margin-top: var(--space-1); }
.inside-grid figcaption strong { display: block; font-size: var(--step-0); }
.inside-grid figcaption span { display: block; color: var(--text-soft); }
.zoom { display: block; border-radius: 0; transition: transform var(--dur-2) var(--ease); }
.zoom:hover { transform: translateY(calc(-1 * var(--space-1))); }

.files { display: grid; gap: var(--space-3); padding: 0; list-style: none; }
.files li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-4); align-items: center; padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-sm); }
.files .ext { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.06em; color: var(--kicker); }
.files .what { min-width: 0; }
.files .what strong { display: block; }
.files .what span { display: block; color: var(--text-soft); font-size: var(--step--1); }
.files .size { font-size: var(--step--1); color: var(--text-meta); white-space: nowrap; }
@media (max-width: 39.99rem) {
  .files li { grid-template-columns: auto minmax(0, 1fr); }
  .files .size { grid-column: 2; }
}

.plans { display: grid; gap: var(--space-6); }
@media (min-width: 64rem) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 40rem) and (max-width: 63.99rem) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan { display: grid; grid-template-rows: auto auto auto auto 1fr auto; gap: var(--space-3); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.plan .sheet { padding: var(--space-3); }
.plan .sheet.map { padding: 0; overflow: hidden; }
.plan .sheet.map img { width: 100%; height: auto; }
.plan h3 { font-size: var(--step-1); }
.plan .meta { margin-top: calc(-1 * var(--space-2)); }

.reach-grid, .tool-grid, .split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); align-items: center; }
@media (min-width: 64rem) {
  .reach-grid, .tool-grid, .split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-9); }
}

.checklist { display: grid; gap: var(--space-3); padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: var(--space-5) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.checklist svg { width: var(--space-5); height: var(--space-5); margin-top: var(--space-1); color: var(--link); }
.checklist.no svg { color: var(--kicker); }
.checklist.info svg { color: var(--text-soft); }

.steps { display: grid; gap: var(--space-4); padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: var(--space-7) minmax(0, 1fr); gap: var(--space-4); align-items: start; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: var(--space-7); height: var(--space-7); border-radius: 50%; background: var(--bg-alt); border: var(--border) solid var(--line-strong); font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--text); }
.steps li > div > * + * { margin-top: var(--space-1); }

.fit { display: grid; gap: var(--space-6); }
@media (min-width: 48rem) { .fit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Count strip */
.counts { padding-block: 0 var(--space-8); }
.count-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); padding: var(--space-5) 0 0; margin: 0; list-style: none; border-top: var(--border) solid var(--line); }
@media (min-width: 48rem) { .count-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.count-strip li { display: grid; gap: var(--space-1); align-content: start; }
.count-strip strong { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1; color: var(--text); }
.count-strip span { font-size: var(--step--1); color: var(--text-soft); }
.quick-answer { margin-top: var(--space-7); max-width: var(--measure); }

/* Plan facts */
.plan-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: var(--space-3); margin: 0; padding-top: var(--space-3); border-top: var(--border) solid var(--line); align-self: end; }
.plan-facts dt { font-size: var(--step--1); color: var(--text-meta); }
.plan-facts dd { margin: 0; font-family: var(--font-head); font-size: var(--step-1); font-weight: 600; white-space: nowrap; }

/* Details */
.details-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); align-items: start; }
@media (min-width: 64rem) { .details-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); gap: var(--space-8); } }
.spec th { width: 32%; white-space: nowrap; }
.read-first { background: var(--surface); border: var(--border) solid var(--line-strong); border-radius: var(--radius-lg); padding: var(--space-6); }
.read-first > * + * { margin-top: var(--space-4); }
.read-first h3 { font-size: var(--step-2); }

/* Price */
.buy-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); align-items: start; }
@media (min-width: 64rem) { .buy-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-9); } }
.price-card { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-1); }
.price-card > * + * { margin-top: var(--space-4); }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.price .amount { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; line-height: 1; }
.price .terms { color: var(--text-soft); }
.price-card .btn { width: 100%; }
.price-card ul { display: grid; gap: var(--space-2); padding: 0; list-style: none; font-size: var(--step--1); color: var(--text-soft); }

/* Trust */
.trust { display: grid; gap: var(--space-5); }
@media (min-width: 48rem) { .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .trust { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trust .card h3 { font-size: var(--step-1); }

/* FAQ */
.faq { border-top: var(--border) solid var(--line); }
.faq details { border-bottom: var(--border) solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--space-7);
  padding-block: var(--space-4);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary { transition: color var(--dur-1) var(--ease); }
.faq summary:hover { color: var(--link); }
.faq summary:active { color: var(--link-hover); }
.faq summary svg { flex: none; width: var(--space-5); height: var(--space-5); color: var(--text-soft); transition: transform var(--dur-2) var(--ease); }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq .answer { padding-bottom: var(--space-5); color: var(--text-soft); max-width: var(--measure); }
.faq .answer > * + * { margin-top: var(--space-3); }
details::details-content { block-size: 0; overflow-y: clip; transition: block-size var(--dur-2) var(--ease), content-visibility var(--dur-2) allow-discrete; }
details[open]::details-content { block-size: auto; }

/* Wren & Co. */
.wren { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
@media (min-width: 64rem) { .wren { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-9); } }
.wren-about > * + * { margin-top: var(--space-4); }
.wren-mark { width: var(--space-8); height: var(--space-8); }
.more { display: grid; gap: var(--space-3); padding: 0; list-style: none; }
.more a { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.more a:hover { border-color: var(--line-strong); transform: translateY(calc(-1 * var(--space-1) / 2)); }
.more a:active { transform: none; border-color: var(--text); }
.zoom:active { transform: none; }
.menu > summary { transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.menu > summary:hover { border-color: var(--text); }
.menu > summary:active { background: var(--bg-alt); }
.nav a:active, .menu-panel a:active, .foot-links a:active { text-decoration-thickness: 0.16em; }
.control:focus-visible { border-color: var(--focus); }
.more strong { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: from-font; }
.more span { color: var(--text-soft); font-size: var(--step--1); }

/* Closing band */
.closing { background: var(--green); color: var(--green-text); padding-block: var(--space-8); }
.closing .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5); }
.closing h2 { color: var(--green-text); font-size: var(--step-3); }

/* ------------------------------------------------------------------ tools (free resources) */

.tool-panel { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-1); min-width: 0; }
@media (min-width: 40rem) { .tool-panel { padding: var(--space-6); } }
.tool-panel > * + * { margin-top: var(--space-5); }
.fields { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-5); align-items: end; }
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field > * { min-width: 0; }
.field > .control, .field > select { width: 100%; }
.field label, .field .label { font-weight: 700; }
.field .hint { font-size: var(--step--1); color: var(--text-meta); }
.control { max-width: 100%; min-height: var(--space-7); padding: var(--space-2) var(--space-4); font: inherit; color: var(--text); background: var(--bg); border: var(--border) solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.control:hover { border-color: var(--text); }
select.control { padding-right: var(--space-7); }
input.control { width: 7ch; min-width: 0; }
.result { display: grid; gap: var(--space-2); padding: var(--space-5); background: var(--bg-alt); border-radius: var(--radius-sm); }
.result .big { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1.1; }
.note { font-size: var(--step--1); color: var(--text-meta); }

/* Tables */
.table-wrap { overflow-x: auto; border: var(--border) solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.table caption { text-align: left; padding: var(--space-4) var(--space-4) 0; font-weight: 700; color: var(--text); }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-bottom: var(--border) solid var(--line); }
.table thead th { background: var(--bg-alt); font-weight: 700; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table .crop { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.table .crop svg { width: var(--space-5); height: var(--space-5); flex: none; }

/* On phones, tables marked .stack turn into labelled rows: no sideways scrolling. */
@media (max-width: 39.99rem) {
  .table-wrap:has(.stack) { overflow: visible; }
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table.stack caption { display: block; padding: var(--space-4) var(--space-4) 0; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack th, .table.stack td { display: block; }
  .table.stack tr { padding: var(--space-4); border-bottom: var(--border) solid var(--line); }
  .table.stack tbody tr:last-child { border-bottom: 0; }
  .table.stack th[scope='row'] { padding: 0 0 var(--space-2); border: 0; }
  .table.stack td { padding: var(--space-1) 0; border: 0; }
  .table.stack td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; color: var(--text-meta); }
  /* The label column never shrinks below its longest word, so a long value wraps instead of running over the label. */
  .table.stack.kv td { display: grid; grid-template-columns: minmax(min-content, 1fr) auto; gap: var(--space-3); text-align: left; }
  .table.stack.kv td[data-label]::before { display: inline; font-weight: 400; }
  .table.stack tr.group { padding: 0; }
}
/* Tables with many number columns: headings may wrap and cells sit closer, so the columns fit the page instead of scrolling. */
.table.wrap-head thead th { white-space: normal; }
@media (min-width: 40rem) {
  .table.wrap-head :is(th, td) { padding-inline: var(--space-2); }
  .table.wrap-head :is(th, td):first-child { padding-left: var(--space-4); }
  .table.wrap-head :is(th, td):last-child { padding-right: var(--space-4); }
}
/* A heading row that starts a group of rows (for example, crops outside the chart). */
.table tr.group th { background: var(--bg-alt); }

/* Article furniture */
.byline { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--step--1); color: var(--text-meta); }
.answer-box { background: var(--surface); border: var(--border) solid var(--line-strong); border-radius: var(--radius-lg); padding: var(--space-5); }
.answer-box > * + * { margin-top: var(--space-2); }
.crumbs ol { display: flex; flex-wrap: wrap; column-gap: var(--space-2); padding: 0; list-style: none; font-size: var(--step--1); color: var(--text-meta); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: '/'; margin-right: var(--space-2); color: var(--line-strong); }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--space-7); min-width: var(--space-7); }
.sources-list { padding-left: var(--space-6); font-size: var(--step--1); color: var(--text-soft); }
.sources-list li + li, .notes li + li { margin-top: var(--space-2); }
.product-note { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); padding: var(--space-6); background: var(--bg-alt); border-radius: var(--radius-lg); }
.product-note > div > * + * { margin-top: var(--space-2); }

/* ------------------------------------------------------------------ footer */

.site-foot { background: var(--green); color: var(--green-text); padding-block: var(--space-8) var(--space-6); font-size: var(--step--1); }
.site-foot a { color: var(--green-text); }
.foot-top { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 48rem) { .foot-top { grid-template-columns: auto minmax(0, 1fr); } .foot-nav { justify-self: end; } }
.foot-brand { display: inline-flex; align-items: center; gap: var(--space-3); }
.foot-brand svg { width: var(--space-7); height: var(--space-7); flex: none; }
.foot-brand span { font-family: var(--font-head); font-size: var(--step-1); }
.foot-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
@media (min-width: 64rem) { .foot-nav { grid-template-columns: repeat(3, auto); gap: var(--space-7); } }
.foot-h { font-weight: 700; padding-inline: var(--space-3); margin-bottom: var(--space-1); }
.foot-links { display: grid; gap: var(--space-1); padding: 0; list-style: none; }
.foot-links a { display: inline-flex; align-items: center; min-height: var(--space-7); padding: var(--space-2) var(--space-3); line-height: 1.35; border-radius: var(--radius-sm); }
.foot-fine { margin-top: var(--space-6); padding-top: var(--space-5); border-top: var(--border) solid color-mix(in srgb, var(--green-text) 25%, transparent); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); }
.foot-fine p { max-width: var(--measure); }

/* Small parts used by several pages */
.block { display: block; }
.pair-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.shot { width: 100%; height: auto; border: var(--border) solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.btn-secondary.on-dark { color: var(--green-text); border-color: color-mix(in srgb, var(--green-text) 55%, transparent); }
.btn-secondary.on-dark:hover { background: color-mix(in srgb, var(--green-text) 12%, transparent); color: var(--green-text); border-color: var(--green-text); }
.refs { white-space: nowrap; }
.guide .qa { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }
.figure figcaption { margin-top: var(--space-3); font-size: var(--step--1); color: #3f4a3b; }
.guides { display: grid; gap: var(--space-5); padding: 0; list-style: none; }
@media (min-width: 48rem) { .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guides .card h2 a { display: flex; align-items: center; min-height: var(--space-7); text-decoration-thickness: from-font; }
.link-list { list-style: none; padding: 0; }
.link-list a { display: inline-flex; align-items: center; min-height: var(--space-7); }
.table .rule { display: block; }
.table .rule + .rule { margin-top: var(--space-3); }
.table .dates { display: block; }
.planting td { min-width: 12rem; }
.unit-input { display: inline-flex; align-items: center; gap: var(--space-2); }
.unit { color: var(--text-meta); }
fieldset.fields { border: 0; margin: 0; padding: 0; }
fieldset.fields legend { padding: 0; margin-bottom: var(--space-2); font-weight: 700; }
.bag-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); margin: 0; }
@media (min-width: 40rem) { .bag-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bag-list > div { display: flex; flex-direction: column; justify-content: space-between; } /* numbers line up when a label wraps */
.bag-list > div:last-child { grid-column: 1 / -1; } /* bulk, on a row of its own under the bag counts */
.bag-list dt { font-size: var(--step--1); color: var(--text-meta); }
.bag-list dd { margin: 0; font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; }
.try-out .when strong { display: block; }
.wren-mark svg { width: 100%; height: 100%; }

.guide-figure { display: grid; gap: var(--space-4); max-width: 22rem; }
.guide-figure figcaption { font-size: var(--step--1); color: var(--text-soft); }

/* Utilities (token-based) */
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.center { margin-inline: auto; text-align: center; }
.nowrap { white-space: nowrap; }
.control-wide { width: 100%; }

/* ------------------------------------------------------------------ simple pages */

.page-head { padding-block: var(--space-8) var(--space-6); }
.page-head > * + * { margin-top: var(--space-4); }
.page-body { padding-bottom: var(--section); }
.not-found { padding-block: var(--section); text-align: center; }
.not-found > * + * { margin-top: var(--space-5); }
.not-found .cta-row { justify-content: center; }

/* ------------------------------------------------------------------ motion */

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-2); animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .zoom:hover, .more a:hover, .btn:active { transform: none; }
}

/* ------------------------------------------------------------------ print */

@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --text: #000; --text-soft: #222; --text-meta: #333; --link: #000; --kicker: #000; }
  .site-head, .stamp, .menu, .nav, .btn, .cta-row, .skip, .closing, .wren-more, .zoom::after { display: none !important; }
  body { font-size: 12pt; background: #fff; }
  .section { padding-block: var(--space-5); }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 0.85em; word-break: break-all; }
  .card, .sheet, .paper, .table-wrap, figure, tr, .faq details { break-inside: avoid; box-shadow: none; }
  .faq details::details-content { block-size: auto; content-visibility: visible; }
  .site-foot { background: #fff; color: #000; }
  .site-foot a { color: #000; }
}

/* ---------- review fixes: rhythm, measure, small screens ---------- */
main { flex: 1 0 auto; }
.narrow > * { max-width: var(--container-narrow); }
.page-body p, .page-body li { max-width: var(--measure); }
/* Questions on Help and the guides: room between one answer and the next question. */
.flow > * + .qa { --flow: var(--space-7); }
/* …but inside an answer, a second paragraph or table follows at the normal rhythm (the question's wider gap is inherited otherwise). */
.qa > * { --flow: var(--space-4); }
.qa > h2 { font-size: var(--step-2); }
/* A kicker belongs to the heading under it. */
.flow > .kicker + :is(h2, h3) { --flow: var(--space-3); }
.hero h1 em { display: block; }
.sheet.map img { width: 100%; height: auto; }
.sheet.map figcaption { margin-top: var(--space-2); color: #424c3e; } /* on paper in both themes */
.inside-grid .guide-link { display: inline-flex; align-items: center; min-height: var(--space-7); }
@media (max-width: 39.99rem) {
  .inside-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-4); }
  .inside-grid .desc { display: none; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
  .crumbs li:last-child { display: none; }
}
@media (min-width: 40rem) and (max-width: 63.99rem) { .plans > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 40rem) { .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.more li { display: grid; }
.split.mt-7 { align-items: start; }
@media (min-width: 40rem) { .split > .sheet { max-width: 30rem; justify-self: center; } }
@media (prefers-color-scheme: dark) { .paper img, .sheet img, .shot { filter: brightness(0.9); } }

/* ---------- free printable: inline offer, footer band, polite prompt ---------- */
.signup { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: var(--space-5); align-items: start; padding: var(--space-5); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); }
@media (min-width: 40rem) { .signup { grid-template-columns: 9rem minmax(0, 1fr); padding: var(--space-6); } }
.signup-copy > * + * { margin-top: var(--space-3); }
.signup-copy .btn { margin-top: var(--space-4); }
.consent { font-size: var(--step--1); color: var(--text-meta); max-width: var(--measure); }
.signup-band { background: var(--bg-alt); border-top: var(--border) solid var(--line); padding-block: var(--space-6); }
.signup-band-inner { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 48rem) { .signup-band-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); } }
.signup-band .consent { margin-top: var(--space-2); }
.prompt { position: fixed; z-index: 30; inset: auto var(--space-5) var(--space-5) auto; width: min(27rem, 100% - 2 * var(--space-5)); display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--space-4); padding: var(--space-5); background: var(--surface); color: var(--text); border: var(--border) solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); opacity: 0; transform: translateY(var(--space-4)); transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.prompt.is-open { opacity: 1; transform: none; }
.prompt:focus { outline: none; }
.prompt:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.prompt-copy > * + * { margin-top: var(--space-2); }
.prompt-copy h2 { font-size: var(--step-1); }
.prompt-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
@media (max-width: 39.99rem) {
  /* Phones: a small slide-in at the bottom, never a full-screen cover. */
  .prompt { inset: auto var(--space-3) var(--space-3) var(--space-3); width: auto; grid-template-columns: minmax(0, 1fr); max-height: 50vh; overflow: auto; padding: var(--space-4); }
  .prompt-art, .prompt-more { display: none; }
  .prompt-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .prompt { transition: none; transform: none; } }
.choices { padding: var(--space-5); background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-lg); }
.choices label { display: flex; gap: var(--space-3); align-items: center; min-height: var(--space-7); font-weight: 700; }
.choices input { width: var(--space-5); height: var(--space-5); flex: none; }
.share { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; padding: 0; list-style: none; }
.share a { display: inline-flex; align-items: center; min-height: var(--space-7); }
