:root {
  --bg:#070912;
  --fg:#edf0f7;
  --fg-dim:#aab2c8;
  --fg-muted:#6f7894;
  --surface:rgba(13,17,31,0.92);
  --surface-2:rgba(20,26,44,0.9);
  --border:rgba(255,255,255,0.09);
  --axis:rgba(255,255,255,0.1);
  --empty:rgba(255,255,255,0.035);
  --skeleton:rgba(255,255,255,0.075);
  --line-0:#00a6a6;
  --line-1:#df5f4f;
  --line-2:#8f63d6;
  --line-3:#e0952d;
  --line-4:#4fa36f;
  --line-5:#4c78a8;
}

:root[data-theme="light"] {
  --bg:#f6f0e4;
  --fg:#172033;
  --fg-dim:#44506a;
  --fg-muted:#747f95;
  --surface:rgba(255,250,239,0.92);
  --surface-2:rgba(245,236,220,0.92);
  --border:rgba(39,48,68,0.13);
  --axis:rgba(39,48,68,0.15);
  --empty:rgba(39,48,68,0.045);
  --skeleton:rgba(39,48,68,0.07);
}

* { box-sizing:border-box; }
body {
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(47,143,185,0.18), transparent 32rem),
    radial-gradient(circle at 85% 0%, rgba(211,162,51,0.14), transparent 34rem),
    var(--bg);
  color:var(--fg);
  font-family:Inter, system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 10% 5%, rgba(47,143,185,0.2), transparent 30rem),
    radial-gradient(circle at 92% 2%, rgba(211,162,51,0.18), transparent 34rem),
    linear-gradient(135deg, rgba(255,255,255,0.52), transparent 42rem),
    var(--bg);
}

header {
  max-width:1680px;
  margin:0 auto;
  padding:28px 24px 12px;
  position:relative;
}

h1 {
  margin:0;
  font-weight:300;
  letter-spacing:0.26em;
  text-transform:uppercase;
  font-size:clamp(1.45rem,2.2vw,2.2rem);
  text-align:center;
}

header p {
  margin:8px auto 0;
  max-width:1050px;
  color:var(--fg-muted);
  line-height:1.55;
  font-size:0.88rem;
  text-align:center;
}

#theme-toggle {
  position:absolute;
  top:28px;
  right:24px;
  width:36px;
  height:36px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--fg);
  font:inherit;
  font-size:1.2rem;
  line-height:1;
  cursor:pointer;
  box-shadow:0 12px 40px rgba(0,0,0,0.12);
  backdrop-filter:blur(16px);
}

#theme-toggle:hover {
  color:var(--fg);
  border-color:color-mix(in srgb, var(--fg-muted) 42%, transparent);
}

main {
  max-width:1680px;
  margin:0 auto;
  padding:0 24px 28px;
  display:grid;
  gap:8px;
}

main > aside,
main > section {
  min-width:0;
}

#layout-resizer {
  position:sticky;
  top:16px;
  height:calc(100vh - 32px);
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--fg-muted);
  cursor:col-resize;
  touch-action:none;
}

#layout-resizer::before {
  content:"";
  width:2px;
  height:100%;
  max-height:720px;
  border-radius:999px;
  background:var(--border);
  transition:background 160ms ease, width 160ms ease;
}

#layout-resizer::after {
  content:"";
  position:absolute;
  width:8px;
  height:46px;
  border-radius:999px;
  background:var(--surface-2);
  border:1px solid var(--border);
  box-shadow:0 10px 28px rgba(0,0,0,0.18);
}

#layout-resizer:hover::before,
#layout-resizer.dragging::before {
  width:3px;
  background:color-mix(in srgb, var(--fg-muted) 52%, transparent);
}

.panel {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 18px 70px rgba(0,0,0,0.18);
  backdrop-filter:blur(16px);
}

.panel-title {
  margin:0;
  color:var(--fg-muted);
  font-weight:800;
  letter-spacing:0.16em;
  text-transform:uppercase;
  font-size:0.68rem;
}

.button-group {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

button.pill {
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  background:var(--surface-2);
  color:var(--fg-dim);
  font:inherit;
  font-size:0.7rem;
  cursor:pointer;
}

button.pill.active {
  color:var(--fg);
  border-color:var(--active-color, #2f8fb9);
  background:color-mix(in srgb, var(--active-color, #2f8fb9) 22%, var(--surface-2));
}

.info {
  padding:14px 16px;
  margin-bottom:12px;
  color:var(--fg-dim);
  font-size:0.84rem;
  line-height:1.55;
}

.info-title {
  color:var(--fg);
  font-weight:800;
  margin-bottom:4px;
}

.info-kicker {
  color:var(--fg-muted);
  font-size:0.62rem;
  font-weight:800;
  letter-spacing:0.12em;
  text-transform:uppercase;
  margin-bottom:4px;
}

.tooltip {
  position:fixed;
  pointer-events:none;
  z-index:40;
  max-width:380px;
  opacity:0;
  padding:11px 13px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  box-shadow:0 14px 50px rgba(0,0,0,0.28);
  backdrop-filter:blur(16px);
  transition:opacity 120ms ease;
}

.tooltip.visible { opacity:1; }
.tooltip-band {
  font-size:0.62rem;
  text-transform:uppercase;
  letter-spacing:0.11em;
  font-weight:800;
  margin-bottom:3px;
}
.tooltip-name {
  font-size:0.92rem;
  font-weight:800;
  margin-bottom:4px;
}
.tooltip-meta {
  color:var(--fg-muted);
  font-size:0.68rem;
  line-height:1.45;
  margin-bottom:5px;
}
.tooltip-meta:empty { display:none; }
.tip-pill {
  display:inline-block;
  padding:1px 6px;
  border-radius:6px;
  background:color-mix(in srgb, var(--pill-color) 22%, transparent);
  color:var(--pill-color);
  font-weight:700;
  white-space:nowrap;
}
.tooltip-desc {
  color:var(--fg-dim);
  font-size:0.78rem;
  line-height:1.48;
}

.stance-caveat {
  margin-top:6px; font-size:0.78em; line-height:1.4;
  color:var(--fg-muted); font-style:italic;
}

@media (max-width:1180px) {
  #layout-resizer { display:none; }
}

/* ── About modal ── */
#about-toggle {
  position:absolute;
  top:28px;
  right:68px;
  width:36px;
  height:36px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--fg-dim);
  font:inherit;
  font-size:1rem;
  cursor:pointer;
  box-shadow:0 12px 40px rgba(0,0,0,0.12);
  backdrop-filter:blur(16px);
}

#about-toggle:hover {
  color:var(--fg);
  border-color:color-mix(in srgb, var(--fg-muted) 42%, transparent);
}

.about-backdrop {
  display:none;
  position:fixed;
  inset:0;
  z-index:50;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.45);
  backdrop-filter:blur(6px);
}

.about-backdrop.visible {
  display:flex;
}

.about-modal {
  position:relative;
  max-width:860px;
  width:calc(100% - 32px);
  max-height:calc(100vh - 64px);
  overflow-y:auto;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 18px 70px rgba(0,0,0,0.28);
  backdrop-filter:blur(16px);
  padding:36px 40px 32px;
}

.about-modal h2 {
  margin:0 0 20px;
  font-weight:300;
  letter-spacing:0.22em;
  text-transform:uppercase;
  font-size:1.2rem;
  text-align:center;
}

.about-modal h3 {
  margin:28px 0 12px;
  font-weight:800;
  letter-spacing:0.12em;
  text-transform:uppercase;
  font-size:0.72rem;
  color:var(--fg-muted);
}

.about-modal p {
  margin:0 0 14px;
  color:var(--fg-dim);
  font-size:0.94rem;
  line-height:1.65;
}

.about-close {
  position:absolute;
  top:16px;
  right:16px;
  width:32px;
  height:32px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--fg-dim);
  font:inherit;
  font-size:1rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.about-close:hover {
  color:var(--fg);
  border-color:color-mix(in srgb, var(--fg-muted) 42%, transparent);
}

.about-lead {
  font-size:1rem;
  color:var(--fg);
  line-height:1.7;
  text-align:center;
}

.about-pills {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0;
}

.about-pill {
  display:inline-block;
  padding:5px 12px;
  border-radius:999px;
  font-size:0.78rem;
  font-weight:600;
  color:var(--fg);
  background:color-mix(in srgb, var(--pill-color, var(--fg-muted)) 18%, var(--surface-2));
  border:1px solid color-mix(in srgb, var(--pill-color, var(--fg-muted)) 38%, transparent);
}

.about-caption {
  color:var(--fg-muted);
  font-size:0.82rem;
  line-height:1.55;
  margin:6px 0 0;
}

.about-example {
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px 18px;
}

.about-example-title {
  font-size:0.66rem;
  font-weight:800;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--fg-muted);
  margin-bottom:10px;
}

.about-example-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:4px 0;
  font-size:0.82rem;
  color:var(--fg-dim);
}

.about-example-row + .about-example-row {
  border-top:1px solid var(--border);
}

.about-examples-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:14px 0;
}

/* ── About modal: screens & navigation ── */
.about-screen { display:none; }
.about-screen.active { display:block; }
.about-screen a { color:inherit; font-weight:600; text-decoration:underline; }

.about-nav {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid var(--border);
}

.about-nav-arrow {
  width:32px;
  height:32px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--fg);
  font-size:0;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.about-nav-arrow::before {
  content:'';
  width:8px;
  height:8px;
  border-top:2.5px solid currentColor;
  border-right:2.5px solid currentColor;
}

.about-nav-prev::before {
  transform:rotate(-135deg);
  margin-left:2px;
}

.about-nav-next::before {
  transform:rotate(45deg);
  margin-right:2px;
}

.about-nav-arrow:hover:not(:disabled) {
  color:var(--fg);
  border-color:color-mix(in srgb, var(--fg-muted) 42%, transparent);
}

.about-nav-arrow:disabled {
  opacity:0.3;
  cursor:default;
}

.about-nav-dot {
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--fg-muted);
  opacity:0.3;
  cursor:pointer;
  transition:opacity 160ms ease;
}

.about-nav-dot.active {
  opacity:1;
}

/* ── About modal: pill tooltips ── */
.about-pill {
  position:relative;
}

.about-pill .about-pill-tip {
  display:none;
}

.about-backdrop > .about-pill-tip {
  display:none;
  position:absolute;
  z-index:60;
  transform:translateX(-50%) translateY(-100%);
  max-width:280px;
  width:max-content;
  padding:8px 12px;
  border-radius:8px;
  background:var(--surface-2);
  border:1px solid var(--border);
  box-shadow:0 8px 28px rgba(0,0,0,0.22);
  color:var(--fg-dim);
  font-size:0.76rem;
  font-weight:400;
  line-height:1.5;
  pointer-events:none;
  text-align:center;
}

/* ── Footer ── */
footer {
  max-width:1680px;
  margin:0 auto;
  padding:16px 24px 24px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:var(--fg-muted);
  font-size:0.78rem;
}

footer a {
  color:var(--fg-muted);
  text-decoration:none;
}

footer a:hover {
  color:var(--fg);
}

footer svg {
  vertical-align:middle;
}

@media (max-width:720px) {
  .about-modal { padding:24px 20px 20px; }
  .about-examples-grid { grid-template-columns:1fr; }
}
