/* Astra encyclopedia. The page background equals the render background of the
   ship art (#05070A), so ships sit on the page without frames. Colour comes
   from the six fleet liveries through --accent. */
:root {
  --void: #05070A;
  --hull: #0D1218;
  --plate: #18202A;
  --line: #27313D;
  --ink: #DCE5EC;
  --dim: #8F9CAB;
  --accent: #EAFBFF;
  --display: "Oswald", "DIN Condensed", "Arial Narrow", sans-serif;
  --text: "Golos Text", system-ui, sans-serif;
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); color-scheme: dark; }
body {
  margin: 0; background: var(--void); color: var(--ink);
  font: 400 17px/1.6 var(--text); -webkit-text-size-adjust: 100%;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--plate); padding: 8px 12px; z-index: 10; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.6em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 68ch; }
small { display: block; font: 400 0.82rem/1.35 var(--text); color: var(--dim); }
.tint { color: var(--accent); }
.small { color: var(--dim); font-size: 0.9rem; }
.intro { color: var(--dim); }

/* ---- frame */
.top, main, .foot { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px;
  padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.mark { font: 600 1.5rem/1 var(--display); text-decoration: none; letter-spacing: 0.02em; }
.mark span { font: 400 0.9rem var(--text); color: var(--dim); margin-left: 8px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-right: auto; }
.top nav a { text-decoration: none; color: var(--dim); padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.play {
  text-decoration: none; font: 500 1rem var(--display); letter-spacing: 0.03em;
  color: var(--void); background: var(--accent); padding: 8px 18px; border-radius: 2px;
}
.play:hover { filter: brightness(1.12); }
main > section, main > figure { margin: 0; padding: 44px 0 8px; }
.foot { margin-top: 72px; padding-top: 24px; padding-bottom: 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.9rem; }

/* ---- lead */
.lead { padding-top: 56px !important; }
.lead h1 + p, .lead .lead-sub + p, .lead .trait { margin-top: 18px; }
.lead p { font-size: 1.12rem; }
.lead-sub { font: 400 1.25rem var(--display); color: var(--dim); margin: 6px 0 0; }
.crumb { font-size: 0.9rem !important; color: var(--dim); margin-bottom: 10px; }
.trait { font-size: clamp(1.2rem, 2.4vw, 1.55rem) !important; line-height: 1.35; max-width: 34ch;
  border-left: 3px solid var(--accent); padding-left: 16px; }

/* ---- socket rings */
.rings { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; vertical-align: middle; }
.ring circle { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.ring .core { fill: var(--plate); stroke: var(--dim); stroke-width: 1; }

/* ---- class ladder (index) */
.ladder-note { color: var(--dim); font-size: 0.9rem; max-width: 78ch; }
.tier { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 30px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tier h2 { margin: 0; font-size: 1.15rem; color: var(--dim); font-weight: 400; }
.tier p { margin: 0; color: var(--dim); font-size: 0.9rem; }
.rung {
  display: grid; grid-template-columns: 210px minmax(120px, 1fr) 70px 250px 170px;
  align-items: center; gap: 20px; padding: 14px 0; text-decoration: none;
  border-bottom: 1px solid var(--hull);
}
.rung:hover { background: linear-gradient(90deg, var(--hull), transparent); }
.rung-name { font: 500 1.75rem/1.05 var(--display); }
.rung-bar { height: 10px; background: var(--hull); }
.rung-bar i { display: block; height: 100%; background: var(--ink); }
.rung:hover .rung-bar i { background: var(--accent); }
.rung-len { font: 400 1.15rem var(--display); text-align: right; }
.rung-hangar { color: var(--dim); font-size: 0.9rem; }

/* ---- grids of ships */
.grid { display: grid; gap: 28px 24px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.five { grid-template-columns: repeat(5, 1fr); }
.ship, .fleet { text-decoration: none; display: block; }
/* The renders are near-black but not exactly the page colour: fade their edges into the page. */
.ship img, .fleet img, .hero img, .matrix td img, .grid figure img {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.ship img, .fleet img { transition: transform 0.25s ease; }
.ship:hover img, .fleet:hover img { transform: scale(1.04); }
.ship h3, .fleet h3 { margin-top: 2px; padding-top: 10px; border-top: 2px solid var(--accent); }
.fleet h3 { color: var(--accent); font-size: 1.5rem; }
.ship p, .fleet p { color: var(--dim); font-size: 0.93rem; line-height: 1.45; margin: 6px 0 0; }
.ship.mini h3 { font-size: 1rem; color: var(--accent); }
.grid figure { margin: 0; }
.grid figcaption { color: var(--dim); font-size: 0.93rem; line-height: 1.45; padding-top: 8px; border-top: 2px solid var(--accent); }
.grid figcaption strong { color: var(--ink); font-weight: 500; }
.sizes h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sizes p { color: var(--dim); font-size: 0.95rem; }

/* ---- two-column text blocks */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 56px; }
.split h2 + p, .split p + h2 { margin-top: 0; }
.split p + h2 { margin-top: 28px; }
.facts { margin: 0 0 14px; }
.facts > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.facts dd .rings { margin-right: 12px; }
.plain { list-style: none; margin: 0 0 14px; padding: 0; }
.plain li { padding: 6px 0 6px 18px; position: relative; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 8px; height: 2px; background: var(--accent); }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 12px; }
.proscons h3 { font: 500 0.95rem var(--text); color: var(--dim); margin-bottom: 4px; }

/* ---- ship page */
.hero { padding-top: 12px !important; }
.hero img { width: 100%; }
.hero figcaption, .sheet figcaption { color: var(--dim); font-size: 0.9rem; margin-top: 8px; }
.sheet { margin: 0; }
.sheet img { width: 100%; border: 1px solid var(--line); }

/* ---- tables */
.scroll { overflow-x: auto; margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { text-align: left; vertical-align: middle; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
thead th { font: 500 0.9rem var(--text); color: var(--dim); }
tbody th { font: 500 1.3rem/1.1 var(--display); white-space: nowrap; }
tbody th a { text-decoration: none; }
tbody th a:hover { text-decoration: underline; }
.cell-note { display: block; color: var(--dim); font-size: 0.88rem; margin-top: 2px; }
.matrix { min-width: 900px; }
.matrix thead th { font: 500 1.1rem var(--display); }
.matrix thead a { text-decoration: none; }
.matrix td { padding: 4px 4px 4px 0; }
.matrix td a { display: block; }
.matrix td img { transition: transform 0.2s ease; }
.matrix td a:hover img { transform: scale(1.08); }

@media (max-width: 980px) {
  .rung { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .rung-bar { grid-column: 1 / -1; order: 3; }
  .rung-len { order: 2; }
  .rung-fit { order: 4; }
  .rung-hangar { order: 5; text-align: right; }
  .grid.four, .grid.five { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top, main, .foot { padding-left: 16px; padding-right: 16px; }
  .grid.three, .grid.four, .grid.five { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .facts > div { grid-template-columns: 130px 1fr; }
  .proscons { grid-template-columns: 1fr; gap: 8px; }
  .mark span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.facts dd .rings + span { display: inline-block; }
@media (max-width: 640px) { .facts dd .rings { display: flex; margin: 0 0 4px; } }
