/* Tranquility Base — shared site stylesheet.
   Palette + typography lifted from the game repo's own doc theme
   (claude-spacegame/tools/render_docs.py): the dark panel colors come
   from the client's Clay UI, and the accent colors are the seven crew
   role colors from scripts/roles.lua. Used by both the landing page
   (public/index.html) and the generated Player Guide page
   (public/guide/index.html, built by tools/render_guide.py) so the two
   stay visually identical without duplicating this file. */

:root {
  --bg:         #101018;
  --panel:      #1b1b28;
  --panel-alt:  #232333;
  --border:     #4a4a64;
  --border-hi:  #7c7ca8;
  --text:       #d8d8e6;
  --text-dim:   #9a9ab2;
  --text-bright:#f4f4fb;

  /* Crew-role colors, scripts/roles.lua */
  --medical:     #2870dc;  /* Medical    (40,110,220) */
  --engineering: #d22828;  /* Engineering(210,40,40)  */
  --agriculture: #3caa3c;  /* Agriculture(60,170,60)  */
  --logistics:   #e6c828;  /* Logistics  (230,200,40) */
  --physics:     #963cbe;  /* Physics    (150,60,190) */
  --astronomy:   #e68228;  /* Astronomy  (230,130,40) */
  --soldier:     #141414;  /* Soldier    (20,20,20)   */

  --link:    var(--medical);
  --hl:      var(--logistics);
  --danger:  var(--engineering);
  --ok:      var(--agriculture);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 20px;
  line-height: 1.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
}

::selection { background: var(--hl); color: #14141c; }

img { image-rendering: pixelated; max-width: 100%; }

a { color: var(--link); text-decoration: underline dotted; }
a:hover { background: var(--link); color: var(--bg); text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Press Start 2P', monospace;
  color: var(--text-bright);
  line-height: 1.5;
  margin: 1.6em 0 0.7em;
}

/* ---------- Top nav (shared across every page) ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 32px;
  background: var(--panel);
  border-bottom: 4px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-bright);
}
.site-nav .brand:hover { background: none; color: var(--hl); }

.site-nav .brand-mark {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  flex: none;
}

.site-nav .brand-word {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  letter-spacing: 1px;
}

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav .nav-links a {
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
  padding: 6px 10px;
  border: 2px solid transparent;
}
.site-nav .nav-links a:hover {
  background: var(--panel-alt);
  color: var(--text-bright);
  border-color: var(--border-hi);
}
.site-nav .nav-links a.current {
  border-color: var(--hl);
  color: var(--hl);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--text-bright);
  background: var(--panel-alt);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.45);
  padding: 14px 20px;
  cursor: pointer;
}
.btn:hover {
  background: var(--medical);
  color: var(--bg);
  border-color: var(--medical);
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.45);
}
.btn-primary { border-color: var(--medical); }
.btn-primary:hover { background: var(--medical); }

.btn-ghost { background: transparent; }

.btn-disabled,
.btn-disabled:hover {
  background: var(--panel);
  color: var(--text-dim);
  border-color: var(--border);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.45);
  cursor: default;
  transform: none;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.btn-note {
  display: block;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ---------- Page content (guide + prose sections) ---------- */

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 56px 32px 90px;
  max-width: 760px;
  margin: 0 auto;
}

.page-title { border-bottom: 4px solid var(--medical); padding-bottom: 12px; }

h1 { font-size: 24px; border-bottom: 4px solid var(--medical); padding-bottom: 12px; }
h2 { font-size: 18px; border-left: 6px solid var(--astronomy); padding-left: 12px; }
h3 { font-size: 15px; border-left: 6px solid var(--physics); padding-left: 12px; }
h4, h5, h6 { font-size: 13px; border-left: 6px solid var(--agriculture); padding-left: 12px; }

p, ul, ol, table { margin: 0.8em 0; }

.page-meta {
  color: var(--text-dim);
  font-size: 16px;
  margin: -8px 0 28px;
}

code {
  font-family: 'VT323', monospace;
  font-size: 1.05em;
  background: var(--panel-alt);
  color: var(--hl);
  border: 1px solid var(--border);
  padding: 0 4px;
}

pre {
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 rgba(0,0,0,0.45);
  padding: 16px 18px;
  overflow-x: auto;
  position: relative;
}
pre code { background: none; border: none; padding: 0; color: var(--text); }

blockquote {
  border-left: 6px solid var(--hl);
  margin: 1em 0;
  padding: 2px 16px;
  color: var(--text-dim);
  background: var(--panel);
}

hr { border: none; border-top: 4px dashed var(--border); margin: 2em 0; }

table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
}
th, td {
  border: 2px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--astronomy);
  color: #14141c;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
}
tr:nth-child(even) td { background: var(--panel); }
tr:nth-child(odd) td { background: var(--panel-alt); }

.page-footer {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: 4px solid var(--border);
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------- Landing page sections ---------- */

.hero {
  padding: 72px 32px 56px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  border: none;
  font-size: 32px;
  margin: 0 0 14px;
}
.hero .tagline {
  font-size: 26px;
  color: var(--hl);
  margin: 0 0 24px;
}
.hero p.lede {
  max-width: 640px;
  margin: 0 auto 32px;
  font-size: 21px;
  color: var(--text);
}
.hero .btn-row { justify-content: center; }

.hero-shot {
  margin: 40px auto 0;
  max-width: 820px;
}
.hero-shot img {
  /* This is a real screenshot (with anti-aliased window chrome, not raw
     tile art), so it needs smooth scaling rather than the site-wide
     pixelated rendering used for actual game sprites. */
  image-rendering: auto;
  width: 100%;
  display: block;
  border: 3px solid var(--border);
  box-shadow: 8px 8px 0 rgba(0,0,0,0.45);
}
.hero-shot figcaption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-dim);
}

section.block {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px;
}

section.block.alt {
  background: var(--panel);
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
  max-width: none;
}
section.block.alt > .inner { max-width: 900px; margin: 0 auto; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-alt);
  border: 3px solid var(--border);
  padding: 12px 14px;
}

.role-swatch {
  width: 28px;
  height: 28px;
  flex: none;
  border: 2px solid var(--border-hi);
}

.role-name { font-size: 18px; color: var(--text-bright); }
.role-color { display: block; font-size: 14px; color: var(--text-dim); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.feature-card {
  background: var(--panel-alt);
  border: 3px solid var(--border);
  padding: 18px 20px;
}
.feature-card h3 {
  margin-top: 0;
  border-left: 6px solid var(--astronomy);
  padding-left: 10px;
  font-size: 14px;
}
.feature-card p { margin: 0.6em 0 0; font-size: 18px; color: var(--text-dim); }

.cta-band {
  text-align: center;
  padding: 56px 32px;
  border-top: 4px solid var(--border);
  border-bottom: 4px solid var(--border);
  background: var(--panel);
}
.cta-band h2 { border: none; margin-top: 0; }
.cta-band .btn-row { justify-content: center; margin-top: 20px; }

.site-footer {
  padding: 32px 32px 48px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}
.site-footer .btn-row { justify-content: center; margin-bottom: 20px; }

@media (max-width: 600px) {
  .hero { padding: 48px 20px 40px; }
  .hero h1 { font-size: 24px; }
  .hero .tagline { font-size: 20px; }
  section.block { padding: 32px 20px; }
}
