/*
  spacebeavers.com — one stylesheet for every page.

  Colors and type follow the game's design pass 3 ("Victorian, a tad dark"; its
  tokens.css and theme.css): the deep navy ground, copper and brass, and the
  patent-medicine label (parchment paper, a brass frame with an ink rule, a dotted inner
  rule and brass fleurons) for the title card and the document pages. Fonts are the
  game's, all SIL Open Font License, served from /fonts (Latin only) with their licenses
  beside them: Abril Fatface (the title), Pinyon Script (the script line), Playfair
  Display (headings, the claim), IM Fell English SC (small print), Nunito (text).
*/

/* Abril Fatface 400, latin */
@font-face {
  font-family: 'Abril Fatface';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/abril-fatface-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display 700, latin */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/playfair-display-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Playfair Display 400 italic, latin */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/playfair-display-latin-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Pinyon Script 400, latin */
@font-face {
  font-family: 'Pinyon Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/pinyon-script-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IM Fell English SC 400, latin */
@font-face {
  font-family: 'IM Fell English SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/im-fell-english-sc-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Nunito 400, latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/nunito-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Nunito 700, latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/nunito-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The game's tokens (design pass 3, "Victorian, a tad dark"), same names and values. */
:root {
  color-scheme: dark;
  --bg: #0a0e17;
  --bg-2: #141826;
  --panel-edge: rgba(201, 162, 74, 0.26);
  --ink: #efe3c8;
  --muted: #b9ae98;
  --dim: #9a917e;
  --accent: #d9742b;
  --gold: #c9a24a;
  --fur-ink: #6b4019;
  --visor: #9fbbd6;
  --paper: #efe3c8;
  --paper-2: #e2d2ae;
  --paper-edge: #b9a275;
  --ink-on-paper: #2a1b12;
  --label-ink: #2a1b12;
  --accent-ink: #9a4a14;
  --claim-ink: #7a2b2b;
  --jet: #1b1511;
  --dim-on-paper: #5c5244;
  --ink-on-accent: #1b1209;

  --font-body: "Nunito", system-ui, sans-serif;
  --font-label: "Abril Fatface", "Playfair Display", Georgia, serif;
  --font-label-text: "Playfair Display", Georgia, serif;
  --font-label-script: "Pinyon Script", "Playfair Display", cursive;
  --font-label-caps: "IM Fell English SC", "Playfair Display", Georgia, serif;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --page: 960px;
  --prose: 720px;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  /* A faint starfield: three dots in a tile, no images. */
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(239, 227, 200, 0.45), transparent 60%),
    radial-gradient(1px 1px at 140px 90px, rgba(159, 187, 214, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 90px 160px, rgba(239, 227, 200, 0.3), transparent 60%);
  background-size: 200px 200px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

main { flex: 1; }

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-label-text);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.35em; }

a { color: var(--visor); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--visor);
  outline-offset: 3px;
  border-radius: 3px;
}

strong, b { font-weight: 700; }

code { font-size: 0.9em; overflow-wrap: anywhere; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--ink-on-accent);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}
.prose { max-width: var(--prose); }

/* ---------- Header ---------- */

/* Brass hairlines, drawn double, as on the game's panels. */
.site-header {
  border-bottom: 1px solid var(--panel-edge);
  box-shadow: 0 3px 0 -2px var(--panel-edge);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: block; line-height: 0; }
/* The game's wordmark lockup (cameo, SPACE BEAVERS, "or, Professor Gnawton's Apparatus"). */
.brand img { width: 186px; height: 45px; display: block; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  font-family: var(--font-label-caps);
  color: var(--muted);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--gold); }

/* ---------- The label (the game's title card; theme.css, `.label`) ---------- */

/* Parchment in a brass frame, an ink rule 5 px inside it, a dotted rule at 9 px, and four brass fleurons. */
.label {
  position: relative;
  background: var(--paper);
  color: var(--label-ink);
  border: 2px solid var(--gold);
  border-radius: 3px;
  padding: 24px 24px 20px;
  text-align: center;
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--label-ink), 0 12px 32px rgba(0, 0, 0, 0.55);
}
.label::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dotted var(--label-ink);
  opacity: 0.55;
  pointer-events: none;
}
.label::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  --fleuron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 28 28'><path fill='%23c9a24a' d='M0 -9 C4 -9 6 -5 6 -2 C9 -2 13 0 13 0 C13 0 9 2 6 2 C6 5 4 9 0 9 C-4 9 -6 5 -6 2 C-9 2 -13 0 -13 0 C-13 0 -9 -2 -6 -2 C-6 -5 -4 -9 0 -9 Z'/><circle r='2.2' fill='%23efe3c8'/></svg>");
  background-image: var(--fleuron), var(--fleuron), var(--fleuron), var(--fleuron);
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: 3px 3px, calc(100% - 3px) 3px, 3px calc(100% - 3px), calc(100% - 3px) calc(100% - 3px);
}

/* The double title: SPACE BEAVERS; / or, / Professor Gnawton's / REMARKABLE GRAVITATIONAL APPARATUS / the claim. */
.label-title {
  font-family: var(--font-label);
  font-weight: 400;
  line-height: 1.02;
  margin: 4px 0 0;
  color: var(--label-ink);
}
.label-title .main {
  display: block;
  font-size: clamp(24px, 7.2vw, 40px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.label .or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px auto 2px;
  max-width: 300px;
  color: var(--gold);
}
.label .or::before,
.label .or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
}
.label .or span {
  font-family: var(--font-label-text);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  color: var(--dim-on-paper);
}
.label .eyebrow {
  font-family: var(--font-label-script);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 400;
  line-height: 1;
  color: var(--claim-ink);
  margin-top: 2px;
}
/* A small-caps tag where the title screen has the script (the end screen's, and the 404's). */
.label .eyebrow.caps {
  font-family: var(--font-label-caps);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
}
.label-sub {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(15px, 4.2vw, 21px);
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--label-ink);
  margin: 2px 0 0;
}
.label-sub .big {
  display: block;
  font-size: 1.5em;
  letter-spacing: 0.03em;
}
/* A rule with a winged hourglass in the middle (tempus fugit), the way old labels break a line. */
.label .rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px auto;
  max-width: 260px;
  color: var(--gold);
  --hourglass: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-20 -10 40 20'><g fill='%23c9a24a' stroke='%23c9a24a' stroke-linejoin='round'><path d='M-4.5 -7 H4.5 L0.8 0 L4.5 7 H-4.5 L-0.8 0 Z' fill='none' stroke-width='1.3'/><path d='M-3.4 6.2 H3.4 L0 1.8 Z M-1.8 -2.6 H1.8 L0 -0.6 Z' stroke='none'/><path d='M-5.5 -8 H5.5 M-5.5 8 H5.5' stroke-width='1.8' stroke-linecap='round'/><path d='M-6 -1 C-8 -6 -14 -7 -18 -4 C-15 -4 -12 -3 -10 -1 C-13 -1 -16 1 -17 4 C-14 3 -11 2 -8 2 C-10 3 -11 5 -11 7 C-9 5 -7 3 -5 2 Z' stroke-width='0.8'/><path d='M6 -1 C8 -6 14 -7 18 -4 C15 -4 12 -3 10 -1 C13 -1 16 1 17 4 C14 3 11 2 8 2 C10 3 11 5 11 7 C9 5 7 3 5 2 Z' stroke-width='0.8'/></g></svg>");
}
.label .rule::before,
.label .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
}
.label .rule i {
  width: 30px;
  height: 16px;
  background: var(--hourglass) center / contain no-repeat;
}
.label .claim {
  font-family: var(--font-label-text);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1.25;
  margin: 10px 0 0;
  color: var(--claim-ink);
}
.label .label-pitch {
  font-size: 15px;
  line-height: 1.5;
  margin: 12px auto 0;
  max-width: 400px;
  color: var(--ink-on-paper);
}
.label .label-pitch b { color: var(--accent-ink); }
.label .label-pitch a { color: var(--accent-ink); }
.label .small-print {
  font-family: var(--font-label-caps);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--dim-on-paper);
  margin: 12px 0 0;
}

/* Her portrait as a cameo, mounted like a mourning brooch: an oval in a jet ring with a brass edge,
   a brass bead ring (dotted outline) outside it, overlapping the label's top. */
.medallion {
  display: inline-grid;
  place-items: center;
  width: 112px;
  height: 136px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 3px solid var(--jet);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 5px var(--paper), 0 10px 26px rgba(0, 0, 0, 0.5);
  outline: 2px dotted var(--gold);
  outline-offset: 7px;
  overflow: hidden;
  margin: -84px 0 8px;
  position: relative;
  z-index: 1;
}
.medallion img { width: 120px; height: 116px; max-width: none; margin-top: 6px; display: block; }

/* ---------- Home ---------- */

.hero { padding: 108px 0 48px; }
.hero .label { max-width: 540px; margin: 0 auto; }

/* The dark card under the label, with the double brass hairline. */
.below {
  max-width: 540px;
  margin: 16px auto 0;
  padding: 20px 20px 22px;
  background: var(--bg-2);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 3px var(--bg-2), inset 0 0 0 4px var(--panel-edge);
}
.below .pitch { font-size: 1.05rem; }
.modes { list-style: none; padding: 0; margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }
.modes li + li { margin-top: 0.6em; }
.modes b { color: var(--ink); }

/* "Coming soon to Google Play": plain text on copper, not Google's badge artwork (that needs a store link). */
.store-badge {
  display: block;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink-on-accent);
  text-align: center;
  line-height: 1.2;
}
.store-badge small { display: block; font-size: 0.8rem; }
.store-badge strong { display: block; font-size: 1.15rem; }
.fine { color: var(--dim); font-size: 0.9rem; margin: 12px 0 0; text-align: center; }

/* ---------- Document pages (privacy, support) ---------- */

.page-head { padding: 44px 0 8px; }
.page-head h1 {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.kicker {
  font-family: var(--font-label-caps);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 0 0 8px;
}
.lead { color: var(--muted); font-size: 1.1rem; }

/* The document itself: a long label. */
.sheet {
  text-align: left;
  padding: 32px 30px 26px;
  margin: 16px 0 72px;
  color: var(--ink-on-paper);
  font-size: 1rem;
}
.sheet a { color: var(--accent-ink); }
.sheet h2 {
  font-size: 1.45rem;
  color: var(--label-ink);
  margin-top: 1.8em;
}
.sheet h2:first-child { margin-top: 0.2em; }
.sheet h3 { font-size: 1.1rem; color: var(--fur-ink); margin-top: 1.5em; }
.sheet > :last-child { margin-bottom: 0; }

.summary {
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 16px 20px;
  margin: 8px 0 8px;
}
.summary ul { margin: 0; }

.toc { border-left: 2px solid var(--paper-edge); padding: 2px 0 2px 18px; margin: 4px 0 8px; }
.toc h2 {
  font-family: var(--font-label-caps);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  margin: 0 0 8px;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li + li { margin-top: 0.3em; }

.faq h2 { scroll-margin-top: 16px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--panel-edge);
  box-shadow: 0 -3px 0 -2px var(--panel-edge);
  padding: 28px 0 36px;
  color: var(--dim);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer p { margin: 0; }

/* ---------- 404 ---------- */

.not-found { padding: 108px 0 72px; }
.not-found .label { max-width: 480px; margin: 0 auto; }
.not-found h1.label-sub { margin: 4px 0; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  /* Sides only: .hero and .not-found set their own top and bottom. */
  .wrap { padding-left: 16px; padding-right: 16px; }
  .label { padding: 22px 16px 18px; }
  .sheet { padding: 26px 20px 22px; }
  .below { padding: 18px 16px 20px; }
  .summary { padding: 14px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
