/*
 * CITY OF LEGENDS — the public front, in the game's own visual contract.
 *
 * MOBILE FIRST, and not as a slogan: every base rule here is the phone rule,
 * and the two `min-width` blocks at the bottom are the only places a wider
 * screen is considered. The audience arrives from a stream or a post, on a
 * phone, once. If it does not land there it does not land.
 *
 * THE PALETTE IS NOT A CHOICE — it is `apps/client/src/shell/menu/menu.css:14-18`,
 * the same tokens the game's own front door uses. The retired login gate had
 * drifted off them (#19e6f0 / #ff2fd6 / #0a0a12) and looked generic for it.
 *
 * THE SIGNATURE IS MISREGISTERED INK, NOT GLOW. `docs/ART_BIBLE.md` names the
 * house style "Neon Ink — comic cel-shaded cyberpunk superhero. Bold ink
 * outlines, 2-band flat lighting, saturated neon against desaturated grime,
 * halftone in the shadows", and `titleScreen.ts:4` specifies the wordmark as
 * "chromatic ink offset, NOT a glow filter". Everything soft and radial in here
 * would be wrong. Edges are hard, shadows are dots.
 */

:root {
  /* the contract */
  --cyan: #22e0ff;
  --magenta: #ff2d74;
  --amber: #ffaa2b;
  --ink: #05060a;
  --paper: #c7d0de;

  /* grounds, biased toward the ink rather than a neutral grey */
  --bg: #05060a;
  --bg-2: #0a0e16;
  --bg-3: #0e131d;
  --hair: #1b2331;
  --hair-2: #2a3444;
  --text: #d5dde9;
  --dim: #78839a;
  --dim-2: #4c5568;

  --display: "Archivo Black", "Helvetica Neue", Impact, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --pad: 20px;
  --motion: 1;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion: 0;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* HALFTONE IN THE SHADOWS — the ART_BIBLE's own words, as a fixed Ben-Day
   field rather than a gradient. 3px cell so it reads as print texture on a
   phone and does not moire against the type. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(34, 224, 255, 0.05) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ── nav ─────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--hair);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav > a {
  color: var(--text);
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-links a {
  color: var(--dim);
}
.nav-links a.on {
  color: var(--cyan);
}
.nav-play {
  color: var(--ink) !important;
  background: var(--cyan);
  padding: 6px 12px;
  border-radius: 2px;
  font-weight: 700;
}

/* ── hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 44px var(--pad) 52px;
  border-bottom: 1px solid var(--hair);
}

.kicker {
  margin: 0 0 14px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
}

.mark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.84;
  color: #f4f8ff;
}
.mark-sm {
  display: block;
  font-size: clamp(13px, 3.6vw, 22px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--text);
}
/* THE SIGNATURE. Magenta plate right, cyan plate left — a misregistered
   two-colour print, not a glow. Offset scales with the type so it stays a
   registration error rather than becoming a blur on a big screen. */
.mark-lg {
  display: block;
  font-size: clamp(46px, 15vw, 128px);
  letter-spacing: 0.01em;
  text-shadow:
    0.024em 0 0 rgba(255, 45, 116, 0.62),
    -0.024em 0 0 rgba(34, 224, 255, 0.62);
}

.rule {
  width: min(420px, 82%);
  height: 1px;
  margin: 20px 0 18px;
  background: linear-gradient(90deg, var(--cyan), rgba(255, 45, 116, 0.5), transparent);
}

.lede {
  margin: 0;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.lede b {
  color: var(--paper);
}

.cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 26px 0 16px;
}
.btn {
  display: block;
  padding: 15px 20px;
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}
.btn:hover {
  text-decoration: none;
}
.btn-go {
  background: var(--cyan);
  color: var(--ink);
}
.btn-go:hover {
  filter: brightness(1.1);
}
.btn-alt {
  border-color: var(--hair-2);
  color: var(--text);
}
.btn-alt:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.fineprint {
  margin: 0;
  max-width: 56ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}

/* ── bands ───────────────────────────────────────────────────────────── */

.band {
  padding: 38px var(--pad);
  border-bottom: 1px solid var(--hair);
}
.band h2 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan);
}
.band-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.band-head h2 {
  margin-bottom: 20px;
}
.more {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.tile {
  padding: 18px;
  background: var(--bg-2);
  border: 1px solid var(--hair-2);
  border-left: 2px solid var(--magenta);
}
.tile:nth-child(2) {
  border-left-color: var(--cyan);
}
.tile:nth-child(3) {
  border-left-color: var(--amber);
}
.tile h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
}
.tile p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--dim);
}

/* ── dev-log cards ───────────────────────────────────────────────────── */

.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--hair-2);
}
.card-hit {
  display: block;
  padding: 16px 18px;
  color: inherit;
}
.card-hit:hover {
  text-decoration: none;
  background: var(--bg-3);
}
.card time {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim-2);
}
.card h3 {
  margin: 6px 0 6px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--paper);
  text-wrap: balance;
}
.card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
}

/* ── the running feed ────────────────────────────────────────────────── */

.ticker {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.ticker li {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 12.5px;
  line-height: 1.55;
}
.ticker time {
  color: var(--dim-2);
  font-variant-numeric: tabular-nums;
}
.ticker span {
  color: var(--dim);
  min-width: 0;
  overflow-wrap: anywhere;
}

.empty {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

/* ── article pages ───────────────────────────────────────────────────── */

.page-head,
.post {
  padding: 34px var(--pad) 40px;
}
.page-title {
  margin: 10px 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 7.5vw, 46px);
  line-height: 1.06;
  text-transform: uppercase;
  color: #f4f8ff;
  text-wrap: balance;
}
.commit-row {
  margin: 0 0 22px;
  font-size: 12px;
  color: var(--dim);
}
.commit-row code {
  color: var(--amber);
}
.prose {
  max-width: 66ch;
}
.prose h2 {
  margin: 30px 0 10px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.prose h3 {
  margin: 24px 0 8px;
  font-size: 14px;
  color: var(--paper);
}
.prose p {
  margin: 0 0 15px;
  line-height: 1.75;
}
.prose ul {
  margin: 0 0 15px;
  padding-left: 20px;
}
.prose li {
  margin-bottom: 7px;
}
.prose blockquote {
  margin: 0 0 15px;
  padding: 12px 16px;
  border-left: 2px solid var(--magenta);
  background: var(--bg-2);
  color: var(--paper);
}
.prose code {
  color: var(--amber);
  font-size: 0.92em;
}
.prose pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--hair-2);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}
.prose pre code {
  color: var(--text);
}

.hero-404 {
  border-bottom: none;
}

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

.foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px var(--pad) 40px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

/* ── wider screens. Everything above this line is the phone. ─────────── */

@media (min-width: 700px) {
  :root {
    --pad: 40px;
  }
  body {
    font-size: 16px;
  }
  .hero {
    padding: 76px var(--pad) 84px;
  }
  .lede {
    font-size: 17px;
  }
  .cta {
    flex-direction: row;
    align-items: center;
  }
  .btn {
    display: inline-block;
    min-width: 210px;
  }
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .band {
    padding: 56px var(--pad);
  }
  .ticker li {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}

@media (min-width: 1100px) {
  .nav,
  .hero,
  .band,
  .page-head,
  .post,
  .foot {
    padding-left: max(var(--pad), calc((100vw - 1120px) / 2));
    padding-right: max(var(--pad), calc((100vw - 1120px) / 2));
  }
  /* ASYMMETRY, on purpose: the hero copy holds the left two-thirds and the
     right stays empty. A centred column is the look this project already
     rejected once. */
  .hero .lede,
  .hero .fineprint {
    max-width: 60ch;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
