/* duochrome.css — Duochrome design system, v1.1.0
   Two colours, one typeface. Ink #000, ground #fff, nothing between.
   Load Roboto + Roboto Mono before this file. */

:root {
  --ink: #000;
  --ground: #fff;

  /* "Roboto Fallback" is the metric-matched Arial below: the swap to Roboto reflows ~0px. */
  --font-sans: Roboto, "Roboto Fallback", Helvetica, Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;

  --rule-hair: 1px;   /* list dividers */
  --rule-base: 2px;   /* panels, columns, controls */
  --rule-loud: 4px;   /* section opener, error, destructive */
  --rule-bar: 12px;   /* one deliberate bar per surface */

  /* spacing: --sN = N x 4px, always */
  --unit: 4px;
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s11: 44px; --s12: 48px;
  --s16: 64px; --s20: 80px;

  --track-caps: 0.18em;
  --track-label: 0.24em;
  --track-display: -0.04em;

  --hatch: repeating-linear-gradient(135deg, #fff 0 3px, #000 3px 4px);
  --hatch-inv: repeating-linear-gradient(135deg, #000 0 3px, #fff 3px 4px);
}

/* Metric-matched fallback face (no font file): Arial sized to Roboto's metrics. */
@font-face {
  font-family: "Roboto Fallback";
  src: local("Arial");
  ascent-override: 92.7%;
  descent-override: 24.4%;
  line-gap-override: 0%;
  size-adjust: 100.3%;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
/* Inversion is instant: a colour transition interpolates through greys (see README § Motion). */
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:hover, a:focus-visible { background: var(--ink); color: var(--ground); text-decoration: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
* { border-radius: 0 !important; box-shadow: none !important; }

.dc-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;
}

/* ---------- inversion ---------- */
.dc-invert { background: var(--ink); color: var(--ground); }
.dc-invert a:hover, .dc-invert a:focus-visible { background: var(--ground); color: var(--ink); }
.dc-invert :focus-visible { outline-color: var(--ground); }

/* ---------- type ---------- */
.dc-display { font-size: 150px; font-weight: 900; line-height: .86; letter-spacing: -.045em; text-transform: uppercase; }
.dc-h1 { font-size: 72px; font-weight: 700; line-height: 1.02; letter-spacing: -.03em; }
.dc-h2 { font-size: 38px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.dc-h3 { font-size: 24px; font-weight: 700; line-height: 1.14; letter-spacing: -.02em; }
.dc-lead { font-size: 28px; font-weight: 300; line-height: 1.3; }
.dc-body { font-size: 16px; font-weight: 400; line-height: 1.6; max-width: 78ch; }
.dc-small { font-size: 13px; font-weight: 400; line-height: 1.55; }
.dc-label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
}
.dc-meta {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
/* the numeral primitive; size and alignment belong to its context (see .dc-table .dc-num) */
.dc-num { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- section header ---------- */
.dc-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: var(--s3);
  border-bottom: var(--rule-loud) solid currentColor; padding-bottom: var(--s3);
}

/* ---------- buttons ---------- */
.dc-btn {
  display: inline-block;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
  padding: 14px 22px; border: var(--rule-base) solid currentColor;
  background: var(--ground); color: var(--ink); cursor: pointer;
}
.dc-btn:hover, .dc-btn:focus-visible { background: var(--ink); color: var(--ground); text-decoration: none; }
.dc-btn:active { border-width: var(--rule-loud); }
/* --fill: the filled button, opposite of its surface. --primary is the 1.0 name, kept as an alias. */
.dc-btn--fill, .dc-btn--primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.dc-btn--fill:hover, .dc-btn--fill:focus-visible,
.dc-btn--primary:hover, .dc-btn--primary:focus-visible { background: var(--ground); color: var(--ink); }
.dc-btn--text { border-color: transparent; border-bottom-color: currentColor; padding: 12px 4px; }
.dc-btn--text:hover, .dc-btn--text:focus-visible { background: none; color: inherit; border-bottom-width: var(--rule-loud); }
.dc-btn--sm { font-size: 10px; padding: 7px 14px; }
.dc-btn--lg { font-size: 14px; padding: 18px 28px; }
.dc-btn[disabled], .dc-btn[aria-disabled="true"] {
  background: var(--hatch); color: var(--ink); cursor: not-allowed;
}
.dc-invert .dc-btn { background: var(--ink); color: var(--ground); border-color: var(--ground); }
.dc-invert .dc-btn:hover, .dc-invert .dc-btn:focus-visible { background: var(--ground); color: var(--ink); }
.dc-invert .dc-btn--fill, .dc-invert .dc-btn--primary { background: var(--ground); color: var(--ink); border-color: var(--ground); }
.dc-invert .dc-btn--fill:hover, .dc-invert .dc-btn--fill:focus-visible,
.dc-invert .dc-btn--primary:hover, .dc-invert .dc-btn--primary:focus-visible { background: var(--ink); color: var(--ground); }
.dc-invert .dc-btn--text { background: none; color: inherit; border-color: transparent; border-bottom-color: currentColor; }
@media (pointer: coarse) {
  .dc-btn { min-height: 44px; }
  .dc-btn--text { display: inline-flex; align-items: center; }
}

/* ---------- fields ---------- */
.dc-field { display: grid; gap: 7px; }
.dc-field > .dc-label { font-size: 11px; letter-spacing: 0.16em; }
.dc-input, .dc-select, .dc-textarea {
  border: var(--rule-base) solid var(--ink); background: var(--ground); color: var(--ink);
  padding: 12px 14px; font-family: var(--font-sans); font-size: 15px;
}
.dc-input::placeholder { color: var(--ink); font-weight: 300; }
.dc-input--error { border-width: var(--rule-loud); }
.dc-error { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.dc-input[disabled] { background: var(--hatch); cursor: not-allowed; }

/* ---------- chips & status ---------- */
.dc-chip {
  display: inline-block; border: var(--rule-hair) solid currentColor;
  padding: 6px 10px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dc-chip--on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.dc-invert .dc-chip--on { background: var(--ground); color: var(--ink); border-color: var(--ground); }

/* ---------- surfaces ---------- */
.dc-card { border: var(--rule-base) solid currentColor; padding: 26px; }
.dc-card--hover:hover { background: var(--ink); color: var(--ground); }
.dc-row {
  display: grid; align-items: center; gap: var(--s6);
  padding: 18px 16px; border-bottom: var(--rule-hair) solid currentColor;
  text-decoration: none;
}
.dc-row:hover { background: var(--ink); color: var(--ground); }
.dc-modal { border: var(--rule-loud) solid var(--ink); padding: 22px; background: var(--ground); }
.dc-toast { background: var(--ink); color: var(--ground); padding: 16px 18px; }
.dc-empty { border: var(--rule-base) solid var(--ink); background: var(--hatch); padding: 26px; }
.dc-empty > * { background: var(--ground); padding: 14px; }

/* ---------- table ---------- */
.dc-table { width: 100%; border-collapse: collapse; }
.dc-table caption {
  text-align: left; padding: var(--s4); border-bottom: var(--rule-base) solid currentColor;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dc-table th, .dc-table td {
  text-align: left; vertical-align: top; padding: 14px 12px;
  border-bottom: var(--rule-hair) solid currentColor;
  font-size: 15px; line-height: 1.5;
}
.dc-table th { font-weight: 700; }
.dc-table thead th {
  padding: 0 12px 10px; border-bottom: var(--rule-base) solid currentColor;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase;
}
.dc-table tbody tr:last-child td, .dc-table tbody tr:last-child th { border-bottom-width: var(--rule-base); }
.dc-table .dc-num { font-size: 14px; text-align: right; }
/* a framed, horizontally scrollable table; the cue is a mono label, never a shadow */
.dc-table-wrap { position: relative; overflow-x: auto; border: var(--rule-base) solid currentColor; }
.dc-table-wrap .dc-table thead th { padding-top: var(--s4); }
.dc-table-wrap .dc-table tbody tr:last-child td,
.dc-table-wrap .dc-table tbody tr:last-child th { border-bottom: 0; }
@media (max-width: 620px) {
  .dc-table-wrap { padding-top: 28px; }
  .dc-table-wrap::before {
    content: "\2194  scroll"; position: absolute; top: 0; right: 0;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 6px 12px; border-left: var(--rule-hair) solid currentColor; border-bottom: var(--rule-hair) solid currentColor;
  }
}

/* ---------- imagery ---------- */
.dc-img-1bit { filter: grayscale(1) contrast(1000%); }
.dc-img-slot { background: repeating-linear-gradient(135deg, #fff 0 2px, #000 2px 6px); }

/* ---------- motion: honour the OS setting everywhere ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- print ---------- */
@media print {
  a { text-decoration: underline; }
  .dc-invert { background: var(--ink) !important; color: var(--ground) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
