
:root{--measure:68ch}
html[lang^="zh"],html[lang="ja"],html[lang="ko"]{--measure:42em}
.lede,main section > p,.route p,.faq-list p,.hero-card p,.stage-copy p{max-width:var(--measure)}
.nav-actions{display:flex;align-items:center;gap:10px}
.lang-fold ul{min-width:170px}
.ad-slot-wrap{margin:22px 0;max-width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}
.ad-label{font-family:Silkscreen,monospace;font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--ash);margin-bottom:6px}
.ad-slot{width:100%;max-width:728px;aspect-ratio:var(--ad-aspect-ratio,4 / 1);min-height:92px;border:1px solid rgba(228,197,106,.22);background:rgba(16,6,10,.68);display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px 14px}
.ad-placeholder{font-size:14px;color:var(--ash);opacity:.8}

/* Shipboard codex. Armor stripe, cream serif, condensed labels. */
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces/fraunces-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces/fraunces-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed/barlow-condensed-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #140810;
  --wine: #3c1830;
  --wine-deep: #481830;
  --navy: #183054;
  --stripe: #e44824;
  --edge: #e44824;
  --omni: #ff9d2e;
  --paragon: #7eb6ff;
  --codex: #e6d7c4;
  --synthesis: #8ea58a;
  --muted: #b4a89a;
  --hair: rgba(230, 215, 196, 0.22);
  --ink: #10080e;
  color-scheme: dark;
  --measure: 68ch;
}

html[lang^="zh"],
html[lang="ja"],
html[lang="ko"] {
  --measure: 42em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--void);
}

body {
  margin: 0;
  background: var(--void);
  color: var(--codex);
  font-family: Fraunces, "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Hiragino Mincho ProN", serif;
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

body[data-scope="andromeda"] {
  --edge: #7eb6ff;
  --stripe: #7eb6ff;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: var(--edge);
  pointer-events: none;
  z-index: 5;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

img {
  object-fit: cover;
}

a {
  color: var(--paragon);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--codex);
}

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

[hidden] {
  display: none !important;
}

p,
li,
a,
button,
label,
summary,
figcaption {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  overflow-wrap: normal;
  word-break: normal;
}

td,
th {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.12;
}

h1 {
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

h2 {
  font-size: clamp(26px, 3vw, 36px);
  margin: 40px 0 12px;
}

h3 {
  font-family: Fraunces, serif;
  font-size: 22px;
  margin: 0 0 4px;
}

p {
  margin: 0 0 14px;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 72px 36px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--omni);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 40;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.mast-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--codex);
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-kicker,
.kicker,
.row-kicker,
.phase-k,
legend,
.finder span,
.field > span,
caption,
.nav-toggle,
.lang-fold summary,
.primary-nav a,
.index a,
.ad-label {
  font-family: "Barlow Condensed", "Arial Narrow", "Noto Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-kicker {
  display: block;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.brand-name {
  display: block;
  font-family: Fraunces, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--codex);
  border: 1px solid var(--stripe);
  font-size: 16px;
  padding: 8px 12px;
  cursor: pointer;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  padding: 14px 0 0;
  margin: 0;
}

.primary-nav a {
  color: var(--codex);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.2;
}

.primary-nav a[aria-current="page"] {
  color: var(--stripe);
  box-shadow: inset 0 -2px 0 var(--stripe);
}

.lang-fold {
  position: relative;
}

.lang-fold summary {
  font-size: 16px;
  color: var(--codex);
  cursor: pointer;
  list-style: none;
  padding: 8px 0;
}

.lang-fold summary::-webkit-details-marker {
  display: none;
}

.lang-fold ul {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 170px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #241428;
  border: 1px solid var(--hair);
  z-index: 30;
}

.lang-fold a {
  display: block;
  padding: 6px 14px;
  color: var(--codex);
  text-decoration: none;
  font-size: 16px;
  font-family: Fraunces, serif;
  letter-spacing: 0;
  text-transform: none;
}

.lang-fold a[aria-current="page"] {
  color: var(--omni);
}

.crumb {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 16px;
}

.crumb a {
  color: var(--muted);
}

.hero {
  display: flex;
  flex-direction: column;
  margin: 4px 0 28px;
}

.hero-art {
  width: 100%;
  height: 52vh;
  min-height: 420px;
  max-height: 620px;
  object-fit: cover;
  object-position: 28% center;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px 36px;
  align-items: end;
  background: transparent;
  padding: 22px 0 0;
}

.hero-copy .deck,
.hero-copy .tool-result p {
  max-width: none;
}

.cover {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 8px 0 28px;
}

.cover > * {
  min-width: 0;
}

.deck {
  font-size: 20px;
  line-height: 1.45;
  max-width: 62ch;
  margin-bottom: 16px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--stripe);
  font-size: 16px;
}

.status-line {
  border-left: 2px solid var(--stripe);
  margin: 16px 0;
  padding-left: 12px;
  color: var(--muted);
  font-size: 16px;
  max-width: var(--measure);
}

.still,
.plate {
  margin: 0;
}

.still {
  position: relative;
  background: #000;
  overflow: hidden;
}

.still img {
  display: block;
  width: 100%;
  height: 440px;
  min-height: 440px;
  object-fit: cover;
  object-position: center 30%;
}

.chapter {
  margin: 0 0 18px;
  overflow: hidden;
}

.chapter img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center 62%;
}

.still::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: var(--edge);
}

.still figcaption,
.plate figcaption {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 8px;
}

.plate {
  margin: 28px 0;
  overflow: hidden;
}

.plate img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center 70%;
}

.helius-plate {
  min-height: 200px;
  background: #12243c;
  color: var(--codex);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  border-bottom: 8px solid var(--paragon);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 28px;
}

.helius-plate span:last-child {
  color: var(--paragon);
  font-size: 16px;
  letter-spacing: 0.18em;
}

.slash {
  width: 72px;
  height: 8px;
  background: var(--edge);
  transform: skewX(-24deg);
  transform-origin: left center;
  margin: 8px 0 18px;
}

.lede,
main section > p,
.route p,
.faq p {
  max-width: var(--measure);
  font-size: 18px;
}

.tool {
  margin: 8px 0 28px;
  padding-top: 8px;
}

.tool form,
.finder {
  margin: 0;
}

.assign {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field > span,
.finder span,
legend {
  font-size: 16px;
  color: var(--muted);
}

fieldset {
  border: 0;
  margin: 16px 0 0;
  padding: 0;
  min-width: 0;
}

.upgrade-row,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.upgrade-row label,
.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  min-width: 0;
}

input,
select,
textarea {
  font-family: Fraunces, "Iowan Old Style", Palatino, serif;
  font-size: 16px;
}

input[type="search"],
select {
  color: var(--codex);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--stripe);
  border-radius: 0;
  padding: 8px 2px;
  width: 100%;
  max-width: 100%;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--omni);
  flex: 0 0 auto;
}

.finder {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 8px 0;
}

.finder label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 240px;
  min-width: 0;
}

button,
.tool-reset {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: transparent;
  color: var(--codex);
  border: 1px solid var(--stripe);
  padding: 8px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--wine);
}

.finder-status {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
}

.tool-result {
  position: relative;
  overflow: hidden;
  margin: 16px 0 0;
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--omni);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.5;
  min-height: 4.5em;
}

.tool-result p {
  margin: 0 0 8px;
  max-width: 78ch;
  font-size: 16px;
}

.tool-result::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--omni);
  animation: codex-scan 3.4s linear infinite;
  pointer-events: none;
}

@keyframes codex-scan {
  from { top: 0; }
  to { top: 100%; }
}

.end-dots {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0;
  margin: 4px 0 10px;
}

.end-dots li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.wiki-empty {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0 4px;
}

.wiki-empty img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wiki-empty p {
  margin: 0;
}

.ledger {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.ledger li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  min-width: 0;
}

.ledger.plain li {
  grid-template-columns: minmax(8.5rem, 0.35fr) minmax(0, 1fr);
}

.seal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--stripe);
  background: #12243c;
  display: grid;
  place-items: center;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.row-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.meta {
  display: block;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 6px;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 8px 0 20px;
}

table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 16px;
}

caption {
  text-align: left;
  font-size: 16px;
  color: var(--muted);
  padding: 0 0 8px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--hair);
  font-weight: 400;
}

thead th {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--stripe);
}

tbody th {
  font-family: Fraunces, serif;
  font-weight: 600;
}

tr.is-selected td:first-child,
tr.is-selected th:first-child {
  box-shadow: inset 3px 0 0 var(--omni);
}

.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 28px;
  margin: 12px 0 20px;
}

.route h3 {
  margin-bottom: 8px;
}

.phase {
  border-top: 1px solid var(--hair);
  padding-top: 8px;
  margin-top: 10px;
}

.phase-k {
  display: block;
  color: var(--stripe);
  font-size: 16px;
  margin-bottom: 4px;
}

.phase p {
  margin: 0;
  font-size: 16px;
}

.meters {
  display: grid;
  gap: 12px;
  margin: 8px 0 22px;
}

.meter {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.meter b {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 16px;
}

.tracks {
  display: flex;
  min-width: 0;
}

.tracks.split {
  gap: 10px;
}

.track {
  height: 10px;
  flex: 1 1 0;
  min-width: 0;
}

.track.paragon { background: var(--paragon); }
.track.renegade { background: var(--stripe); }
.track.skill {
  background: transparent;
  border-top: 2px solid var(--paragon);
  height: 0;
  margin-top: 4px;
}
.track.skill.renegade { border-top-color: var(--stripe); }

.meter em {
  grid-column: 2;
  font-style: normal;
  color: var(--muted);
  font-size: 16px;
}

.index {
  list-style: none;
  padding: 0;
  margin: 0;
}

.index li {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 8px 16px;
  border-top: 1px solid var(--hair);
  padding: 12px 0;
}

.index a {
  color: var(--codex);
  text-decoration: none;
  font-size: 18px;
}

.index span {
  color: var(--muted);
  font-size: 16px;
}

.faq {
  border-top: 1px solid var(--hair);
}

.faq summary {
  cursor: pointer;
  font-size: 18px;
  padding: 12px 0;
}

.faq p {
  margin: 0 0 14px;
}

.related p {
  font-size: 18px;
}

.fold {
  margin-top: 14px;
  border-top: 1px solid var(--hair);
}

.fold summary {
  cursor: pointer;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 0;
}

.choices-note {
  max-width: var(--measure);
}

.colophon {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 16px;
}

.colophon a {
  color: var(--codex);
}

dl {
  margin: 8px 0 16px;
}

dt {
  font-weight: 600;
  margin-top: 10px;
}

dd {
  margin: 0 0 8px;
  color: var(--muted);
  max-width: var(--measure);
}

ol.route-list {
  margin: 8px 0 16px;
  padding-left: 1.2em;
  max-width: var(--measure);
}

ol.route-list li {
  margin: 0 0 8px;
}

.tool-actions {
  margin: 14px 0 0;
}

.ad-label {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.ad-slot {
  border-color: rgba(228, 72, 36, 0.45);
  background: #1a1020;
}

.ad-placeholder {
  font-size: 16px;
  color: var(--muted);
  font-family: Fraunces, serif;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .primary-nav {
    display: none;
    width: 100%;
  }

  .primary-nav.is-open {
    display: block;
    padding-bottom: 8px;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 800px) {
  .hero-art {
    min-height: 220px;
    height: 220px;
    max-height: none;
  }

  .hero-copy {
    grid-template-columns: 1fr;
    padding: 16px 0 0;
  }

  .cover,
  .routes,
  .assign {
    grid-template-columns: 1fr;
  }

  .still img {
    min-height: 220px;
    height: 220px;
  }

  .plate img {
    height: 200px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 16px 16px 56px 22px;
  }

  .ledger.plain li,
  .index li,
  .meter {
    grid-template-columns: 1fr;
  }

  .meter em {
    grid-column: 1;
  }

  .brand-name {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-result::after {
    animation: none;
    top: 0;
  }
}
