/* ==========================================================================
   Rosie Payne · Crochet Reference
   One stylesheet, every page.

   Direction: linen and forest. A deep forest green does the structural work —
   the menu band, each chart's header, the footer — with white panels on a
   linen ground. The madder red is spent only on measurements, so the numbers
   never compete with the furniture on a site whose whole job is numbers.

   Rules this file keeps:
     1. The measurement is the hero. Prose stays quiet around it.
     2. Real value range: forest bands, white panels, linen ground.
     3. No tracked all-caps labels. Weight and size do that work.
     4. On a phone the chart is one white panel of rows, never a sideways
        scroll.
   ========================================================================== */

:root {
  --linen:      #f3eee3;   /* the page ground */
  --card:       #ffffff;   /* panels, lifted off the linen */
  --card-deep:  #ebe6d9;   /* the rare surface that should recede */

  --forest:     #22331f;
  --forest-ink: #f1efe4;
  --forest-dim: #b3bfa8;

  --ink:        #1d2419;
  --ink-soft:   #5d6554;
  --rule:       #d7d8c9;
  --rule-soft:  #e4e2d6;

  --madder:     #9e4426;   /* measurements only */
  --madder-lit: #b55330;
  --ochre:      #c6803f;   /* the current page, and links on forest */
  --sage:       #55664c;

  --lift-1: 0 1px 2px rgb(29 36 25 / 0.04), 0 2px 10px -3px rgb(29 36 25 / 0.07);
  --lift-2: 0 2px 4px rgb(29 36 25 / 0.05), 0 14px 30px -14px rgb(29 36 25 / 0.26);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Instrument Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --measure: 64ch;
  --column:  46rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --linen:      #121711;
    --card:       #1b231a;
    --card-deep:  #0e130d;
    --forest:     #2b3a27;   /* kept clearly greener than the ground, so the band still reads as a band */
    --forest-ink: #eef0e7;
    --forest-dim: #9aa891;
    --ink:        #eef0e7;
    --ink-soft:   #9fa795;
    --rule:       #333c30;
    --rule-soft:  #283020;
    --madder:     #e08456;
    --madder-lit: #ea9169;
    --ochre:      #d9a05f;
    --sage:       #9bae8b;
    --lift-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 10px -3px rgb(0 0 0 / 0.4);
    --lift-2: 0 2px 4px rgb(0 0 0 / 0.3), 0 14px 30px -14px rgb(0 0 0 / 0.65);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --linen:      #121711;
  --card:       #1b231a;
  --card-deep:  #0e130d;
  --forest:     #2b3a27;
  --forest-ink: #eef0e7;
  --forest-dim: #9aa891;
  --ink:        #eef0e7;
  --ink-soft:   #9fa795;
  --rule:       #333c30;
  --rule-soft:  #283020;
  --madder:     #e08456;
  --madder-lit: #ea9169;
  --ochre:      #d9a05f;
  --sage:       #9bae8b;
  --lift-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 10px -3px rgb(0 0 0 / 0.4);
  --lift-2: 0 2px 4px rgb(0 0 0 / 0.3), 0 14px 30px -14px rgb(0 0 0 / 0.65);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--linen);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- the two colour bands, and the reading column between them ---------- */

.bandinner {
  max-width: var(--column);
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

.navband { background: var(--forest); }
.navband .bandinner { padding-block: 0.9rem; }

.footband { background: var(--forest); color: var(--forest-ink); margin-top: 3.6rem; }
.footband .bandinner { padding-block: 2rem 2.4rem; }

.wrap {
  max-width: var(--column);
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-block: 2.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 3.4rem;
}

/* ---------- navigation ---------- */

.sitenav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1.35rem;
}

.sitenav .brand {
  font-family: var(--display);
  font-size: 1.14rem;
  font-variation-settings: "opsz" 24, "wght" 600, "SOFT" 40, "WONK" 1;
  letter-spacing: -0.01em;
  color: var(--forest-ink);
  text-decoration: none;
  margin-right: auto;
}

.sitenav .brand:hover { color: var(--ochre); }

.sitenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.15rem;
}

.sitenav a {
  font-size: 0.9rem;
  color: var(--forest-dim);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.sitenav a:hover { color: var(--forest-ink); }

.sitenav a[aria-current="page"] {
  color: var(--forest-ink);
  border-bottom-color: var(--ochre);
}

/* ---------- masthead ---------- */

.masthead { display: flex; flex-direction: column; gap: 1rem; }

.eyebrow { font-size: 0.9rem; font-weight: 500; color: var(--sage); }

h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 8.4vw, 3.3rem);
  font-variation-settings: "opsz" 120, "wght" 500, "SOFT" 24, "WONK" 1;
  line-height: 1.06;
  letter-spacing: -0.016em;
  word-spacing: 0.02em;
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
}

.standfirst {
  font-family: var(--display);
  font-size: clamp(1.14rem, 3.4vw, 1.34rem);
  font-variation-settings: "opsz" 32, "wght" 350, "SOFT" 50, "WONK" 0;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  max-width: 48ch;
}

/* ---------- sections and base text ---------- */

section { display: flex; flex-direction: column; gap: 1.15rem; }

h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4.8vw, 1.85rem);
  font-variation-settings: "opsz" 48, "wght" 500, "SOFT" 30, "WONK" 1;
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0;
  max-width: 30ch;
  text-wrap: balance;
}

h3 {
  font-family: var(--display);
  font-size: 1.16rem;
  font-variation-settings: "opsz" 24, "wght" 600, "SOFT" 40, "WONK" 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  max-width: 34ch;
}

p { margin: 0; max-width: var(--measure); }

strong { font-weight: 600; }

a {
  color: var(--madder);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--madder-lit); }

.divider { border: 0; border-top: 1px solid var(--rule); margin: 0; }

ul.plain, .steps {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: var(--measure);
}

.steps li, ul.plain li { padding-left: 0.15rem; }

::marker { color: var(--sage); }

/* ---------- callouts ---------- */

.gauge, .warn, .example {
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-left: 4px solid var(--madder);
  border-radius: 2px;
  box-shadow: var(--lift-1);
  padding: 1.45rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

/* Where getting it wrong ruins the project. */
.warn { border-left-color: var(--sage); }

/* A worked example is evidence, so it sits quieter. */
.example {
  border-left: 1px solid var(--rule-soft);
  box-shadow: none;
  background: none;
}

.eq {
  font-family: var(--body);
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.75;
  background: var(--card-deep);
  border-radius: 2px;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  white-space: nowrap;
}

.eq span { color: var(--madder); font-weight: 600; }

/* ---------- the chart: forest header on a white panel ---------- */

/* These sections hold exactly a header bar and its table, joined as one unit. */
section:has(> .chart-head) { gap: 0; }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--forest);
  color: var(--forest-ink);
  border-radius: 3px 3px 0 0;
  padding: 0.75rem 0.95rem;
}

.chart-head h2 {
  color: var(--forest-ink);
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  font-variation-settings: "opsz" 34, "wght" 600, "SOFT" 34, "WONK" 0;
}

.print-btn {
  font-family: var(--body);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}

.print-btn:hover { color: var(--madder); }

.scroller {
  overflow: visible;
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  box-shadow: var(--lift-1);
  padding-inline: 0.95rem;
}

.chart-head + .scroller {
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

caption {
  text-align: left;
  padding-block: 0.9rem 0.2rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  max-width: var(--measure);
}

/* --- phone: the panel holds a column of rows, not a sideways scroll --- */

@media (max-width: 47.99rem) {
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  caption { display: block; }

  tbody { display: flex; flex-direction: column; }

  /* The measurement and its designations on one line, the explanation below.
     Someone scanning for one hook size should not scroll past a tall card
     for every size they are not looking for. */
  tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 1.3rem;
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--rule-soft);
  }

  tbody tr:last-child { border-bottom: 0; }

  /* The first cell names the row. On the charts where that name IS the
     measurement it gets the hero treatment below; where it is a project or a
     stitch, it stays a quiet label and the measurement elsewhere in the row
     takes the emphasis. */
  td:first-child {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    margin-right: auto;
  }

  td:not(:first-child):not(.note) {
    font-size: 1rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  td.size {
    font-family: var(--display);
    font-size: 1.55rem;
    font-variation-settings: "opsz" 40, "wght" 500, "SOFT" 28, "WONK" 0;
    font-variant-numeric: tabular-nums;
    font-weight: normal;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--madder);
  }

  td:not(:first-child):not(.note)::before {
    content: attr(data-label) " ";
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--ink-soft);
  }

  td.note {
    flex: 1 0 100%;
    margin-top: 0.45rem;
    color: var(--ink-soft);
    font-size: 0.93rem;
    line-height: 1.5;
  }

  tr.flag {
    box-shadow: inset 3px 0 0 var(--madder);
    padding-left: 0.75rem;
  }
}

/* --- wider screens: a proper table inside the panel --- */

@media (min-width: 48rem) {
  th {
    font-family: var(--body);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 0.9rem 1.1rem 0.7rem 0;
    border-bottom: 1px solid var(--rule);
    vertical-align: bottom;
  }

  td {
    padding: 0.85rem 1.1rem 0.85rem 0;
    border-bottom: 1px solid var(--rule-soft);
    vertical-align: baseline;
  }

  tbody tr:last-child td { border-bottom: 0; }

  td:first-child {
    font-weight: 600;
    color: var(--ink);
    padding-right: 1.6rem;
  }

  td:not(:first-child) { font-variant-numeric: tabular-nums; }

  /* The measurement, wherever it sits in the row. */
  td.size {
    font-family: var(--display);
    font-size: 1.32rem;
    font-variation-settings: "opsz" 32, "wght" 500, "SOFT" 28, "WONK" 0;
    font-variant-numeric: tabular-nums;
    font-weight: normal;
    letter-spacing: -0.015em;
    color: var(--madder);
    white-space: nowrap;
  }

  .note {
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.5;
    font-variant-numeric: normal;
  }

  /* A row worth lingering on: marked at the edge, not flooded with colour. */
  tr.flag td:first-child {
    box-shadow: inset 3px 0 0 var(--madder);
    padding-left: 0.8rem;
  }
  tr.flag td { background: var(--card-deep); }
}

.size { white-space: nowrap; }

/* ---------- key-number grid ---------- */

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 1.7rem 2.2rem;
}

.rule-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding-top: 0.9rem;
  border-top: 2px solid var(--forest);
}

.rule-item .num {
  font-family: var(--display);
  font-size: 1.22rem;
  font-variation-settings: "opsz" 28, "wght" 600, "SOFT" 28, "WONK" 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
  color: var(--madder);
}

.rule-item h3 { font-size: 1.05rem; }
.rule-item p { font-size: 0.96rem; color: var(--ink-soft); }

/* ---------- calculators ---------- */

.calc {
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  box-shadow: var(--lift-1);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calc-intro { display: flex; flex-direction: column; gap: 0.6rem; }

.unit-toggle { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }

.unit-toggle .k { font-size: 0.9rem; color: var(--ink-soft); }

.unit-toggle .seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  background: var(--card);
}

.unit-toggle button {
  font-family: var(--body);
  font-size: 0.88rem;
  font-weight: 500;
  background: none;
  border: 0;
  color: var(--ink-soft);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.unit-toggle button:hover { color: var(--ink); }

.unit-toggle button[aria-pressed="true"] {
  background: var(--forest);
  color: var(--forest-ink);
}

.calc-group { display: flex; flex-direction: column; gap: 0.85rem; }

.calc-group > h3 {
  font-family: var(--display);
  font-size: 1.04rem;
  font-variation-settings: "opsz" 20, "wght" 600, "SOFT" 40, "WONK" 0;
  color: var(--sage);
  max-width: none;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule-soft);
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }

.field label { font-size: 0.92rem; font-weight: 500; color: var(--ink); }

.field input {
  font-family: var(--display);
  font-size: 1.22rem;
  font-variation-settings: "opsz" 24, "wght" 500, "SOFT" 28, "WONK" 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--linen);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  width: 100%;
  min-width: 0;
}

.field input:hover { border-color: var(--ink-soft); }
.field input:focus-visible { outline: 2px solid var(--madder); outline-offset: 1px; }

.field .hint { font-size: 0.86rem; color: var(--ink-soft); }

/* The answer is what the calculator is for, so it gets the forest block. */
.calc-out {
  background: var(--forest);
  color: var(--forest-ink);
  border-radius: 3px;
  padding: 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.out-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.out-row .k { font-size: 0.96rem; color: var(--forest-dim); }

.out-row .v {
  font-family: var(--display);
  font-size: 1.62rem;
  font-variation-settings: "opsz" 40, "wght" 500, "SOFT" 28, "WONK" 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ochre);
}

.out-row.minor .v { font-size: 1.14rem; color: var(--forest-ink); }

.calc-note { font-size: 0.94rem; color: var(--ink-soft); }

/* ---------- author note ---------- */

.why {
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  box-shadow: var(--lift-1);
  padding: 1.7rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.why h3 { font-size: 1.2rem; }

.why p {
  font-family: var(--display);
  font-size: 1.1rem;
  font-variation-settings: "opsz" 20, "wght" 350, "SOFT" 50, "WONK" 0;
  line-height: 1.6;
  max-width: 58ch;
}

.signoff {
  font-family: var(--display);
  font-size: 1.1rem;
  font-variation-settings: "opsz" 24, "wght" 500, "SOFT" 60, "WONK" 1;
  color: var(--madder);
}

/* ---------- related pages ---------- */

.related { border-top: 2px solid var(--forest); padding-top: 1.8rem; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.related-grid a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.15rem;
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  box-shadow: var(--lift-1);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.related-grid a:hover, .related-grid a:focus-visible {
  border-color: var(--forest);
  box-shadow: var(--lift-2);
}

.related-grid .t {
  font-family: var(--display);
  font-size: 1.12rem;
  font-variation-settings: "opsz" 22, "wght" 550, "SOFT" 35, "WONK" 0;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.related-grid .d { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- book: full treatment, home page ---------- */

.book { border-top: 2px solid var(--forest); padding-top: 2.1rem; }

.book-body {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 2rem;
  align-items: start;
}

.cover, .bookcard img, .next img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  box-shadow: var(--lift-2);
}

.book-copy { display: flex; flex-direction: column; gap: 1.05rem; min-width: 0; }

.formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 0.4rem;
}

.format {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.2rem;
  background: var(--card);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  box-shadow: var(--lift-1);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.format:hover, .format:focus-visible {
  border-color: var(--forest);
  box-shadow: var(--lift-2);
}

.format .kind { font-size: 0.9rem; color: var(--sage); font-weight: 500; }

.format .name {
  font-family: var(--display);
  font-size: 1.24rem;
  font-variation-settings: "opsz" 26, "wght" 550, "SOFT" 35, "WONK" 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.format .go { font-size: 0.92rem; color: var(--madder); font-weight: 500; }

@media (max-width: 34rem) {
  .book-body { grid-template-columns: 1fr; gap: 1.5rem; }
  .cover { max-width: 11rem; }
}

/* ---------- book: compact card, secondary pages ---------- */

.bookcard {
  border-top: 2px solid var(--forest);
  padding-top: 1.9rem;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.6rem;
  align-items: start;
}

.bookcard-copy { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.bookcard-copy p { font-size: 1rem; }

.bookcard-links, .next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 0.25rem;
}

.bookcard-links a, .next-links a {
  color: var(--madder);
  font-weight: 500;
  font-size: 0.97rem;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}

.bookcard-links a:hover, .next-links a:hover { border-bottom-color: var(--madder); }

@media (max-width: 30rem) {
  .bookcard { grid-template-columns: 6.5rem 1fr; gap: 1.2rem; }
}

/* ---------- book two: deliberately quieter than book one ---------- */

.next {
  border-top: 1px solid var(--rule);
  padding-top: 1.7rem;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.3rem;
  align-items: start;
}

.next-copy { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.next-copy .label { font-size: 0.9rem; color: var(--sage); font-weight: 500; }

.next-copy .t {
  font-family: var(--display);
  font-size: 1.14rem;
  font-variation-settings: "opsz" 22, "wght" 550, "SOFT" 35, "WONK" 0;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.next-copy p { font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 30rem) {
  .next { grid-template-columns: 5.5rem 1fr; gap: 1.1rem; }
}

/* ---------- footer, on the forest band ---------- */

footer {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.94rem;
  color: var(--forest-dim);
}

footer p { max-width: var(--measure); }
footer a { color: var(--ochre); }
footer a:hover { color: var(--forest-ink); }

.series {
  font-size: 0.94rem;
  color: var(--ink-soft);
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule-soft);
  margin-top: 0.3rem;
}

.fineprint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.3rem;
  font-size: 0.89rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgb(241 239 228 / 0.14);
}

:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- print: these are reference charts, people want them on paper ---------- */

@media print {
  :root {
    --linen: #fff;
    --card: #fff;
    --card-deep: #fff;
    --forest: #fff;
    --forest-ink: #000;
    --forest-dim: #333;
    --ink: #000;
    --ink-soft: #333;
    --rule: #999;
    --rule-soft: #ccc;
    --madder: #000;
    --madder-lit: #000;
    --ochre: #000;
    --sage: #333;
    --lift-1: none;
    --lift-2: none;
  }

  .wrap { max-width: none; padding-block: 0; gap: 1.5rem; }
  .book, .bookcard, .why, .navband, .sitenav, .related, .no-print { display: none; }
  .footband { margin-top: 1.5rem; }
  .footband .bandinner { padding-block: 0.8rem 0; max-width: none; }
  footer { border-top: 1px solid #999; padding-top: 0.8rem; font-size: 8.5pt; }
  .fineprint { border-top: 0; }

  h1 { font-size: 22pt; }
  h2 { font-size: 14pt; }
  body { font-size: 10.5pt; }

  .gauge, .warn { border-left: 2px solid #000; box-shadow: none; }
  .example, .calc, .related-grid a, .format { box-shadow: none; }

  .chart-head {
    background: none;
    color: #000;
    padding: 0 0 0.4rem;
    border-bottom: 2px solid #000;
  }
  .chart-head h2 { color: #000; }

  .calc-out {
    background: none;
    color: #000;
    border-left: 2px solid #000;
  }
  .calc-out .k, .calc-out .v { color: #000; }

  /* back to a real table, whatever the paper width */
  .scroller {
    overflow: visible;
    border: 0;
    box-shadow: none;
    padding-inline: 0;
  }
  table { display: table; width: 100%; font-size: 9.5pt; }
  thead { display: table-header-group; }
  tbody { display: table-row-group; }
  tr {
    display: table-row;
    background: none;
    border: 0;
    padding: 0;
    box-shadow: none;
  }
  td, th { display: table-cell; }
  th {
    text-align: left;
    font-weight: 600;
    padding: 0 0.7rem 0.4rem 0;
    border-bottom: 1px solid #000;
  }
  td {
    padding: 0.4rem 0.7rem 0.4rem 0;
    border-bottom: 1px solid #ccc;
    vertical-align: baseline;
    margin: 0;
    color: #000;
  }
  td:first-child { font-weight: 600; margin: 0; color: #000; }
  td.size {
    font-family: var(--display);
    font-size: 11pt;
    font-weight: 600;
    white-space: nowrap;
    margin: 0;
    color: #000;
  }
  td:not(:first-child):not(.note) { display: table-cell; margin: 0; }
  td:not(:first-child):not(.note)::before { content: none; }
  td.note { margin: 0; padding-top: 0.4rem; border-top: 0; font-size: 9pt; }
  tr.flag td { background: none; font-weight: 600; box-shadow: none; padding-left: 0; }
  tr.flag td:first-child { box-shadow: none; padding-left: 0; }

  section { break-inside: avoid; }
  tr { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
}
