/* ==========================================================================
   PRAECISE — DESIGN SYSTEM  ·  praecise.com

   Derived from oxide.computer (the site) and Pentagram's identity for Oxide,
   and from nothing else: an off-white ground and near-black type; ONE green,
   spent only on the actions; section heads in uppercase at a restrained scale
   with the body in sentence case at a reading measure; monospace reserved for
   what is technical — labels, specs, figure captions — and specs that lead
   with their number. Whitespace and a shift of ground do the separating; rules
   are thin and rare. Figures are numbered "fig. 1", "fig. 2", like a paper.

   Not a copy. Their faces are Neue Haas Grotesk and GT America Mono; ours are
   Hanken Grotesk and Martian Mono. Their green is theirs; this one is the
   green a measurement was drawn in on the first fleet we instrumented.
   ========================================================================== */

@font-face {
  font-family: 'Hanken';
  src: url('/assets/fonts/hanken-300-800.woff2') format('woff2-variations');
  font-weight: 300 800; font-display: swap;
}
@font-face {
  font-family: 'Hanken';
  src: url('/assets/fonts/hanken-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Martian';
  src: url('/assets/fonts/martian-300-800.woff2') format('woff2-variations');
  font-weight: 300 800; font-display: swap;
}

:root {
  --ground:    oklch(0.976 0.004 95);
  --ground-2:  oklch(0.954 0.005 95);
  --ink:       oklch(0.205 0.012 250);
  --ink-2:     oklch(0.430 0.012 250);
  --ink-3:     oklch(0.580 0.010 250);
  --rule:      oklch(0.855 0.007 250);
  --hair:      oklch(0.905 0.006 250);
  --dot:       oklch(0.820 0.008 250);

  --green:     oklch(0.815 0.175 152);   /* the action colour. CTAs, nothing else. */
  --green-ink: oklch(0.470 0.130 152);   /* green that can carry type on light    */
  --warn:      oklch(0.700 0.150 80);
  --fault:     oklch(0.580 0.200 28);

  --sans: 'Hanken', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian', ui-monospace, Menlo, Consolas, monospace;
  --measure: 64ch;
}

/* -- Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html {
  font-size: clamp(1rem, 0.98rem + 0.1vw, 1.0625rem);
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip;
}
body {
  margin: 0; background: var(--ground); color: var(--ink-2);
  font-family: var(--sans); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word; font-synthesis: none;
  counter-reset: fig;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green-ink);
    text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-ink); }
a:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 3px; }
::selection { background: var(--green); color: var(--ink); }

.rack { max-width: 74rem; margin: 0 auto; padding: 0 1.4rem; }
@media (min-width: 62rem) { .rack { padding: 0 2.6rem; } }

/* -- Type ----------------------------------------------------------------- */

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 {
  font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.9rem, 4.1vw, 3.3rem); line-height: 1.08; letter-spacing: 0.012em;
  max-width: 22ch;
}
h2 {
  font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.2rem, 2.3vw, 1.8rem); line-height: 1.22; letter-spacing: 0.024em;
  margin-bottom: 1.1rem;
}
h3 { font-weight: 600; font-size: 1rem; line-height: 1.35; margin-bottom: 0.35rem; }
p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }
.lede { font-size: clamp(1.05rem, 1.7vw, 1.22rem); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: normal; color: var(--ink); font-weight: 600; }
.col { max-width: var(--measure); }

/* What is technical is set in mono, lowercase, lightly tracked — a label. */
.label, .basis, .chan {
  font-family: var(--mono); font-weight: 400;
  font-size: 0.72rem; letter-spacing: 0.02em; text-transform: lowercase;
  color: var(--ink-3); font-variant-ligatures: none;
}
.label.sig { color: var(--green-ink); }
.basis.measured { color: var(--green-ink); }
.basis.none { color: var(--ink-3); }
.v, code {
  font-family: var(--mono); font-size: 0.86em; color: var(--ink); font-variant-ligatures: none;
}
code { background: var(--ground-2); border: 1px solid var(--hair); padding: 0.08em 0.4em; border-radius: 3px; }

/* A numbered figure, like a paper. Counted through the document. */
.readouts::before, .meters::before, .wrapx::before {
  counter-increment: fig; content: "fig. " counter(fig);
  display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.02em;
  color: var(--ink-3); margin-bottom: 0.7rem;
}

/* -- Masthead ------------------------------------------------------------- */

header.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  color: var(--ink); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.005em;
}
.wordmark b { color: var(--green-ink); font-weight: 700; }
.wordmark svg { width: 1.05rem; height: 1.05rem; color: var(--green-ink); }
nav.masthead { display: flex; flex-wrap: wrap; gap: 1.5rem; }
nav.masthead a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.88rem; }
nav.masthead a:hover { color: var(--ink); }

/* -- Hero ----------------------------------------------------------------- */
/* A dot grid behind the opening — depth, not decoration; it fades under the type. */

.hero {
  padding: 4.6rem 0 3.4rem; position: relative;
  background:
    radial-gradient(var(--dot) 0.9px, transparent 1px) 0 0 / 20px 20px;
  background-clip: content-box;
}
@media (min-width: 62rem) { .hero { padding: 6.2rem 0 4.2rem; } }
.hero > * { position: relative; }
.hero .label { display: block; margin-bottom: 1.4rem; }
.hero .lede { margin-top: 1.5rem; }

/* -- Readouts: the numbers lead ------------------------------------------ */

.readouts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair); margin-top: 2.6rem;
}
@media (min-width: 58rem) { .readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.readouts::before { grid-column: 1 / -1; background: var(--ground); padding: 0.9rem 1.2rem 0; margin: 0; }
.readout { background: var(--ground); padding: 1.1rem 1.2rem 1.35rem; }
.readout .n {
  display: block; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; letter-spacing: -0.02em;
}
.readout .n u { text-decoration: none; font-family: var(--mono); font-weight: 400;
                font-size: 0.34em; letter-spacing: 0.02em; color: var(--ink-3); margin-left: 0.3em; }
.readout .n.dim { color: var(--ink-3); }
.readout .cap { display: block; font-size: 0.86rem; color: var(--ink-2); margin-top: 0.7rem; line-height: 1.4; }
.readout .basis { display: block; margin-top: 0.55rem; }

/* -- Sections ------------------------------------------------------------- */
/* Separated by air and, where a section is major, a shift of ground. */

section.panel { padding: 3.6rem 0; }
@media (min-width: 62rem) { section.panel { padding: 5.2rem 0; } }
section.panel.major { border-top: 1px solid var(--rule); }
.panelhead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 3rem; margin-bottom: 1.6rem; }
@media (min-width: 62rem) { .panelhead { grid-template-columns: 10rem minmax(0, 1fr); } }
.panelhead .ch { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em;
                 color: var(--ink-3); text-transform: lowercase; padding-top: 0.35rem; }
.panelhead .ch span { display: block; }
@media (max-width: 61.99rem) { .panelhead .ch span { display: inline; margin-left: 0.5rem; } }
.panelbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3rem; }
@media (min-width: 62rem) { .panelbody { grid-template-columns: 10rem minmax(0, 1fr); } }
.panelbody > .spacer { display: none; }
@media (min-width: 62rem) { .panelbody > .spacer { display: block; } }

/* -- Feature grid: tinted, hairline-separated, no rails --------------------- */

.grid2, .grid3, .grid4 {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair); margin-top: 1.8rem;
}
@media (min-width: 48rem) { .grid2 { grid-template-columns: repeat(2, 1fr); } .grid3, .grid4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 72rem) { .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--ground-2); padding: 1.3rem 1.3rem 1.45rem; }
.card .label { display: block; margin-bottom: 0.55rem; }
.card p { font-size: 0.92rem; margin: 0; color: var(--ink-2); }
.card .out { display: block; margin-top: 0.75rem; font-family: var(--mono); font-size: 0.74rem;
             color: var(--green-ink); letter-spacing: 0.01em; }

/* -- Meters: a measured value is a mark --------------------------------- */

.meters { margin-top: 1.8rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.meter {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem 1.2rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--hair); align-items: center;
}
@media (min-width: 46rem) { .meter { grid-template-columns: 11rem 1fr 8rem; } }
.meter .k { font-size: 0.86rem; font-weight: 500; color: var(--ink); }
.meter .bar { position: relative; height: 10px; background: var(--hair); overflow: hidden; border-radius: 2px; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; background: var(--green-ink); display: block; }
.meter .bar i.warn { background: var(--warn); }
.meter .bar i.fault { background: var(--fault); }
.meter .bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); text-decoration: none; }
.meter .bar.unwired { background: repeating-linear-gradient(90deg, var(--rule) 0 2px, transparent 2px 6px); }
.meter .val { font-family: var(--mono); font-size: 0.86rem; color: var(--ink); }
@media (min-width: 46rem) { .meter .val { text-align: right; } }
.meter .val.none { color: var(--ink-3); }
.meter .val u { text-decoration: none; color: var(--ink-3); margin-left: 0.3em; }

/* -- Refusals: a two-column contrast, like a comparison ------------------- */

.refusals { margin-top: 1.8rem; border-top: 1px solid var(--rule); }
.refusal {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem 2.4rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--hair);
}
@media (min-width: 54rem) { .refusal { grid-template-columns: 12rem minmax(0, 1fr); } }
.refusal .k { font-family: var(--mono); font-size: 0.78rem; color: var(--green-ink); letter-spacing: 0.01em; padding-top: 0.15rem; }
.refusal p { font-size: 0.92rem; margin: 0; }
.refusal .instead { display: block; margin-top: 0.35rem; color: var(--ink-3); font-size: 0.88rem; }

/* -- Table ---------------------------------------------------------------- */

.wrapx { overflow-x: auto; max-width: 100%; margin-top: 1.8rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 38rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--hair); }
.tbl thead th { font-family: var(--mono); font-weight: 400; font-size: 0.7rem; letter-spacing: 0.02em;
                text-transform: lowercase; color: var(--ink-3); border-bottom: 1px solid var(--ink); }
.tbl td:first-child { color: var(--ink); font-weight: 500; }
.tbl .mono { font-family: var(--mono); color: var(--green-ink); font-size: 0.84em; }
.tbl .off { color: var(--ink-3); }

/* -- Notes ---------------------------------------------------------------- */

.note { background: var(--ground-2); border-left: 2px solid var(--green-ink); padding: 0.95rem 1.1rem;
        margin: 1.8rem 0; max-width: var(--measure); }
.note .label { display: block; color: var(--green-ink); margin-bottom: 0.3rem; }
.note p { font-size: 0.92rem; margin: 0; }
.note.warn { border-left-color: var(--warn); }
.note.warn .label { color: var(--warn); }

/* -- Actions: the only green on the page ---------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2.2rem; }
.btn {
  display: inline-block; text-decoration: none; border-radius: 4px;
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0;
  padding: 0.7rem 1.25rem; border: 1px solid var(--green); background: var(--green); color: var(--ink);
}
.btn:hover { background: oklch(0.86 0.15 152); border-color: oklch(0.86 0.15 152); }
.btn-line { background: none; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--ground); }

/* -- Footer --------------------------------------------------------------- */

footer.foot { border-top: 1px solid var(--rule); padding: 2.8rem 0 3.4rem; }
footer.foot .cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.8rem 3rem; }
@media (min-width: 48rem) { footer.foot .cols { grid-template-columns: repeat(4, 1fr); } }
footer.foot h4 { margin: 0 0 0.7rem; font-family: var(--mono); font-weight: 400; font-size: 0.7rem;
                 letter-spacing: 0.02em; text-transform: lowercase; color: var(--ink-3); }
footer.foot ul { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
footer.foot li { margin-bottom: 0.38rem; }
footer.foot a { text-decoration: none; color: var(--ink-2); }
footer.foot a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green-ink); }
.colophon { margin-top: 2.4rem; padding-top: 1.3rem; border-top: 1px solid var(--hair);
            font-size: 0.82rem; color: var(--ink-3); max-width: 74ch; line-height: 1.6; }

p, li, .card p { text-wrap: pretty; }

/* -- Mobile menu ---------------------------------------------------------- */

.navtoggle { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.navbtn { display: none; }
@media (max-width: 61.99rem) {
  header.masthead { row-gap: 0; }
  .navbtn { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none;
            font-weight: 600; font-size: 0.86rem; color: var(--ink); padding: 0.35rem 0; }
  .navbtn::after { content: "+"; font-size: 1.05em; line-height: 1; }
  .navtoggle:checked ~ .navbtn::after { content: "–"; }
  .navtoggle:focus-visible ~ .navbtn { outline: 2px solid var(--green-ink); outline-offset: 3px; }
  nav.masthead { display: none; flex-basis: 100%; width: 100%; flex-direction: column; gap: 0; margin: 0 0 0.4rem; }
  .navtoggle:checked ~ nav.masthead { display: flex; }
  nav.masthead a { display: block; width: 100%; padding: 0.72rem 0; border-top: 1px solid var(--hair); }
}

/* -- Long tokens ---------------------------------------------------------- */
.v, code, .basis, .chan, .meter .val, .tbl .mono, .refusal .k { overflow-wrap: anywhere; }
h1, h2 { overflow-wrap: break-word; }
