/* Planet Unum launch site. No build step, no external requests. */

:root {
  color-scheme: dark;
  --bg: #0b0f1a;
  --bg-raised: #121a2b;
  --bg-sunken: #070a12;
  --fg: #e9edf5;
  --fg-muted: #a7b0c3;
  --line: #273149;
  --accent: #ffd166;
  --accent-ink: #1a1400;
  --link: #8fd3ff;
  --focus: #ffffff;
  --map-glow: #3b63d9;
  --ok: #7ad38a;
  --warn: #ffb347;
  --danger: #ff7b7b;

  --c-space: #8fd3ff;
  --c-history: #ffd166;
  --c-wildlife: #7ad38a;
  --c-film: #f49ac1;
  --c-science: #c3a6ff;
  --c-games: #ffa07a;
  --c-worlds: #9be7e1;
  --c-other: #c9d1e3;

  --radius: 12px;
  --gutter: 16px;
  --measure: 68ch;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); }
h2 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--fg-muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: var(--gutter); }

/* Header and footer */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gutter);
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; }
.brand-mark circle { fill: var(--accent); stroke: none; }
.site-header nav { display: flex; gap: 6px; }
.site-header nav a {
  color: var(--fg-muted); text-decoration: none; padding: 6px 10px; border-radius: 8px;
}
.site-header nav a:hover { color: var(--fg); background: var(--bg-raised); }
.site-header nav a[aria-current="page"] { color: var(--fg); background: var(--bg-raised); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px var(--gutter);
  font-size: 0.92rem;
  color: var(--fg-muted);
}
.site-footer p { margin: 0 0 4px; }

/* Landing */
.hero { padding: clamp(40px, 8vw, 96px) var(--gutter) 24px; max-width: 60rem; margin: 0 auto; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin-bottom: 12px; }
.lede { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem); max-width: var(--measure); color: #d6dcea; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-weight: 600;
  background: var(--bg-raised);
}
.button:hover { border-color: var(--fg-muted); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.primary:hover { filter: brightness(1.05); }

.three-up {
  display: grid; gap: 16px; padding: 24px var(--gutter);
  max-width: 60rem; margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.three-up article { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.three-up p { margin: 0; color: var(--fg-muted); }

.promises, .status { padding: 24px var(--gutter); max-width: 60rem; margin: 0 auto; }
.promises ul { padding-left: 1.2em; max-width: var(--measure); }
.promises li { margin-bottom: 8px; }
.status p { max-width: var(--measure); color: var(--fg-muted); }

/* Charter page */
.prose { padding: 32px var(--gutter) 48px; max-width: 48rem; margin: 0 auto; }
.prose h2 { margin-top: 2em; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.notice {
  border-left: 4px solid var(--warn); background: var(--bg-raised);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg-muted);
}

/* Map layout */
.map-layout {
  display: grid; gap: var(--gutter); padding: var(--gutter);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .map-layout { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
}
.map {
  position: relative; width: 100%; aspect-ratio: 3 / 2;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: #6f7ea3;
}
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-bg .orbits { opacity: 0.35; }
.map-bg .sun { fill: var(--accent); }
.map-hint { margin-top: 10px; color: var(--fg-muted); font-size: 0.95rem; }
.map-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 8px 12px; background: var(--bg-raised); border-radius: 8px; color: var(--fg);
}
.map-status:empty { display: none; }

.pins { position: absolute; inset: 0; }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg);
  display: flex; align-items: center; gap: 8px;
  font: inherit; text-align: left;
}
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--pin-color, var(--c-other));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pin-color, var(--c-other)) 30%, transparent), 0 0 14px var(--pin-color, var(--c-other));
  flex: none;
}
.pin-label {
  font-size: 0.82rem; line-height: 1.2; padding: 3px 8px; border-radius: 6px;
  background: rgba(7, 10, 18, 0.85); border: 1px solid var(--line); white-space: nowrap;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.pin:hover .pin-dot, .pin:focus-visible .pin-dot { transform: scale(1.2); }
.pin[data-status="under_review"] .pin-dot { background: repeating-linear-gradient(45deg, var(--warn) 0 4px, #6b4a12 4px 8px); }
.pin[hidden] { display: none; }
.pin.dim { opacity: 0.25; }
@media (max-width: 640px) {
  .pin-label { display: none; }
  .pin-dot { width: 22px; height: 22px; }
}

/* Browse pane */
.list-pane { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.filters input[type="search"] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-sunken); color: var(--fg); font: inherit;
}
.chips { border: 0; padding: 0; margin: 12px 0 0; }
.chips div { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 0.85rem; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  background: var(--bg-sunken); color: var(--fg-muted); border: 1px solid var(--line);
}
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.results { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.result {
  width: 100%; text-align: left; font: inherit; color: var(--fg); cursor: pointer;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start;
}
.result:hover { border-color: var(--fg-muted); }
.result .swatch { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--pin-color, var(--c-other)); }
.result .title { font-weight: 600; }
.result .meta { color: var(--fg-muted); font-size: 0.88rem; }

/* Badges */
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-muted);
  vertical-align: middle;
}
.badge.review { color: var(--accent-ink); background: var(--warn); border-color: var(--warn); }
.badge.rating { text-transform: capitalize; }

/* Detail card (dialog) */
.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0;
  background: var(--bg-raised); color: var(--fg);
  width: min(92vw, 640px); max-height: 90dvh;
}
.card::backdrop { background: rgba(3, 5, 10, 0.7); }
.card-close-form { position: absolute; right: 8px; top: 8px; margin: 0; }
.card-close {
  font: inherit; font-size: 1.4rem; line-height: 1; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-sunken); color: var(--fg); border: 1px solid var(--line); cursor: pointer;
}
.card-body { padding: 24px; }
.card-body h2 { padding-right: 44px; margin-bottom: 4px; }
.card-kicker { color: var(--fg-muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-section { margin-top: 18px; }
.card-section h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); margin-bottom: 8px; }
.labels { display: grid; grid-template-columns: 1fr; gap: 6px 16px; margin: 0; }
@media (min-width: 520px) { .labels { grid-template-columns: 1fr 1fr; } }
.labels div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.labels dt { color: var(--fg-muted); }
.labels dd { margin: 0; text-align: right; }
.yes { color: var(--warn); }
.no { color: var(--ok); }
.prov { margin: 0; }
.prov div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.prov dt { color: var(--fg-muted); }
.prov dd { margin: 0; overflow-wrap: anywhere; }
.card-footer {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
}
.card-footer .launch-note { color: var(--fg-muted); font-size: 0.9rem; margin: 0; flex: 1 1 240px; }
.launch { font-size: 1.05rem; }

@media (prefers-reduced-motion: no-preference) {
  .pin-dot { transition: transform 120ms ease; }
}
