/* Tech Radar — slate theme. Ported from the Claude Design prototype
   (Tech Radar.html), trimmed to the slate style and adapted from a React SPA
   to server-rendered markup (controls are anchors, not buttons). */

:root {
  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Base dark tokens (slate overrides a subset below). */
html[data-theme='dark'] {
  --bg:         #0a0c0e;
  --bg-2:       #11141a;
  --panel:      #15191f;
  --panel-2:    #1a1f27;
  --border:     rgba(255,255,255,.08);
  --border-2:   rgba(255,255,255,.14);
  --fg:         #e8eaed;
  --fg-2:       rgba(232,234,237,.72);
  --fg-3:       rgba(232,234,237,.5);
  --fg-4:       rgba(232,234,237,.3);

  --ring:       rgba(255,255,255,.10);
  --axis:       rgba(255,255,255,.06);
  --legend-fg:  #e8eaed;

  --blip-stroke:    rgba(10,12,14,.7);
  --blip-stroke-on: #fff;
  --blip-num:       #0a0c0e;
  --blip-new-fill:  #0a0c0e;
  --accent-blue:    #5ab0ff;

  --scrim: rgba(0,0,0,.55);
}

/* Slate — calm dark, soft slate-blue neutrals. */
html[data-style='slate'] {
  --bg:       #0f1419;
  --bg-2:     #131922;
  --panel:    #161d27;
  --panel-2:  #1b2330;
  --border:   rgba(255,255,255,.07);
  --border-2: rgba(255,255,255,.13);
  --ring:     rgba(255,255,255,.075);
  --axis:     rgba(255,255,255,.05);
  --accent-blue: #6f93bf;
  --scrim: rgba(6,10,14,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

/* ─────────── Top bar ─────────── */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 11px; justify-self: start; }
.brand-mark { width: 26px; height: 26px; color: var(--fg); }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.radar-tabs { justify-self: center; display: inline-flex; align-items: center; gap: 2px; }
.radar-tab {
  color: var(--fg-3);
  font-size: 14px; font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, background .15s;
  letter-spacing: -0.005em;
}
.radar-tab:hover { color: var(--fg-2); }
.radar-tab.is-on { color: var(--fg); background: var(--panel); box-shadow: inset 0 0 0 1px var(--border-2); }

.top-right { display: flex; align-items: center; gap: 18px; justify-self: end; }
.top-date {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--panel);
  padding: 3px;
}
.view-switch a {
  color: var(--fg-2);
  font-size: 12px; font-weight: 500;
  padding: 5px 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.view-switch a:hover { color: var(--fg); }
.view-switch a.is-on { background: var(--fg); color: var(--bg); }

/* ─────────── Timeline ─────────── */
.timeline {
  padding: 26px 64px 30px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.timeline-track-wrap { position: relative; max-width: 980px; margin: 0 auto; }
.timeline-track { position: relative; height: 2px; background: var(--border-2); }
.timeline-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--accent-blue);
  transition: width .2s cubic-bezier(.3,.7,.3,1);
}
.timeline-tick {
  position: absolute; top: 50%;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  display: block;
  cursor: pointer; padding: 0;
}
.timeline-tick::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--fg-4);
  transition: box-shadow .15s, background .15s;
}
.timeline-tick.is-past::before { box-shadow: inset 0 0 0 1.5px var(--accent-blue); }
.timeline-tick:hover::before { box-shadow: inset 0 0 0 1.5px var(--fg-2); }
.timeline-tick.is-on::before { background: var(--accent-blue); box-shadow: none; }
.timeline-tick-label {
  position: absolute; top: -26px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--fg-3);
  white-space: nowrap;
  opacity: 0; transition: opacity .15s, color .15s;
  pointer-events: none;
}
.timeline-tick:hover .timeline-tick-label { opacity: 1; color: var(--fg); }
.timeline-handle {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; gap: 3px;
  pointer-events: none;
  transition: left .2s cubic-bezier(.3,.7,.3,1);
}
.timeline-handle span { width: 3px; height: 18px; border-radius: 2px; background: var(--accent-blue); }
.timeline-years { position: relative; height: 14px; margin-top: 14px; }
.timeline-year {
  position: absolute; transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px; color: var(--fg-4);
  letter-spacing: 0.06em;
}

/* ─────────── Stage ─────────── */
.stage { padding: 24px 28px 28px; display: grid; gap: 24px; min-height: 0; }
.stage.view-polar { grid-template-columns: minmax(0, 1fr) 340px; align-items: stretch; }
.stage.view-matrix { grid-template-columns: 1fr; }

/* ─────────── Polar radar ─────────── */
.radar-col { display: flex; flex-direction: column; min-width: 0; }
.radar-wrap {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1;
  max-width: 760px;
  max-height: calc(100vh - 250px);
  margin: 0 auto; width: 100%; flex: 1;
}
.radar-host { display: grid; place-items: center; width: 100%; height: 100%; }
.radar-svg { width: 100%; height: 100%; display: block; overflow: visible; }

.ring-label {
  fill: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.16em;
  text-anchor: start;
}
.quadrant-label { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; }
.blip-num {
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 600;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.blip { cursor: pointer; transition: filter .15s; }
.blip:hover, .blip.is-selected { filter: brightness(1.12); }

.hover-card {
  position: absolute; top: 8px; left: 8px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-left-width: 3px;
  border-radius: 9px;
  padding: 9px 13px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  z-index: 5;
}
.hover-card[hidden] { display: none; }
.hover-num { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.hover-name { font-weight: 600; color: var(--fg); }
.hover-ring {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-3);
  padding-left: 8px; border-left: 1px solid var(--border-2);
}

.radar-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 14px 8px 0; margin-top: 8px;
  border-top: 1px solid var(--border);
}
.foot-stats { display: flex; gap: 18px; font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }
.foot-stats b { color: var(--fg); font-weight: 600; }
.foot-legend { display: flex; gap: 16px; color: var(--fg-2); }
.foot-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; }
.mov-icon { width: 15px; height: 15px; color: var(--fg-2); }

/* ─────────── Entry list rail ─────────── */
.list-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
}
.list { overflow-y: auto; padding: 8px 6px 16px; max-height: calc(100vh - 260px); }
.list-quad { margin-top: 14px; }
.list-quad:first-child { margin-top: 4px; }
.list-quad-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 14px 8px;
  position: sticky; top: 0;
  background: var(--panel); z-index: 2;
}
.list-quad-dot { width: 7px; height: 7px; border-radius: 50%; }
.list-ring { margin-bottom: 4px; }
.list-ring-head {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 6px 14px 4px;
}
.list-item {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 22px 1fr auto;
  align-items: center; gap: 8px;
  padding: 5px 14px;
  font-size: 13px; color: var(--fg-2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s;
}
.list-item:hover { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--fg); }
.list-item.is-selected { background: color-mix(in oklab, var(--accent) 20%, transparent); border-left-color: var(--accent); color: var(--fg); }
.list-item-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.list-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-mov { font-size: 10px; line-height: 1; color: var(--accent); }
.list-item-mov.mov-out { opacity: .55; }
.list-item-mov.mov-new { font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ─────────── Matrix view ─────────── */
.matrix { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.matrix-grid { display: grid; }
.matrix-corner { background: var(--panel); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.matrix-col-head {
  padding: 18px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
  background: var(--panel-2);
}
.matrix-col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.matrix-row-head {
  padding: 18px 16px 18px 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.matrix-row-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.matrix-row-blurb { font-size: 11.5px; color: var(--fg-3); line-height: 1.4; }
.matrix-cell {
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  min-height: 100px;
}
.matrix-chip {
  color: var(--fg);
  font-size: 12.5px; text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  cursor: pointer;
  transition: background .12s;
  border-left: 2px solid var(--accent);
}
.matrix-chip:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.matrix-chip.is-selected { background: color-mix(in oklab, var(--accent) 18%, transparent); }
.matrix-chip-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.matrix-chip-name { color: var(--fg); }
.matrix-chip-mov { font-size: 11px; line-height: 1; color: var(--accent); }
.mov-out { opacity: 0.6; }

/* ─────────── Side panel ─────────── */
.side-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 100; animation: scrim-in .18s ease-out; display: block; }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--border-2);
  z-index: 101;
  display: flex; flex-direction: column;
  animation: slide-in .22s cubic-bezier(.2,.7,.3,1);
  box-shadow: -16px 0 48px rgba(0,0,0,.18);
}
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.side-eyebrow { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 500; }
.side-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; }
.side-close { display: inline-flex; align-items: center; justify-content: center; color: var(--fg-2); width: 30px; height: 30px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.side-close:hover { background: var(--bg-2); color: var(--fg); }
.side-body { padding: 24px; overflow-y: auto; flex: 1; }
.side-id { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.04em; margin-bottom: 6px; }
.side-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 24px; }
.side-meta { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
.side-meta-cell { padding: 14px 16px; }
.side-meta-cell:first-child { border-right: 1px solid var(--border); }
.side-meta-label { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px; }
.side-meta-value { font-size: 14px; font-weight: 500; color: var(--fg); }
.side-desc { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin: 0 0 24px; text-wrap: pretty; }
.side-section { margin-bottom: 24px; }
.side-section-label { font-family: var(--font-mono); font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 12px; }
.side-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.side-history li { display: grid; grid-template-columns: 90px 16px 1fr; align-items: center; padding: 8px 0; font-size: 13px; position: relative; }
.side-history li:not(:last-child)::after { content: ''; position: absolute; left: 97px; top: 24px; bottom: -2px; width: 1px; background: var(--border-2); }
.history-when { font-family: var(--font-mono); color: var(--fg-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); margin-left: 4px; }
.side-history li.is-current .history-dot { background: var(--fg); }
.history-ring { color: var(--fg-2); font-weight: 400; padding-left: 8px; }
.side-history li.is-current .history-ring { color: var(--fg); font-weight: 500; }

/* ─────────── Tweaks panel ─────────── */
.tweaks { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.tweaks-toggle {
  list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--panel); color: var(--fg-2);
  border: 1px solid var(--border-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  cursor: pointer;
}
.tweaks-toggle::-webkit-details-marker { display: none; }
.tweaks-toggle:hover { color: var(--fg); }
.tweaks[open] .tweaks-toggle { color: var(--fg); }
.tweaks-body {
  position: absolute; right: 0; bottom: 52px;
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.36);
}
.tweaks-sect { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-4); margin: 4px 0 8px; }
.tweaks-sect:not(:first-child) { margin-top: 16px; }
.tweaks-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tweaks-label { font-size: 13px; color: var(--fg-2); }
.tweaks .seg { display: inline-flex; width: 100%; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg-2); padding: 3px; }
.tweaks .seg a { flex: 1; text-align: center; font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 5px 0; border-radius: 5px; cursor: pointer; }
.tweaks .seg a.is-on { background: var(--fg); color: var(--bg); }
button.toggle { border: 0; padding: 0; font: inherit; -webkit-appearance: none; appearance: none; }
.toggle {
  position: relative; display: inline-block;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--border-2);
  cursor: pointer; transition: background .15s;
}
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg-3); transition: transform .15s, background .15s; }
.toggle.is-on { background: var(--accent-blue); box-shadow: none; }
.toggle.is-on .knob { transform: translateX(16px); background: #fff; }

/* ─────────── Responsive ─────────── */
@media (max-width: 1100px) {
  .stage.view-polar { grid-template-columns: 1fr; }
  .list-col { max-height: none; }
  .list { max-height: 520px; }
  .top { padding: 12px 18px; }
  .stage { padding: 18px; }
  .timeline { padding: 22px 32px 26px; }
  .top-right { gap: 12px; }
}
@media (max-width: 720px) {
  .top { grid-template-columns: auto 1fr; row-gap: 12px; }
  .radar-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .matrix-row-blurb { display: none; }
  .matrix-chip-name { font-size: 12px; }
  .quadrant-label { font-size: 11px; }
}
