/* ═══ Neuro Compass design tokens — "Paper" (light, default) & "Dusk" (dark) ═══
   Category colors validated with the dataviz palette validator (CVD ΔE ≥ 8,
   normal-vision ΔE ≥ 15, contrast ≥ 3:1) against each theme's panel surface. */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg-0: #f6f2ec;
  --bg-1: #efe9e0;
  --panel: #fffdf9;
  --panel-2: #f7f2ea;          /* inset / hover step */
  --border: #e6ded2;
  --border-strong: #d6cbbb;
  --text-1: #2a2833;
  --text-2: #55525f;
  --text-3: #736f7d;
  --accent: #3e7c6f;           /* sage-teal */
  --accent-ink: #ffffff;
  --accent-soft: rgba(62, 124, 111, 0.12);
  --accent-2: #c2653f;         /* terracotta */
  --accent-2-soft: rgba(194, 101, 63, 0.12);
  --cat-adhd: #b98314;
  --cat-autism: #5566c2;
  --cat-ocd: #9c4a78;
  --grid: #ebe4d9;
  --shadow: 0 1px 2px rgba(60, 45, 30, 0.05), 0 8px 24px rgba(60, 45, 30, 0.07);
  --shadow-lift: 0 2px 4px rgba(60, 45, 30, 0.06), 0 14px 34px rgba(60, 45, 30, 0.10);
  --radius: 18px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.22, 0.8, 0.36, 1);
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --mesh: 62, 124, 111;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg-0: #17161d;
  --bg-1: #1f1d27;
  --panel: #26232f;
  --panel-2: #2d2a37;
  --border: #3a3645;
  --border-strong: #4a4557;
  --text-1: #ece8f1;
  --text-2: #bdb7c8;
  --text-3: #958fa2;
  --accent: #7cc2b2;
  --accent-ink: #10201c;
  --accent-soft: rgba(124, 194, 178, 0.14);
  --accent-2: #e59a78;
  --accent-2-soft: rgba(229, 154, 120, 0.14);
  --cat-adhd: #bf8a2a;
  --cat-autism: #7a88e6;
  --cat-ocd: #cf5f9a;
  --grid: #34303f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.28);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 36px rgba(0, 0, 0, 0.35);
  --mesh: 124, 194, 178;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; min-height: 100%; }
html { background: var(--bg-1); }

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-1);
  background:
    radial-gradient(120% 80% at 100% 0%, var(--accent-2-soft) 0%, transparent 45%),
    radial-gradient(100% 70% at 0% 100%, var(--accent-soft) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1)) fixed;
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#mesh { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; font-variation-settings: "SOFT" 100, "opsz" 72; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
.eyebrow { font-family: var(--font); font-size: 0.74rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }
p { margin: 0.4em 0 0.8em; }
a { color: var(--accent); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
.muted { color: var(--text-3); }
.small { font-size: 0.86rem; }

/* Cards */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card.lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.card.cat-adhd   { border-top: 4px solid var(--cat-adhd); }
.card.cat-autism { border-top: 4px solid var(--cat-autism); }
.card.cat-ocd    { border-top: 4px solid var(--cat-ocd); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .16em .7em; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--border);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.warm { background: var(--accent-2-soft); color: var(--accent-2); border-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* Band chips: an ordinal, calm scale — deliberately NOT alarm-red */
.band { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: .16em .7em; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); background: var(--panel-2); }
.band .pips { display: inline-flex; gap: 2px; }
.band .pips i { width: 6px; height: 10px; border-radius: 2px; background: var(--border-strong); }
.band .pips i.on { background: var(--accent-2); }
.band.elevated, .band.high { color: var(--text-1); }

/* Buttons & inputs */
button, .btn {
  font: inherit; font-weight: 700; font-size: .92rem;
  color: var(--text-1); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 9px 18px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s;
}
button:hover, .btn:hover { border-color: var(--accent); background: var(--panel-2); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.07); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover, .btn.ghost:hover { color: var(--accent); background: var(--accent-soft); }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input, select {
  font: inherit; color: var(--text-1); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px;
}
input:focus, select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); padding: 0; border: none; background: none; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
label { font-size: .86rem; color: var(--text-2); }

table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th { text-align: right; color: var(--text-3); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
td.wrap { white-space: normal; text-align: left; }
tr:last-child td { border-bottom: none; }

::-webkit-scrollbar { height: 9px; width: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
