/*
 * CITY OF LEGENDS: base, header, footer, shared parts.
 *
 * NEON INK (docs/ART_BIBLE.md): hard edges, flat light, halftone in the
 * shadows, misregistered two-plate offsets. No blur, no glow, no soft
 * gradients pretending to be light. Panels are framed in caption paper and
 * lifted off the page with a hard ink offset, like a printed comic.
 *
 * COLOUR is the city at night: sodium-vapour orange for action, registry red
 * for the offset plate, lattice cyan for the machine, paper for type.
 *
 * Other files: cinema.css (hero, media, motion), pages.css (home, game,
 * world), lore.css (factions, legends, token). Mobile first throughout; the
 * min-width blocks are the wider layouts.
 *
 * FONTS are served from this site, not from a font CDN, so a page view sends
 * nothing to a third party. Latin subsets as Google Fonts cuts them, under the
 * SIL Open Font License (static/fonts/OFL-*.txt). Big Shoulders Display is one
 * variable file for every weight. The build fingerprints these urls
 * (src/asset-build.ts) and src/html.ts preloads the display face and the
 * regular body face.
 */

@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(/assets/big-shoulders-display.203dd8ba4a.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/barlow-semi-condensed-400.e7deb8e131.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/barlow-semi-condensed-400-italic.6010571d5f.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/barlow-semi-condensed-600.6850e108c9.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/barlow-semi-condensed-700.bc8aadf929.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/barlow-semi-condensed-800.e9c030e551.woff2) format("woff2");
}

:root {
  --ink: #000;
  --night: #0a1028;
  --night-2: #141c3d;
  --sodium: #ff8f1c;
  --registry: #e3123b;
  /* registry red for small text on black: --registry is 4.42:1 there, this is 5.04:1 */
  --registry-text: #f0234a;
  --lattice: #38e8ff;
  --paper: #d9d2bd;
  --text: #c9cfdf;
  --dim: #9aa3bd;
  --line: rgba(217, 210, 189, 0.22);

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;

  /* type scale for card headings and labels; card grids use these rather than their own sizes */
  --t-card-lg: 40px;
  --t-card: 32px;
  --t-card-sm: 26px;
  --t-label: 14px;
  --track-label: 0.16em;

  --pad: 16px;
  --max: 1200px;
  --head-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
  scroll-padding-top: calc(var(--head-h) + 12px);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--sodium);
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--lattice);
  outline-offset: 3px;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--pad);
  top: -80px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--sodium);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}
.skip:focus {
  top: 8px;
}

/* ── header ────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  border-bottom: 3px solid var(--paper);
}
.head-in {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--head-h);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  line-height: 0.85;
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--display);
}
.logo-sm {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--paper);
}
.logo-lg {
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 0.02em;
  color: var(--sodium);
  text-shadow: 2px 0 0 var(--registry);
}

.menu-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--ink);
  border: 3px solid var(--paper);
  color: var(--paper);
  cursor: pointer;
}
.menu-bars,
.menu-bars::before,
.menu-bars::after {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--paper);
}
.menu-bars {
  position: relative;
}
.menu-bars::before,
.menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-bars::before {
  top: -7px;
}
.menu-bars::after {
  top: 7px;
}
.is-open .menu-bars {
  background: transparent;
}
.is-open .menu-bars::before {
  top: 0;
  transform: rotate(45deg);
}
.is-open .menu-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* phone: the menu is a panel under the bar; with no script it simply stays open */
.head-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  display: none;
  flex-direction: column;
  gap: 16px;
  height: calc(100svh - var(--head-h));
  padding: 8px var(--pad) 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink);
  border-bottom: 3px solid var(--paper);
}
/* menu open on a phone: the page behind it does not scroll */
html.menu-open {
  overflow: hidden;
}
.is-open .head-menu {
  display: flex;
}
/* a header button that only repeats a menu link is left out of the phone menu */
@media (max-width: 959px) {
  .head-menu .head-cta-desk {
    display: none;
  }
}
html:not(.js) .head-menu {
  display: flex;
  position: static;
  height: auto;
  border-bottom: 0;
  padding: 0;
}
html:not(.js) .head-in {
  flex-wrap: wrap;
  padding-block: 8px;
}
html:not(.js) .menu-btn {
  display: none;
}

.head-nav {
  display: flex;
  flex-direction: column;
}
.head-nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 2px solid var(--night-2);
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
}
.head-nav a:hover,
.head-nav a.on {
  color: var(--sodium);
}

/* ── buttons ───────────────────────────────────────────────────────── */

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.btn {
  display: inline-block;
  padding: 12px 20px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 3px solid var(--paper);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}
.btn-go {
  background: var(--sodium);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--registry);
}
.btn:hover {
  transform: translate(-2px, -2px);
}
.btn-go:hover {
  box-shadow: 7px 7px 0 var(--registry);
}
.btn-alt:hover {
  border-color: var(--sodium);
  color: var(--sodium);
}
.btn-sm {
  padding: 9px 16px;
  font-size: 17px;
  box-shadow: 4px 4px 0 var(--registry);
}

/* ── type ──────────────────────────────────────────────────────────── */

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sodium);
}
.kicker::before {
  content: "";
  flex: none;
  width: 28px;
  height: 4px;
  background: var(--registry);
}
.kicker a {
  display: inline-block;
  padding: 12px 0;
  margin: -12px 0;
  color: inherit;
}

.sec-head {
  max-width: 46rem;
  margin: 0 0 36px;
}
.sec-head h2,
.feat-copy h2,
.teaser h2,
.disclaimer h2,
.doc-h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 6.4vw, 60px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--paper);
  text-wrap: balance;
}
.sec-lede {
  margin: 0;
  font-size: 19px;
  color: var(--text);
}

.more {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sodium);
  border-bottom: 3px solid var(--registry);
  padding: 10px 0 2px;
}
.more::after {
  content: " \2192";
}
.more:hover {
  color: var(--paper);
}

.fine {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--dim);
}

/* ── bands: full-width sections with a centred column ───────────────── */

.band {
  position: relative;
  padding: 56px 0;
  border-top: 3px solid var(--paper);
}
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.wrap-narrow {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.band-ink {
  background: var(--ink);
}
.band-night {
  background-color: var(--night);
  /* halftone: hard dots, not a gradient */
  background-image: radial-gradient(rgba(56, 232, 255, 0.09) 1.2px, transparent 1.6px);
  background-size: 9px 9px;
}
.band-paper {
  background: var(--paper);
  color: var(--ink);
}
.band-paper .sec-head h2,
.band-paper .kicker {
  color: var(--ink);
}
.band-paper .kicker::before {
  background: var(--registry);
}
.band-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 36px 0 0;
}

/* ── page hero (every page but the home page) ──────────────────────── */

.phero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(340px, 56svh, 540px);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}
.phero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
/* --focus is the part of the art that stays in frame, set per page (src/ui.ts, PageHero.focus) */
.phero-media img,
.phero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 60% 30%);
}
.phero-media video {
  position: absolute;
  inset: 0;
}
/* a few comic panels carry a pale page border in the file itself; a slight zoom crops it off the edges of the hero */
.phero-media img {
  transform: scale(1.04);
  transform-origin: var(--focus, 60% 30%);
}
.phero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.1) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent 55%);
}

.phero-in {
  width: 100%;
  padding-top: 72px;
  padding-bottom: 40px;
}
.phero-title,
.page-title {
  margin: 0 0 16px;
  max-width: 14em;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 9.5vw, 92px);
  line-height: 0.88;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow:
    3px 0 0 var(--registry),
    -3px 0 0 var(--lattice);
  text-wrap: balance;
}
.phero-lede,
.lede {
  max-width: 38em;
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  color: var(--paper);
}

/* ── dev log, posts, 404 ───────────────────────────────────────────── */

.doc-head {
  padding: 64px 0 40px;
  background: var(--night);
}
.post {
  padding-top: 40px;
  padding-bottom: 72px;
}
.post-art {
  margin: 0 0 32px;
  border: 3px solid var(--paper);
  box-shadow: 7px 7px 0 var(--registry);
}
.post-art img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}
.cards {
  display: grid;
  gap: 14px;
}
.card {
  border: 3px solid var(--paper);
  background: var(--night);
  box-shadow: 6px 6px 0 var(--registry);
  transition: transform 0.1s steps(2), box-shadow 0.1s steps(2);
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--registry);
}
.card-hit {
  display: block;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
.card time {
  font-size: 14px;
  color: var(--sodium);
}
.card h3 {
  margin: 4px 0 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--paper);
}
.card p {
  margin: 0;
  font-size: 16px;
  color: var(--dim);
}
.rawlog-h {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--paper);
}
.rawlog summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sodium);
  cursor: pointer;
}
.rawlog summary::-webkit-details-marker {
  display: none;
}
.rawlog summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border: solid var(--sodium);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-2px, -2px);
}
.rawlog[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.ticker {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--night-2);
}
.ticker li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 2px solid var(--night-2);
  font-size: 16px;
}
.ticker time {
  color: var(--sodium);
  font-variant-numeric: tabular-nums;
}
.ticker span {
  overflow-wrap: anywhere;
}
.empty,
.commit-row {
  color: var(--dim);
  font-size: 15px;
}
.commit-row code {
  color: var(--sodium);
}
.prose h2,
.prose h3 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--paper);
  line-height: 1;
}
/* a post's sections are h2s (src/html.ts); they keep the size they were drawn at as h3s */
.prose h2 {
  font-size: 28px;
  margin: 32px 0 10px;
}
.prose h3 {
  font-size: 22px;
  margin: 24px 0 8px;
}
.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--registry);
}
.prose code {
  color: var(--sodium);
}
.prose pre {
  padding: 14px;
  overflow-x: auto;
  background: var(--night);
  border: 2px solid var(--night-2);
  font-size: 14px;
}
.prose pre code {
  color: var(--text);
}

/* ── footer ────────────────────────────────────────────────────────── */

.site-foot {
  background: var(--ink);
  border-top: 3px solid var(--paper);
}
.foot-in {
  display: grid;
  gap: 36px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--pad) 36px;
}
.foot-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  line-height: 0.85;
  text-transform: uppercase;
  font-family: var(--display);
}
.foot-mark span {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--paper);
}
.foot-mark b {
  font-weight: 900;
  font-size: 46px;
  color: var(--sodium);
  text-shadow: 3px 0 0 var(--registry);
}
.foot-line {
  max-width: 24em;
  margin: 0;
  font-size: 16px;
  color: var(--dim);
}
.foot-cols {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.foot-cols h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
}
.foot-cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-cols li {
  margin: 0;
}
.foot-cols a {
  display: block;
  padding: 10px 0;
  color: var(--text);
  text-decoration: none;
}
.foot-cols a:hover {
  color: var(--sodium);
}
.foot-legal {
  width: calc(100% - 2 * var(--pad));
  max-width: calc(var(--max) - 2 * var(--pad));
  margin: 0 auto;
  padding: 22px 0 40px;
  border-top: 2px solid var(--night-2);
  font-size: 14px;
  color: var(--dim);
}
.foot-legal p {
  max-width: 62em;
  margin: 0 0 10px;
}
.foot-legal .foot-credit {
  color: var(--paper);
}
.foot-legal a {
  color: var(--paper);
}
.foot-legal .foot-city {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
}

/* ── wider screens ─────────────────────────────────────────────────── */

@media (min-width: 640px) {
  :root {
    --pad: 32px;
  }
  /* as many columns as there are link groups: while there are no official accounts there is no third group, and no empty third track */
  .foot-cols {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* the newest write-up takes the whole row; the rest pair up under it */
  .cards > :first-child {
    grid-column: 1 / -1;
  }
}

/* a phone on its side: the header would take a sixth of the screen */
@media (max-height: 500px) {
  :root {
    --head-h: 48px;
  }
  .logo-lg {
    font-size: 24px;
  }
  .menu-btn {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 960px) {
  :root {
    --pad: 40px;
    --head-h: 72px;
  }
  .band {
    padding: 88px 0;
  }
  .menu-btn {
    display: none;
  }
  html.menu-open {
    overflow: visible;
  }
  .head-menu,
  html:not(.js) .head-menu {
    position: static;
    display: flex;
    height: auto;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    border: 0;
    background: none;
  }
  /* eight links plus the button must fit from 960px up: the gap shrinks with the viewport, and no label breaks onto a second line */
  .head-nav {
    flex-direction: row;
    gap: clamp(14px, 1.9vw, 26px);
  }
  .head-nav a {
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    font-size: 19px;
    white-space: nowrap;
  }
  .head-menu .btn {
    white-space: nowrap;
  }
  .head-nav a:hover {
    border-bottom-color: var(--registry);
  }
  .head-nav a.on {
    border-bottom-color: var(--sodium);
  }
  /* four link groups: the columns take two thirds, so a 1280px screen sets them in one row */
  .foot-in {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
    gap: 64px;
  }
  .foot-cols {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }
  .phero-in {
    padding-bottom: 56px;
  }
  /* the title on the right: the scrim darkens that side, and the art's subject stands clear on the left.
     Narrower screens keep the title on the left, where it fills the width anyway. */
  .phero-right .phero-media::after {
    background:
      linear-gradient(270deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.1) 100%),
      linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent 55%);
  }
  .phero-right .phero-in {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
  }
  .phero-right .acts {
    justify-content: flex-end;
  }
}
