/* DISC wheel. Plain CSS, no build step.
 *
 * Chart colours are the four quarter hues. The set was checked with the
 * data-viz palette validator against both surfaces: light passes every gate,
 * dark passes with adjacent CVD delta-E 8.9. Every coloured region also
 * carries its letter, so identity never rests on hue alone. */

:root {
  --paper: #fbfbf9;
  --card: #ffffff;
  --ink: #15191f;
  --muted: #5d6673;
  --line: #dcdfe4;
  --line-strong: #b9bec7;
  --accent: #15191f;
  --grid: rgba(21, 25, 31, 0.06);

  /* quarter hues: D, i, S, C */
  --q-d: #e34948;
  --q-i: #eda100;
  --q-s: #1baf7a;
  --q-c: #2a78d6;
  --sector-off: #eceef1;
  --pos: #0d6b3f;
  --neg: #a33a2f;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --max: 1040px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121417;
    --card: #1a1d22;
    --ink: #eceef1;
    --muted: #9aa3ae;
    --line: #2b3038;
    --line-strong: #414855;
    --accent: #eceef1;
    --grid: rgba(236, 238, 241, 0.06);
    --q-d: #d64550;
    --q-i: #bd8c10;
    --q-s: #199e70;
    --q-c: #3987e5;
    --sector-off: #262b33;
    --pos: #4bbd84;
    --neg: #e77c6e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
ul { padding-left: 1.2em; }
li { margin-bottom: 0.3em; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em; }
.eyebrow { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 0.6rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { font: inherit; color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.lang-switch { background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; cursor: pointer; color: var(--muted); }
.lang-switch:hover { color: var(--ink); border-color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--paper);
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: transform 120ms ease, opacity 120ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-title { font-size: 1.05rem; font-family: var(--body); font-weight: 600; letter-spacing: 0; margin-bottom: 16px; }
.card-note { margin: 14px 0 0; }

/* Home */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 36px 0 24px; }
.hero-copy p.lede { font-size: 1.15rem; max-width: 34em; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 20px 0 26px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.hero-facts li::before { content: "·"; margin-right: 8px; }
.hero-facts li:first-child::before { content: none; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.wheel-figure { position: relative; margin: 0; }
.wheel-figure svg { width: 100%; height: auto; display: block; overflow: visible; }
.wheel-caption { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44%; text-align: center; pointer-events: none; }
.wheel-caption .name { font-family: var(--display); font-weight: 700; font-size: clamp(1rem, 2.6vw, 1.5rem); line-height: 1.1; }
.wheel-caption .tag { font-size: 0.8rem; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.wheel-hint { text-align: center; color: var(--muted); margin-top: 6px; }

/* Wheel marks */
.sector { transition: fill-opacity 140ms ease; }
.sector.hoverable { cursor: pointer; }
.sector.active { fill-opacity: 0.5 !important; }
.wheel-ring { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.wheel-axis { stroke: var(--line-strong); stroke-width: 1; }
.avg-ring { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.8; }
.profile-shape { fill: var(--ink); fill-opacity: 0.10; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; opacity: 0.85; }
.profile-node { fill: var(--ink); }
.profile-hit { fill: transparent; cursor: pointer; }
.wheel-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.wheel-label.pure { fill: var(--ink); font-weight: 600; font-size: 13px; }
.wheel-axis-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.dot { fill: var(--ink); stroke: var(--card); stroke-width: 3; }
.dot.other { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.dot-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.7; }
@keyframes drop { from { transform: scale(0); } to { transform: scale(1); } }
.dot.animate { transform-box: fill-box; transform-origin: center; animation: drop 500ms cubic-bezier(.2,.9,.3,1.3) both; }
@media (prefers-reduced-motion: reduce) { .dot.animate { animation: none; } .btn { transition: none; } }

.section { padding: 40px 0; border-top: 1px solid var(--line); }
.quads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quad { border-top: 4px solid; padding-top: 14px; }
.quad h3 { margin-bottom: 2px; }
.quad .axis { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.quad p { font-size: 0.95rem; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

/* Test */
.test { max-width: 720px; margin: 0 auto; padding: 24px 0 60px; }
.progress { display: flex; gap: 3px; margin: 8px 0 20px; }
.progress span { flex: 1; height: 5px; border-radius: 2px; background: var(--line); }
.progress span.done { background: var(--ink); }
.progress span.current { background: var(--muted); }
.test-meta { display: flex; justify-content: space-between; align-items: baseline; }
.instructions { margin-bottom: 26px; }
.statement { font-family: var(--display); font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; min-height: 2.4em; margin-bottom: 24px; }
.options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 6px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--card); cursor: pointer; text-align: center; font-size: 0.82rem; line-height: 1.22;
  transition: border-color 100ms ease, background 100ms ease, transform 100ms ease;
}
.opt:hover { border-color: var(--ink); transform: translateY(-1px); }
.opt[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.opt .key { font-family: var(--mono); font-size: 0.75rem; width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; opacity: 0.7; }
.opt .ring { width: var(--sz); height: var(--sz); border-radius: 50%; border: 2px solid currentColor; flex: none; }
.opt[aria-checked="true"] .ring { background: currentColor; }
.opt-label { flex: 1; display: flex; align-items: center; }
.test-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.hint { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* Results */
.results { padding: 20px 0 60px; }
.result-head { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; margin-bottom: 28px; }
.result-head .wheel-figure { max-width: 430px; }
.style-name { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0.1em 0 0.25em; }
.style-code { display: inline-block; font-family: var(--mono); font-size: 0.85rem; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; color: var(--muted); margin-top: 10px; justify-content: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.legend i.me { background: var(--ink); }
.legend i.other { border: 2px solid var(--ink); }
.legend i.poly { background: var(--ink); opacity: 0.25; border-radius: 2px; }
.legend i.avg { border: 1px dashed var(--muted); border-radius: 50%; }

.panel-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 16px; }

/* Axis meters: one measure each, zero in the middle */
.meter { margin-bottom: 20px; }
.meter:last-of-type { margin-bottom: 0; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.meter-name { font-weight: 600; font-size: 0.95rem; }
.meter-val { font-family: var(--mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.meter-track { position: relative; height: 12px; background: var(--sector-off); border-radius: 6px; }
.meter-zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.meter-fill { position: absolute; top: 0; bottom: 0; background: var(--ink); border-radius: 4px; min-width: 2px; }
.meter-ends { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: 5px; font-family: var(--mono); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: 1fr; gap: 14px; align-content: start; }
.stat { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: baseline; }
.stat-v { font-size: 2rem; font-weight: 600; line-height: 1; min-width: 2.6em; }
.stat-v .unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.stat-l { font-size: 0.95rem; font-weight: 600; }
.stat-h { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); line-height: 1.35; }

/* Segment table */
.table-card { margin-bottom: 32px; }
.seg-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.seg-table th, .seg-table td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.seg-table thead th { font-family: var(--mono); font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.seg-table tbody th { font-weight: 600; white-space: nowrap; }
.seg-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.seg-table .pos { color: var(--pos); }
.seg-table .neg { color: var(--neg); }
.seg-table .oct { color: var(--muted); font-size: 0.82rem; }
.seg-id { display: inline-block; min-width: 2em; font-family: var(--mono); color: var(--muted); }
.table-wrap { overflow-x: auto; }

.jump { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.jump a { text-decoration: none; color: var(--muted); }
.jump a:hover { color: var(--ink); }
.report { max-width: 62em; }
.report-section { padding: 26px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.report-section h2 { font-size: 1.35rem; margin-bottom: 0.6em; }
.report-section h3 { margin-top: 0.4em; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.priorities { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; padding: 0; list-style: none; }
.priorities li { font-family: var(--mono); font-size: 0.8rem; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; }
.growth { border-left: 3px solid var(--ink); padding: 4px 0 4px 16px; margin-top: 22px; }

.compare-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.compare-form input { flex: 1 1 320px; padding: 10px 14px; font: inherit; font-family: var(--mono); font-size: 0.85rem; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); }
.compare-result { margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 0.9rem; opacity: 0; transition: opacity 150ms ease; pointer-events: none; }
.toast.show { opacity: 1; }

/* Method page */
.prose { max-width: 42em; }
.prose h2 { margin-top: 2.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 1em 0 1.5em; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.prose td.num, .prose th.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.refs { font-size: 0.9rem; }
.refs li { margin-bottom: 0.6em; }

.site-footer { border-top: 1px solid var(--line); padding-block: 24px 40px; font-size: 0.85rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Responsive */
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero .wheel-figure { max-width: 400px; margin: 0 auto; order: -1; }
  .quads { grid-template-columns: 1fr 1fr; }
  .result-head { grid-template-columns: 1fr; }
  .result-head .wheel-figure { margin: 0 auto; }
  .two-col, .pair { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { flex-wrap: wrap; gap: 8px 16px; padding-block: 14px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.9rem; }
  .hint { display: none; }
  .statement { min-height: 2.6em; }
  .options { gap: 5px; }
  .opt { padding: 10px 2px 8px; font-size: 0.62rem; gap: 6px; }
  .opt .key { display: none; }
  .quads { grid-template-columns: 1fr 1fr; }
  .stat-v { font-size: 1.7rem; }
}

/* Print */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .site-footer, .actions, .jump, .compare-form, .hint, .btn, .lang-switch, .wheel-hint { display: none !important; }
  .report-section, .card, .result-head { page-break-inside: avoid; }
  .card { border-color: #ccc; }
  .panel-grid { grid-template-columns: 1fr 1fr; }
}
