/* Orbit Accuracy Experiments — the Space Data Network style guide
   (spacedatanetwork.org/style-guide.html): dark first, one amber accent,
   signal cyan for a second series, system fonts, nothing loaded from a third
   party. The shared bar, stack section and footer are sdn-chrome's. */

:root {
  --sdn-stack-header-height: 52px;
  --sdn-stack-header-brand-size: 15px;
  --sdn-stack-header-link-size: 14px;
  --sdn-stack-header-action-size: 13px;
  --sdn-stack-header-mobile-link-size: 16px;

  --bg: #000000;
  --surface: #0b0b0c;
  --panel-solid: #161617;
  --panel: rgba(28, 28, 30, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --grid: rgba(255, 255, 255, 0.10);
  --text: #f5f5f7;
  --text-2: rgba(245, 245, 247, 0.78);
  --muted: #8e8e93;
  --accent: #f5a524;
  --accent-soft: rgba(245, 165, 36, 0.14);
  --cyan: #59d9ff;
  --sat: #b3e0ff;
  --alert: #ff3b30;
  --series-muted: rgba(245, 245, 247, 0.32);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --panel-solid: #ffffff;
  --panel: rgba(255, 255, 255, 0.8);
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.24);
  --grid: rgba(0, 0, 0, 0.10);
  --text: #1d1d1f;
  --text-2: rgba(29, 29, 31, 0.8);
  --muted: #6e6e73;
  --accent: #c77d00;
  --accent-soft: rgba(199, 125, 0, 0.12);
  --cyan: #0a84b8;
  --series-muted: rgba(29, 29, 31, 0.32);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 13px; }
code { background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; }
.skip-link:focus { left: 12px; z-index: 100; background: var(--panel-solid); padding: 6px 12px; border-radius: 999px; }

main { display: block; }
section.hero, section.band { max-width: 1120px; margin: 0 auto; padding: 72px 20px; }
section.hero { padding-top: 96px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 18px; max-width: 14ch; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 19px; font-weight: 600; margin: 0 0 12px; }
.lede { font-size: clamp(17px, 2vw, 21px); color: var(--text-2); max-width: 760px; margin: 0; }
.section-head { margin-bottom: 28px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: rgba(28, 28, 30, 0.6); color: var(--text);
  font: 600 14px/1 var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button:hover { background: var(--text); color: var(--bg); text-decoration: none; }
.actions:hover .button.primary:not(:hover) { background: rgba(28, 28, 30, 0.6); color: var(--text); }
.button:disabled { opacity: 0.5; cursor: progress; }
:root[data-theme="light"] .button { background: rgba(255, 255, 255, 0.7); }
:root[data-theme="light"] .button.primary { background: var(--text); color: #fff; }
.button.small { min-height: 32px; padding: 0 14px; font-size: 13px; }

.facts { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.facts li { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; backdrop-filter: blur(12px); }
.facts strong { display: block; font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: 14px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 20px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); min-width: 0; }
.panel + .panel, .chart-card + .panel, .panel + .downloads, .grid-2 + .panel { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2.notes { margin-top: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.live { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .live { grid-template-columns: minmax(0, 1fr); } }
.globe-frame { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #000; min-height: 520px; }
.globe { position: absolute; inset: 0; }
@media (max-width: 900px) { .globe-frame { min-height: 380px; } }
.globe .cesium-viewer-bottom, .globe .cesium-credit-logoContainer { display: none !important; }
.globe .cesium-viewer-timelineContainer { background: rgba(11, 11, 12, 0.8); }
.globe-legend { position: absolute; left: 12px; top: 12px; display: flex; gap: 14px; font-size: 13px; color: var(--text); background: rgba(22, 22, 23, 0.72); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 6px 10px; backdrop-filter: blur(12px); }
.key { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.key.amber { background: #f5a524; } .key.cyan { background: #59d9ff; } .key.muted { background: var(--series-muted); }
.isolation { position: absolute; inset: auto 12px 12px 12px; background: rgba(22, 22, 23, 0.9); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.controls { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
select {
  font: 400 15px/1.3 var(--sans); color: var(--text); background: var(--panel-solid);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 12px; width: 100%; min-width: 0;
}
.hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.status { margin: 0; color: var(--text-2); font-size: 14px; min-height: 1.6em; overflow-wrap: anywhere; }
.status.error { color: var(--text); }
.status.error::before { content: '⚠ '; color: var(--alert); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tiles div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-width: 0; }
.tiles dt { color: var(--muted); font-size: 12px; }
.tiles dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.inline label { flex: 1 1 320px; }
.inline .status { flex-basis: 100%; }

.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.downloads:empty { display: none; }

.chart-card { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 16px 8px; min-width: 0; }
.chart-card figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.chart-card figcaption strong { font-weight: 600; }
.chart-card figcaption span { color: var(--muted); font-size: 13px; }
.chart { position: relative; width: 100%; height: 300px; }
.chart.tall { height: 420px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text, .chart .label { fill: var(--muted); font: 12px var(--sans); }
.chart .direct { fill: var(--text-2); font: 600 12px var(--sans); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .tooltip { position: absolute; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font-size: 13px; line-height: 1.45; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 2; }
.chart .tooltip b { font-variant-numeric: tabular-nums; }
.chart .legend { position: absolute; right: 8px; left: 8px; top: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; font-size: 12px; color: var(--text-2); }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--surface); position: sticky; top: 0; }
.data-table tr.highlight td { color: var(--text); font-weight: 600; }
.data-table tr.highlight td:first-child::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; }
.data-table tr.second td:first-child::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-right: 8px; }
.data-table.compact th, .data-table.compact td { padding: 6px 8px; }
.data-table td.hash { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.data-table td.wrap { white-space: normal; text-align: left; min-width: 220px; color: var(--text-2); }

.criteria { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.criteria li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--text-2); }
.criteria li .badge { white-space: nowrap; margin-top: 1px; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 9px; font: 600 12px/1.6 var(--sans); border: 1px solid var(--border-strong); }
.badge.pass { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.badge.fail { color: var(--text); }
.badge.fail::before { content: '✕ '; color: var(--alert); }
.badge.pass::before { content: '✓ '; color: var(--accent); }
.configs { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.configs dt { font-weight: 600; } .configs dd { margin: 0; color: var(--text-2); }

.message { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; overflow-x: auto; max-height: 360px; line-height: 1.45; margin: 0 0 12px; color: var(--text-2); }
.notes-list { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cards .panel h3 { margin-bottom: 6px; }
.cards .panel p { color: var(--text-2); font-size: 15px; margin: 0 0 10px; }
.cards .state { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }

.fine { color: var(--muted); font-size: 13px; margin-top: 12px; overflow-wrap: anywhere; }
h3 .fine, td .fine { font-weight: 400; margin: 0 0 0 6px; }
.file-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.file-group h3 { margin: 0 0 6px; }
.file-group p { margin: 0 0 6px; color: var(--text-2); font-size: 14px; }
.file-group p.fine { margin: 0 0 4px; font-size: 12px; }
.file-group .table-wrap { margin-top: 10px; max-height: 360px; overflow: auto; }
.file-group .data-table td.hash { text-align: left; }
.file-group .data-table td.file { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.file-group .data-table td.file .source { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.file-group .data-table { table-layout: auto; }
.file-group details { margin-top: 8px; }
.file-group summary { cursor: pointer; color: var(--text); font-size: 14px; padding: 6px 0; }
.file-group summary::marker { color: var(--accent); }
@media (max-width: 600px) {
  section.hero, section.band { padding: 48px 16px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart { height: 260px; }
  .chart.tall { height: 520px; }
}
@media (max-width: 900px) { .file-groups { grid-template-columns: minmax(0, 1fr); } }
