/* Emergent Life: content site design system.
   System font stack only: no external font/CDN request, fast on first load,
   works if the simulation backend (or any third party) is unreachable. */

:root {
  --bg: #0b0f10;
  --bg-raised: #12181a;
  --bg-card: #151d1f;
  --line: #253032;
  --text: #e8eeee;
  --text-dim: #a7b6b8;
  --text-faint: #74898b;
  --accent: #6fd6c4;
  --accent-strong: #9be8da;
  --west: #7fb6e8;
  --east: #e8a97f;
  --danger: #e88a7f;
  --max-width: 76rem;
  --radius: 10px;
  font-size: 17px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration-color: rgba(155, 232, 218, 0.4); }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

img, svg, canvas { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #05100e;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

header.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(11, 15, 16, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  margin-right: auto;
}
.brand:hover { color: var(--accent-strong); }

.site-header ul {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.site-header a { color: var(--text-dim); text-decoration: none; }
.site-header a[aria-current="page"], .site-header a:hover { color: var(--text); }

.nav-support {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.35rem 0.9rem !important;
  color: var(--accent-strong) !important;
}
.nav-support:hover { background: rgba(111, 214, 196, 0.12); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

main.wide { max-width: 96rem; }

/* The world is the primary content on /watch -- full viewport width, minimal
   padding, no competing max-width (Public Spectator Parity phase, mission §7). */
main.watch-main {
  max-width: none;
  padding: 0.75rem 0.75rem 3rem;
}
@media (min-width: 640px) {
  main.watch-main { padding: 1rem 1.25rem 3rem; }
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin-top: 2.4rem; }
h3 { font-size: 1.1rem; margin-top: 1.6rem; }
p { color: var(--text-dim); }
.lede { font-size: 1.15rem; color: var(--text); max-width: 42rem; }

.hero {
  padding: 2.5rem 0 1rem;
}

.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.6rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #05100e; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { border-color: var(--line); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-dim); }

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: baseline;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-variant-numeric: tabular-nums;
}
.status-strip .figure { font-size: 1.1rem; font-weight: 600; }
.status-strip .label { color: var(--text-faint); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.status-strip.is-unavailable { color: var(--text-faint); }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.1rem;
  margin-top: 1.6rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; }

.claim-fact { border-left: 3px solid var(--accent); padding-left: 0.9rem; }
.claim-qualified { border-left: 3px solid var(--west); padding-left: 0.9rem; }
.claim-unsupported { border-left: 3px solid var(--danger); padding-left: 0.9rem; }

table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
th, td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); font-size: 0.94rem; }
th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }

details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 0.7rem 0;
}
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 0.5rem; }

.island-west { color: var(--west); }
.island-east { color: var(--east); }

.support-note {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: 0.95rem;
  color: var(--text-dim);
}

footer.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}
footer.site-footer .wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.88rem;
}
footer.site-footer a { color: var(--text-faint); }
footer.site-footer nav ul { list-style: none; display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Mobile nav collapse (Final Staging Correctness phase, mobile audit): a
   CSS-only checkbox toggle -- no JS, so every content page keeps rendering
   fully with none (docs/DEPLOYMENT_ARCHITECTURE.md §2.5). Above 640px this is
   inert: the input/label are hidden and .site-header ul renders exactly as it
   always did. */
.nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-btn { display: none; }

@media (max-width: 640px) {
  main { padding: 1.6rem 1rem 3rem; }
  /* `wrap` (not `nowrap`) is required so the ul's `flex-basis: 100%` below
     actually forces it onto its own line once opened -- with `nowrap` the
     browser has nowhere to put that overflow but squeezed onto the same row
     as the brand/toggle, which is what the first version of this fix shipped
     with (caught by re-screenshotting the open state, not just the closed
     one). Harmless when the menu is closed: the ul is `display:none` then,
     so there is nothing left to wrap. */
  .site-header nav { gap: 0.8rem; flex-wrap: wrap; }

  .nav-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    flex: none;
  }
  .nav-toggle-btn:hover { border-color: var(--accent); }

  .site-header ul {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    /* Below the header row -- the header itself is a flex row (brand + toggle),
       and this list becomes its own full-width block once opened. */
    flex-basis: 100%;
    order: 3;
    border-top: 1px solid var(--line);
    margin-top: 0.6rem;
    padding-top: 0.4rem;
  }
  .site-header ul li { width: 100%; }
  .site-header ul a { display: block; padding: 0.6rem 0.1rem; }
  .nav-support { display: inline-block; margin: 0.3rem 0 0.2rem; }

  .nav-toggle-input:checked ~ ul { display: flex; }
}
