/* Camera Landscape — styles. Dependency-free, neutral with a bit of play. */
:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --ink: #20242b;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --line: #e3e1db;
  --accent: #2e5984;
  --accent-soft: #eaf0f6;
  --dot-on: #2e5984;
  --dot-off: #d8d6d0;
  --na: #b9b5ac;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---- header / nav ---- */
header.app {
  background: #1c2530;
  color: #fff;
  padding: 18px 22px 0;
}
header.app .titlewrap { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
header.app h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header.app .sub { color: #aeb7c2; font-size: 13px; margin: 0; }
header.app .sub a { color: #cdd7e2; }
nav.views { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
nav.views button {
  background: transparent; color: #c4ccd6; border: none; cursor: pointer;
  padding: 9px 15px; font-size: 14px; border-radius: 8px 8px 0 0; font-weight: 550;
}
nav.views button:hover { color: #fff; background: #2a3542; }
nav.views button.active { background: var(--bg); color: var(--ink); }

/* ---- layout ---- */
main { padding: 18px 22px 60px; max-width: 1180px; margin: 0 auto; }
.viewhead { margin: 4px 0 14px; }
.viewhead h2 { margin: 0 0 4px; font-size: 17px; }
.viewhead p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }

.controls {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.ctrl { display: flex; flex-direction: column; gap: 4px; }
.ctrl label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); }
select, .controls button.flip {
  font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.controls button.flip { min-width: 38px; font-weight: 600; }
.controls button.flip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---- matrix table ---- */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
table.matrix th, table.matrix td { padding: 8px 10px; text-align: center; white-space: nowrap; }
table.matrix thead th {
  position: sticky; top: 0; background: #fbfaf8; border-bottom: 2px solid var(--line);
  cursor: pointer; user-select: none; font-weight: 600; color: var(--muted); z-index: 2;
}
table.matrix thead th:hover { color: var(--ink); }
table.matrix thead th .arrow { color: var(--accent); font-size: 10px; }
table.matrix td.name, table.matrix th.name { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; }
table.matrix thead th.name { z-index: 3; background: #fbfaf8; }
table.matrix tbody tr { cursor: pointer; border-bottom: 1px solid #f0eee9; }
table.matrix tbody tr:hover { background: #fbfbf9; }
table.matrix tbody tr:hover td.name { background: #fbfbf9; }
table.matrix tr.bandtop td { border-top: 2px solid #e8e6e0; }
.camname { font-weight: 600; }
.camname .fam { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.statustag { font-size: 10px; color: var(--faint); margin-left: 6px; text-transform: uppercase; letter-spacing: .4px; }

/* dots */
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-off); display: inline-block; }
.dots i.f { background: var(--dot-on); }
.na { color: var(--na); }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 11px; font-size: 11.5px;
  background: #f0efea; color: #4b5563; border: 1px solid #e6e4dd;
}
.conf { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.conf.high { background: #e4f1e6; color: #2f6b3a; }
.conf.medium { background: #fdf1dc; color: #8a6314; }
.conf.low { background: #f3e6e6; color: #9a4b4b; }

/* ---- detail drawer ---- */
.drawer-back {
  position: fixed; inset: 0; background: rgba(20, 25, 32, 0.34);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40;
}
.drawer-back.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 430px; max-width: 92vw;
  background: var(--panel); box-shadow: -8px 0 30px rgba(0,0,0,.16); z-index: 50;
  transform: translateX(100%); transition: transform .2s ease; overflow-y: auto; padding: 22px 22px 50px;
}
.drawer.open { transform: translateX(0); }
.drawer .close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.drawer h3 { margin: 2px 0 2px; font-size: 19px; }
.drawer .summary { color: #374151; font-size: 14px; margin: 10px 0 16px; }
.drawer .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.drawer .axisrow { border-top: 1px solid var(--line); padding: 9px 0; }
.drawer .axisrow .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer .axisrow .alabel { font-weight: 600; font-size: 13px; }
.drawer .axisrow .anote { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.drawer .lvl { font-size: 11.5px; color: var(--accent); }
.readlink { display: inline-block; margin-top: 16px; font-weight: 600; }

/* ---- svg scatter / constellation ---- */
.plotwrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
svg { display: block; width: 100%; height: auto; }
.gridline { stroke: #ecece6; stroke-width: 1; }
.axislabel { fill: var(--muted); font-size: 12px; }
.ticklabel { fill: var(--faint); font-size: 10px; }
.pt { cursor: pointer; }
.pt:hover { stroke: #1c2530; stroke-width: 2; }
.frontier { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .7; }
.ptlabel { font-size: 9.5px; fill: #3a4250; pointer-events: none; }
.quadlabel { font-size: 11px; fill: #9aa1ab; font-style: italic; }

.insight {
  margin-top: 12px; background: var(--accent-soft); border: 1px solid #d4e0ec;
  border-radius: 9px; padding: 10px 13px; font-size: 13.5px; color: #2b4a68;
}
.insight b { color: var(--accent); }
.unplotted { margin-top: 10px; color: var(--faint); font-size: 12px; }

/* legend */
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend .item { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend .hollow { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); display: inline-block; }

/* ---- stories ---- */
.story-banner {
  background: #1c2530; color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px;
  display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow);
}
.story-banner .btxt { flex: 1; }
.story-banner h2 { margin: 0 0 4px; font-size: 16px; }
.story-banner p { margin: 0; color: #c4ccd6; font-size: 13.5px; }
.story-banner button { background: #2a3542; color: #fff; border: none; border-radius: 7px; padding: 8px 13px; cursor: pointer; font: inherit; white-space: nowrap; }
.story-banner button:hover { background: #36424f; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.story-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.story-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.07), 0 14px 30px rgba(0,0,0,.09); }
.story-card h3 { margin: 0 0 7px; font-size: 15.5px; }
.story-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.story-card .pair { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.story-card .pair .x { color: var(--faint); font-weight: 400; }

footer.note { color: var(--faint); font-size: 12px; margin-top: 24px; max-width: 75ch; }
@media (max-width: 640px) { main { padding: 14px 12px 50px; } header.app { padding: 14px 14px 0; } }
