@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --void: #06070f;
  --void-2: #0b0d1e;
  --panel: rgba(14, 16, 32, 0.6);
  --panel-solid: #10122455;
  --star: #f2f4fb;
  --star-dim: #9aa0bf;
  --star-faint: #5c6188;
  --line: #23264a;

  /* per-planet accents, overridden per page via body[data-world] */
  --accent: #52e08a;
  --accent-deep: #1c6b45;
  --accent-soft: rgba(82, 224, 138, 0.14);

  --green: #52e08a;    --green-deep: #123a26;
  --purple: #b47bff;   --purple-deep: #2a1a4c;
  --blue: #4fd1ff;     --blue-deep: #10314a;

  --shadow: 0 14px 44px rgba(2, 3, 12, 0.55);
}

body[data-world="green"]  { --accent: var(--green);  --accent-deep: var(--green-deep);  --accent-soft: rgba(82,224,138,0.14); }
body[data-world="purple"] { --accent: var(--purple); --accent-deep: var(--purple-deep); --accent-soft: rgba(180,123,255,0.14); }
body[data-world="blue"]   { --accent: var(--blue);   --accent-deep: var(--blue-deep);   --accent-soft: rgba(79,209,255,0.14); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--star);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

canvas#field, canvas.planet-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at 50% -10%, var(--void-2) 0%, var(--void) 60%);
}

.site { position: relative; z-index: 1; }
a { color: inherit; }
::selection { background: var(--accent-soft); color: var(--star); }

/* ---------- Nav ---------- */
nav.topnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(6, 7, 15, 0.85), rgba(6, 7, 15, 0));
}

.brand {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 600;
  font-size: 19px;
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.brand .dot { color: var(--accent); font-size: 14px; }

.navlinks {
  display: flex; gap: clamp(14px, 3vw, 28px);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.navlinks a {
  text-decoration: none; color: var(--star-dim);
  padding-bottom: 3px; border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.navlinks a:hover, .navlinks a.active { color: var(--star); border-color: var(--accent); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
h1, h2, h3 { font-family: 'Baloo 2', sans-serif; font-weight: 600; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(36px, 6vw, 62px); line-height: 1.08; }
h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.3; }
p.lede { font-size: 16.5px; line-height: 1.7; color: var(--star-dim); max-width: 56ch; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
section { padding: clamp(48px, 8vw, 110px) 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase;
  text-decoration: none; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--star); background: var(--panel-solid);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #06070f; border-color: var(--accent); font-weight: 500; }

/* ---------- Home: galaxy portals ---------- */
.hero-quiet {
  min-height: 88vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px;
}
.hero-quiet h1 { max-width: 16ch; }
.hero-quiet p.lede { margin: 18px auto 0; text-align: center; }
.scroll-hint {
  margin-top: 48px; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--star-faint);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint .arrow { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.portals {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.portal {
  text-decoration: none; display: block; padding: 26px 22px 22px;
  text-align: center; transition: transform 0.25s ease, border-color 0.25s ease;
}
.portal:hover { transform: translateY(-4px); }
.portal-stage { position: relative; margin-bottom: 6px; }
.portal canvas { width: 100%; height: 160px; display: block; }
.alien-mini { position: absolute; bottom: -6px; right: 2px; width: 46px; height: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); pointer-events: none; }
.portal .alien-mini { color: var(--accent-portal, var(--accent)); }
.portal .world-name { font-family: 'Baloo 2', sans-serif; font-weight: 600; font-size: 19px; }
.portal .role { font-size: 12.5px; color: var(--star-dim); margin-top: 4px; }
.portal .tag {
  display: inline-block; margin-top: 12px; font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-portal, var(--accent));
}
.portal.green { --accent-portal: var(--green); }
.portal.purple { --accent-portal: var(--purple); }
.portal.blue { --accent-portal: var(--blue); }
.portal.green:hover { border-color: var(--green); }
.portal.purple:hover { border-color: var(--purple); }
.portal.blue:hover { border-color: var(--blue); }

/* ---------- Planet hero ---------- */
.planet-hero {
  min-height: 92vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 20px 30px; position: relative;
}
.alien { width: 108px; height: auto; color: var(--accent); filter: drop-shadow(0 0 18px var(--accent-soft)); }
.speech {
  margin-top: 18px; max-width: 52ch; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 22px; font-size: 15px; color: var(--star-dim); box-shadow: var(--shadow);
}
.speech b { color: var(--star); font-weight: 600; }
.world-title { margin-top: 22px; }
.world-role { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-top: 10px; }

/* ---------- Outposts (scroll-revealed steps) ---------- */
.outposts { display: flex; flex-direction: column; gap: 20px; }
.outpost {
  padding: 26px 30px; display: flex; gap: 22px; align-items: flex-start;
  opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease;
}
.outpost.in { opacity: 1; transform: translateY(0); }
.outpost .num {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.outpost .step-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--star-faint); margin-bottom: 4px; }

/* ---------- Stat chips (used sparingly, not a wall) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel-solid);
}
.chip b { color: var(--accent); font-size: 14px; }

/* ---------- Status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.pill.sourced { color: #9aa1c4; background: rgba(154,161,196,0.14); }
.pill.sourced::before { background: #9aa1c4; }
.pill.drafted { color: #d9a354; background: rgba(217,163,84,0.16); }
.pill.drafted::before { background: #d9a354; }
.pill.sent { color: var(--accent); background: var(--accent-soft); }
.pill.sent::before { background: var(--accent); }
.pill.replied { color: #7fe8c9; background: rgba(127,232,201,0.16); }
.pill.replied::before { background: #7fe8c9; }

/* ---------- Table (tracker) ---------- */
.table-scroll { overflow-x: auto; }
table.catalog { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.catalog thead th {
  text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--star-faint); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.catalog tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.catalog tbody tr:last-child td { border-bottom: none; }
table.catalog .id { font-family: 'IBM Plex Mono', monospace; color: var(--star-faint); font-size: 12px; white-space: nowrap; }
table.catalog .contact { font-family: 'IBM Plex Mono', monospace; color: var(--star-dim); font-size: 12.5px; }
table.catalog td.mono { white-space: nowrap; }

/* ---------- Footer ---------- */
footer.sitefoot {
  padding: 40px clamp(20px, 5vw, 56px) 60px; color: var(--star-faint); font-size: 12.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
footer.sitefoot a { color: var(--star-faint); text-decoration: none; border-bottom: 1px dotted var(--star-faint); }
footer.sitefoot a:hover { color: var(--star-dim); }

@media (max-width: 760px) {
  .portals { grid-template-columns: 1fr; }
  .outpost { flex-direction: column; }
}
