/* ==========================================================================
   Speedmaster Gonzales™ — Unified Theme
   Mission Control design DNA, shared across the whole public site.
   The public site is the museum; Mission Control is the back office —
   same world, same light. Dark lunar identity throughout.
   ========================================================================== */

:root {
  /* Mission Control tokens (source of truth) */
  --space: #04060c;
  --ink: #ece5d8;
  --muted: #b3a795;
  --quiet: #7e7568;
  --line: rgba(160, 180, 210, .14);
  --panel: rgba(10, 15, 26, .78);
  --panel-solid: #0a0f1a;
  --brass: #cda56f;
  --brass-soft: #e8cf9f;
  --orange: #e8641b;
  --amber: #ffb454;
  --red: #e0685c;
  --green: #6fd08c;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  /* Legacy aliases used by existing public-site stylesheets */
  --accent: #cda56f;
  --accent-soft: #e8cf9f;
  --bg: #04060c;
}

html { background: #04060c; }

/* --------------------------------------------------------------------------
   Top navigation — slim console bar on every public page
   -------------------------------------------------------------------------- */
.sg-topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 11px clamp(16px, 4vw, 40px);
  background: rgba(4, 6, 12, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sg-topnav .sg-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px; font-weight: 600; letter-spacing: .01em;
  color: var(--brass-soft); text-decoration: none; white-space: nowrap;
  text-shadow: 0 0 14px rgba(232, 207, 159, .35);
}
.sg-topnav .sg-brand:hover { color: #fff; }
.sg-topnav .sg-navlinks {
  display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto;
}
.sg-topnav .sg-navlinks a {
  color: var(--muted); text-decoration: none;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 2px; border-bottom: 1px solid transparent;
}
.sg-topnav .sg-navlinks a:hover { color: var(--brass-soft); border-bottom-color: var(--brass); }
@media (max-width: 760px) {
  /* Mobile header: brand + Circle key on one row, the section links in a
     single horizontally-scrollable row beneath — no more stacked tower. */
  .sg-topnav { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .sg-topnav .sg-brand { font-size: 17px; }
  .sg-topnav .sg-circle-key {
    margin-left: auto;
    font-size: 14px;
    padding: 6px 14px;
  }
  .sg-topnav .sg-navlinks {
    order: 3;
    flex: 1 1 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px 16px;
    padding: 2px 0 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sg-topnav .sg-navlinks::-webkit-scrollbar { display: none; }
  .sg-topnav .sg-navlinks a {
    flex: none;
    font-size: 10px; letter-spacing: .08em;
  }
}
/* The Circle key — not an eighth nav link but the door to the study:
   a distinct brass key, visually separated from the content tour. */
.sg-topnav .sg-circle-key {
  flex: none; margin-left: 4px; white-space: nowrap;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16px; font-weight: 600; letter-spacing: .05em;
  color: #1c0d03; text-decoration: none;
  background: linear-gradient(180deg, #e8cf9f 0%, #cda56f 55%, #a8824a 100%);
  border: 1px solid rgba(255, 232, 185, .65);
  padding: 7px 18px; border-radius: 999px;
  box-shadow: 0 0 16px rgba(205, 165, 111, .35), inset 0 1px 0 rgba(255,255,255,.5);
}
.sg-topnav .sg-circle-key:hover {
  color: #1c0d03;
  box-shadow: 0 0 26px rgba(205, 165, 111, .65), inset 0 1px 0 rgba(255,255,255,.5);
}

/* --------------------------------------------------------------------------
   Kicker / eyebrow — the section label voice
   -------------------------------------------------------------------------- */
.sg-eyebrow {
  color: var(--brass-soft);
  font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  text-shadow: 0 0 14px rgba(232, 207, 159, .35);
}
.sg-kicker {
  color: var(--quiet); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   Buttons — Apollo console keys
   -------------------------------------------------------------------------- */
.sg-btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink);
  background: linear-gradient(180deg, #1b2438 0%, #0e1524 55%, #080d18 100%);
  border: 1px solid rgba(160, 180, 210, .24);
  border-top-color: rgba(205, 225, 250, .38);
  padding: 11px 18px; border-radius: 9px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.65), 0 8px 18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.sg-btn::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--brass); box-shadow: 0 0 8px var(--brass);
}
.sg-btn:hover {
  border-color: var(--brass); transform: translateY(-1px); color: var(--brass-soft);
  box-shadow: 0 3px 0 rgba(0,0,0,.65), 0 10px 22px rgba(0,0,0,.5), 0 0 16px rgba(205,165,111,.35), inset 0 1px 0 rgba(255,255,255,.08);
}
.sg-btn:active { transform: translateY(2px); }
.sg-btn.solid {
  background: linear-gradient(180deg, #f07f2e 0%, #d55a12 60%, #b34a0e 100%);
  border-color: rgba(255, 170, 110, .55); border-top-color: rgba(255, 205, 160, .75);
  color: #1c0d03;
  box-shadow: 0 2px 0 rgba(0,0,0,.6), 0 8px 22px rgba(232, 100, 27, .45), inset 0 1px 0 rgba(255,255,255,.4);
}
.sg-btn.solid::before { background: #1c0d03; box-shadow: 0 0 8px rgba(28,13,3,.8); }
.sg-btn.solid:hover { border-color: #ffc890; color: #1c0d03;
  box-shadow: 0 3px 0 rgba(0,0,0,.6), 0 12px 28px rgba(232, 100, 27, .6), inset 0 1px 0 rgba(255,255,255,.45); }

/* --------------------------------------------------------------------------
   Cards — instrument panels
   -------------------------------------------------------------------------- */
.sg-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(8, 12, 22, .94));
  border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 32px rgba(0,0,0,.5);
}
.sg-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.sg-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* --------------------------------------------------------------------------
   Pills — status / taxonomy tags
   -------------------------------------------------------------------------- */
.sg-pill {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
  font-family: var(--mono); color: var(--brass-soft);
  border: 1px solid var(--brass); background: transparent;
}

/* --------------------------------------------------------------------------
   Tables — ledgers
   -------------------------------------------------------------------------- */
table.sg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sg-table th {
  text-align: left; color: var(--quiet); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; font-family: var(--mono);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.sg-table td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
table.sg-table tr:last-child td { border-bottom: none; }
table.sg-table td.num, table.sg-table th.num {
  font-family: var(--mono); font-weight: 600; color: var(--brass-soft);
  font-variant-numeric: tabular-nums; text-align: right;
}

/* --------------------------------------------------------------------------
   Footer — the sitemap deck
   -------------------------------------------------------------------------- */
.sg-footer {
  margin-top: 64px; padding: 44px clamp(20px, 5vw, 56px) 54px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 12, 22, .6), rgba(4, 6, 12, .95));
}
.sg-sitemap {
  display: grid; gap: 26px 32px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-width: 1160px; margin: 0 auto 30px;
}
.sg-sitemap h4 {
  margin: 0 0 12px; color: var(--brass-soft);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
}
.sg-sitemap a {
  display: block; color: var(--muted); text-decoration: none;
  font-size: 14px; padding: 4px 0; line-height: 1.5;
}
.sg-sitemap a:hover { color: var(--brass-soft); }
.sg-footer .sg-brandline {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px; font-weight: 600; color: var(--brass-soft);
  margin: 0 0 8px; text-align: center;
}
.sg-footer .sg-fine {
  color: var(--quiet); font-size: 12.5px; line-height: 1.7;
  max-width: 760px; margin: 0 auto 8px; text-align: center;
}
.sg-footer .sg-fine a { color: var(--muted); }
.sg-footer .sg-fine a:hover { color: var(--brass-soft); }
.sg-footer .sg-top { text-align: center; margin-top: 18px; }
.sg-footer .sg-top a {
  color: var(--quiet); text-decoration: none; font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
}
.sg-footer .sg-top a:hover { color: var(--brass-soft); }

@media (prefers-reduced-motion: reduce) {
  .sg-btn { transition: none; }
}

/* --------------------------------------------------------------------------
   Theme toggle — Study / Classic. One clear pill: moon dot for Study,
   lamp dot for Classic, sliding brass knob under the active room.
   Hidden on small screens where the header is already crowded.
   -------------------------------------------------------------------------- */
.sg-theme-toggle {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  padding: 3px;
  margin-left: 2px;
  cursor: pointer;
}
.sg-theme-toggle .sg-tt-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 11px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
  transition: color .25s ease;
}
.sg-theme-toggle .sg-tt-glyph {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.sg-theme-toggle .sg-tt-study .sg-tt-glyph {
  background: #c3d2ec;
  box-shadow: 0 0 8px rgba(195, 210, 236, .9);
}
.sg-theme-toggle .sg-tt-classic .sg-tt-glyph {
  background: var(--brass);
  box-shadow: 0 0 8px rgba(205, 165, 111, .9);
}
.sg-theme-toggle .sg-tt-knob {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--brass);
  box-shadow: 0 0 14px rgba(205, 165, 111, .45);
  transition: transform .3s cubic-bezier(.55, .1, .25, 1.15), background-color .25s ease;
}
.sg-theme-toggle[aria-checked="true"] .sg-tt-knob {
  transform: translateX(100%);
  background: var(--brass-soft);
}
.sg-theme-toggle .sg-tt-opt.is-active { color: #1c0d03; }
.sg-theme-toggle:hover { border-color: var(--brass); }
.sg-theme-toggle:focus-visible {
  outline: 2px solid var(--brass-soft);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .sg-theme-toggle { display: none; }
}

/* Seamless room change: the lights dim, the theme swaps mid-fade,
   the lights come back up. Driven by theme-switch.js; skipped for
   prefers-reduced-motion. */
body { transition: opacity .17s ease; }
html.sg-theme-fading body { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

/* --------------------------------------------------------------------------
   Existing footer chrome, translated into Mission Control's voice
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 3em;
  padding: 2.6em clamp(24px, 6vw, 58px) 3em;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-brand {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px; font-weight: 600; color: var(--brass-soft);
  text-shadow: 0 0 14px rgba(232, 207, 159, .35);
}
.site-footer p { margin: 0 0 8px; color: var(--quiet); font-size: 13.5px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brass-soft); }
.footer-nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 22px; margin: 0 0 20px;
}
.footer-nav a {
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   CTA band — homepage section teasers in the same voice
   -------------------------------------------------------------------------- */
.sg-band {
  text-align: center;
  padding: clamp(36px, 6vw, 64px) clamp(24px, 6vw, 58px);
  margin: 8px auto;
  max-width: 1160px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(205, 165, 111, .07), transparent 70%),
    transparent;
}
.sg-band h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(30px, 4.4vw, 46px); font-weight: 600; letter-spacing: -.02em;
  margin: 10px 0 12px; color: var(--ink);
}
.sg-band .sg-eyebrow { display: block; }
.sg-band-deck {
  color: var(--muted); font-size: 16.5px; line-height: 1.7;
  max-width: 620px; margin: 0 auto 22px;
}
