/* ==========================================
   Conduit design tokens
   Source: docs/plans/2026-04-17-conduit-visual-design.md
   Directly reusable in the real implementation.
   ========================================== */

:root {
  /* Backgrounds (amber theme) */
  --bg-deep: #0a0a08;
  --bg-panel: #0f0f0c;
  --bg-surface: #141410;
  --bg-raised: #1a1a15;
  --bg-hot: rgba(212, 169, 58, 0.08);

  /* Lines & borders */
  --line-dim: rgba(199, 184, 154, 0.12);
  --line: rgba(199, 184, 154, 0.22);
  --line-bright: rgba(199, 184, 154, 0.4);

  /* Foregrounds */
  --fg-dim: rgba(199, 184, 154, 0.45);
  --fg: #c7b89a;
  --fg-bright: #e4d4b0;
  --fg-max: #f4e9cc;

  /* Amber accent */
  --amber: #d4a93a;
  --amber-bright: #f0c048;

  /* Semantic */
  --green: #7dc97d;
  --blue: #9ac9f4;
  --red: #e67a5c;
  --pink: #e8b4d4;

  /* Typography */
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Monaco, 'Cascadia Mono', monospace;

  /* Type scale */
  --text-xs: 9px;
  --text-sm: 10px;
  --text-md: 11px;
  --text-base: 13px;
  --text-lg: 26px;
  --text-hero: 64px;

  /* Letter spacing presets */
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.1em;
  --tracking-wider: 0.12em;
  --tracking-widest: 0.22em;

  /* Spacing grid (2px base) */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 6px;
  --sp-4: 8px;
  --sp-5: 10px;
  --sp-6: 12px;
  --sp-8: 16px;
  --sp-10: 20px;
  --sp-12: 24px;
  --sp-16: 32px;

  /* Motion */
  --duration-fast: 120ms;
  --duration-normal: 150ms;
  --ease: ease;
  --ease-out: ease-out;
}

/* ==========================================
   Base / reset
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 13px;
  color-scheme: dark;
}

body {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 400;
  background: var(--bg-deep);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Scanline overlay — gated on body.scanlines so Settings can toggle without reload. */
body.scanlines::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.012) 2px,
    rgba(255, 255, 255, 0.012) 3px
  );
  pointer-events: none;
  z-index: 1000;
}

a {
  color: var(--fg-bright);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--amber-bright);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-5);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--amber);
}

/* ==========================================
   Accessibility
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 1px solid var(--amber-bright);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible {
  outline: 1px solid var(--amber-bright);
  outline-offset: 2px;
}
