/* Design 01 · pricing page only, loaded after styles.css (which holds everything the homepage and this page share).
   Request (owner, 2026-11-04): a full pricing page beside the homepage: the same four levels, worked examples, a
   digital card, ownership and running costs, then a level-by-level table, with the same numbers as the homepage.
   Design: the table is a real <table>. On wide screens its column heads (L1–L4) stick to the top of the screen while
   the long table scrolls, so every tick stays tied to its level; on phones it never scrolls sideways: each row puts
   its name on a line of its own and the four values under it, in the same four columns as the heads.
   Colour rule as in styles.css: only the four palette variables carry colour (the ticks sit on --sage); text and
   lines are neutral. Motion: none of its own; the footnote landing cue reuses styles.css and
   stops under reduced motion there. No :root here: the colour check reads the palette from styles.css. */

/* The hero states the pricing headline, so the cards follow it closer than a new section would */
.hero + .pricing { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* Worked examples: the .plan-notes family (same size, bold label, soft text), one sum per line */
.price-examples { margin-top: 1.25rem; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.price-examples dt { font-weight: 700; }
.price-examples dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* ---------- Level by level ---------- */
.compare { margin-top: var(--section-gap); }
/* Sticky heads need every ancestor of the table to leave overflow visible; none of them clips */
.compare-table {
  width: 100%;
  margin-top: 2rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.compare-table th, .compare-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: break-word;
}
/* Row names take a third of the width; the four levels share the rest equally */
.compare-corner { width: 34%; }
/* The column heads stick just under the sticky site header: header.js writes its height into --header-height
   (it changes with the screen width); without the script the fallback is the header's usual height */
.compare-table thead th {
  position: sticky;
  top: var(--header-height, 4.25rem);
  z-index: 1;
  padding-block: 1rem 0.85rem;
  border-bottom-color: var(--ink);
  background: var(--bg);
}
.compare-code { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.compare-name { display: block; margin-top: 0.1rem; font-size: 0.8125rem; color: var(--ink-soft); }
.compare-table th[scope="row"] { padding-left: 0; text-align: left; }
.compare-table .compare-group {
  padding: 2.25rem 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}
.compare-table tbody:first-of-type .compare-group { padding-top: 1.5rem; }
.compare-table .ui-tick { margin-inline: auto; }
.compare-no { display: block; width: 0.9rem; height: 2px; margin-inline: auto; border-radius: 1px; background: var(--ink-soft); }
/* After a footnote's back link, the row name holding the reference breathes, like a paragraph on the homepage */
.compare-table th:has(> sup:target) { --breathe-spread: 0.25rem; border-radius: 8px; animation: fn-breathe 1.2s ease-in-out 2; }

/* ---------- Phones: no sideways scrolling ----------
   Each row becomes a four-column grid: the row name spans the full width, the four values sit under it, lined up
   with the four column heads, which stick to the top as one block. */
@media (max-width: 640px) {
  .compare-table, .compare-table thead, .compare-table tbody { display: block; }
  .compare-table thead { position: sticky; top: var(--header-height, 3.75rem); z-index: 1; border-bottom: 1px solid var(--ink); background: var(--bg); }
  .compare-table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .compare-table thead th { position: static; padding: 0.75rem 0.25rem 0.6rem; border-bottom: 0; }
  .compare-table .compare-corner { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .compare-name { font-size: 0.75rem; line-height: 1.3; }
  .compare-table th[scope="row"], .compare-table .compare-group { grid-column: 1 / -1; }
  .compare-table th[scope="row"] { padding: 0.85rem 0 0.15rem; border-bottom: 0; font-weight: 600; }
  /* Ticks, dashes and one- or two-line values share one centre line across the four columns */
  .compare-table td { display: flex; align-items: center; justify-content: center; padding: 0.3rem 0.25rem 0.85rem; }
  .compare-table .compare-group { padding-top: 2rem; }
}
