/* Ganymede components. Shared by every page -- the reason the case and the desk
   now look like one product instead of two files with similar palettes. */

/* ---- provenance badge --------------------------------------------------
   The load-bearing component. Every number on this site wears its epistemic
   status: what kind of evidence stands behind it. The shapes are as
   distinguishable as the colours, so the distinction survives greyscale. */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: var(--fs--2); font-weight: 500;
  letter-spacing: .02em; padding: 2px var(--s-2); border-radius: var(--r-1);
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }

.badge-measured   { background: var(--signal-quiet); color: var(--signal); }
.badge-measured::before { background: currentColor; }

.badge-backtested { border-color: var(--signal); color: var(--signal); }
.badge-backtested::before { border: 1.5px solid currentColor; }

.badge-simulated  { border-color: var(--predict); color: var(--predict); }
.badge-simulated::before { border: 1.5px solid currentColor; border-radius: 1px; transform: rotate(45deg); }

.badge-seeded     { border: 1px dashed var(--line-strong); color: var(--faint); }
.badge-seeded::before { border: 1.5px dashed currentColor; }

.badge-pending    { border-color: var(--line-strong); color: var(--faint); background: transparent; }
.badge-pending::before { box-shadow: inset 0 0 0 1.5px currentColor; opacity: .55; }

/* ---- figure / stat ----------------------------------------------------- */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.stat b {
  font-family: var(--font-mono); font-size: var(--fs-4); font-weight: 500;
  letter-spacing: var(--tracking-tight); line-height: 1;
}
.stat .cap { font-size: var(--fs--1); color: var(--muted); line-height: var(--lh-snug); }
.stat.predict b { color: var(--predict); }
.stat.signal  b { color: var(--signal); }
.stat.kept    b { color: var(--kept); }

/* ---- card -------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: var(--s-6);
}
.card-quiet { background: var(--surface-2); }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: var(--fs--1); font-weight: 500; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { border-color: var(--line-strong); }
.btn-primary { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
.btn-primary:hover { background: var(--signal-strong); border-color: var(--signal-strong); }
.btn-danger { background: transparent; border-color: var(--broken); color: var(--broken); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- segmented control (experiment arm, depth switcher, speed) ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.seg button {
  background: transparent; color: var(--muted); border: 0;
  padding: var(--s-2) var(--s-3); font-size: var(--fs--1); font-weight: 500;
  transition: background var(--dur-fast) var(--ease-out);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--signal-quiet); color: var(--signal); }

/* ---- glossary term ----------------------------------------------------- */
.term {
  border-bottom: 1px dashed var(--line-strong); cursor: help;
  text-decoration: none; color: inherit;
}
.term:hover, .term:focus-visible { border-bottom-color: var(--signal); color: var(--signal); }

.tip {
  position: absolute; z-index: 60; max-width: 300px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-2);
  box-shadow: var(--shadow-3); padding: var(--s-3) var(--s-4);
  font-size: var(--fs--1); line-height: var(--lh-snug);
}
.tip .t { font-weight: 600; display: block; margin-bottom: 2px; }

/* ---- tables ------------------------------------------------------------ */
table { border-collapse: collapse; width: 100%; font-size: var(--fs--1); }
th, td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: var(--fs--2); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--faint); font-weight: 600;
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---- callout ----------------------------------------------------------- */
.callout {
  border-left: 2px solid var(--signal); background: var(--surface);
  border-radius: 0 var(--r-3) var(--r-3) 0; padding: var(--s-4) var(--s-5);
  margin: var(--s-6) 0;
}
.callout-kept   { border-left-color: var(--kept); }
.callout-warn   { border-left-color: var(--predict); }

/* ---- site chrome ------------------------------------------------------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-3) var(--s-6);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) { .topnav { background: var(--ground); } }

.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.brand svg { width: 20px; height: 20px; flex: none; }
.brand small { color: var(--faint); font-weight: 500; letter-spacing: .03em; }

.navlinks { display: flex; gap: var(--s-1); }
.navlinks a {
  padding: var(--s-2) var(--s-3); border-radius: var(--r-2);
  font-size: var(--fs--1); font-weight: 500; color: var(--muted); text-decoration: none;
}
.navlinks a:hover { background: var(--surface-2); color: var(--text); }
.navlinks a[aria-current="page"] { color: var(--signal); background: var(--signal-quiet); }

.themebtn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--r-2); padding: var(--s-2); display: inline-flex;
}
.themebtn svg { width: 16px; height: 16px; }

.navtoggle { display: none; }

@media (max-width: 860px) {
  .navlinks { display: none; }
  .navtoggle { display: inline-flex; }
  .topnav.open .navlinks {
    display: flex; position: absolute; inset: 100% 0 auto; flex-direction: column;
    background: var(--ground); border-bottom: 1px solid var(--line);
    padding: var(--s-3); box-shadow: var(--shadow-2); gap: 2px;
  }
  .topnav.open .navlinks a { padding: var(--s-3) var(--s-4); font-size: var(--fs-0); }
}

/* ---- depth switcher ----------------------------------------------------
   One control, three densities. Detail tiers are additive: depth 2 shows only
   [data-tier="1"]; depth 3 shows everything. */
:root[data-depth="1"] [data-tier="2"],
:root[data-depth="1"] [data-tier="3"],
:root[data-depth="2"] [data-tier="3"] { display: none; }

footer.site {
  margin-top: var(--s-12); padding: var(--s-8) var(--s-6);
  border-top: 1px solid var(--line-strong); color: var(--faint); font-size: var(--fs--1);
}

/* ---- footer ------------------------------------------------------------ */
.footwrap {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-6);
  align-items: start;
}
@media (max-width: 860px) { .footwrap { grid-template-columns: 1fr; gap: var(--s-5); } }
.footbrand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--signal); font-weight: 600; }
.footbrand svg { width: 20px; height: 20px; }
.footbrand span { color: var(--text); }
.footnav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.footnav a { color: var(--muted); text-decoration: none; }
.footnav a:hover { color: var(--signal); }
.footmeta { display: flex; flex-direction: column; gap: 4px; text-align: right; }
@media (max-width: 860px) { .footmeta { text-align: left; } }
.footmeta a { color: var(--muted); text-decoration: none; }
.footmeta a:hover { color: var(--signal); }

/* ---- the moon ---------------------------------------------------------- */
.ganymede { filter: drop-shadow(0 18px 44px rgb(0 0 0 / .28)); }
.phasestrip { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.phasestrip span { display: block; flex: none; opacity: .9; }

/* A quiet field of signal behind a hero. Sized in the page, not here.
   It clips itself: the glow overhangs its box, and without this it silently
   widens the page's scroll area by a few pixels on narrow screens. */
.aura { position: relative; isolation: isolate; overflow: clip; }
@supports not (overflow: clip) { .aura { overflow: hidden; } }
.aura::before {
  content: ""; position: absolute; z-index: -1; inset: -20% -10% auto auto;
  width: min(760px, 70vw); aspect-ratio: 1;
  background: radial-gradient(circle, var(--signal-quiet) 0%, transparent 68%);
  opacity: .5; pointer-events: none;
}
