/* ══════════════════════════════════════════════════════════════════════════
   SP-RP shared shell — the case-file language.

   Every public page loads this file, so it is the one place the site's
   design lives. The language is not new: it is the one already used by The
   Streets (the faction/territory scene), extracted here so the rest of the
   site speaks it too. Tilted boards on hard black shadows, torn edges,
   split-tone panels, Pricedown titles cut with a black stroke, cream and
   amber on near-black, and monospace for the small print.

   Anything a page still styles for itself should be layout, not language.
   ══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Pricedown";
  src: url("/assets/fonts/pricedown.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground */
  --sprp-paper: #0c0b0e;
  --sprp-deep: #050507;
  --sprp-panel: #151019;
  --sprp-panel-raised: #231a29;
  --sprp-line: #302a38;

  /* Ink */
  --sprp-copy: #bdb7c7;
  --sprp-muted: #7c7589;
  --sprp-cream: #eee6d7;
  --sprp-amber: #f5a31a;
  --sprp-purple: #6c63f0;
  --sprp-ink: #000;

  /* The Streets uses this to tint a whole scene. Kept as the site-wide
     accent hook so a page can re-tint without touching the components. */
  --case-colour: #f5a31a;

  /* Split-tone panel fill, the exact ramp the dossiers use. */
  --case-fill: linear-gradient(112deg, #151019 0 68%, #261a2c 68%);
  --case-fill-flat: #151019;

  /* Torn edges. Four corners, none of them square. */
  --case-tear: polygon(10px 0, 100% 3px, calc(100% - 12px) 100%, 0 calc(100% - 3px));
  --case-tear-wide: polygon(0 0, 98% 1%, 100% 97%, 1% 100%);

  /* Titles are Pricedown; buttons, chips and small caps are Anton. Both
     come from The Streets, which uses them for exactly these two jobs. */
  --case-display: Pricedown, Anton, Impact, sans-serif;
  --case-label: Anton, Impact, sans-serif;
  --case-body: "Public Sans", system-ui, sans-serif;
  --case-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* Printed-paper grain, laid over fills so nothing reads as flat CSS. */
  --case-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72 .48' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23888' filter='url(%23p)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

/* ── Scroll model ──────────────────────────────────────────────────────────
   Every document page scrolls the same way: the document scrolls, the header
   sticks, and anchors stop clear of it instead of underneath it. The two map
   viewers opt out below, because they are applications, not documents. */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--sprp-paper); }

/* ══ Wordmark ═════════════════════════════════════════════════════════════
   Text, not an image: sharp at every size, and one file fewer to cache-bust. */
.wordmark {
  display: inline-block;
  font-family: var(--case-display);
  font-weight: 900;
  font-size: 28px;
  line-height: .85;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  -webkit-text-stroke: 2px var(--sprp-ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .85);
  transform: rotate(-1deg);
  transition: transform .14s steps(2), color .2s;
}
.wordmark i { font-style: normal; color: var(--case-colour); }
.wordmark:hover { transform: rotate(-1deg) translate(1px, -1px); color: #fff; }
.wordmark.is-large {
  font-size: clamp(56px, 8vw, 104px);
  -webkit-text-stroke: 4px var(--sprp-ink);
  text-shadow: 0 8px 0 rgba(0, 0, 0, .9);
}
.wordmark.is-small { font-size: 21px; -webkit-text-stroke: 1.5px var(--sprp-ink); text-shadow: 0 3px 0 rgba(0, 0, 0, .8); }

/* ══ Case components ══════════════════════════════════════════════════════ */

/* A board: the tilted slab with the hard shadow and the colour slipped out
   from behind it, exactly as the territory board on The Streets. */
.case-board {
  position: relative;
  isolation: isolate;
  background: var(--sprp-deep);
  border: 4px solid var(--sprp-ink);
  box-shadow: 9px 10px 0 var(--sprp-ink);
  transform: rotate(-.6deg);
}
.case-board::before {
  content: '';
  position: absolute;
  inset: -12px 18px 6px -10px;
  z-index: -1;
  background: var(--case-colour);
  transform: rotate(1.3deg);
  clip-path: polygon(0 3%, 100% 0, 98% 97%, 2% 100%);
  pointer-events: none;
}
/* Boards alternate their lean so a column of them does not look like a
   printing fault. */
.case-board:nth-of-type(even) { transform: rotate(.5deg); }

/* The board's header bar: split tone, heavy rule under it. */
.case-head {
  position: relative;
  padding: 20px 24px 18px;
  background: linear-gradient(112deg, #151018 0 64%, #28202c 64%);
  border-bottom: 5px solid var(--sprp-ink);
  color: var(--sprp-cream);
}
.case-head > span,
.case-note {
  display: block;
  font: 10px/1.5 var(--case-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--case-colour);
}
.case-note.is-quiet { color: var(--sprp-muted); }

/* Titles. One treatment: Pricedown, cream, cut out of a black stroke. */
.case-title {
  margin: 8px 0 0;
  font: 900 clamp(25px, 4vw, 44px)/1 var(--case-display);
  text-transform: uppercase;
  color: var(--sprp-cream);
  -webkit-text-stroke: 1px var(--sprp-ink);
  paint-order: stroke fill;
}
.case-title.is-page {
  font-size: clamp(38px, 6.5vw, 78px);
  line-height: .92;
  -webkit-text-stroke: 3px var(--sprp-ink);
  text-shadow: 0 6px 0 rgba(0, 0, 0, .85);
  margin: 14px 0 0;
}

/* The kicker chip above a title. Amber, bordered, knocked off true. */
.case-kicker {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  background: var(--case-colour);
  border: 3px solid var(--sprp-ink);
  box-shadow: 5px 5px var(--sprp-ink);
  color: #12100c;
  font: 400 11px/1 var(--case-label);
  letter-spacing: .2em;
  text-transform: uppercase;
  transform: rotate(2deg);
}

/* Sticker buttons: skewed, cream, hard shadow, amber on hover. */
.case-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 36px;
  padding: 9px 16px;
  border: 2px solid var(--sprp-ink);
  background: #e9dfc9;
  box-shadow: 3px 3px var(--sprp-ink);
  color: #17121a;
  font: 400 13px/1 var(--case-label);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transform: skew(-7deg);
  transition: background .18s, transform .12s steps(2), box-shadow .12s steps(2);
}
.case-btn > * { transform: skew(7deg); }
.case-btn:hover { background: var(--case-colour); }
.case-btn:active { transform: skew(-7deg) translate(3px, 3px); box-shadow: 0 0 var(--sprp-ink); }
.case-btn.is-ghost { background: transparent; color: var(--sprp-cream); border-color: var(--sprp-cream); box-shadow: 3px 3px rgba(0, 0, 0, .8); }
.case-btn.is-ghost:hover { background: var(--case-colour); color: #17121a; border-color: var(--sprp-ink); }
.case-btn[disabled], .case-btn.is-off { opacity: .45; cursor: default; }
.case-btn.is-off { text-decoration: line-through; }

/* A card: torn edges, split fill, a colour stripe down the opening edge. */
.case-card {
  position: relative;
  padding: 22px 26px;
  background: var(--case-fill);
  box-shadow: inset 3px 0 var(--case-colour), inset 0 1px #ffffff24;
  clip-path: var(--case-tear);
  transition: transform .16s ease, box-shadow .16s ease;
}
.case-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--case-grain);
  opacity: .14;
  mix-blend-mode: multiply;
  pointer-events: none;
}
a.case-card:hover,
.case-card.is-interactive:hover { transform: translateY(-3px); box-shadow: inset 5px 0 var(--case-colour), inset 0 1px #ffffff2e; }

/* One focus ring for the whole site. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--case-colour); outline-offset: 3px; }

/* ══ Page shell: header ═══════════════════════════════════════════════════ */
.page-header,
.auth-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 4px solid var(--sprp-ink);
  background: linear-gradient(112deg, #0e0c11 0 64%, #161220 64%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .5);
}
.page-header-inner,
.auth-header-inner {
  width: min(1320px, 100%);
  min-height: 66px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.page-wordmark,
.auth-wordmark { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; flex-shrink: 0; white-space: nowrap; }
.brand-pill { display: block; height: auto; object-fit: contain; }

/* Kept for the 3D map's own chrome, which still uses a square mark. */
.sprp-s-mark { width: 28px; height: 28px; min-width: 28px; aspect-ratio: 1; flex: 0 0 28px; object-fit: contain; }
#floating-panel .sprp-s-mark,
#world3d-panel .sprp-s-mark { width: 32px !important; height: 32px !important; min-width: 32px; flex-basis: 32px; }

.page-nav,
.auth-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.page-nav a,
.auth-nav a {
  position: relative;
  color: var(--sprp-muted);
  font: 10px/1 var(--case-mono);
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s;
}
.page-nav a::after,
.auth-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: -7px;
  height: 2px;
  background: var(--case-colour);
  transition: right .18s ease;
}
.page-nav a:hover,
.page-nav a[aria-current='page'],
.auth-nav a:hover,
.auth-nav a[aria-current='page'] { color: var(--sprp-cream); }
.page-nav a:hover::after,
.page-nav a[aria-current='page']::after,
.auth-nav a:hover::after,
.auth-nav a[aria-current='page']::after { right: 0; }
.page-nav .nav-donate,
.auth-nav .nav-donate {
  padding: 8px 12px;
  border: 2px solid var(--sprp-ink);
  background: var(--case-colour);
  box-shadow: 3px 3px var(--sprp-ink);
  color: #12100c;
  transform: skew(-7deg);
}
.page-nav .nav-donate:hover,
.auth-nav .nav-donate:hover { background: #e9dfc9; color: #12100c; }
.page-nav .nav-donate::after,
.auth-nav .nav-donate::after { display: none; }

/* ══ Page shell: document body ════════════════════════════════════════════ */
/* ── Info dossier ────────────────────────────────────────────────────────── */
.info-file {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  max-width: 1024px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.info-body { order: 1; }
.info-facts { order: 2; }
.info-body h3 {
  margin: 0 0 12px;
  font: 700 14px/1.3 var(--case-display);
  text-transform: uppercase;
  color: var(--sprp-cream);
  letter-spacing: .02em;
}
.info-body p { margin: 0 0 16px; color: var(--sprp-copy); line-height: 1.6; font-size: 14px; }
.info-body p:last-of-type { margin-bottom: 0; }
.info-body a { color: var(--sprp-amber); text-decoration: underline; }
.info-lead {
  font: 13px/1.7 var(--case-mono);
  color: var(--sprp-muted);
  margin-bottom: 24px !important;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sprp-line);
}
.info-facts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.info-facts dt {
  font: 700 9px/2 var(--case-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--sprp-amber) 70%, #fff);
}
.info-facts dd {
  margin: 0;
  padding: 3px 8px;
  background: var(--sprp-amber);
  border: 2px solid var(--sprp-ink);
  color: #12100c;
  font: 400 9px/1 var(--case-label);
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--sprp-ink);
}
.info-release {
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(112deg, #1a1820 0 65%, #2a1f30 65%);
  border-left: 4px solid var(--sprp-amber);
  clip-path: var(--case-tear);
}
.info-release-head {
  margin: 0 0 8px;
  font: 700 11px/1.3 var(--case-display);
  text-transform: uppercase;
  color: var(--sprp-amber);
}
.info-release p { margin: 0 0 8px; font-size: 12px; }
.info-release p:last-child { margin-bottom: 0; }
.info-release strong { color: var(--sprp-cream); font-weight: 600; }
@media (max-width: 860px) {
  .info-file { grid-template-columns: 1fr; gap: 18px; }
}

.page-main { width: min(900px, 100%); max-width: 900px; margin: 0 auto; padding: 64px 28px 88px; box-sizing: border-box; }
.page-heading {
  margin: 14px 0 0;
  font: 900 clamp(38px, 6.5vw, 78px)/.92 var(--case-display);
  text-transform: uppercase;
  color: var(--sprp-cream);
  -webkit-text-stroke: 3px var(--sprp-ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0, 0, 0, .85);
}
.page-standfirst {
  max-width: 68ch;
  margin: 20px 0 44px;
  color: var(--sprp-muted);
  font: 12px/1.7 var(--case-mono);
  letter-spacing: .04em;
}
.prose { color: var(--sprp-copy); font-family: var(--case-body); font-size: 15px; line-height: 1.8; }
.prose h2 {
  margin: 44px 0 14px;
  padding: 0 0 10px;
  border-bottom: 3px solid var(--sprp-ink);
  color: var(--sprp-cream);
  font: 900 clamp(22px, 3vw, 30px)/1.1 var(--case-display);
  text-transform: uppercase;
}
.prose h2::first-letter { color: var(--case-colour); }
.prose h3 { margin: 26px 0 8px; color: var(--sprp-cream); font-size: 1.05rem; font-weight: 600; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1.1rem; padding-left: 1.3rem; list-style: disc; }
.prose li { margin-bottom: .45rem; }
.prose a { color: var(--case-colour); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: #ffc35f; }
.prose strong { color: var(--sprp-cream); font-weight: 600; }

/* ══ Footer ═══════════════════════════════════════════════════════════════
   The mark, who built it, the preferences and the notice. It ends the page;
   it does not repeat the header. A nav list and a Donate button were styled
   here for a long time with no markup anywhere that drew them - that dead
   pair is what got rebuilt by mistake, so the rules are gone with them. */
/* ══ Footer ═══════════════════════════════════════════════════════════════ */
.site-foot { position: relative; padding: 56px 0 34px; text-align: center; border-top: 4px solid var(--sprp-ink); background: linear-gradient(112deg, #0e0c11 0 64%, #161220 64%); }
.site-foot p:not(.site-disclaimer) { width: auto !important; max-width: 760px !important; margin-inline: auto !important; white-space: normal !important; font: 10px/1.7 var(--case-mono) !important; letter-spacing: .03em; color: #5b5468 !important; }

/* The notice, one rule for every page and for the artwork, so there is a
   single place it is described rather than a copy in each template.

   One line, always. It is a single sentence of credits and it reads as one;
   broken over three it stops looking like small print and starts looking
   like a paragraph nobody wrote on purpose. So: nowrap, and the size comes
   down with the viewport to keep it fitting rather than wrapping. 227
   characters of monospace is about 136em, hence the divisor. */
.site-disclaimer { font: 9px/1.7 monospace !important; letter-spacing: 0;
  font-size: min(9px, calc((100vw - 56px) / 137)) !important;
  color: rgba(255,255,255,.52) !important; text-align: center;
  max-width: none !important; width: auto !important;
  margin: 20px 28px 0 !important; padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.16);
  white-space: nowrap !important; overflow: hidden; text-overflow: clip; }
.site-disclaimer strong { color: rgba(255,255,255,.65); font-weight: 600; }
.site-disclaimer a { color: inherit; }
.site-disclaimer a:hover { color: rgba(255,255,255,.8); }
/* Narrow enough that one line would be too small to read: below this it
   wraps and stays legible, which is the right trade on a phone. */
@media (max-width: 860px) {
  .site-disclaimer { margin: 20px 14px 0 !important;
    font-size: 9px !important; white-space: normal !important; }
}
/* The drawn wordmark still has a place: once per page, in the footer, where
   it reads as a mark rather than as a heading. The headers use the text
   version, which stays sharp at nav size. */

/* A preference, not a call to action: it should read as the quietest control
   on the page rather than the loudest thing in the footer. */
.site-foot .foot-drip {
  margin: 1.6rem 0 0;
  padding: 6px 13px;
  background: transparent;
  border: 1px solid var(--sprp-line);
  color: var(--sprp-muted);
  font: 400 10px/1 var(--case-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.site-foot .foot-drip:hover { color: var(--sprp-cream); border-color: var(--sprp-muted); }

.foot-mark { display: inline-block; margin: 0 0 4px; line-height: 0; }
/* In the footer the mark opens the column, so it needs the step down to
   the nav under it rather than the 4px it uses when it stands alone. */
.site-foot .foot-mark { margin: 0 0 1.5rem; }
.foot-mark img { width: 180px; height: auto; opacity: .65; transition: opacity .2s, transform .14s steps(2); }
.foot-mark:hover img { opacity: 1; transform: translateY(-2px); }
@media (max-width: 720px) { .foot-mark img { width: 140px; } }

.built img { height: 32px; width: auto; filter: grayscale(1) brightness(1.7); opacity: .4; transition: opacity .2s, filter .2s; }
.built a:hover img, .built .mark:hover img { opacity: 1; filter: grayscale(0) brightness(1); }

/* The column the rows sit in. It was written inline in each template, with a
   different width and a different gap in each, so the same footer was a
   different shape depending on which page you had reached it from. The rows
   set their own spacing above, which is the point of the rhythm; the gap here
   is only the floor under rows that ask for nothing. */
.site-foot .foot-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.site-foot .foot-prefs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
/* The notice is a block that wants the whole width. In a centred flex column
   `width: auto` means fit-content, not full width, so it was laid out as a
   narrow 70px ribbon of text several hundred pixels tall - present in the
   markup, and unreadable on the page. The rows above it are short enough
   that they never showed the problem. */
/* And it is never faded in. The reveal animation is for decoration; a
   notice that can end up invisible because an observer did not fire is
   not a notice. This holds even if something puts .arrives back on it. */
.site-disclaimer.arrives { opacity: 1 !important; transform: none !important; }
.site-foot .built {
  opacity: .75;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
@media (max-width: 720px) {
  .site-foot { padding: 40px 0 28px; }
  .site-foot .foot-inner { padding: 0 16px; }
  .site-foot .built { gap: 1.25rem; }
}

/* ══ Account pages ════════════════════════════════════════════════════════ */
/* A column, so the footer these pages now carry sits under the form rather
   than a screen below it: the card still centres in whatever height is left
   over once the header and the footer have taken theirs. */
.auth-page { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: var(--sprp-paper); color: var(--sprp-copy); font-family: var(--case-body); }
.auth-header { position: relative; z-index: 20; }
.auth-main {
  flex: 1 0 auto;
  padding: 56px 24px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 75% 60% at 50% 26%, rgba(245, 163, 26, .08), transparent 72%),
    var(--sprp-paper);
}
.auth-card {
  position: relative;
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr);
  background: var(--sprp-deep);
  border: 4px solid var(--sprp-ink);
  box-shadow: 9px 10px 0 var(--sprp-ink);
  transform: rotate(-.6deg);
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: -12px 18px 6px -10px;
  z-index: -1;
  background: var(--case-colour);
  transform: rotate(1.3deg);
  clip-path: polygon(0 3%, 100% 0, 98% 97%, 2% 100%);
  pointer-events: none;
}
.auth-form-panel { min-width: 0; padding: 44px 40px; background: var(--case-fill); }
.auth-form-wrap { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.auth-page h1 {
  margin: 0;
  color: var(--sprp-cream);
  font: 900 clamp(30px, 4vw, 44px)/.95 var(--case-display);
  text-transform: uppercase;
  -webkit-text-stroke: 2px var(--sprp-ink);
  paint-order: stroke fill;
}
.auth-intro { margin: 16px 0 30px; color: var(--sprp-muted); font: 11px/1.7 var(--case-mono); letter-spacing: .04em; }
.auth-page form > div + div { margin-top: 18px; }
.auth-page label { display: block; margin-bottom: 8px; color: var(--sprp-cream); font: 10px/1 var(--case-mono); letter-spacing: .16em; text-transform: uppercase; }
.auth-page input:not([type='checkbox']) {
  width: 100%; box-sizing: border-box; padding: 12px 13px;
  border: 2px solid var(--sprp-ink); border-radius: 0; outline: 0;
  background: #0b0910; color: var(--sprp-cream); font: inherit;
}
.auth-page input:not([type='checkbox']):focus { border-color: var(--case-colour); box-shadow: inset 0 0 0 1px var(--case-colour); }
.auth-check { display: inline-flex !important; align-items: center; gap: 9px; margin-top: 18px; color: var(--sprp-muted) !important; font: 10px/1 var(--case-mono); letter-spacing: .12em; text-transform: uppercase; }
.auth-check input { accent-color: var(--case-colour); }
.auth-submit {
  width: 100%; margin-top: 24px; padding: 13px 16px;
  border: 2px solid var(--sprp-ink); border-radius: 0;
  background: var(--case-colour); box-shadow: 4px 4px 0 var(--sprp-ink);
  color: #17121a; cursor: pointer;
  font: 400 15px/1 var(--case-label); letter-spacing: .06em; text-transform: uppercase;
  transition: background .18s, transform .12s steps(2), box-shadow .12s steps(2);
}
.auth-submit:hover { background: #e9dfc9; }
.auth-submit:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--sprp-ink); }
.auth-message { min-height: 20px; margin: 16px 0 0; text-align: center; font: 11px/1.6 var(--case-mono); color: var(--case-colour); }
.auth-switch { display: block; margin-top: 20px; color: var(--sprp-muted); text-align: center; font: 10px/1 var(--case-mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.auth-switch span { color: var(--case-colour); }
.auth-switch:hover { color: var(--sprp-cream); }
.auth-art { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-left: 4px solid var(--sprp-ink); background: #100d15; }
.auth-art img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; filter: saturate(.75) contrast(1.08); }
.auth-art div { padding: 13px; border-top: 4px solid var(--sprp-ink); text-align: center; background: var(--case-colour); }
.auth-art a { color: #12100c; font: 400 11px/1 var(--case-label); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.auth-back { display: inline-block; margin-top: 30px; color: var(--sprp-muted); font: 10px/1 var(--case-mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }
.auth-back:hover { color: var(--case-colour); }

/* ══ Map viewers ══════════════════════════════════════════════════════════
   These two are applications: they own the viewport and must not scroll the
   document behind their canvas. Only their chrome takes the language. */
body.map-app, body.map-app > #map-canvas { height: 100%; }
html:has(body.map-app) { scroll-behavior: auto; }

#floating-panel,
#legend,
#world3d-panel,
#gfx-settings,
#ui-keys-panel,
#gfx-sel {
  border: 3px solid var(--sprp-ink) !important;
  border-radius: 0 !important;
  background: linear-gradient(112deg, #0e0c11 0 64%, #161220 64%) !important;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .8) !important;
  color: var(--sprp-copy) !important;
  backdrop-filter: blur(12px);
}
#floating-panel button,
#floating-panel input[type='button'],
#floating-panel > a:not(:first-child),
#world3d-panel .ui-btn {
  border: 2px solid var(--sprp-ink) !important;
  border-radius: 0 !important;
  background: #e9dfc9 !important;
  box-shadow: 3px 3px var(--sprp-ink);
  color: #17121a !important;
  font: 400 12px/1 var(--case-label) !important;
  letter-spacing: .05em;
  text-transform: uppercase;
  transform: skew(-7deg);
  transition: background .18s;
}
#floating-panel button:hover,
#floating-panel input[type='button']:hover,
#floating-panel > a:not(:first-child):hover,
#world3d-panel .ui-btn:hover { background: var(--case-colour) !important; color: #17121a !important; }
/* A toggle that is off reads as struck through, not as a different grey. */
#floating-panel input[type='button'].line-through,
#floating-panel .line-through { background: #2b2633 !important; color: #6f6879 !important; text-decoration: line-through; }
#floating-panel > a:first-child,
#world3d-panel .ui-logo { border-right: 3px solid var(--sprp-ink) !important; padding-right: 14px; }

/* The flat map's legend keeps the UCP's utility classes; give its chips the
   same sticker treatment as the toolbar above them. */
#legend button,
#legend a,
#legend span[class*='bg-'] {
  border: 2px solid var(--sprp-ink) !important;
  border-radius: 0 !important;
  background: #e9dfc9 !important;
  color: #17121a !important;
  font: 400 11px/1 var(--case-label) !important;
  letter-spacing: .05em;
  text-transform: uppercase;
}
#legend button:hover,
#legend a:hover { background: var(--case-colour) !important; }

#map-gate { background: rgba(5, 5, 7, .95) !important; font-family: var(--case-body) !important; }
#map-gate .map-gate-card {
  border: 4px solid var(--sprp-ink) !important;
  border-radius: 0 !important;
  background: var(--case-fill) !important;
  box-shadow: 9px 10px 0 var(--sprp-ink) !important;
  transform: rotate(-.6deg);
}
#map-gate .map-gate-card h2 {
  font: 900 clamp(26px, 3.4vw, 38px)/1 var(--case-display) !important;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: var(--sprp-cream) !important;
  -webkit-text-stroke: 2px var(--sprp-ink);
  paint-order: stroke fill;
}
#map-gate #gate-row button {
  border: 2px solid var(--sprp-ink) !important;
  border-radius: 0 !important;
  background: var(--case-colour) !important;
  box-shadow: 3px 3px 0 var(--sprp-ink);
  color: #171109 !important;
  font: 400 13px/1 var(--case-label) !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  transform: skew(-7deg);
}
#map-gate #gate-row button:hover { background: #e9dfc9 !important; }
#map-gate #gate-row a {
  border-radius: 0 !important;
  font: 10px/1 var(--case-mono) !important;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sprp-muted) !important;
}
#map-gate #gate-row a:hover { color: var(--case-colour) !important; }

/* ══ Reading aids ═════════════════════════════════════════════════════════
   Both are driven by /assets/shell.js and degrade to nothing without it. */
.rules-toc a[data-current] {
  box-shadow: inset 5px 0 var(--case-colour), inset 0 1px #ffffff2e;
  color: #fff;
}
.rules-toc a[data-current]::after {
  content: '▸';
  float: right;
  color: var(--case-colour);
}
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  padding: 10px 16px;
  border: 2px solid var(--sprp-ink);
  background: var(--case-colour);
  box-shadow: 4px 4px 0 var(--sprp-ink);
  color: #12100c;
  font: 400 12px/1 var(--case-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transform: skew(-7deg);
  transition: background .18s, transform .12s steps(2), box-shadow .12s steps(2);
}
.to-top:hover { background: #e9dfc9; }
.to-top:active { transform: skew(-7deg) translate(3px, 3px); box-shadow: 0 0 0 var(--sprp-ink); }

/* ══ Narrow screens ═══════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  .page-header-inner, .auth-header-inner { align-items: center; gap: 12px; padding-inline: 16px; }
  .page-nav, .auth-nav { justify-content: flex-end; gap: 8px 14px; }
  .page-nav a, .auth-nav a { font-size: 9px; letter-spacing: .12em; }
  .wordmark { font-size: 22px; }
  .page-main { padding: 44px 20px 72px; }
  .auth-main { padding: 34px 20px 52px; }
  .auth-card { grid-template-columns: 1fr; transform: none; }
  .auth-card::before { display: none; }
  .auth-form-panel { padding: 34px 24px; }
  .auth-art { display: none; }
  /* Tilts stack badly in a single narrow column: keep the language, drop the
     lean, so nothing overhangs the viewport and causes a sideways scroll. */
  .case-board, #map-gate .map-gate-card { transform: none; }
  .case-board::before { inset: -8px 10px 4px -6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .case-board, .auth-card, .case-kicker, .case-btn, .wordmark, #map-gate .map-gate-card { transform: none !important; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Movement, shared by every page.
   Lived on the entrance alone, which made the written pages feel like a
   different site. Small and quick throughout: the pages are dense, and
   anything slower reads as lag rather than life.
   ───────────────────────────────────────────────────────────────────────── */
.arrives { opacity: 0; transform: translateY(14px);
           transition: opacity .45s ease, transform .45s cubic-bezier(.22,.61,.36,1); }
.arrives.is-in { opacity: 1; transform: none; }

.page-nav a { transition: color .18s ease; }
.case-btn, .mod-download, .faction-dossier-foot button, .foot-drip, .sa-street,
.page-contents a, .to-top {
  transition: transform .14s ease, background .18s ease, color .18s ease, border-color .18s ease; }
.case-btn:hover, .mod-download:hover, .faction-dossier-foot button:hover,
.foot-drip:hover, .to-top:hover { transform: translateY(-2px); }
.case-btn:active, .mod-download:active, .faction-dossier-foot button:active,
.foot-drip:active, .sa-fold-bar:active, .to-top:active { transform: translateY(1px); }
.roster-section > summary { transition: background .2s ease, color .2s ease; }
.roster-section > summary:hover { background: #1c1522; }
.mod-card > summary { transition: color .18s ease; }
.prose a { transition: color .15s ease, background .15s ease; }

/* One switch, not two kinds of switch: whatever the visitor asked the system
   for is what every rule above respects. */
@media (prefers-reduced-motion: reduce) {
  .arrives { opacity: 1; transform: none; transition: none; }
  .case-btn, .mod-download, .faction-dossier-foot button, .foot-drip, .sa-street, .to-top { transition: none; }
  .case-btn:hover, .mod-download:hover, .faction-dossier-foot button:hover, .foot-drip:hover, .to-top:hover { transform: none; }
}
