/* iq-check -- swamplink family identity, same token system as
   counting-cars-plates ("Blackwater") and wings, so the sibling sites read
   as one family. Palette is the shared dark swamp water; shallows teal
   marks interaction and provenance, tannin (amber) is reserved for
   "read this with care" -- which is most of this site, given what it is.

   Fonts load from a <link> in index.html's <head>, NOT an @import here:
   an @import below other rules is invalid CSS and silently dropped, which
   has bitten a sibling site before (rendered in fallback fonts, no error).
*/
:root {
  --paper: #0e1214; --card: #161c1f; --well: #1b2225;
  --line: #263133; --rule: #33403f;
  --ink: #dce4e2; --dim: #7f9089; --faint: #5c6b66;

  --stamp: #4fa08f; --stamp-soft: #3a7a6d;
  --estimate: #e8b13f; --bad: #c1554a; --good: #4fa08f;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Bitter', Georgia, serif;
  --body-font: 'Alegreya Sans', system-ui, -apple-system, sans-serif;
}

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

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15.5px/1.62 var(--body-font);
}

a {
  color: var(--estimate);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--estimate) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--stamp); text-decoration-color: var(--stamp); }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }

/* Quiet family bar -- same chrome as the hub and plates. */
.chrome {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.chrome .home {
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.chrome .home:hover { color: var(--stamp); }
.chrome .home svg { width: 0.95rem; height: 0.95rem; flex: none; }
.chrome nav { display: flex; align-items: center; gap: 1.1rem; }
.chrome nav a { color: var(--dim); text-decoration: none; white-space: nowrap; }
.chrome nav a:hover { color: var(--ink); }

header {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0.5rem;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  margin: 0;
}

header h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 7vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0.55rem;
}

.tagline {
  color: var(--dim);
  max-width: 38rem;
  margin: 0;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

/* --- mode picker --- */
#mode-picker {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.mode-btn {
  background: none;
  color: var(--dim);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.55rem 0.25rem;
  margin: 0 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  color: var(--ink);
  border-bottom-color: var(--stamp);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
}

/* --- forms --- */
.field { display: block; margin: 1rem 0; }

.field span {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  width: 100%;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 1rem;
}
.field textarea { font-family: var(--body-font); line-height: 1.55; }
.field input:focus, .field textarea:focus {
  border-color: var(--stamp-soft);
  outline: none;
}

button {
  background: var(--stamp);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  padding: 0.65rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 1rem;
}
button:hover { background: var(--stamp-soft); }
button:disabled { opacity: 0.5; cursor: default; }

input[type="range"] { width: 100%; accent-color: var(--stamp); }

/* --- quiz --- */
.question {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.85rem;
}

.question .prompt {
  font-family: var(--mono);
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.choices label {
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.choices label:hover { border-color: var(--stamp-soft); }

.tier-choices { grid-template-columns: repeat(2, 1fr); }

/* --- ladder --- */
.level-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
}
.level-card.passed { border-left: 3px solid var(--stamp); }
.level-card.locked { opacity: 0.5; }
.level-card button { margin-top: 0; padding: 0.45rem 0.9rem; }
.level-card strong { font-family: var(--display); font-weight: 700; }

.level-status {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.free-play { margin-top: 1.25rem; color: var(--dim); }
.free-play summary { cursor: pointer; font-family: var(--mono); font-size: 0.78rem; }
.free-play .choices { margin-top: 0.75rem; }

.study-text { color: var(--dim); font-size: 0.95rem; }

.pass-banner {
  color: var(--stamp);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.fail-banner {
  color: var(--bad);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --- results --- */
.result-summary { text-align: center; margin-bottom: 1.25rem; }

.estimate {
  font-family: var(--display);
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--estimate);
  margin: 0.4rem 0;
  font-variant-numeric: tabular-nums;
}

.bar-chart { margin: 0.75rem 0; }

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 3.5rem;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.bar-track {
  background: var(--well);
  border-radius: 2px;
  height: 12px;
  overflow: hidden;
}
.bar-fill { background: var(--stamp); height: 100%; }

.bar-value {
  text-align: right;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.chart-label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1.35rem 0 0.4rem;
}

.math-box {
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--dim);
  overflow-x: auto;
}
.math-box code { color: var(--ink); font-family: var(--mono); }
.math-box strong { color: var(--ink); font-family: var(--mono); }

.bell-wrap { margin: 0.85rem 0; }
.bell-wrap svg { width: 100%; height: auto; display: block; }

/* --- footer --- */
footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.disclaimer {
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.6;
}
.disclaimer strong { color: var(--estimate); }

/* swamplink family strip — see claude-rules/shared-rules.md. Styled to this
   page's own tokens; there is no shared build step across the properties. */
.family {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
.family span { color: var(--dim); }
.family a { color: var(--faint); text-decoration: none; }
.family a:hover { color: var(--stamp); }

.build {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
}
.build .sep { margin: 0 0.4rem; }
.build code { font-family: var(--mono); color: var(--dim); }
