/* paperskyline.org — hand-written, no build step, no JS.
   Tokens are the game's own (design spec §4), not invented for the web. */

:root {
  --paper: #f6efd9;
  --desk: #ece4cf;
  --ink: #2a2622;
  --ink-soft: #5d564d;
  --ink-faint: #857c70;
  --line: #d8cfb4;
  --red: #c9463d;
  --gold: #f4d47c;
  --gold-deep: #a9791b;
  --amber: #e6a24a;
  --blueprint: #1f3a5f;
  --blueprint-line: #e8eef7;
  --grid: rgba(42, 38, 34, .07);
  --on-sky: #2a2622;

  --facet-1: #ffffff;
  --facet-2: #e6ebf1;
  --facet-3: #cbd4de;
  --facet-4: #b3bec9;
  --facet-edge: rgba(110, 125, 140, .55);

  --max: 68rem;
  --measure: 62ch;
  --display: Caveat, "Bradley Hand", "Segoe Script", cursive;
  --body: "Patrick Hand", "Comic Sans MS", "Segoe Print", system-ui, sans-serif;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-red: 5px 5px 0 var(--red);
}

/* Dark is the Garage blueprint (spec §4) — a surface the game already owns, not a new theme. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f3a5f;
    --desk: #16293f;
    --ink: #e8eef7;
    --ink-soft: #b9c9dd;
    --ink-faint: #8fa3bb;
    --line: #365a85;
    --red: #ef6f63;
    --gold: #f4d47c;
    --gold-deep: #f4d47c;
    --grid: rgba(232, 238, 247, .09);
    --on-sky: #e8eef7;
    --shadow: 5px 5px 0 rgba(9, 20, 36, .85);
    --shadow-red: 5px 5px 0 var(--red);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* The graph-paper ground, at every width. 40 px is the grid the Title screen draws. */
body {
  margin: 0;
  color: var(--ink);
  font: 1.2rem/1.55 var(--body);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 40px);
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(3rem, 9vw, 5.5rem); }
h2 { font-size: clamp(2.1rem, 5vw, 3.1rem); }
h3 { font-size: 1.7rem; }
p, li { max-width: var(--measure); }
p { margin: 0 0 1rem; }
a { color: var(--gold-deep); text-underline-offset: .18em; text-decoration-thickness: 2px; }
a:hover { color: var(--red); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
img, svg { max-width: 100%; height: auto; display: block; }
strong { font-weight: 400; color: var(--red); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 46rem; }
.eyebrow {
  display: inline-block; font: 1rem/1 var(--body); letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
}
.skip { position: absolute; left: -9999px; }
.skip:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 10;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: .6rem 1rem;
}

/* Rotation is punctuation, not texture: one tilted element per section, and never within
   1 rem of the viewport edge, so the hard shadow has somewhere to fall on a phone. */
.tilt { transform: rotate(-1.6deg); }
.tilt-r { transform: rotate(1.8deg); }
@media (max-width: 34rem) { .tilt, .tilt-r { transform: rotate(-1deg); } }

/* header + footer */
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: .4rem 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
@media (max-width: 37.5rem) { .site-header .wrap { flex-direction: column; align-items: flex-start; } }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font: 700 2rem/1 var(--display); color: inherit; text-decoration: none;
}
.brand svg { width: 2.4rem; height: 2.4rem; flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: 1.1rem; }
.site-nav a { color: inherit; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline wavy var(--red); }

.site-footer { border-top: 3px solid var(--ink); margin-top: 3rem; padding: 2.5rem 0 3.5rem; color: var(--ink-soft); }
.site-footer .wrap { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer .brand { color: var(--ink); }
.site-footer p { margin: .6rem 0 0; font-size: 1.05rem; }
.site-footer .fine { font-size: .95rem; color: var(--ink-faint); }

/* the card — 3 px ink border, hard offset shadow, no radius, no gradient (spec §4) */
.card {
  background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); }

.pill {
  display: inline-block; border: 2px solid var(--ink); background: var(--gold);
  color: #2a2622; padding: .3rem 1rem; font-size: 1.05rem;
}
.section { padding: 3rem 0; }
@media (min-width: 44rem) { .section { padding: 4.5rem 0; } }
.section h2 { margin-bottom: .75rem; }
.section > .wrap > .eyebrow + h2 { margin-top: .3rem; }
.section.alt { background: var(--desk); border-block: 3px solid var(--ink); }
.lede { font-size: 1.45rem; color: var(--ink-soft); }

/* hero */
.hero { position: relative; overflow: hidden; padding-bottom: 0; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem;
  padding-top: 1.5rem; padding-bottom: 1rem; align-items: center;
}
@media (min-width: 56rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2.5rem; padding-top: 3rem; }
}
.hero-copy { display: grid; gap: 1.1rem; justify-items: start; min-width: 0; }
.hero-copy h1 { max-width: 12ch; }
.hero-copy .lede { max-width: 32ch; margin: 0; }
.hero-art { min-width: 0; }
.hero-art svg { width: 100%; height: auto; }

/* The skyline band runs full-bleed under the hero, the way the flight camera sits under the HUD. */
.skyline { display: block; width: 100%; height: clamp(9rem, 17vw, 15.6rem); margin-top: -1px; }

/* Store badges, drawn here rather than fetched, and deliberately unlinked until the listings
   exist (spec §5). Launch day is one href each; check.sh fails if one appears early by accident. */
.badges { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.badges li { max-width: none; }
.badge {
  display: inline-flex; align-items: center; gap: .6rem;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  padding: .5rem .9rem; box-shadow: 3px 3px 0 var(--ink); text-decoration: none;
}
.badge svg { width: 1.8rem; height: 1.8rem; flex: none; }
.badge-text > b { display: block; font: 700 1.25rem/1 var(--display); }
.badge-text > span { display: block; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.badge[aria-disabled="true"] { opacity: .62; box-shadow: none; border-style: dashed; }

/* three steps */
.steps { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { display: grid; gap: .5rem; align-content: start; }
.step .glyph {
  border: 3px solid var(--ink); background: var(--paper); box-shadow: var(--shadow);
  padding: .75rem; margin-bottom: .6rem;
}
.step .glyph svg { width: 100%; height: auto; }
.step h3 { margin: 0; }
.step p { margin: 0; color: var(--ink-soft); }
.step .num { font: 700 1.3rem/1 var(--display); color: var(--red); }

/* the workshop band — blueprint in both themes, since the Garage is the game's one dark screen */
/* The Garage is the game's one dark screen. On the dark site the page is already blueprint,
   so this band drops a shade to stay a distinct panel rather than dissolving into the page. */
.blueprint { --band: #1f3a5f; }
@media (prefers-color-scheme: dark) { .blueprint { --band: #142438; } }
.blueprint {
  background-color: var(--band); color: #e8eef7;
  background-image:
    repeating-linear-gradient(to right, rgba(232,238,247,.10) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(to bottom, rgba(232,238,247,.10) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(to right, rgba(232,238,247,.18) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(to bottom, rgba(232,238,247,.18) 0 1px, transparent 1px 80px);
  border-block: 3px solid var(--ink);
}
.blueprint .eyebrow, .blueprint p { color: #b9cbe2; }
.blueprint a { color: var(--gold); }
.blueprint .wrap { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 52rem) { .blueprint .wrap { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 3rem; } }
.blueprint-fig { min-width: 0; }
.blueprint-fig figcaption {
  font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; color: #8fa8c4; margin-top: .6rem;
}
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.tracks li {
  border: 2px solid #7d9ec4; padding: .5rem .65rem; max-width: none;
  display: flex; justify-content: space-between; gap: .5rem; align-items: baseline;
}
.tracks .lv { font: 700 1.1rem/1 var(--display); color: var(--gold); }

/* the tour */
.cities { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.cities li {
  max-width: none; border: 2px solid var(--ink); background: var(--paper);
  padding: .3rem .8rem; font-size: 1.05rem;
}
.cities li.later { border-style: dashed; color: var(--ink-faint); }
.tour { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .tour { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; } }

/* card rows */
.plainly { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
@media (min-width: 44rem) { .plainly { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* a torn strip of note paper, used once per page for an aside */
.note {
  border-left: 6px solid var(--red); background: var(--desk); padding: 1rem 1.25rem; margin: 2rem 0;
}
.note > :last-child { margin-bottom: 0; }

/* legal pages */
.page-head { padding: 2.5rem 0 1rem; }
.page-head h1 { margin-bottom: .5rem; }
.updated { color: var(--ink-faint); font-size: 1.05rem; }
.legal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 62rem) { .legal { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; } }
.toc, .legal-body { min-width: 0; }
.toc { font-size: 1.05rem; }
@media (min-width: 62rem) { .toc { position: sticky; top: 1.5rem; } }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; border-left: 3px solid var(--ink); }
.toc li { max-width: none; }
.toc a { display: block; padding: .1rem 0 .1rem .9rem; color: var(--ink-soft); text-decoration: none; border-left: 3px solid transparent; margin-left: -3px; }
.toc a:hover { color: var(--ink); border-left-color: var(--red); }
.legal-body h2 { font-size: 2rem; margin: 2.5rem 0 .6rem; scroll-margin-top: 1.5rem; }
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body ul { padding-left: 1.2rem; }
.legal-body li { margin-bottom: .4rem; }
.glance { margin-bottom: 2rem; }
.glance ul { margin: .5rem 0 0; }

.data-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; margin: 1rem 0 1.5rem; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.data-table th, .data-table td { text-align: left; padding: .6rem .75rem; border: 2px solid var(--ink); vertical-align: top; }
.data-table th { background: var(--desk); font-weight: 400; }

.history { border-left: 3px solid var(--red); padding-left: 1rem; }
.history dt { color: var(--ink); }
.history dd { margin: 0 0 .75rem; color: var(--ink-soft); }

/* support FAQ — native <details>, no JS */
.faq { margin-top: 1.5rem; }
.faq details { border-bottom: 2px solid var(--line); }
.faq summary {
  cursor: pointer; padding: .9rem 0; font: 1.3rem/1.3 var(--body);
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > p, .faq details > ul { margin: 0 0 1rem; color: var(--ink-soft); }

/* 404 */
.oops { text-align: center; padding: 4rem 0 5rem; }
.oops .wrap { display: grid; justify-items: center; gap: 1.25rem; }
.oops svg { width: min(100%, 20rem); }
