/* hex-cmyk.com — original stylesheet.
   Visual direction: the press control strip printers put on the edge of every sheet.
   System fonts only: no third-party font requests, so no GDPR exposure and no render delay. */

:root {
  --magenta-text: #C4006B;   /* accessible on light backgrounds */
  --ink:      #101418;   /* rich black */
  --ink-70:   #454B54;
  --muted:    #5D6570;
  --stock:    #F3F4F1;   /* coated stock */
  --paper:    #FFFFFF;
  --rule:     #DDDFD9;
  --rule-2:   #EBEDE8;

  --cyan:     #009EE0;
  --magenta:  #E5007D;
  --yellow:   #FFD500;
  --key:      #101418;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1080px;
  --r: 3px;
}

* { box-sizing: border-box; }

img, svg, table { max-width: 100%; }
.prose p, .prose li, .readout .value { overflow-wrap: anywhere; }

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

body {
  margin: 0;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: #0072A3; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--magenta-text); }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

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

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 62px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand {
  font-family: var(--mono);
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { color: var(--ink); }
.brand-dots { display: inline-flex; gap: 3px; }
.brand-dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.brand-dots i:nth-child(1) { background: var(--cyan); }
.brand-dots i:nth-child(2) { background: var(--magenta); }
.brand-dots i:nth-child(3) { background: var(--yellow); }
.brand-dots i:nth-child(4) { background: var(--key); }

.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a {
  font-size: 14px; padding: 4px 0; min-height: 24px; display: inline-block; color: var(--ink-70); text-decoration: none;
  font-weight: 500;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--magenta-text); }

/* ---------------- page head ---------------- */

.crumbs {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 18px 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs span { padding: 0 6px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}

h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 14px;
}
.standfirst {
  font-size: 19px; color: var(--ink-70); max-width: 62ch; margin: 0 0 30px;
}

/* ---------------- the tool ---------------- */

.tool {
  background: var(--paper);
  margin-top: 4px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  margin-bottom: 44px;
  overflow: hidden;
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
}
.tool-in { padding: 24px; border-right: 1px solid var(--rule); }
.tool-out { padding: 24px; }

.field-label {
  display: block;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}

.hexfield { display: flex; align-items: stretch; gap: 0; }
.hexfield .hash {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--stock); border: 1px solid var(--rule); border-right: 0;
  border-radius: var(--r) 0 0 var(--r);
  font-family: var(--mono); color: var(--muted); font-size: 18px;
}
input[type="text"], input[type="number"] {
  font-family: var(--mono);
  font-size: 18px;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
.hexfield input { border-radius: 0 var(--r) var(--r) 0; text-transform: uppercase; letter-spacing: 0.06em; }
input:focus { border-color: var(--cyan); }

.pickrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pickrow input[type="color"] {
  width: 46px; height: 34px; padding: 0; border: 1px solid var(--rule);
  border-radius: var(--r); background: none; cursor: pointer;
}
.pickrow span { font-size: 13px; color: var(--muted); }

.quad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quad .fld label { display:block; }

.slider-row { margin-bottom: 14px; }
.slider-row .top { display: flex; justify-content: space-between; align-items: baseline; }
.slider-row .val { font-family: var(--mono); font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--cyan); margin: 4px 0 0; }
.slider-row[data-ink="c"] input[type="range"] { accent-color: var(--cyan); }
.slider-row[data-ink="m"] input[type="range"] { accent-color: var(--magenta); }
.slider-row[data-ink="y"] input[type="range"] { accent-color: #C9A800; }
.slider-row[data-ink="k"] input[type="range"] { accent-color: var(--key); }

.preview-wrap { margin-top: 18px; }
.preview {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  min-height: 118px;
}
.preview-label {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--muted); margin-top: 8px;
}
.preview-label b { color: var(--ink); }

.msg { font-size: 13px; color: var(--magenta-text); min-height: 20px; margin-top: 10px; }

/* --- signature element: the press control strip --- */

.strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.patch-cell { min-width: 0; }
.patch-label {
  display: flex; justify-content: space-between; gap: 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--muted);
  margin-top: 6px;
}
.patch-label b { color: var(--ink); font-weight: 700; }
.patch {
  aspect-ratio: 1 / 0.82;
  border-radius: 2px;
  border: 1px solid rgba(16,20,24,0.14);
}

.readout { border-top: 1px solid var(--rule-2); }
.readout .line {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rule-2);
}
.readout .key {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); flex: none;
}
.readout .value { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.copy {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  background: none; border: 1px solid var(--rule); color: var(--muted);
  padding: 0 11px; min-height: 26px; border-radius: var(--r); cursor: pointer; flex: none;
}
.copy:hover { border-color: var(--cyan); color: var(--cyan); }
.copy[data-done="1"] { border-color: var(--cyan); color: var(--cyan); }

.tac {
  min-height: 2.9em;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-2);
}
.tac b { color: var(--ink); }
.tac.warn b { color: var(--magenta-text); }

/* ---------------- prose ---------------- */

.prose { max-width: 68ch; }
.prose h2 {
  font-size: 25px; letter-spacing: -0.015em; font-weight: 700;
  margin: 46px 0 12px; padding-top: 18px; border-top: 2px solid var(--ink);
}
.prose h3 { font-size: 18px; font-weight: 700; margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--rule-2); padding: 1px 5px; border-radius: 2px;
}

.formula {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper); border: 1px solid var(--rule);
  border-left: 4px solid var(--cyan);
  border-radius: var(--r);
  padding: 18px 20px; margin: 0 0 20px;
  font-family: var(--mono); font-size: 14.5px; line-height: 1.9;
}
.formula .fl { display: block; }
.formula .cmt { color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0 0 20px; counter-reset: s; }
.steps li {
  counter-increment: s;
  border-bottom: 1px solid var(--rule-2);
  padding: 12px 0 12px 42px; position: relative;
  font-size: 16px;
}
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 12px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--cyan);
}
.steps li b { font-family: var(--mono); font-weight: 700; }

.callout {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px; margin: 0 0 20px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .h {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--magenta-text); margin: 0 0 8px; display: block; font-weight: 700;
}

/* ---------------- tables ---------------- */

.tablewrap { overflow-x: auto; max-width: 100%; margin: 0 0 22px; }
table.data {
  width: 100%; border-collapse: collapse; background: var(--paper);
  font-size: 14px; font-family: var(--mono);
}
table.data th {
  text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: 10px 12px; border-bottom: 2px solid var(--ink); white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
table.data tr:hover td { background: var(--stock); }
.sw { display: inline-block; width: 34px; height: 16px; border-radius: 2px; border: 1px solid rgba(16,20,24,0.18); vertical-align: -3px; }

/* ---------------- faq ---------------- */

.faq { margin: 0 0 20px; }
.faq details {
  border-bottom: 1px solid var(--rule); background: none;
}
.faq summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; font-size: 17px;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--cyan); font-weight: 700; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 16px; color: var(--ink-70); }
.faq details > div p:last-child { margin-bottom: 0; }

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

.related { margin: 46px 0 0; padding-top: 18px; border-top: 2px solid var(--ink); }
.related h2 { font-size: 15px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 16px; border: 0; padding: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 15px 16px; text-decoration: none; display: block; color: var(--ink);
}
.card:hover { border-color: var(--cyan); color: var(--ink); }
.card b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.card span { font-size: 13px; color: var(--muted); }

/* ---------------- hub grid ---------------- */

.hubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0 0 34px; }
.hubgrid .card b { font-family: var(--mono); font-size: 14.5px; }

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

.foot {
  margin-top: 64px; background: var(--ink); color: #A8B0BB;
  padding: 44px 0 30px; font-size: 14px;
}
.foot a { color: #D6DCE4; text-decoration: none; }
.foot a:hover { color: var(--yellow); }
.footgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 30px; }
.foot h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #9AA3B0; margin: 0 0 12px; font-weight: 700;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 7px; }
.footnote {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid #262C34;
  font-size: 12.5px; color: #8A94A2; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}

/* ---------------- forms (contact) ---------------- */

.formbox { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; max-width: 520px; }
.formbox label { display: block; margin-bottom: 16px; }
.formbox textarea {
  width: 100%; font-family: var(--sans); font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--rule); border-radius: var(--r); min-height: 130px; resize: vertical;
}
.btn {
  background: var(--ink); color: #fff; border: 0; border-radius: var(--r);
  padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: var(--cyan); }

/* ---------------- responsive ---------------- */

@media (max-width: 800px) {
  .wrap { padding: 0 16px; }
  .tool-in, .tool-out { padding: 18px; }
  .preview { min-height: 96px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-in { border-right: 0; border-bottom: 1px solid var(--rule); }
  .strip { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .patch { font-size: 9px; padding: 5px; flex-direction: column; align-items: flex-start; gap: 2px; }
  body { font-size: 16px; }
  .nav { gap: 16px; }
}

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


/* ---------------- direct answer + contents ---------------- */

.answer {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--cyan);
  border-radius: var(--r);
  padding: 20px 22px;
  margin: 0 0 34px;
  max-width: 68ch;
}
.answer .aq {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 700;
}
.answer .aa { margin: 0; font-size: 17px; line-height: 1.6; }

.toc {
  border-left: 2px solid var(--rule);
  padding: 2px 0 2px 18px;
  margin: 0 0 38px;
  max-width: 68ch;
}
.toc h2 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 10px; border: 0; padding: 0; font-weight: 700;
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; margin-bottom: 6px; font-size: 15.5px; }
.toc li::before {
  content: counter(t, decimal-leading-zero) "  ";
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

.prose h2 { scroll-margin-top: 20px; }

.anchor {
  font-family: var(--mono); font-size: 0.55em; color: var(--rule);
  text-decoration: none; margin-left: 10px; vertical-align: middle;
}
.prose h2:hover .anchor { color: var(--cyan); }

/* semantic term list */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 26px; margin: 0 0 20px; }
.terms div { border-bottom: 1px solid var(--rule-2); padding: 11px 0; font-size: 15px; }
.terms b { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; }
.terms span { color: var(--ink-70); font-size: 14.5px; }


/* ---------------- reverse-conversion bar ---------------- */

.swap {
  border-top: 1px solid var(--rule);
  background: var(--stock);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  font-size: 15px;
}
.swap span { color: var(--muted); }
.swap a { font-weight: 600; text-decoration: none; }
.swap a:hover { text-decoration: underline; }

/* ---------------- footer converter matrix ---------------- */

.footmatrix { grid-column: span 2; min-width: 0; }
.footmatrix > table { min-width: 0; }
table.matrix { border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
table.matrix caption {
  text-align: left; color: #8A94A2; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; padding-bottom: 8px;
}
table.matrix th {
  color: #9AA3B0; font-weight: 700; padding: 5px 9px;
  font-size: 11px; letter-spacing: 0.06em; text-align: left;
}
table.matrix td { padding: 3px 4px; }
table.matrix td a {
  display: block; padding: 6px 9px; min-height: 24px; border: 1px solid #262C34; border-radius: 2px;
  color: #D6DCE4; text-decoration: none; white-space: nowrap;
}
table.matrix td a:hover { border-color: var(--cyan); color: var(--yellow); }
table.matrix td.self { text-align: center; color: #3A424C; }
table.matrix td.soon { padding: 7px 9px; color: #8A94A2; font-size: 11px; }

@media (max-width: 700px) {
  .footmatrix { grid-column: span 1; }
  table.matrix { font-size: 11px; }
  table.matrix td a { padding: 4px 6px; }
}

/* =====================================================================
   BOXED LAYOUT — the page as a press sheet on the bed
   ===================================================================== */

:root {
  --bed:   #CED2CA;   /* press bed showing around the sheet */
  --sheet: #FFFFFF;   /* the paper */
  --panel: #F4F5F2;   /* tinted regions printed on the paper */
}

body { background: var(--bed); }

.bed { padding: 34px 34px 44px; }

.sheet {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  background: var(--sheet);
  box-shadow:
    0 1px 2px rgba(16, 20, 24, 0.10),
    0 14px 40px rgba(16, 20, 24, 0.13);
}

/* the four-colour bar printed along the head of the sheet */
.sheetbar { display: flex; height: 5px; }
.sheetbar i { flex: 1; display: block; }
.sheetbar i:nth-child(1) { background: var(--cyan); }
.sheetbar i:nth-child(2) { background: var(--magenta); }
.sheetbar i:nth-child(3) { background: var(--yellow); }
.sheetbar i:nth-child(4) { background: var(--key); }

/* trim marks, as they appear outside the crop on a real press sheet */
.trim { position: absolute; width: 17px; height: 17px; pointer-events: none; }
.trim::before, .trim::after {
  content: ""; position: absolute; background: rgba(16, 20, 24, 0.34);
}
.trim::before { width: 17px; height: 1px; top: 8px; }
.trim::after  { width: 1px; height: 17px; left: 8px; }
.trim.tl { top: -22px; left: -22px; }
.trim.tr { top: -22px; right: -22px; }
.trim.bl { bottom: -22px; left: -22px; }
.trim.br { bottom: -22px; right: -22px; }

.colophon {
  max-width: 1140px;
  margin: 16px auto 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3D4249;
  text-align: right;
}

/* --- the sheet is now white, so interior regions take the tint --- */

.masthead { background: transparent; }
.masthead-in { padding-top: 14px; padding-bottom: 14px; }

.tool { background: var(--sheet); }
.tool-in { background: var(--panel); }
.tool-out { background: var(--sheet); }
.swap { background: var(--panel); }

.formula, .callout, .answer, .card, .formbox { background: var(--panel); }
.answer { border-top-width: 3px; }
.card:hover { background: var(--sheet); }

table.data { background: transparent; }
table.data tr:hover td { background: var(--panel); }

.preview { border-color: rgba(16, 20, 24, 0.12); }

/* footer becomes the black plate at the foot of the sheet */
.foot { margin-top: 56px; padding: 46px 0 34px; }

main { padding-bottom: 10px; }

/* --- responsive: on small screens the sheet fills the bed --- */

@media (max-width: 760px) {
  .bed { padding: 0 0 24px; }
  .sheet { box-shadow: none; max-width: none; }
  .trim { display: none; }
  .colophon { display: none; }
}

@media (max-width: 1060px) and (min-width: 761px) {
  .bed { padding: 22px 22px 30px; }
  .trim { display: none; }
}

/* ---------------- two-column reading layout with sticky rail ---------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 56px;
  align-items: start;
}
.layout .col { min-width: 0; }

.rail { position: sticky; top: 26px; padding-top: 4px; }
.railbox { margin-bottom: 30px; }
.railbox h2 {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin: 0 0 12px; padding: 0 0 9px;
  border: 0; border-bottom: 1px solid var(--rule);
}
.railnav { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.railnav li { counter-increment: r; margin-bottom: 9px; line-height: 1.35; }
.railnav:not(.plain) li { display: flex; gap: 7px; align-items: baseline; }
.railnav a {
  font-size: 13.5px; color: var(--ink-70); text-decoration: none;
  display: inline-block;
}
.railnav a:hover { color: var(--magenta-text); }
.railnav:not(.plain) li::before {
  content: counter(r, decimal-leading-zero);
  font-family: var(--mono); font-size: 10px; color: var(--rule);
  flex: none; padding-top: 1px;
}
/* current section, updated as you scroll */
.railnav a[data-active] { color: var(--ink); font-weight: 600; }
.railnav li:has(a[data-active])::before { color: var(--cyan); }
.railnav.plain a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em;
}

/* wide tables can bleed toward the rail gutter; the tool stays in its column */
.layout .col .tablewrap { margin-right: -28px; }
.layout .col { overflow-x: clip; }

@media (max-width: 1060px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .layout .col .tablewrap { margin-right: 0; }

  /* Rail becomes an end-of-article navigation block. Nothing is hidden, so the
     links keep their full weight under mobile-first indexing. */
  .rail {
    position: static;
    margin: 40px 0 0;
    padding-top: 22px;
    border-top: 2px solid var(--ink);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0 32px;
    align-items: start;
  }
  .railbox { margin-bottom: 22px; }
  .railnav a { font-size: 14.5px; }
  .railnav li { margin-bottom: 7px; }
}

@media (max-width: 520px) {
  .rail { grid-template-columns: 1fr; }
}

/* ---------------- standing disclaimer under each tool ---------------- */

.toolnote {
  margin: -30px 0 44px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  border-left: 2px solid var(--rule);
  padding-left: 14px;
  max-width: 74ch;
}
.toolnote a { color: var(--muted); }
.toolnote a:hover { color: var(--magenta-text); }

/* legal pages: readable, plainly set */
.legal-meta {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 34px;
}


/* horizontally scrollable tables are keyboard-focusable (WCAG 2.1.1) */
.tablewrap:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.tablewrap { scrollbar-width: thin; }

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


/* Links sitting inside a block of body text carry an underline, so they are
   distinguishable without relying on colour (WCAG 1.4.1). */
.footnote a, .toolnote a, .foot p a {
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* --- WCAG 1.4.10 reflow: nothing may force horizontal scrolling of the page
   at 320px. Wide tables scroll inside their own container instead. --- */

@media (max-width: 420px) {
  .footmatrix { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.matrix { font-size: 10px; }
  table.matrix td a { padding: 6px 5px; }
  table.matrix th { padding: 5px 5px; }
}

/* heading anchors: 24x24 hit area for WCAG 2.2 target size, small glyph */
.anchor {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; min-height: 24px;
  margin-left: 4px; vertical-align: middle;
}


/* WCAG 2.2 SC 2.5.8 — navigation links sit in lists rather than sentences,
   so the inline exception is not relied on. Each gets a 24px hit area. */

.foot li a,
.railnav a,
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.foot li { margin-bottom: 4px; }
.railnav li { margin-bottom: 5px; }
.railnav:not(.plain) li::before { padding-top: 4px; }

/* =====================================================================
   TYPOGRAPHY — self-hosted, so no third-party requests and no GDPR exposure.
   Archivo: a neo-grotesque that holds up at large sizes with tight tracking.
   IBM Plex Mono: for every number, code and label. Licences in /assets/fonts/.
   ===================================================================== */

@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/archivo-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/archivo-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/archivo-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/assets/fonts/archivo-latin-800-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

/* Fallback metrics tuned to Archivo so the swap causes no visible reflow. */
@font-face {
  font-family: "Archivo Fallback"; src: local("Arial");
  size-adjust: 103%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%;
}

:root {
  --sans: "Archivo", "Archivo Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body { font-size: 16.5px; line-height: 1.68; letter-spacing: -0.003em; }

/* --- display --- */

h1 {
  font-size: clamp(36px, 5.6vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.038em;
  font-weight: 800;
  margin: 0 0 18px;
}

.standfirst {
  font-size: 19.5px; line-height: 1.55; letter-spacing: -0.012em;
  color: var(--ink-70); max-width: 56ch; margin: 0 0 34px; font-weight: 400;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-70); margin: 0 0 14px;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; background: var(--cyan); display: block;
}

/* --- section headings set like a spec sheet: numbered, thin rule --- */

.prose { counter-reset: sec; }
.prose h2 {
  counter-increment: sec;
  font-size: clamp(22px, 2.6vw, 27px);
  line-height: 1.14;
  letter-spacing: -0.024em;
  font-weight: 700;
  margin: 54px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
}
.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--mono); font-weight: 600;
  font-size: 10.5px; letter-spacing: 0.16em;
  color: var(--cyan);
  margin-bottom: 11px;
}
.prose h3 {
  font-size: 17.5px; font-weight: 700; letter-spacing: -0.012em; margin: 30px 0 8px;
}
.prose p { margin: 0 0 17px; }
.prose ul, .prose ol { margin: 0 0 17px; }
.prose li { margin-bottom: 8px; }
.prose b { font-weight: 700; }

/* --- halftone: the dot pattern a press lays down, at a whisper --- */

.bed {
  background-image: radial-gradient(circle, rgba(16, 20, 24, 0.055) 1px, transparent 1px);
  background-size: 9px 9px;
  background-position: -1px -1px;
}

/* --- refinements --- */

.masthead-in { min-height: 68px; }
.brand { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.nav a { font-size: 14px; font-weight: 500; letter-spacing: -0.006em; }

.readout .value { font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.readout .key { font-weight: 600; font-size: 10px; letter-spacing: 0.16em; }
.field-label { font-weight: 600; font-size: 10px; letter-spacing: 0.16em; }
.copy { font-weight: 600; font-size: 10px; letter-spacing: 0.12em; }
input[type="text"], input[type="number"] { font-weight: 500; letter-spacing: 0.02em; }

.answer .aa { font-size: 17.5px; line-height: 1.58; letter-spacing: -0.011em; }
.answer .aq { font-weight: 600; letter-spacing: 0.16em; font-size: 10px; }

.formula { font-size: 14px; line-height: 2.0; letter-spacing: -0.005em; }
.callout .h { font-weight: 600; letter-spacing: 0.16em; font-size: 10px; }
.steps li { font-size: 16px; }
.steps li::before { font-weight: 600; }

table.data { font-size: 13.5px; }
table.data th { font-weight: 600; font-size: 10px; letter-spacing: 0.14em; border-bottom-width: 1px; border-bottom-color: var(--ink); }
table.data td { padding: 10px 12px; }

.faq summary { font-size: 16.5px; font-weight: 600; letter-spacing: -0.014em; padding: 17px 0; }
.faq details > div { font-size: 16px; }

.card b { font-size: 15px; font-weight: 700; letter-spacing: -0.016em; }
.card { border-left: 2px solid var(--rule); transition: border-color .12s ease; }
.card:hover { border-left-color: var(--cyan); }
.related h2 { font-weight: 600; font-size: 10.5px; letter-spacing: 0.16em; }

.railbox h2 { font-weight: 600; font-size: 10px; letter-spacing: 0.16em; }
.railnav a { font-size: 13px; letter-spacing: -0.008em; }
.patch-label { font-weight: 600; font-size: 10px; letter-spacing: 0.06em; }
.toolnote { font-size: 12.5px; }
.tac { font-size: 11.5px; letter-spacing: 0.01em; }

.foot { font-size: 13.5px; }
.foot h3 { font-weight: 600; font-size: 10px; letter-spacing: 0.18em; }
.colophon { font-weight: 400; font-size: 10px; letter-spacing: 0.16em; }

/* --- legibility corrections ---------------------------------------- */

/* Archivo sets a tight word space; negative tracking on top of it made words
   run together in body copy. Reading text gets neutral tracking and a little
   extra word spacing. Tight tracking stays on display sizes only. */
body { letter-spacing: 0; word-spacing: 0.045em; }
.standfirst { letter-spacing: -0.006em; word-spacing: 0.04em; }
.prose p, .prose li, .faq details > div, .answer .aa, .callout p, .steps li {
  letter-spacing: 0; word-spacing: 0.045em;
}
.card span, .toolnote, .foot { word-spacing: 0.035em; }
h1, .prose h2, .prose h3, .card b { word-spacing: 0; }

/* Swatch captions: left-aligned so each reads as one unit ("C 88%") rather
   than colliding with the neighbouring cell across the gap. */
.patch-label { justify-content: flex-start; gap: 6px; }
@media (max-width: 900px) {
  .patch-label { flex-direction: column; gap: 1px; align-items: flex-start; }
  .patch-label b { margin-left: 0; }
}


/* Masthead mark matches the favicon: four process-ink squares, not dots. */
.brand-dots { gap: 2px; }
.brand-dots i { width: 8px; height: 8px; border-radius: 0; }
.brand-dots i:nth-child(4) { background: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }


/* --- mobile refinements --------------------------------------------- */

/* iOS zooms the page when a control with font-size under 16px gains focus. */
input[type="color"], input[type="range"] { font-size: 16px; }

/* The footer strapline link sits in a sentence, but give it a full touch height. */
.footnote a { display: inline-block; padding: 3px 0; min-height: 24px; }

/* Scrollable tables get a fade on the right edge so it is visible that there
   is more content sideways, rather than leaving people to guess. */
@media (max-width: 1060px) {
  .tablewrap {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent 100%);
  }
  .tablewrap:focus-visible { -webkit-mask-image: none; mask-image: none; }
}

/* Comfortable tap targets on the ink sliders. */
@media (max-width: 760px) {
  input[type="range"] { height: 30px; }
  .slider-row { margin-bottom: 18px; }
  .copy { min-height: 30px; padding: 0 14px; }
  .nav { gap: 18px; row-gap: 2px; }
}

/* --- mobile vertical rhythm -----------------------------------------
   On a converter, every pixel above the tool is a pixel of the answer the
   reader cannot see. Tighten the header stack on small screens without
   shrinking body copy below a comfortable reading size. */

@media (max-width: 760px) {
  .masthead-in { min-height: 0; padding-top: 10px; padding-bottom: 8px; }
  .nav { row-gap: 0; }
  .crumbs { padding-top: 14px; }
  .eyebrow { margin-bottom: 9px; }
  h1 { font-size: clamp(30px, 8.4vw, 38px); margin-bottom: 12px; }
  .standfirst { font-size: 17px; line-height: 1.5; margin-bottom: 22px; }
  .tool { margin-bottom: 34px; }
  .toolnote { margin-top: -22px; margin-bottom: 32px; }
  .prose h2 { margin-top: 42px; padding-top: 22px; }
}

/* The large preview swatch repeats what the composite patch already shows, so
   on small screens it shrinks to a confirmation bar and the ink values move up. */
@media (max-width: 760px) {
  .preview { min-height: 56px; }
  .preview-wrap { margin-top: 14px; }
  .preview-label { margin-top: 6px; }
  .pickrow { margin-top: 10px; }
  .tool-in, .tool-out { padding: 16px; }
}
