:root {
  --bg: #0b0d14;
  --panel: #151925;
  --line: #2a3040;
  --text: #ece9e1;
  --muted: #a3a8b5;
  --accent: #f2b84b;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.15; margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Home: hero */
.hero {
  position: relative;
  min-height: min(72vh, 680px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 2%, rgba(11, 13, 20, 0.72) 42%, rgba(11, 13, 20, 0.05) 78%);
}

.hero-text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 120px 24px 32px;
}

.hero h1 {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34em;
  margin: 12px 0 20px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.latest {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: #17120a;
  font-weight: 600;
  text-decoration: none;
}

.latest:hover { background: #ffd07a; }

/* Shared page column */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* Home: progress */
.progress { margin-bottom: 56px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 24px;
}

.stats dt { color: var(--muted); font-size: 0.9rem; }

.stats dd {
  margin: 2px 0 0;
  font-size: clamp(1.1rem, 3.4vw, 1.9rem);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.track-fill {
  display: block;
  height: 100%;
  min-width: 6px;
  background: var(--accent);
}

.track-labels {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Home: waypoint cards */
#waypoints-heading { font-size: 1.5rem; margin-bottom: 20px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--accent); }

.card img { width: 100%; }

.card-body { padding: 14px 16px 16px; }

.card-number { margin: 0 0 2px; color: var(--muted); font-size: 0.85rem; }

.card h3 { font-size: 1.2rem; font-weight: 600; }

.card-ship { margin: 8px 0 10px; }

.class-change { color: var(--accent); font-size: 0.85rem; font-weight: 600; white-space: nowrap; margin-left: 4px; }

.card-data {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

/* Waypoint page */
.home { color: var(--muted); text-decoration: none; }

.home:hover { color: var(--text); }

.eyebrow { margin: 28px 0 2px; color: var(--accent); font-weight: 600; }

.waypoint h1 { font-size: clamp(2.2rem, 6vw, 3.75rem); font-weight: 600; letter-spacing: -0.01em; }

.caption { max-width: 40em; margin: 14px 0 0; font-size: 1.1rem; }

.waypoint-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
  margin-top: 28px;
}

.gallery figure { margin: 0 0 24px; }

.gallery img { width: 100%; border-radius: 6px; }

.gallery figcaption { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }

.facts {
  position: sticky;
  top: 24px;
  margin: 0;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.facts div { padding: 11px 0; border-bottom: 1px solid var(--line); }

.facts div:last-child { border-bottom: 0; }

.facts dt { color: var(--muted); font-size: 0.85rem; }

.facts dd { margin: 1px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.facts .glyph-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.facts .glyph-names,
.facts .glyph-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.pager a { color: var(--accent); font-weight: 600; text-decoration: none; }

.pager a:hover { text-decoration: underline; }

.footer {
  padding: 20px 24px 36px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer p { margin: 0; }

@media (max-width: 800px) {
  .waypoint-layout { grid-template-columns: minmax(0, 1fr); }
  .facts { position: static; }
  .hero { min-height: 62vh; }
}
