/* ==========================================================================
   Day Rate — paper desk surface.
   Bone paper, ink rules, vermilion markers, zero radius, hard offset shadow.
   Mobile-first: the base rules below are the 390px layout; every wider
   layout is added with min-width, in this order:
     390 (base)  ->  640  ->  768  ->  1024  ->  1200
   Budget held at 390x844: h1 <= 30px, section 1 <= 360px, no sideways scroll.
   ========================================================================== */
:root {
  --paper: #F7F2E8;
  --paper-2: #FBF7EF;
  --paper-3: #EFE6D6;
  --ink: #1B1815;
  --rule: #1B1815;
  --muted: #6B6156;
  --verm: #D2452A;
  --cobalt: #2147A8;
  --olive: #6C7A46;
  --display: "Bahnschrift", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --mono: Consolas, ui-monospace, "Cascadia Mono", monospace;
  --header-h: 56px;
  --rule-w: 1.5px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 1.08;
  margin: 0 0 0.55em;
}

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 14px;
}

.icon { display: inline-block; vertical-align: middle; }

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 7px 14px; font-family: var(--mono); font-size: 12px;
}
.skip:focus { top: 10px; }

/* ---- header: one row, print masthead -------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.header-inner {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); flex: 0 0 auto; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--verm);
  color: var(--paper);
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.brand-text strong {
  font-family: var(--display); font-size: 17px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.brand-text small {
  display: none;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--muted); padding: 1px 4px;
}

.site-nav {
  display: flex; align-items: center; gap: 0;
  flex: 1 1 auto; min-width: 0;
  margin-left: auto; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-link {
  color: var(--ink);
  font-family: var(--display); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 7px;
  border-left: 1px solid rgba(27, 24, 21, 0.3);
  flex: 0 0 auto;
}
.nav-link:hover, .nav-link.is-active { background: var(--ink); color: var(--paper); }
.nav-search {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; color: var(--ink);
  border: var(--rule-w) solid var(--ink); margin-left: 2px;
}
.nav-search:hover { background: var(--ink); color: var(--paper); }

/* ---- section 1: diptych (mobile budget: <= 360px tall) --------------- */
.s1 { border-bottom: 3px solid var(--ink); background: var(--paper); }
.s1-diptych { padding: 14px 0 12px; }

.diptych-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: var(--rule-w) solid var(--rule);
  margin-bottom: 10px;
}
.eyebrow {
  display: block;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--verm); margin-bottom: 4px;
}
.diptych-head h1 { font-size: 28px; margin: 0; text-wrap: balance; }
.diptych-deck {
  color: var(--muted); font-size: 13.5px; margin: 0; max-width: 34em;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.diptych-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.diptych-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  color: var(--ink);
  border: var(--rule-w) solid var(--ink);
  background: var(--paper-2);
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.diptych-panel:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.diptych-media { display: block; border-bottom: var(--rule-w) solid var(--ink); overflow: hidden; }
.diptych-media img { width: 100%; height: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.diptych-no {
  position: absolute; top: 5px; left: 5px;
  font-family: var(--mono); font-size: 9px;
  background: var(--verm); color: var(--paper);
  padding: 1px 5px; letter-spacing: 0.1em;
}
.diptych-title {
  font-family: var(--display); text-transform: uppercase; font-weight: 700;
  font-size: 13px; letter-spacing: 0.03em;
  padding: 4px 8px 0;
}
.diptych-desc { display: none; font-size: 13.5px; color: var(--muted); padding: 4px 14px 14px; }

.diptych-rows {
  margin-top: 8px; border-top: var(--rule-w) solid var(--rule);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px;
}
.diptych-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px; align-items: baseline;
  padding: 5px 2px;
  border-bottom: var(--rule-w) solid var(--rule);
  color: var(--ink);
}
.diptych-row:hover { background: var(--paper-3); }
.diptych-row:hover .diptych-row-title { color: var(--verm); }
.diptych-row-num { font-family: var(--mono); font-size: 10px; color: var(--verm); }
.diptych-row-title { font-family: var(--display); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.02em; }
.diptych-row-cat { display: none; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---- modules --------------------------------------------------------- */
.module { padding: 30px 0; border-bottom: var(--rule-w) solid var(--rule); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px;
}
.section-head h2 {
  font-size: 21px; margin: 0;
  position: relative;
  padding-left: 16px;
}
.section-head h2::before {
  content: "";
  position: absolute; left: 0; top: 0.18em;
  width: 8px; height: 0.82em;
  background: var(--verm);
}
.section-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink);
  border-bottom: var(--rule-w) solid var(--ink);
  padding-bottom: 2px; white-space: nowrap;
}
.section-link:hover { color: var(--verm); border-bottom-color: var(--verm); }

.module-note { color: var(--muted); max-width: 46em; font-size: 14px; }

/* ---- cards ----------------------------------------------------------- */
.tool-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  border-top: var(--rule-w) solid var(--rule); border-left: var(--rule-w) solid var(--rule);
}
.tool-grid > div { display: flex; }

.card {
  display: flex; flex-direction: column;
  gap: 6px;
  background: var(--paper-2);
  border-right: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
  padding: 14px;
  color: var(--ink);
  width: 100%;
  transition: background-color 0.14s ease;
}
.card:hover { background: var(--paper-3); }
.tool-card { min-height: 0; }

.card-art {
  display: block;
  border: 1px solid rgba(27, 24, 21, 0.35);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-kicker {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--verm);
  margin-top: 4px;
}
.card-title {
  display: block; font-family: var(--display); font-weight: 700;
  text-transform: uppercase; font-size: 17px; line-height: 1.18;
  letter-spacing: 0.02em;
}
.card-desc { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.48; }
.card-go {
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid rgba(27, 24, 21, 0.25);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.card:hover .card-go { color: var(--verm); }

.cat-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cat-card { min-height: 0; border: var(--rule-w) solid var(--ink); }
.card-icon { color: var(--cobalt); }
.card-icon .icon { width: 26px; height: 26px; }
.card-meta {
  margin-top: auto; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--verm);
  padding-top: 8px; border-top: 1px solid rgba(27, 24, 21, 0.25);
}

.calc-band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.calc-card { min-height: 0; border: var(--rule-w) solid var(--ink); }
.calc-card .card-go { color: var(--cobalt); }

.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.post-grid.wide { grid-template-columns: minmax(0, 1fr); }
.post-card { min-height: 0; border: var(--rule-w) solid var(--ink); }
.post-meta {
  display: flex; gap: 10px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--verm);
}

/* ---- tables ---------------------------------------------------------- */
.ref-wrap { overflow-x: auto; border: var(--rule-w) solid var(--ink); }
.ref-table, .data-table { width: 100%; border-collapse: collapse; background: var(--paper-2); font-size: 14px; }
.ref-table th, .ref-table td, .data-table th, .data-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid rgba(27, 24, 21, 0.25);
  vertical-align: top;
}
.ref-table th, .data-table th {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 400;
}
.ref-table .num, .data-table .num { font-family: var(--mono); color: var(--verm); white-space: nowrap; }

.stage-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stage-item { border-top: 4px solid var(--ink); padding-top: 10px; }
.stage-no { font-family: var(--mono); font-size: 11px; color: var(--verm); }
.stage-item h3 { font-size: 20px; margin: 4px 0 6px; }
.stage-item p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---- page hero ------------------------------------------------------- */
.page-hero { padding: 22px 0 20px; border-bottom: var(--rule-w) solid var(--rule); }
.page-hero h1 { font-size: 30px; margin-bottom: 8px; }
.lede { color: var(--muted); font-size: 16px; max-width: 48em; }
.hero-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--verm); }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0 0 14px; }
.crumbs li { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.crumbs li + li::before { content: ">"; margin-right: 7px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--verm); }
.crumbs span[aria-current] { color: var(--ink); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; border: var(--rule-w) solid var(--ink);
  padding: 5px 10px; color: var(--ink); background: var(--paper-2);
}
.chip:hover { background: var(--ink); color: var(--paper); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 18px; border: var(--rule-w) solid var(--ink); width: 100%; }
.filter-btn {
  font-family: var(--display); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--paper-2); color: var(--ink);
  border: 0; border-right: var(--rule-w) solid var(--ink);
  padding: 7px 12px; cursor: pointer;
}
.filter-btn:last-child { border-right: 0; }
.filter-btn:hover { background: var(--paper-3); }
.filter-btn.is-on { background: var(--ink); color: var(--paper); }

/* ---- detail: stacked data plate ------------------------------------- */
.detail-hero { padding: 18px 0 0; }
.detail-head {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 18px; align-items: start;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--ink);
}
.detail-art {
  margin: 0; border: var(--rule-w) solid var(--ink); overflow: hidden;
  background: var(--paper-2); order: -1; max-width: 320px;
}
.detail-title h1 { font-size: 28px; margin: 6px 0 8px; }
.detail-body { padding: 24px 0 36px; }

.detail-cols { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.detail-cols.with-rail { grid-template-columns: minmax(0, 1fr); }
.detail-cols.stacked { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; }

/* in stacked anatomy the rail is a top data plate, not a sidebar */
.detail-cols.stacked .detail-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: var(--rule-w) solid var(--ink);
  background: var(--paper-2);
}
.detail-cols.stacked .rail-block { border: 0; border-bottom: 1px solid rgba(27, 24, 21, 0.3); background: transparent; padding: 12px 14px; }
.detail-cols.stacked .rail-block:last-child { border-bottom: 0; }
.detail-cols.stacked .spec-table th, .detail-cols.stacked .spec-table td { border-bottom: 1px solid rgba(27, 24, 21, 0.2); }
.detail-cols.stacked .detail-main { max-width: 760px; }

.detail-main h2 {
  font-size: 20px; margin-top: 24px;
  padding-bottom: 6px; border-bottom: var(--rule-w) solid var(--rule);
}
.detail-main h2:first-child { margin-top: 0; }

.summary-list { list-style: none; padding: 0; margin: 0 0 8px; }
.summary-list li { padding: 6px 0 6px 18px; position: relative; border-bottom: 1px solid rgba(27, 24, 21, 0.2); }
.summary-list li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 7px; height: 7px; background: var(--cobalt); }
.note-list { padding-left: 18px; margin: 0 0 8px; }
.note-list li { margin-bottom: 9px; }
.note-list li::marker { font-family: var(--mono); color: var(--verm); }
.safety-list { list-style: none; padding: 0; margin: 0; }
.safety-list li {
  display: flex; gap: 10px; align-items: flex-start;
  border-left: 4px solid var(--verm);
  background: var(--paper-3);
  padding: 9px 12px; margin-bottom: 8px;
}
.safety-list .icon { color: var(--verm); flex: 0 0 auto; }

.detail-return { margin-top: 24px; }

.mini-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(27, 24, 21, 0.25);
  color: var(--ink); font-size: 14px;
}
.mini-link:hover { color: var(--verm); }
.mini-link .icon { color: var(--muted); }

.detail-rail { display: flex; flex-direction: column; gap: 14px; }
.rail-block { border: var(--rule-w) solid var(--ink); background: var(--paper-2); padding: 12px 14px; }
.rail-block h3 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--verm); font-weight: 400; margin-bottom: 7px;
}
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th {
  text-align: left; font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  font-weight: 400; padding: 5px 0; width: 40%; vertical-align: top;
  border-bottom: 1px solid rgba(27, 24, 21, 0.2);
}
.spec-table td { padding: 5px 0; border-bottom: 1px solid rgba(27, 24, 21, 0.2); vertical-align: top; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.rail-text { font-size: 13px; color: var(--muted); margin-bottom: 5px; }

/* ---- calculators ----------------------------------------------------- */
.calc-panel {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  margin-bottom: 26px;
}
.calc-form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.unit { color: var(--verm); }
.field input {
  font-family: var(--mono); font-size: 16px;
  padding: 8px 10px; background: var(--paper);
  border: var(--rule-w) solid var(--ink); color: var(--ink);
}
.field input:focus { outline: 3px solid var(--cobalt); outline-offset: 1px; }
.calc-out { border-left: 0; border-top: 3px solid var(--ink); padding: 16px; background: var(--paper-3); }
.calc-out h2 { font-size: 17px; margin-bottom: 10px; }
.out-list { margin: 0; }
.out-list div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(27, 24, 21, 0.25); }
.out-list div:last-child { border-bottom: 0; }
.out-list dt { color: var(--muted); font-size: 13px; }
.out-list dd { margin: 0; font-family: var(--mono); font-size: 15px; color: var(--ink); text-align: right; }
.calc-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---- blog / prose ---------------------------------------------------- */
.post-wrap { max-width: 740px; }
.post h1 { font-size: 28px; }
.post h2 { font-size: 21px; margin-top: 26px; padding-bottom: 5px; border-bottom: var(--rule-w) solid var(--rule); }
.post-meta {
  display: flex; gap: 14px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 14px 0 20px;
}
.post-art { margin: 0 0 24px; border: var(--rule-w) solid var(--ink); overflow: hidden; background: var(--paper-2); }
.post-foot { margin-top: 28px; padding-top: 12px; border-top: 3px solid var(--ink); }
.prose { max-width: 760px; }
.prose h2 { font-size: 21px; margin-top: 26px; }

/* ---- search ---------------------------------------------------------- */
.search-form { margin: 16px 0 8px; max-width: 520px; }
.search-form input {
  width: 100%; font-family: var(--mono); font-size: 15px;
  padding: 10px 12px; background: var(--paper-2);
  border: 3px solid var(--ink); color: var(--ink);
}
.search-form input:focus { outline: 3px solid var(--cobalt); outline-offset: 1px; }
.search-count { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { border-bottom: var(--rule-w) solid var(--rule); }
.search-results a { display: block; padding: 10px 0; color: var(--ink); }
.search-results a:hover .r-title { color: var(--verm); }
.r-title { font-family: var(--display); font-size: 17px; text-transform: uppercase; font-weight: 700; }
.r-desc { display: block; font-size: 13px; color: var(--muted); }
.r-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--verm); }
.search-again { display: flex; gap: 12px; margin-top: 20px; }

/* ---- 404 / generic buttons ------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.08em;
  padding: 10px 16px; border: var(--rule-w) solid var(--ink);
  color: var(--ink); background: var(--paper-2);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--verm); border-color: var(--verm); }
.btn-ghost { background: transparent; }
.cat-icon-lg { display: inline-flex; color: var(--cobalt); margin-bottom: 6px; }
.cat-icon-lg .icon { width: 32px; height: 32px; }

/* ---- footer ---------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); padding: 28px 0 20px; }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px; padding-bottom: 20px;
  border-bottom: 1px solid rgba(247, 242, 232, 0.3);
}
.footer-about { grid-column: 1 / -1; }
.footer-about h4 { font-size: 18px; margin-bottom: 6px; color: var(--paper); }
.footer-grid h4 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: #E8B9A8; font-weight: 400; margin: 0 0 9px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: #D8CFC2; font-size: 13.5px; }
.footer-grid a:hover { color: var(--paper); text-decoration: underline; }
.footer-about p { color: #D8CFC2; font-size: 13.5px; }
.footer-note { font-size: 12px; color: #B8AE9F; max-width: 30em; }
.footer-legal { padding-top: 14px; display: flex; flex-wrap: wrap; flex-direction: column; gap: 10px; justify-content: space-between; }
.footer-legal p { font-size: 11.5px; color: #B8AE9F; margin: 0; max-width: 62em; }

/* ---- 640: two-up grids, roomier container ---------------------------- */
@media (min-width: 640px) {
  :root { --header-h: 60px; }
  .container { padding: 0 20px; }
  .header-inner { gap: 14px; }
  .brand-text strong { font-size: 19px; }
  .brand-text small { display: inline; }
  .nav-link { font-size: 11px; padding: 6px 9px; }
  .s1-diptych { padding: 22px 0 20px; }
  .diptych-head { gap: 10px; padding-bottom: 12px; margin-bottom: 14px; }
  .diptych-head h1 { font-size: 34px; }
  .diptych-deck { font-size: 14.5px; -webkit-line-clamp: 2; }
  .diptych-grid { gap: 14px; }
  .diptych-title { font-size: 16px; padding: 8px 12px 0; }
  .diptych-no { top: 7px; left: 7px; font-size: 10px; padding: 2px 6px; }
  .diptych-rows { margin-top: 12px; column-gap: 22px; }
  .diptych-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; padding: 8px 2px; }
  .diptych-row-title { font-size: 15px; }
  .diptych-row-cat { display: inline; }
  .module { padding: 36px 0; }
  .section-head h2 { font-size: 23px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-grid, .post-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-cols.stacked .detail-rail { grid-template-columns: 1.3fr 1fr; }
  .detail-cols.stacked .rail-block { border-right: 1px solid rgba(27, 24, 21, 0.3); border-bottom: 0; }
  .detail-cols.stacked .rail-block:last-child { grid-column: 1 / -1; border-top: 1px solid rgba(27, 24, 21, 0.3); border-right: 0; }
  .page-hero { padding: 28px 0 24px; }
  .page-hero h1 { font-size: 36px; }
  .detail-hero { padding: 24px 0 0; }
  .detail-title h1 { font-size: 34px; }
  .detail-main h2 { font-size: 22px; }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-about { grid-column: auto; }
  .footer-legal { flex-direction: row; }
  .calc-form, .calc-out { padding: 20px; }
}

/* ---- 768: three-up directory, three-up calculators ------------------- */
@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .nav-link { font-size: 12px; padding: 6px 12px; }
  .s1-diptych { padding: 26px 0 22px; }
  .diptych-head h1 { font-size: clamp(32px, 4.6vw, 58px); }
  .diptych-deck { font-size: 15.5px; }
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-head { grid-template-columns: 320px minmax(0, 1fr); gap: 28px; padding-bottom: 22px; }
  .detail-art { max-width: none; }
  .detail-title h1 { font-size: clamp(28px, 4vw, 46px); }
  .detail-body { padding: 30px 0 50px; }
  .detail-cols { gap: 26px; }
  .detail-cols.stacked .detail-rail { grid-template-columns: 1.3fr 1fr 1fr; }
  .detail-cols.stacked .rail-block:last-child { grid-column: auto; border-top: 0; border-right: 0; border-left: 1px solid rgba(27, 24, 21, 0.3); }
  .detail-cols.stacked .rail-block { border-bottom: 0; border-right: 1px solid rgba(27, 24, 21, 0.3); }
  .detail-cols.stacked .rail-block:nth-child(3) { border-right: 0; }
  .detail-cols.stacked .detail-main { max-width: 760px; }
  .page-hero { padding: 30px 0 26px; }
  .page-hero h1 { font-size: clamp(30px, 3.8vw, 44px); }
  .detail-main h2 { font-size: 22px; }
  .post h1 { font-size: clamp(28px, 3.6vw, 42px); }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .tool-card { min-height: 220px; }
  .cat-card { min-height: 160px; }
  .calc-card { min-height: 140px; }
  .post-card { min-height: 160px; }
  .calc-panel { grid-template-columns: minmax(0, 1fr) 300px; }
  .calc-out { border-left: 3px solid var(--ink); border-top: 0; }
}

/* ---- 1024: side rail, four-up footer --------------------------------- */
@media (min-width: 1024px) {
  :root { --header-h: 60px; }
  .s1-diptych { padding: 30px 0 26px; }
  .diptych-head { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 30px; align-items: end; padding-bottom: 16px; margin-bottom: 18px; }
  .diptych-grid { gap: 18px; }
  .module { padding: 44px 0; }
  .section-head h2 { font-size: 26px; }
  .detail-cols.with-rail { grid-template-columns: minmax(0, 1fr) 320px; }
  .detail-cols.with-rail .detail-rail { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; }
  .calc-panel { grid-template-columns: minmax(0, 1fr) 340px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .tool-card { min-height: 236px; }
  .cat-card { min-height: 168px; }
  .post-card { min-height: 172px; }
}

/* ---- 1200: full four-up directory, five-up categories ---------------- */
@media (min-width: 1200px) {
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .calc-band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-card { min-height: 148px; }
  .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .diptych-panel:hover { transform: none; box-shadow: none; }
}
