/* Homeworld design story — the one intentionally literary surface. Headings,
 * labels, and the shared nav use the Homeworld family from hw-tokens.css
 * (loaded first); the reading body stays in the serif (--hw-serif). */
:root {
  --ink: var(--hw-ink, #eaf0ff);
  --ink-2: var(--hw-ink-2, #c3cbe6);
  --dim: var(--hw-dim, #8e98bb);
  --blue: var(--hw-cyan-soft, #7ddfff);
  --gold: var(--hw-gold-soft, #f2c96d);
  --violet: var(--hw-violet, #a78bfa);
  --deep: var(--hw-bg, #070812);
  --panel: var(--hw-panel, rgba(16, 18, 34, .86));
  --line: var(--hw-line, rgba(120, 150, 230, .2));
  --line-strong: var(--hw-line-strong, rgba(120, 170, 255, .36));
  --mono: var(--hw-mono, ui-monospace, Consolas, monospace);
  --display: var(--hw-display, system-ui, sans-serif);
  --serif: var(--hw-serif, Georgia, serif);
  --micro: var(--hw-fs-micro, .68rem);
  --radius: var(--hw-radius, 12px);
  --radius-sm: var(--hw-radius-sm, 8px);
  --tap: var(--hw-tap, 44px);
  --focus: var(--hw-focus, 2px solid #fbbf24);
  --ease: var(--hw-ease, ease);
  --fast: var(--hw-dur-fast, .16s);
}
* { box-sizing: border-box; }
html { background: var(--deep); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 6%, rgba(89, 62, 151, .3), transparent 30rem),
    radial-gradient(circle at 12% 24%, rgba(30, 96, 156, .22), transparent 28rem),
    linear-gradient(145deg, var(--hw-bg-2, #0b0d1e), #111733 46%, var(--hw-bg, #070812));
  font: 1.05rem/1.75 var(--serif);
}
a { color: var(--blue); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible { outline: var(--focus); outline-offset: 3px; }
.shell { width: min(70rem, calc(100% - 2rem)); margin: 0 auto; }

/* ---- shared Homeworld nav (same markup on FTL, Dock, Defense, Story) ---- */
.topbar {
  display: flex; justify-content: space-between; gap: .6rem 1rem; align-items: center;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.topbar a { text-decoration: none; }
.brand { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--gold); font: 700 .78rem/1.2 var(--mono); letter-spacing: .16em; }
.hwNav { display: flex; flex-wrap: wrap; gap: .2rem; font: 600 var(--micro)/1 var(--mono); letter-spacing: var(--hw-track-label, .14em); }
.hwNav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .6rem; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--dim);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.hwNav a:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .03); }
.hwNav a[aria-current="page"] { color: var(--hw-cyan, #22d3ee); border-color: var(--hw-line-hot, rgba(34, 211, 238, .72)); background: rgba(34, 211, 238, .08); }

/* ---- hero ---- */
.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(2.5rem, 7vw, 5rem); max-width: 52rem; }
.eyebrow { color: var(--blue); font: 600 .75rem/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; }
h1 { margin: .8rem 0 1.2rem; color: #fff; font-size: var(--hw-fs-hero, clamp(2.4rem, 7vw, 5.2rem)); font-weight: 700; line-height: 1.02; letter-spacing: -.03em; overflow-wrap: break-word; }
h1 span { color: var(--violet); }
.dek { max-width: 44rem; color: var(--ink-2); font-size: clamp(1.15rem, 2.2vw, 1.45rem); }
.stamp { color: var(--dim); font: .75rem/1.6 var(--mono); letter-spacing: .08em; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---- reading layout ---- */
.intro-grid, .influence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.panel { min-width: 0; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .22), var(--hw-inner, inset 0 1px 0 rgba(255, 255, 255, .05)); }
.panel h2 { margin-top: 0; color: var(--gold); font-size: 1rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel h3 { color: var(--blue); font-size: .95rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.panel p:last-child { margin-bottom: 0; }
.ground-panel { border-color: rgba(242, 201, 109, .42); }
.ground-panel h3 { color: var(--gold); }
.ground-note { color: var(--dim); font-size: .95rem; }
.section { padding: 2rem 0; }
.section > h2 { color: var(--gold); font-size: var(--hw-fs-h2, 1.35rem); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.loop { margin: 1.5rem 0; padding: 1.3rem 1.5rem 1.3rem 3rem; border-left: 3px solid var(--violet); border-radius: 0 var(--radius) var(--radius) 0; background: rgba(15, 20, 42, .72); }
.loop li { padding: .25rem 0; }
.loop strong { color: var(--blue); font-family: var(--display); }
.influence-grid .panel { min-height: 13rem; }
.shape-grid .panel { min-height: 12rem; }
.footer { padding: 3rem 0 5rem; color: var(--dim); font-size: .95rem; }
.footer strong { color: var(--ink); }
@media (max-width: 700px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .intro-grid, .influence-grid, .shape-grid { grid-template-columns: minmax(0, 1fr); }
  .influence-grid .panel { min-height: 0; }
  .shape-grid .panel { min-height: 0; }
  .loop { padding: 1.1rem 1rem 1.1rem 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
