/* skycruncher.io shared style for site-owned pages (the Front door, hubs, About, Privacy, Download, Docs, Notes,
   Results). Dark only on screen, with a light print stylesheet at the end. Self-hosted fonts come from
   /assets/fonts/fonts.css; nothing here loads from another site. The shared bar and footer are injected by the
   Worker with their own isolated styles, so pages carry no header or footer of their own. */

:root {
  color-scheme: dark;
  --bg: #0b0e15;
  --surface: #10141d;
  --surface-2: #151b27;
  --border: #232b3d;
  --hairline: rgba(255, 255, 255, 0.08);
  --text: #dbe1ea;
  --muted: #98a1b3;
  --faint: #626c80;
  --accent: #6aa6f8;
  --amber: #f0b23e;
  --ok: #3ddc97;
  --violet: #b48cf2;
  --map-bg: #070a10;
  --sans: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
  --wide: 1200px;
  --narrow: 720px;
  --gutter: 16px;
  --radius: 12px;
  --spectrum: linear-gradient(90deg, #7c5cff, #60a5fa, #4fd1c5, #9ae6b4, #f6e05e, #f08c5a, #e05656);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
code, kbd, samp { font-family: var(--mono); font-size: 0.92em; }
strong, b { font-weight: 600; }
.num, td.num, .stat b { font-family: var(--mono); font-variant-numeric: tabular-nums; }

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
p + p { margin-top: 1em; }

/* ---------------------------------------------------------------- page shell */
.page { max-width: var(--wide); margin: 0 auto; padding: 48px var(--gutter) 80px; }
.page.narrow { max-width: var(--narrow); }
@media (min-width: 640px) { .page { padding-left: 24px; padding-right: 24px; } }
.section { margin-top: 56px; }
.section > h2 + * { margin-top: 16px; }
.section > p, .section > ul, .section > ol, .section > dl { margin-top: 12px; }
.lead { margin-top: 16px; color: var(--muted); font-size: 1.125rem; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.rule { height: 2px; background: var(--spectrum); opacity: 0.7; border: 0; }
.rule.top { margin-bottom: 0; }
.rule.bottom { margin-top: 64px; }

/* ---------------------------------------------------------------- eyebrow */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow + h1, .eyebrow + h2 { margin-top: 12px; }

/* ---------------------------------------------------------------- breadcrumb (Learn Notes) */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 24px 0 8px; }
.hero h1 { max-width: 20ch; }
.hero .lead { font-size: 1.2rem; }

/* ---------------------------------------------------------------- card grid: whole card is the link */
.cards { display: grid; gap: 16px; margin-top: 20px; grid-template-columns: minmax(0, 1fr); list-style: none; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.page.narrow .cards { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .page.narrow .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  min-height: 44px;
}
a.card:hover, a.card:focus-visible { border-color: var(--accent); text-decoration: none; }
.card .eyebrow { color: var(--faint); }
.card h3 { color: var(--text); }
a.card h3::after { content: "\00a0\2192"; color: var(--accent); }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .stamp { margin-top: auto; padding-top: 8px; }

/* ---------------------------------------------------------------- evidence marker chips (word always shown) */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 0.1em;
  text-decoration: none;
}
a.chip:hover { text-decoration: none; filter: brightness(1.15); }
.chip.measured { color: var(--ok); background: rgba(61, 220, 151, 0.12); border-style: solid; }
.chip.tested { color: var(--ok); border-style: dashed; }
.chip.implemented { color: var(--accent); background: rgba(106, 166, 248, 0.10); border-style: solid; }
.chip.published { color: var(--accent); border-style: solid; background: none; }
.chip.prototyped { color: var(--faint); border-style: dashed; }
.chip.planned { color: var(--faint); border-style: dotted; }
.chip.stated { color: var(--muted); border-style: solid; }
.chip.inferred { color: var(--amber); border-style: dotted; }
.chip.illustrative { color: var(--violet); border-style: dashed; }

/* ---------------------------------------------------------------- quiet evidence marks (developer, 2026-10-21)
   The site-owned science pages mark a passage with a thin line beside it (data-ev="<kind>", written by
   tools/evidence/quiet_marks.mjs) and color the numbers of a marked sentence (span.ev-n). "stated" draws nothing.
   The word stays for screen readers (.sr-only) and in each colored number's title. The chips above remain for
   Producer pages that still use them. */
[data-ev="measured"], [data-ev="tested"], .ev-measured, .ev-tested { --ev: var(--ok); }
[data-ev="implemented"], [data-ev="published"], .ev-implemented, .ev-published { --ev: var(--accent); }
[data-ev="prototyped"], [data-ev="planned"], .ev-prototyped, .ev-planned { --ev: var(--faint); }
[data-ev="inferred"], .ev-inferred { --ev: var(--amber); }
[data-ev="illustrative"], .ev-illustrative { --ev: var(--violet); }
[data-ev] { position: relative; }
[data-ev]::after { content: ""; position: absolute; top: 0.3em; bottom: 0.3em; left: -12px; border-left: 2px solid var(--ev); pointer-events: none; }
li[data-ev]::after { left: calc(-1.4em - 8px); }
td[data-ev]::after, th[data-ev]::after { left: 0; }
[data-ev="planned"]::after { border-left-style: dashed; }
.ev-n { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; color: var(--ev); white-space: nowrap; }
.ev-sw { display: inline-block; height: 0.95em; border-left: 2px solid var(--ev); margin: 0 6px 0 2px; vertical-align: -0.12em; }
.ev-sw.ev-planned { border-left-style: dashed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- stat strip */
.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; color: var(--muted); font-size: 0.95rem; }
.stat b { color: var(--text); font-weight: 600; font-size: 1.125rem; margin-right: 6px; }

/* ---------------------------------------------------------------- legend (definition list of markers or map marks) */
.legend { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin-top: 16px; align-items: baseline; }
.legend dt { white-space: nowrap; }
.legend dd { color: var(--muted); }
@media (max-width: 420px) { .legend { grid-template-columns: minmax(0, 1fr); gap: 2px; } .legend dd { margin-bottom: 10px; } }

/* ---------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* ---------------------------------------------------------------- link list */
.links { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.links li { padding-left: 0; }
.links a { display: inline-block; min-height: 44px; padding: 10px 0; }
.links .muted { display: block; margin-top: -8px; padding-bottom: 4px; font-size: 0.925rem; }

/* ---------------------------------------------------------------- CTA band */
.cta-band {
  margin-top: 56px;
  padding: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
}
.cta-band p { color: var(--muted); max-width: 52ch; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { background: #8dbcfa; border-color: #8dbcfa; color: var(--bg); }

/* ---------------------------------------------------------------- prose (Notes, About, Privacy) */
.prose { font-size: 17px; line-height: 1.7; max-width: 68ch; }
.prose h2 { margin-top: 48px; }
.prose h3 { margin-top: 32px; }
.prose p, .prose ul, .prose ol, .prose dl, .prose table, .prose figure, .prose .callout { margin-top: 16px; }
.prose h2 + p, .prose h3 + p { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose a { text-decoration: underline; text-decoration-color: rgba(106, 166, 248, 0.45); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose a.chip { text-decoration: none; }

/* ---------------------------------------------------------------- callout */
.callout {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
}
.callout.warn { border-left-color: var(--amber); }
.callout > * + * { margin-top: 8px; }

/* ---------------------------------------------------------------- figure */
figure { margin: 24px 0 0; }
figure img, figure svg { display: block; border-radius: 8px; border: 1px solid var(--border); background: var(--map-bg); }
figcaption { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------- "last updated" stamp */
.stamp { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.02em; }
.stamp time { color: var(--muted); }

/* ---------------------------------------------------------------- steps list */
.steps { list-style: none; counter-reset: step; margin-top: 20px; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; min-height: 32px; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  color: var(--amber); border: 1px solid var(--amber);
}
.steps > li h3 { line-height: 32px; }

/* ---------------------------------------------------------------- sky map panel and marks */
.skymap { background: var(--map-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skymap .grid { stroke: var(--hairline); fill: none; }
.skymap .galactic { stroke: var(--violet); stroke-opacity: 0.35; stroke-dasharray: 6 4; fill: none; }
.skymap .ecliptic { stroke: var(--amber); stroke-opacity: 0.35; stroke-dasharray: 2 4; fill: none; }
.mark-captured { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.mark-processed { fill: var(--accent); }
.mark-published { fill: var(--amber); }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  a, .card, .btn { transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print: light */
@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff; --surface: #ffffff; --surface-2: #ffffff; --border: #c9ced8; --hairline: #e3e6ec;
    --text: #111111; --muted: #444b57; --faint: #666e7c; --accent: #1d4fa3; --amber: #8a5a00; --ok: #11744a;
    --violet: #5b3a9e; --map-bg: #ffffff;
  }
  body { font-size: 11pt; }
  .page { padding: 0; max-width: none; }
  .rule, .cta-band .btn { display: none; }
  a.card, .card { break-inside: avoid; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: var(--muted); }
  .prose a.chip::after { content: none; }
}
