/* ============================================================================
   CONTRAIR — DARKROOM
   The world. Requires tokens/contrair.tokens.css first. Zero dependencies.
   Warm-dark editorial: a lone object in warm darkness, cream type the only
   decoration. No shadows. No pure black, no pure white. Two grounds and two
   actions; the accent DOES fill a button, at weight 700.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Display type runs to the frame by design; the document never scrolls sideways.
   `clip` rather than `hidden` so the fixed nav still works. */
body {
  margin: 0;
  overflow-x: clip;
  background: var(--ground);
  color: var(--text);
  font-family: var(--face);
  font-size: var(--text-meta);
  line-height: var(--lead-meta);
  font-weight: var(--weight-label);
  /* Both are token-driven so a face swap carries its own tuning. The 'wdth'
     axis is set here and nowhere else per element; unlisted axes still come
     from font-weight, and a face without a width axis just ignores it. */
  font-feature-settings: var(--face-features);
  font-variation-settings: 'wdth' var(--wdth-ui);
  text-transform: uppercase;   /* mode 1 is the default; mode 2 opts out */
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; height: auto; }

/* The user agent sets headings to a synthetic bold 700, which is neither of the
   rungs this system names. Reset once, here, so no heading can inherit it; the
   display classes then put each heading on its own rung. */
h1, h2, h3, h4, h5, h6 { font-weight: var(--weight-heading); margin: 0; }

/* ── TWO TYPOGRAPHIC MODES, AND NOTHING BETWEEN THEM ─────────────────────── */

/* Mode 1 — UPPERCASE. Everything: nav, headings, labels, links, buttons. The
   weight is no longer one number: it rises with size across three rungs, so
   the loud rungs carry structural mass and a 12px caption stays a caption.
   The loud rungs also take the display width, which is the second axis. */
.monument, .display, .heading {
  font-weight: var(--weight-display);
  font-variation-settings: 'wdth' var(--wdth-display);
}
.monument { text-transform: uppercase; font-size: var(--text-monument);
            line-height: var(--lead-monument); margin: 0;
            /* Type is never cropped: it sits whole inside the frame. */
            max-width: 100%; }
.display  { text-transform: uppercase; font-size: var(--text-display);    line-height: var(--lead-display);    margin: 0; }
.heading  { text-transform: uppercase; font-size: var(--text-heading);    line-height: var(--lead-heading);    margin: 0; }
.heading-sm{text-transform: uppercase; font-size: var(--text-heading-sm); line-height: var(--lead-heading-sm); font-weight: var(--weight-heading); margin: 0; }
.subhead  { text-transform: uppercase; font-size: var(--text-subhead);    line-height: var(--lead-subhead);    font-weight: var(--weight-heading); margin: 0; }
.label    { text-transform: uppercase; font-size: var(--text-label);      line-height: var(--lead-label);      font-weight: var(--weight-label); }
.caption  { font-size: var(--text-caption);    line-height: var(--lead-caption);    font-weight: var(--weight-label); }

/* Mode 2 — mixed case 400 at body size. The ONLY conversational voice. When
   the text drops to 400 and loses its caps, the reader knows this is
   description rather than label. Nothing else in the system does this. */
.body {
  font-family: var(--face-body);
  font-size: var(--text-body);
  line-height: var(--lead-body);
  font-weight: var(--weight-body);
  text-transform: none;
  margin: 0;
  /* 34rem against a 29px voice is ~62 characters. `30ch` resolved against this
     element's own 29px and produced a four-word line. */
  max-width: 34rem;
}

/* Compliance, not design: a different typeface signals it is not ours. */
.legal {
  text-transform: uppercase;
  font-family: var(--face-legal);
  font-size: var(--text-legal);
  line-height: var(--lead-legal);
  font-weight: var(--weight-label);
}

.accent { color: var(--text-accent); }

/* ── SECTIONS: EACH ONE OWNS A VIEWPORT ──────────────────────────────────── */
.void {
  min-height: 100vh;
  width: 100%;
  padding: var(--space-204) var(--gutter) var(--space-68);
  display: grid;
  /* Content masses toward the floor instead of floating in a centred void.
     The negative space sits above the block, where it reads as pressure. */
  align-content: end;
  gap: var(--space-41);
}

/* The signature layout: flanking text, centred object, 18px gutters. Text is
   left-aligned on both sides — never centred, even beside a centred object. */
.reveal {
  display: grid;
  gap: var(--element-gap);
  align-items: center;
}
@media (min-width: 900px) {
  .reveal { grid-template-columns: 1fr minmax(0, 1.1fr) 1fr; }
}
.reveal__object {
  display: grid;
  place-items: center;
  min-height: 54vh;
}

/* ── DASHED HAIRLINES ─────────────────────────────────────────────────────
   The only break between sections. Never solid, never thicker than 2px. */
.rule {
  border: 0; height: 0; margin: 0;
  border-top: 2px dashed var(--rule);   /* the brief's ceiling, used */
}
.rule--thin { border-top-width: 1px; }

.rule--quiet { border-top-color: var(--rule-quiet); }

/* ── CONTROLS ─────────────────────────────────────────────────────────────
   Radius vocabulary is four values and no others; the filled action carries
   the accent, at weight 700. */
.pill {
  display: inline-flex; align-items: center; gap: var(--space-12);
  border-radius: var(--radius-pill);
  background: var(--c-ember);
  color: var(--c-walnut);          /* walnut ink: 6.34 on ember */
  border: 0;
  padding: var(--space-18) var(--space-31);
  font: inherit;
  font-size: var(--text-action); line-height: var(--lead-action);
  font-weight: var(--weight-action);
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background var(--state-dur) linear;
}
.pill:hover, .pill:focus-visible { background: var(--c-amber); }
.pill--amber { background: var(--c-amber); }
.pill--amber:hover, .pill--amber:focus-visible { background: var(--c-ember); }

.ghost {
  display: inline-flex; align-items: center; gap: var(--space-8);
  border-radius: var(--radius-outlined);
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  padding: var(--space-12) var(--space-24);
  font: inherit; font-size: var(--text-label); font-weight: var(--weight-label);
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background var(--state-dur) linear, color var(--state-dur) linear;
}
.ghost:hover, .ghost:focus-visible { background: var(--text); color: var(--ground); }

.link {
  border-radius: var(--radius-input);
  color: var(--text); text-decoration: none;
  font-size: var(--text-caption); font-weight: var(--weight-label); text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding: 0;
}
.link--dashed { border-bottom-style: dashed; border-bottom-color: var(--rule); }

/* No boxes, just a line. */

:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--text);   /* NOT the accent: 17.26:1, and Law 3 */
  outline-offset: 3px;
}

/* ── NAVIGATION: FIXED, TRANSPARENT ─────────────────────────────────────────
   ORYZO caps this at four items; this reference site carries five, because
   hiding a whole vocabulary from the nav is worse than exceeding the count. */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-24);
  padding: var(--space-18) var(--gutter);
  background: transparent;
}
.nav__mark { width: 132px; }
.nav__mark svg { fill: var(--text); width: 100%; }
.nav__items { display: flex; gap: var(--space-24); }
.nav__items a { color: var(--text); text-decoration: none;
  font-size: var(--text-caption); font-weight: var(--weight-label); }
.nav__items a[aria-current] { border-bottom: 1px dashed var(--rule); }
@media (max-width: 720px) { .nav__items { gap: var(--space-14); } }

/* Edge branding: a serial number, not decoration. */
.serial {
  position: fixed; left: var(--space-8); top: 50%; z-index: 15;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-size: var(--text-caption); font-weight: var(--weight-label);
  color: var(--text); pointer-events: none;
}
@media (max-width: 900px) { .serial { display: none; } }

/* ── THE INFO CARD ───────────────────────────────────────────────────────
   12px radius, a low-opacity fill, an uppercase head, a dashed divider, then
   the one mixed-case voice. The only card in the system. */
.card {
  border-radius: var(--radius-card);
  background: var(--c-teal);       /* the one ground that carries cream copy */
  padding: var(--card-pad);
  display: grid; gap: var(--space-12);
  max-width: 34em;   /* the 29px voice needs room; 46ch of it ragged badly */
}

/* ── THE WORDMARK ────────────────────────────────────────────────────────
   The only graphical mark. Two sizes: navigation lockup and hero lockup. */
.wordmark svg { fill: var(--text); width: 100%; }

/* The companion mark closes a surface. Once, at the end. Never in a header. */
.seal { width: 26px; flex: none; }
.seal svg { fill: var(--text); width: 100%; }


/* ── SPECIMEN OBJECTS ────────────────────────────────────────────────────
   Where ORYZO puts a product, this system puts the thing being documented.
   The specimen IS the object in the void. */
.swatch-stack { display: grid; gap: 0; width: min(100%, 340px); }
.swatch {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-18);
  padding: var(--space-14) var(--space-18);
  font-size: var(--text-caption); font-weight: var(--weight-label);
}
.swatch:first-child { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.swatch:last-child  { border-radius: 0 0 var(--radius-card) var(--radius-card); }

.data { display: grid; gap: var(--space-12); width: min(100%, 380px); }
.data__row {
  display: flex; justify-content: space-between; gap: var(--space-18);
  padding-bottom: var(--space-9);
  border-bottom: 1px dashed var(--rule-quiet);
  font-size: var(--text-caption); font-weight: var(--weight-label);
}
.data__row:last-child { border-bottom: 0; }

.stack   { display: grid; gap: var(--space-24); align-content: start; }
.stack-8 { display: grid; gap: var(--space-8);  align-content: start; }
.row     { display: flex; gap: var(--space-18); align-items: center; flex-wrap: wrap; }
.between { display: flex; gap: var(--space-24); align-items: baseline;
           justify-content: space-between; flex-wrap: wrap; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

::selection { background: var(--c-cream); color: var(--c-walnut); }
:root { caret-color: var(--c-ember); accent-color: var(--c-ember);
        scrollbar-color: var(--c-ember) var(--c-walnut); }

/* ── THE MASS ──────────────────────────────────────────────────────────────
   The companion mark at architectural scale, in cork on walnut. That pair
   measures 1.70:1 — illegal for text or structure by this system's own gate,
   and precisely right for an object you sense rather than read. It is
   decorative, aria-hidden, and never carries meaning. Cropped hard by the
   section frame: brutalist means the mass runs off the edge, not that it is
   politely contained.
   The fill is CREAM at --mass-presence, which lifts the canvas rather than
   colouring it: a lighter shade of black, not a tinted shape. At 0.07 the
   composite is #211913, only 1.14 against the canvas — sensed, not seen.
   ONE PER SURFACE. Not one per section — a mark behind every band stops being
   an object in a void and becomes wallpaper, which is the opposite of "a lone
   object floating in warm darkness". Presence is governed by --mass-presence. */
.void, .hero, .slide { position: relative; overflow: hidden; }
.void > *:not(.mass), .hero > *:not(.mass), .slide > *:not(.mass) {
  position: relative; z-index: 1;
}
.mass {
  position: absolute; z-index: 0; pointer-events: none;
  height: 150%; width: auto;
  opacity: var(--mass-presence);   /* sensed, not seen */
}
.mass svg { fill: var(--c-cream); height: 100%; width: auto; }
.mass--right  { right: -8%;  top: -22%; }
.mass--left   { left: -14%;  top: -30%; height: 175%; }
.mass--low    { right: -4%;  bottom: -38%; top: auto; height: 130%; }
.mass--centre { left: 50%; top: -25%; transform: translateX(-50%); height: 165%; }

/* The one authored motion in the system: the mass drifts as its section passes.
   Pure CSS, scroll-driven, decorative only — no JavaScript, so nothing is ever
   hidden waiting for a script, and no content depends on it. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mass { animation: drift linear both; animation-timeline: view(); }
    @keyframes drift {
      from { transform: translateY(7vh)  rotate(-1.5deg); }
      to   { transform: translateY(-7vh) rotate(1.5deg); }
    }
    .mass--centre { animation-name: drift-centre; }
    @keyframes drift-centre {
      from { transform: translateX(-50%) translateY(7vh); }
      to   { transform: translateX(-50%) translateY(-7vh); }
    }
  }
}

/* ── CHROMATIC FIELDS ──────────────────────────────────────────────────────
   A field is a REGION of colour, not an accent scattered on one. Sections
   alternate between the walnut canvas and a field. On TEAL the text stays cream
   and the one-text-colour law holds; on EMBER and AMBER the field is too light
   for cream, so those two invert to walnut ink.
   NO ACCENT INSIDE A FIELD — the field IS the accent. Chroma on chroma is both
   illegal by measurement and incoherent by design. Never nest one in another. */
.field {
  --ground: var(--c-teal);
  --text-accent: var(--c-cream);   /* the field is the accent */
  /* A field is much lighter than the canvas, so a canvas-strength rule tint
     vanishes on it (2.0 and 1.8, under the 3:1 bar). Stronger tints here. */
  --rule:       color-mix(in srgb, var(--c-cream) 72%, transparent);
  --rule-quiet: color-mix(in srgb, var(--c-cream) 48%, transparent);
  background: var(--ground); color: var(--text);
}
/* On a field the filled pill inverts to the cream pole. Bark on teal is 2.35
   and on brick 1.81 — below the 3:1 non-text bar, so the control stops being a
   perceivable surface. Cream is level 3 of the brief's own surface table, so
   this stays inside the two-step logic rather than inventing a step. */
.field .pill { background: var(--c-cream); color: var(--c-walnut); }
.field .pill:hover, .field .pill:focus-visible {
  background: var(--c-walnut); color: var(--c-cream); }
/* The inversions: ember and amber are too light for cream (2.72 / 1.60), so a
   section in either carries walnut ink. Their rules invert with them — a walnut
   tint at 60% measures 3.35 on ember and 4.21 on amber, clearing the 3:1 bar,
   where a cream tint would vanish. */
.field--ember, .field--amber {
  --text: var(--c-walnut);
  --text-accent: var(--c-walnut);
  --rule: color-mix(in srgb, var(--c-walnut) 60%, transparent);
  --rule-quiet: color-mix(in srgb, var(--c-walnut) 35%, transparent);
}
.field--teal  { --ground: var(--c-teal); }   /* explicit; also the default */
.field--ember { --ground: var(--c-ember); }
.field--amber { --ground: var(--c-amber); }
/* On an INVERTED field the action goes walnut, not cream: a cream pill on ember
   is 2.72 and would fail, where walnut on ember is 6.34. */
.field--ember .pill, .field--amber .pill {
  background: var(--c-walnut); color: var(--c-cream); }
.field--ember .pill:hover, .field--amber .pill:hover,
.field--ember .pill:focus-visible, .field--amber .pill:focus-visible {
  background: var(--c-cream); color: var(--c-walnut); }

.rule--hot { border-top-color: var(--rule-hot); }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS, STATES, DATA AND ICONS
   The parts a system needs before it can build a real thing, and the parts
   that were missing. Status is never carried by hue alone: every state pairs
   a border-weight change, a drawn icon and words, so it survives greyscale,
   colour blindness, and a badly projected deck.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── ICONS ────────────────────────────────────────────────────────────────
   Drawn, one stroke weight, currentColor, sized to the text. A Unicode glyph
   or an emoji standing in for an icon is never acceptable here — that is what
   the arrows in this system used to be. */
.icon {
  display: inline-block; width: 1em; height: 1em;
  vertical-align: -0.125em; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: square; stroke-linejoin: miter;
}
.icon--lg { width: 1.5em; height: 1.5em; }

/* ── FIELD GROUP: label, control, hint, error ─────────────────────────────── */
.f { display: grid; gap: var(--space-8); }
.f__label {
  font-size: var(--text-caption); line-height: var(--lead-caption);
  font-weight: var(--weight-label); text-transform: uppercase;
}
/* Required is marked in words, not with a bare asterisk floating in space. */
.f__req { font-family: var(--face); }
.f__req::after { content: " (required)"; }
.f__hint {
  font-size: var(--text-caption); line-height: 1.4;
  text-transform: none; font-weight: var(--weight-body);
}
/* The error carries three signals at once: the icon, the words, and the
   border-weight change on the control above it. */
.f__error {
  display: none;
  align-items: center; gap: var(--space-8);
  font-size: var(--text-caption); line-height: 1.4;
  text-transform: none; font-weight: var(--weight-label);
  color: var(--text-accent);
}
.f:has([aria-invalid="true"]) .f__error { display: flex; }

/* ── CONTROLS ─────────────────────────────────────────────────────────────  */
.input, .textarea, .select {
  border-radius: var(--radius-input);
  background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--text);
  padding: var(--space-8) 0;
  font: inherit; font-size: var(--text-label); text-transform: uppercase;
  width: 100%;
}
.textarea { text-transform: none; min-height: 6lh; resize: vertical;
            border: 1px solid var(--text); padding: var(--space-12); }
/* The select keeps its own chevron: a native arrow is the browser's design,
   not ours. */
.select { appearance: none; padding-right: var(--space-31); }
.f__select { position: relative; display: grid; }
.f__select .icon {
  position: absolute; right: 0; top: 50%; translate: 0 -50%;
  pointer-events: none;
}
/* Invalid raises the border to --state-border. The weight is the signal that
   survives greyscale; the ember error text is the second signal, never the
   only one. */
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] {
  border-bottom-width: var(--state-border);
  border-bottom-color: var(--text-accent);
}
.textarea[aria-invalid="true"] { border-width: var(--state-border); border-color: var(--text-accent); }

/* Checkbox and radio, drawn rather than native. Inputs are 0 radius by law;
   the radio is the one place --radius-full earns its keep. */
.check { display: flex; align-items: flex-start; gap: var(--space-12); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 1.25rem; height: 1.25rem; flex: none;
  border: 1px solid var(--text); border-radius: var(--radius-input);
  display: grid; place-items: center;
  transition: background var(--state-dur) linear;
}
.check--radio .check__box { border-radius: var(--radius-full); }
.check__box .icon { opacity: 0; width: .9em; height: .9em; }
.check input:checked + .check__box { background: var(--text); }
.check input:checked + .check__box .icon { opacity: 1; color: var(--ground); }
.check input:focus-visible + .check__box {
  outline: var(--state-border) solid var(--text); outline-offset: 3px; }
.check__label { font-size: var(--text-label); text-transform: uppercase; font-weight: var(--weight-label); }

/* ── DISABLED ─────────────────────────────────────────────────────────────
   Structure, not a faded colour: the fill drops away and the border goes
   dashed, so an inert control is obvious in greyscale and on a projector.
   Pair it with words nearby saying why; a dead button with no explanation is
   a dead end. */
.pill[aria-disabled="true"], .pill:disabled,
.ghost[aria-disabled="true"], .ghost:disabled {
  background: transparent;
  color: var(--text);
  border: 1px dashed var(--rule);
  cursor: not-allowed;
  pointer-events: none;
}

/* ── STATUS MESSAGES ─────────────────────────────────────────────────────
   Icon + words. The colour is the third signal, never the first. */
.status { display: flex; align-items: center; gap: var(--space-10);
          font-size: var(--text-label); text-transform: uppercase; font-weight: var(--weight-label); }
.status--attention { color: var(--text-accent); }
.status--note      { color: var(--text); }

/* ── LOADING ──────────────────────────────────────────────────────────────
   The dashed rule travels. No spinner, no gradient sweep, and it holds still
   for anyone who asked motion to stop. */
.loading { display: grid; gap: var(--space-12); }
.loading__bar {
  height: 2px;
  background-image: repeating-linear-gradient(to right,
    var(--text) 0 10px, transparent 10px 20px);
  background-size: 20px 100%;
  animation: travel 900ms linear infinite;
}
@keyframes travel { to { background-position-x: 20px; } }
@media (prefers-reduced-motion: reduce) { .loading__bar { animation: none; } }

/* ── EMPTY STATE ──────────────────────────────────────────────────────────  */
.empty {
  display: grid; gap: var(--space-18); justify-items: start;
  padding: var(--space-31);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-card);
}

/* ── TABLE ────────────────────────────────────────────────────────────────
   Documents and decks need real tabular data, not a stack of flex rows. */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table caption {
  text-align: left; padding-bottom: var(--space-12);
  font-size: var(--text-caption); text-transform: uppercase; font-weight: var(--weight-label);
}
.table th, .table td {
  text-align: left; padding: var(--space-12) var(--space-18) var(--space-12) 0;
  border-bottom: 1px dashed var(--rule-quiet);
}
.table th {
  font-size: var(--text-caption); text-transform: uppercase; font-weight: var(--weight-label);
  border-bottom: 1px solid var(--rule);
}
.table td { font-size: var(--text-label); text-transform: none; }
.table td.num, .table th.num { text-align: right; padding-right: 0; }
@media (max-width: 560px) {
  .table { table-layout: fixed; }
  .table th, .table td { padding-right: var(--space-10); overflow-wrap: anywhere; }
}
.table tbody tr:last-child td { border-bottom: 0; }

/* ── LISTS ────────────────────────────────────────────────────────────────
   The marker is the system's own, not the browser's bullet. */
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-12); }
.list li {
  position: relative; padding-left: var(--space-24);
  font-family: var(--face-body);
  text-transform: none; font-weight: var(--weight-body);
}
.list li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: var(--space-10); height: 2px; background: var(--text-accent);
}
.list--ordered { counter-reset: l; }
.list--ordered li { counter-increment: l; }
.list--ordered li::before {
  content: counter(l, decimal-leading-zero);
  width: auto; height: auto; background: none; top: 0;
  font-size: var(--text-caption); font-weight: var(--weight-label);
  color: var(--text-accent);
}

/* ── LAYOUT ───────────────────────────────────────────────────────────────
   A named grid, so surfaces stop writing inline grid-template-columns. */
.grid { display: grid; gap: var(--gutter); }
.grid > * { min-width: 0; }   /* a wide child must not size the whole column */
@media (min-width: 900px) {
  .grid--2    { grid-template-columns: repeat(2, 1fr); }
  .grid--3    { grid-template-columns: repeat(3, 1fr); }
  .grid--asym { grid-template-columns: 2fr 1fr; }
  .grid--lead { grid-template-columns: 1.7fr 1fr 1fr; }
}

/* ── SKIP LINK ────────────────────────────────────────────────────────────
   The nav is fixed, so a keyboard visitor lands behind it without this. */
.skip {
  position: absolute; left: var(--space-24); top: 0;
  transform: translateY(-150%);
  z-index: 30;
  background: var(--c-cream); color: var(--c-walnut);
  padding: var(--space-12) var(--space-18);
  font-size: var(--text-label); font-weight: var(--weight-label); text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--state-dur) linear;
}
.skip:focus { transform: translateY(var(--space-12)); }
