/* ============================================================
   DotBinder — shared tokens + primitives (CONTRACT — Voss, frozen).
   Extracted verbatim from design/direction-1/index.html (the picked
   direction). Change requests route through Voss; pages carry their
   own page-specific CSS inline and never redefine tokens.
   Written deviation carried from D1 (on file): mono metadata/labels
   run at 13px (chips, eyebrows, table heads, dates); body prose never
   drops below 16px; all 13px text passes 4.5:1 in both themes.
   ============================================================ */

:root {
  /* -- light theme (default) -- */
  color-scheme: light;
  --bg: #F4F4F1;
  --surface: #FFFFFF;
  --border: #DCDBD4;
  --text: #1B1B17;
  --text-muted: #5B5A52;
  --accent: #1D4ED8;
  --accent-hover: #1A44BC;
  --accent-contrast: #FFFFFF;
  --danger: #B42318;
  --danger-subtle: #FBEAE8;
  --success: #0E6B37;
  --success-subtle: #E1F3E7;
  --warn: #8A5A00;
  --warn-subtle: #F9EFDB;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 4px 12px rgb(0 0 0 / 0.06);

  /* -- type -- */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* -- motion -- */
  --fast: 150ms;
  --base: 200ms;

  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141412;
    --surface: #1D1D1A;
    --border: #35352F;
    --text: #EDECE5;
    --text-muted: #A8A79B;
    --accent: #93B4F8;
    --accent-hover: #A9C4FA;
    --accent-contrast: #0C1633;
    --danger: #F1948C;
    --danger-subtle: #3D1B17;
    --success: #85D6A3;
    --success-subtle: #16301F;
    --warn: #E3B96F;
    --warn-subtle: #342809;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 4px 12px rgb(0 0 0 / 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141412;
  --surface: #1D1D1A;
  --border: #35352F;
  --text: #EDECE5;
  --text-muted: #A8A79B;
  --accent: #93B4F8;
  --accent-hover: #A9C4FA;
  --accent-contrast: #0C1633;
  --danger: #F1948C;
  --danger-subtle: #3D1B17;
  --success: #85D6A3;
  --success-subtle: #16301F;
  --warn: #E3B96F;
  --warn-subtle: #342809;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.5), 0 4px 12px rgb(0 0 0 / 0.35);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- primitives ---------- */
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) ease-out, border-color var(--fast) ease-out, color var(--fast) ease-out;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn-primary:active { background: var(--accent); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-secondary:active { background: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  padding-inline: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-ghost:hover { color: var(--accent-hover); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}
.chip-danger  { background: var(--danger-subtle);  color: var(--danger); }
.chip-warn    { background: var(--warn-subtle);    color: var(--warn); }
.chip-success { background: var(--success-subtle); color: var(--success); }
.chip-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.chip-sample  { background: transparent; color: var(--text-muted); border: 1px dashed var(--text-muted); }

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 20;
}
.skip:focus-visible { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 8px;
  min-height: 44px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand svg { color: var(--text); }
.topnav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
}
.topnav a:hover { color: var(--text); }
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--fast) ease-out, border-color var(--fast) ease-out;
}
.theme-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* ---------- panels (product depictions) ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

/* ---------- email-capture magnet ---------- */
.magnet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--text);
  border-radius: var(--radius);
  padding: 24px;
}
.magnet h3 { font-size: 20px; line-height: 1.2; font-weight: 700; margin-top: 8px; }
.magnet p { margin-top: 8px; color: var(--text-muted); max-width: 44ch; }
.magnet form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.magnet label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.magnet input {
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.magnet input::placeholder { color: var(--text-muted); }
.magnet input:hover { border-color: var(--text-muted); }
.magnet .btn { margin-top: 8px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding-block: 48px 64px; }
.posture {
  margin-top: 16px;
  color: var(--text-muted);
  max-width: 62ch;
  font-size: 16px;
}
.legal {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
