/* ============================================================================
   ds.css — the design system: tokens and primitives.

   Swiss / brutalist, derived from the `Lines and Planes v2` prototype. That
   prototype carried its styling entirely in inline attributes and had no
   stylesheet to vendor, so this file reconstructs the system it implied:

     · one typeface, Archivo, doing every job through weight and tracking
     · pure white ground, near-black ink, and a single red
     · hard 1px and 2px rules; no radius anywhere, and no shadows
     · headings set uppercase, tight and heavy; labels uppercase, wide and small
     · structure drawn with borders that meet at square corners

   Retune the look here. Everything above this layer — theme.css for dark mode,
   site.css for layout — reads from these variables.
   ========================================================================= */

/* Self-hosted, so a PDF export can never depend on a third-party CDN. Archivo
   is variable across 100–900; the whole system is one file per style. */
@font-face {
  font-family: 'Archivo';
  font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('fonts/archivo-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-bg: #ffffff;
  --color-surface: #f4f4f4;
  --color-text: #111111;
  --color-accent: #e30613;          /* the one red — 5.0:1 on white */
  --color-accent-2: #e30613;        /* deliberately the same: this is a mono scheme */
  --color-divider: #111111;         /* rules are INK here, not a tint */
  --color-rule-soft: #d4d4d4;       /* the only softened rule, for dense tables */

  --color-neutral-100: #fafafa;
  --color-neutral-200: #f0f0f0;
  --color-neutral-300: #e2e2e2;
  --color-neutral-400: #c9c9c9;
  --color-neutral-500: #9a9a9a;
  --color-neutral-600: #767676;
  --color-neutral-700: #555555;
  --color-neutral-800: #333333;
  --color-neutral-900: #111111;

  --color-accent-100: #ffeaec;
  --color-accent-200: #ffc9cd;
  --color-accent-300: #ff9aa2;
  --color-accent-400: #f95560;
  --color-accent-500: #e30613;
  --color-accent-600: #c60510;
  --color-accent-700: #a5040d;
  --color-accent-800: #7a030a;
  --color-accent-900: #4d0206;

  --font-heading: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading-weight: 800;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 18px; --space-6: 28px; --space-8: 40px;

  /* Nothing is rounded. The variables stay so the component layer keeps its
     shape, but every one of them is zero — that is the system's whole point. */
  --radius-sm: 0; --radius-md: 0; --radius-lg: 0;

  /* No shadows either. Depth is drawn with a rule, never with a blur. */
  --shadow-sm: none;
  --shadow-md: 0 0 0 1px var(--color-text);
  --shadow-lg: 0 0 0 2px var(--color-text);

  --rule: 1px solid var(--color-divider);
  --rule-heavy: 2px solid var(--color-divider);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.65; font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.06; letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 var(--space-3);
}
h1 { font-size: 44px; font-weight: 900; letter-spacing: -0.025em; }
h2 { font-size: 32px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; letter-spacing: 0; }
h5 { font-size: 15px; letter-spacing: 0.02em; }
h6 { font-size: 12px; letter-spacing: 0.14em; }

p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption { font-size: 12px; margin-top: var(--space-2); color: var(--color-neutral-600); }
.text-muted { color: var(--color-neutral-600); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent); color: #fff; }

/* — rules — the primary structural device — */
.hr { height: 1px; border: 0; margin: var(--space-6) 0; background: var(--color-divider); }
.hr-heavy { height: 2px; }

/* — buttons — outlined, and filled red on hover — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-body); font-weight: 700;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1;
  color: var(--color-text); background: transparent;
  border: 1px solid var(--color-text); border-radius: 0;
  padding: 12px 16px;
  transition: background-color .12s linear, color .12s linear, border-color .12s linear;
}
.btn svg { display: block; }
.btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn:active { background: var(--color-accent-600); border-color: var(--color-accent-600); }
.btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; color: var(--color-text); border-color: var(--color-text); }
.btn-primary { background: var(--color-text); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent); border-color: var(--color-accent); }
.btn-secondary { }
.btn-ghost { border-color: transparent; padding-inline: var(--space-1); }
.btn-ghost:hover { background: transparent; color: var(--color-accent); }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-block { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* — forms — */
.field > label {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px; color: var(--color-neutral-700);
}
.input {
  width: 100%; min-height: 38px; padding: 8px 10px;
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-bg);
  border: 1px solid var(--color-text); border-radius: 0;
}
.input:hover { border-color: var(--color-accent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.radio .dot { width: 15px; height: 15px; flex: none; border: 1px solid var(--color-text); }
.radio input:checked + .dot { background: var(--color-accent); border-color: var(--color-accent); }

/* The segmented control is the system's signature: hard cells, filled when on. */
.seg { display: inline-flex; border: 1px solid var(--color-text); border-radius: 0; overflow: hidden; }
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 10px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-text); }
.seg-opt:has(input:checked) { background: var(--color-text); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { color: var(--color-accent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -3px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); background: transparent;
  border: 1px solid var(--color-text); border-radius: 0;
}
.card-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent); }
.card-title { font-family: var(--font-heading); font-weight: 800; font-size: 17px; text-transform: uppercase; line-height: 1.15; }
.card-body { margin: 0; font-size: 14px; color: var(--color-neutral-700); flex: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-neutral-600); }
.elev-sm, .elev-md, .elev-lg { box-shadow: none; }

/* — tags — */
.tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 0;
}
.tag-accent { background: var(--color-accent); color: #fff; }
.tag-accent-2 { background: var(--color-accent); color: #fff; }
.tag-neutral { background: var(--color-neutral-200); color: var(--color-text); }
.tag-outline { border: 1px solid var(--color-text); color: var(--color-text); }

/* — navigation — */
.nav { display: flex; align-items: center; gap: var(--space-4); padding: 0; border-bottom: var(--rule-heavy); }
.nav-brand { font-family: var(--font-heading); font-weight: 900; font-size: 17px; text-transform: uppercase; letter-spacing: -0.01em; margin-right: auto; }
.nav a { color: inherit; text-decoration: none; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-text); padding: 10px 12px; border-bottom: var(--rule-heavy);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--color-rule-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--color-neutral-100); }

/* — dialog — */
.dialog-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: var(--space-4); background: rgb(17 17 17 / 70%); }
.dialog { width: min(460px, 100%); display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); background: var(--color-bg); border: var(--rule-heavy); }
.dialog-title { font-family: var(--font-heading); font-weight: 800; font-size: 20px; text-transform: uppercase; }
.dialog-body { font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }

/* — the image frame — a hard rule, not a mat — */
.plate { border: 1px solid var(--color-text); }
