/* Orbit Lab - one dark space page; the canvas fills it and the UI floats on top. */
:root {
  --ink: #e8ecf4; --muted: #9aa5b8; --panel: rgba(12, 16, 28, 0.78); --edge: rgba(150, 170, 220, 0.22);
  --green: #35ff6a; --purple: #a060ff; --sun: #ffd27a; --focus: #7cc4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #03050b; color: var(--ink); overflow: hidden;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.title { position: fixed; top: 12px; left: 16px; pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; pointer-events: auto; margin-bottom: 6px; }
.brand img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; object-position: 50% 12%; }
.wordmark { font: 800 12px/1 system-ui, sans-serif; letter-spacing: .08em; }
.wordmark span { font-weight: 500; }
.title h1 { margin: 0; font-size: 22px; letter-spacing: 0.04em; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }

.legend { position: fixed; top: 14px; right: 16px; display: flex; flex-direction: column; gap: 3px;
  font-size: 12.5px; text-align: right; color: var(--ink); pointer-events: none; }
.legend .muted { color: var(--muted); }
.legend .power { color: var(--sun); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot.green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }

.dock { position: fixed; left: 16px; right: 16px; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.caption { width: min(560px, 100%);
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 12px 14px 8px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.caption p { margin: 0 0 6px; font-size: 14.5px; }
.caption strong { color: #fff; }
.caption a { color: var(--focus); }
.caption .spec { color: var(--sun); font-weight: 600; }
.caption-nav { display: flex; align-items: center; justify-content: center; gap: 10px; }
.caption-nav button { background: none; border: 0; color: var(--ink); font-size: 22px; line-height: 1; padding: 2px 10px; cursor: pointer; border-radius: 8px; }
.caption-nav .fold { font-size: 12px; color: var(--muted); padding: 4px 8px; margin-left: auto; }
.caption-nav { position: relative; }
.caption.folded p { display: none; }
.caption.folded { padding: 4px 10px; width: auto; }
#cap-dots i { display: inline-block; width: 7px; height: 7px; margin: 0 3px; border-radius: 50%; background: #445; }
#cap-dots i.on { background: var(--ink); }

.controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.controls button, .speed { background: var(--panel); color: var(--ink); border: 1px solid var(--edge); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.controls button:hover { border-color: rgba(200, 215, 255, 0.5); }
.controls button[aria-pressed="true"] { background: rgba(70, 90, 160, 0.55); border-color: rgba(160, 190, 255, 0.6); }
.controls button.primary { background: linear-gradient(180deg, #ff9a4a, #e0602a); border-color: transparent; color: #fff; font-weight: 600; }
.controls button.primary:disabled { opacity: 0.55; cursor: default; }
.speed { display: flex; align-items: center; gap: 8px; cursor: default; }
.speed input { width: 96px; accent-color: var(--focus); }
.speed output { min-width: 3.2ch; font-variant-numeric: tabular-nums; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.credit { position: fixed; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.credit a { color: var(--muted); }

dialog#compare, dialog#radiators, dialog#sunpower { overflow: auto; overscroll-behavior: contain; border: 0; padding: 0; background: none; color: var(--ink); max-width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); }
dialog#compare::backdrop, dialog#radiators::backdrop, dialog#sunpower::backdrop { background: rgba(2, 4, 10, 0.7); }
.cmp-card { position: relative; background: #0c1222; border: 1px solid var(--edge); border-radius: 16px; padding: 16px 18px; }
.cmp-card h2 { margin: 0 32px 10px 0; font-size: 18px; }
.cmp-card h3 { margin: 12px 0 6px; font-size: 14px; }
.cmp-card h3 span { color: var(--muted); font-weight: 400; }
.cmp-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-row figure { margin: 0; text-align: center; }
.cmp-row svg { width: 100%; height: auto; display: block; }
.cmp-row figcaption { font-size: 12.5px; color: var(--muted); }
.cmp-row figcaption > b:first-child { display: block; color: var(--ink); font-size: 14px; }
.hot { color: #35ffcc; }
.cmp-note { font-size: 13px; margin: 8px 0; }
.cmp-src { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.cmp-src a { color: var(--focus); }
.cmp-launch { display: grid; grid-template-columns: 9.5em 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; margin: 4px 0; }
.cmp-launch > span { color: var(--muted); }
.squares { display: flex; flex-wrap: wrap; gap: 2px; }
.squares i { width: 9px; height: 9px; border-radius: 2px; }

.rad-svg { width: 100%; height: auto; display: block; margin: 4px 0; }
.rad-slider { display: flex; align-items: center; gap: 10px; font-size: 13px; margin: 8px 0; }
.rad-slider input { flex: 1; accent-color: #ff8a50; }
.rad-slider output { min-width: 4.5ch; font-variant-numeric: tabular-nums; }
.rad-viz { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.rad-viz p { margin: 0; font-size: 13px; }
.rad-box { position: relative; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
#rad-square { background: rgba(255, 106, 58, 0.55); box-shadow: 0 0 12px rgba(255, 106, 58, 0.6); transition: width .2s, height .2s; }
.rad-field { position: absolute; left: 0; bottom: 0; width: 6px; height: 6px; background: #3f7a45; outline: 1px solid #9fdcaa; }
.rad-list { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.rad-list li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { #rad-square { transition: none; } }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--focus); text-decoration: underline; cursor: pointer; }
.sun-mass { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.sun-mass svg { width: 84px; height: 84px; filter: drop-shadow(0 0 10px rgba(255, 200, 87, 0.5)); }
.sun-mass p { margin: 0; font-size: 13px; }
.ladder > div { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 6px 0; font-size: 12.5px; }
.ladder span { color: var(--muted); }
.ladder i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #ffc857, #ff8a50); box-shadow: 0 0 8px rgba(255, 170, 80, 0.4); }
.ladder b { font-variant-numeric: tabular-nums; }

/* Phones: notes move to the top, controls tighten into two rows. */
@media (max-width: 600px) {
  .title h1 { font-size: 19px; }
  .title p { display: none; }
  .legend { top: 72px; left: 16px; right: 16px; text-align: left; font-size: 11px; gap: 1px; }
  .legend .muted { display: none; }
  .dock { bottom: 30px; gap: 8px; }
  .caption { padding: 8px 12px 4px; }
  .caption p { font-size: 13.5px; }
  .controls { gap: 6px; }
  .controls button, .speed { padding: 7px 11px; font-size: 13px; min-height: 40px; }
  .speed input { width: 80px; }
  .credit { font-size: 10px; padding: 0 12px; }
}
