/* The scorebook: ruled paper, a red margin, ink in navy, the scorer's pencil in a hand-written face. */
@font-face { font-family: "Public Sans"; src: url(../fonts/public-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(../fonts/public-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(../fonts/public-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(../fonts/zilla-slab-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(../fonts/zilla-slab-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Kalam; src: url(../fonts/kalam-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Kalam; src: url(../fonts/kalam-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #FAFBF7;
  --paper-card: #FFFFFF;
  --rule: #D5E1F3;
  --rule-strong: #9DB4DD;
  --ink: #13213D;
  --ink-soft: #3D4A66;
  --ink-faint: #5B6782;
  --blue: #1F4FA8;
  --blue-ink: #FFFFFF;
  --red: #C81E35;
  --note: #FFF3A8;
  --note-ink: #13213D;
  --shadow: rgba(19, 33, 61, 0.16);
  --frame: #FFFFFF;
  --line: 32px;
  --gutter: 24px;
  --wrap: 1180px;
  --margin-x: max(14px, calc(50% - var(--wrap) / 2 - 8px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1A30;
    --paper-card: #15233F;
    --rule: #1A2944;
    --rule-strong: #34507F;
    --ink: #E9EEF8;
    --ink-soft: #C2CCE0;
    --ink-faint: #9AA7C2;
    --blue: #8DB2FF;
    --blue-ink: #0F1A30;
    --red: #FF7A8C;
    --shadow: rgba(0, 0, 0, 0.45);
    --frame: #E9EEF8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --paper: #0F1A30;
    --paper-card: #15233F;
    --rule: #1A2944;
    --rule-strong: #34507F;
    --ink: #E9EEF8;
    --ink-soft: #C2CCE0;
    --ink-faint: #9AA7C2;
    --blue: #8DB2FF;
    --blue-ink: #0F1A30;
    --red: #FF7A8C;
    --shadow: rgba(0, 0, 0, 0.45);
    --frame: #E9EEF8;
    color-scheme: dark;
  }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  color: var(--ink);
  font: 400 17px/1.6 "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 0 calc(var(--gutter) + 22px); }
.margin-line { position: absolute; top: 0; bottom: 0; left: var(--margin-x); width: 2px; background: var(--red); opacity: 0.7; pointer-events: none; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 12px; }
.pencil { font-family: Kalam, "Comic Sans MS", cursive; }
h1, h2, h3 { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; color: var(--ink); text-wrap: balance; }

/* header */
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 20px; padding-bottom: 20px; }
.wordmark { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 27px; color: var(--ink); text-decoration: none; margin-right: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-weight: 600; font-size: 15.5px; }
.nav a { text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
.nav a:hover { border-bottom-color: currentColor; }
.draft { margin-top: 4px; margin-bottom: 8px; }
.draft { font-family: Kalam, cursive; font-size: 19px; color: var(--red); }

/* buttons and store links */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border-radius: 6px; font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-red { background: #C81E35; border-color: #C81E35; color: #fff; }
.btn-line { background: transparent; color: var(--ink); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.store { display: inline-flex; flex-direction: column; justify-content: center; min-height: 54px; padding: 6px 18px 7px; border-radius: 8px; background: var(--ink); color: var(--paper); text-decoration: none; line-height: 1.15; border: 2px solid var(--ink); }
.store-sub { font-size: 11.5px; opacity: 0.85; }
.store-name { font-size: 17px; font-weight: 700; }
.store-soon { background: transparent; color: var(--ink-soft); border-style: dashed; border-color: var(--rule-strong); }
.store-web { background: #C81E35; border-color: #C81E35; color: #fff; }
.small { font-size: 14px; color: var(--ink-faint); }

/* home: hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 48px; padding-bottom: 88px; }
.hero-kicker { font-family: Kalam, cursive; font-size: 25px; color: var(--red); margin: 0; transform: rotate(-2deg); transform-origin: left; display: inline-block; }
.hero h1 { font-size: clamp(54px, 7.6vw, 108px); line-height: 0.92; letter-spacing: -0.015em; margin: 10px 0 0; }
.hero-lede { font-size: 20px; line-height: 1.55; color: var(--ink-soft); max-width: 34em; margin: 22px 0 0; }
.hero .small { margin: 14px 0 0; }
.polaroid { margin: 0; position: relative; }
.polaroid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 8px solid var(--frame); box-shadow: 0 2px 0 var(--shadow), 0 18px 40px var(--shadow); transform: rotate(1.2deg); }
.sticky { background: var(--note); color: var(--note-ink); font-family: Kalam, cursive; font-size: 19px; line-height: 1.35; padding: 10px 16px; box-shadow: 0 6px 16px var(--shadow); }
.polaroid .sticky { position: absolute; right: -6px; bottom: -26px; transform: rotate(-3deg); max-width: 75%; }

/* sections */
.section { padding-top: 40px; padding-bottom: 88px; }
.section h2 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.02; margin: 0; }
.section-lede { font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 38em; margin: 12px 0 0; }

/* the book: features as a batting card */
.card-table { margin-top: 34px; background: var(--paper-card); border: 2px solid var(--blue); border-radius: 4px; overflow: hidden; }
.card-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 2fr) 92px; border-bottom: 1px solid var(--rule-strong); }
.card-row:last-child { border-bottom: 0; }
.card-row > * { padding: 16px 16px; border-right: 1px solid var(--rule-strong); margin: 0; }
.card-row > *:last-child { border-right: 0; }
.card-head { background: var(--blue); color: var(--blue-ink); font-weight: 700; font-size: 14px; }
.card-head > * { padding-top: 10px; padding-bottom: 10px; border-color: transparent; }
.card-name { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 21px; line-height: 1.25; }
.card-how { font-size: 16px; line-height: 1.55; color: var(--ink-soft); }
.card-count { text-align: right; font-family: Kalam, cursive; font-weight: 700; font-size: 31px; line-height: 1.1; }
.card-head .card-count { font-family: inherit; font-size: 14px; }
.card-head .card-how { color: var(--blue-ink); font-size: 14px; }
.card-foot { background: transparent; }
.card-foot > * { font-size: 14px; color: var(--ink-faint); }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.shot { margin: 0; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 8px solid var(--frame); box-shadow: 0 14px 30px var(--shadow); }
.shot:nth-child(3n + 1) img { transform: rotate(-1deg); }
.shot:nth-child(3n + 2) img { transform: rotate(0.8deg); }
.shot:nth-child(3n) img { transform: rotate(-0.5deg); }
.shot figcaption { margin-top: 12px; font-family: Kalam, cursive; font-size: 19px; color: var(--blue); }

/* fixtures (modes) */
.fixtures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; margin-top: 28px; }
.fixture { padding: 18px 0 22px; border-top: 2px solid var(--ink); }
.fixture h3 { font-size: 25px; margin: 0; }
.fixture p { margin: 8px 0 0; color: var(--ink-soft); line-height: 1.55; }

/* platforms */
.grounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.ground { background: var(--paper-card); border: 1px solid var(--rule-strong); padding: 20px 20px 22px; border-radius: 4px; }
.ground h3 { font-size: 22px; margin: 0; }
.ground p { margin: 8px 0 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.5; }

/* the sign-up note */
.note-card { background: var(--note); color: var(--note-ink); padding: 34px 32px; max-width: 640px; box-shadow: 0 16px 34px var(--shadow); transform: rotate(-0.6deg); }
.note-card h2 { font-family: Kalam, cursive; font-weight: 700; font-size: 34px; line-height: 1.1; color: var(--note-ink); margin: 0; }
.note-card p { margin: 10px 0 0; }
.signup { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.signup label { flex: 1 1 100%; font-weight: 700; font-size: 14px; }
.signup input[type="email"] { flex: 1 1 240px; min-height: 50px; padding: 0 14px; border: 2px solid #13213D; border-radius: 4px; background: #fff; color: #13213D; font: inherit; font-size: 16px; }
.signup .btn-red { border-color: #C81E35; background: #C81E35; }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup-msg { min-height: 1.6em; margin: 10px 0 0; font-weight: 600; }
.note-card .fine { font-size: 13.5px; opacity: 0.85; margin-top: 12px; }
.note-card a { color: #13213D; }

/* text pages: policies, support, press */
.page-head { padding-top: 36px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(42px, 6vw, 72px); line-height: 0.98; margin: 0; }
.page-head p { font-size: 19px; color: var(--ink-soft); max-width: 36em; margin: 16px 0 0; }
.prose { padding-bottom: 72px; }
.prose > * { max-width: 70ch; }
.prose h2 { font-size: 30px; line-height: 1.15; margin: 48px 0 0; }
.prose h3 { font-size: 22px; margin: 32px 0 0; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 14px 0 0; line-height: 1.75; }
.prose li + li { margin-top: 6px; }
.prose dt { font-weight: 700; margin-top: 12px; }
.prose dd { margin: 2px 0 0; }
.prose .sticky { display: inline-block; margin-top: 20px; transform: rotate(-1deg); font-size: 18px; }
.meta-line { font-size: 15px; color: var(--ink-faint); }
.toc { background: var(--paper-card); border: 1px solid var(--rule-strong); padding: 16px 22px; border-radius: 4px; margin-top: 24px; }
.toc p { margin: 0; font-weight: 700; }
.toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.highlight { background: var(--paper-card); border: 2px solid var(--red); padding: 4px 22px 22px; border-radius: 4px; margin-top: 28px; }

/* press kit */
.facts { margin-top: 26px; background: var(--paper-card); border: 2px solid var(--blue); border-radius: 4px; overflow: hidden; }
.fact { display: grid; grid-template-columns: 200px minmax(0, 1fr); border-bottom: 1px solid var(--rule-strong); }
.fact:last-child { border-bottom: 0; }
.fact dt, .fact dd { margin: 0; padding: 12px 16px; }
.fact dt { font-weight: 700; border-right: 1px solid var(--rule-strong); }
.press-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin-top: 26px; }
.press-shots figure { margin: 0; }
.press-shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 6px solid var(--frame); box-shadow: 0 10px 24px var(--shadow); }
.press-shots figcaption { margin-top: 10px; font-size: 15px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.copybox { background: var(--paper-card); border: 1px dashed var(--rule-strong); padding: 14px 18px; border-radius: 4px; margin-top: 12px; white-space: pre-line; }
.icon-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; margin-top: 20px; }
.icon-row figure { margin: 0; }
.icon-row img { border-radius: 22%; box-shadow: 0 8px 20px var(--shadow); }
.icon-row figcaption { margin-top: 8px; font-size: 14.5px; }

/* play */
.play-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 36px; padding-bottom: 64px; }
.play-hero h1 { font-size: clamp(44px, 6vw, 76px); line-height: 0.96; margin: 0; }
.play-hero p { font-size: 19px; color: var(--ink-soft); margin: 16px 0 0; }
.play-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border: 2px solid var(--red); border-radius: 50%; display: grid; place-items: center; font-family: Kalam, cursive; font-weight: 700; color: var(--red); line-height: 1; }

/* footer */
.foot { border-top: 2px solid var(--ink); margin-top: 24px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-top: 36px; padding-bottom: 52px; }
.foot p { margin: 0; }
.foot-name { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 24px; }
.foot-by, .foot-copy { color: var(--ink-faint); font-size: 14.5px; margin-top: 6px; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px 40px; font-size: 15px; align-content: start; }
.foot-links a { padding: 3px 0; }

/* the not-found page */
.lost { padding-top: 60px; padding-bottom: 120px; }
.lost h1 { font-size: clamp(48px, 8vw, 96px); margin: 0; }
.lost .pencil { font-size: 26px; color: var(--red); margin: 0; }

@media (max-width: 900px) {
  .hero, .play-hero { grid-template-columns: 1fr; gap: 44px; padding-bottom: 72px; }
  .shots { grid-template-columns: 1fr 1fr; }
  .grounds, .fixtures { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16.5px; }
  .wrap { padding-left: calc(var(--gutter) + 14px); }
  .margin-line { left: 12px; }
  .card-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .card-row > .card-how { grid-column: 1 / -1; order: 3; border-right: 0; border-top: 1px dashed var(--rule-strong); padding-top: 12px; }
  .card-head .card-how { display: none; }
  .shots, .grounds, .press-shots, .fixtures { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 1fr; }
  .fact dt { border-right: 0; padding-bottom: 0; }
  .toc ol { columns: 1; }
  .foot-links { grid-template-columns: 1fr 1fr; gap: 6px 20px; }
  .note-card { padding: 28px 20px; transform: none; }
  .polaroid .sticky { right: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .store { transition: transform 0.12s ease; }
  .btn:active, .store:active { transform: translateY(1px); }
}
@media print {
  body { background: #fff; color: #000; }
  .margin-line, .top .nav, .foot-links, .note-card, .skip { display: none; }
}
.section h2.pt { margin-top: 64px; }

/* dev notes */
.notes-list { padding-bottom: 72px; display: grid; gap: 0; max-width: calc(70ch + 60px); }
.note-item { padding: 22px 0 24px; border-top: 2px solid var(--ink); }
.note-item h2, .note-item h3 { font-size: 27px; line-height: 1.2; margin: 4px 0 0; }
.note-item h2 a, .note-item h3 a { color: var(--ink); text-decoration: none; }
.note-item h2 a:hover, .note-item h3 a:hover { text-decoration: underline; }
.note-item p { margin: 8px 0 0; color: var(--ink-soft); }
.note-item .note-date { margin: 0; }
.note-date { font-family: Kalam, cursive; font-size: 19px; color: var(--red); }
.note { padding-top: 32px; }
.note h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1; margin: 6px 0 0; max-width: 18em; }
.note .note-back { margin: 0; font-weight: 600; }
.note .note-date { margin: 12px 0 0; }
.latest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-top: 28px; }
@media (max-width: 640px) { .latest { grid-template-columns: 1fr; } }

/* On the lines: every line of text on the paper is exactly one ruled line tall (headings a whole number of lines),
   and js/site.js nudges each block down so its first baseline sits on a rule, as in a school exercise book.
   Cards, notes, photos and buttons are laid on the paper and keep their own spacing. */
main p, main li, main dt, main dd, main figcaption, .foot p, .foot-links a, .wordmark, .nav a { line-height: var(--line) !important; }
h1, h2, h3 { line-height: 1.05 !important; line-height: round(up, 0.88em, var(--line)) !important; }
.ground p, .note-card p, .toc p, .toc li, .highlight p, .highlight li, .copybox, .facts dt, .facts dd, .press-shots figcaption, .icon-row figcaption, .sticky { line-height: 1.55 !important; }
.card-table *, .note-card h2, .toc *, .highlight h2 { line-height: normal !important; }
.card-table .card-how { line-height: 1.55 !important; }
.hero, .play-hero { align-items: start; }
.top-row { align-items: flex-start; }
.nav a { padding: 0; }
.hero-kicker { transform: none; }
.page-head h1 { font-size: clamp(48px, 6vw, 72px); }
.note h1 { font-size: clamp(44px, 5.4vw, 64px); }
.steps li::before { width: 30px; height: 30px; top: 1px; }

/* the lock-up: the mark with the edition raised at its top right, like a degree sign */
.logo { position: relative; display: inline-block; padding-right: 0.5em; }
.logo-ed { position: absolute; right: 0; top: 0.08em; font-size: 0.38em; line-height: 1; color: var(--red); font-weight: 700; }
.hero-sub { font-family: "Zilla Slab", Georgia, serif; font-weight: 500; font-size: clamp(22px, 2.6vw, 32px); color: var(--blue); letter-spacing: 0.04em; margin: 0; }
