/*
 * Reset, typography scale and layout primitives.
 *
 * Fonts are the game's own, self-hosted: Baloo 2 for every display/heading/
 * button (the app's rule is "Baloo 2 for ALL bold/heading text") and Nunito
 * for body copy. Both are SIL Open Font License - see fonts/OFL.txt. Nothing
 * here touches a third-party font host, so the privacy page's "no third-party
 * tracking" claim covers the website too.
 */

@font-face {
  font-family: 'Baloo 2';
  src: url('../fonts/Baloo2-Variable.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-Variable.woff2') format('woff2-variations');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-card-body);
  background: var(--sky-2);
  overflow-x: hidden;
}

/* The sky gradient is the page's ground, fixed behind everything, exactly as
   ambient_background.gd paints it in the app. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--sky);
  z-index: -2;
}

img,
svg,
picture {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--stroke-section);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

a:hover {
  color: var(--sky-0);
}

/* Focus: always visible, never removed. Two rings so it reads on both the
   cream cards and the blue sky. */
:focus-visible {
  outline: 3px solid var(--ink-hi);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--sun);
  color: var(--ink-hi);
}

/* --- Type scale ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  color: var(--ink-card-title);
  line-height: 1.12;
  margin: 0 0 var(--s4);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
}
h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
}
h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}
h4 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 var(--s4);
  max-width: var(--measure);
}

/* Deliberately NOT a global `ul, ol { max-width }`: almost every list on this
   site is a layout list (a card grid, a rail, a chip row), and capping those
   at a reading measure silently clips them. Prose lists opt in instead. */
.prose ul,
.prose ol,
.legal__body ul,
.legal__body ol {
  max-width: var(--measure);
}

strong {
  font-weight: 700;
  color: var(--ink-card-title);
}

small {
  font-size: 0.85rem;
}

/* Tabular figures wherever numbers sit in a column or change in place. */
.num {
  font-variant-numeric: tabular-nums;
}

/*
 * Display titles: white or gold letters with a saturated blue stroke behind
 * them, which is `apply_display_outline()` / the design file's
 * `paint-order: stroke fill` in the app.
 */
.display {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  color: #fff;
  paint-order: stroke fill;
  -webkit-text-stroke: 5px var(--stroke-section);
  text-shadow: 0 4px 0 rgba(9, 64, 124, 0.25);
}

.display--wordmark {
  -webkit-text-stroke-color: var(--stroke-wordmark);
}

.display--gold {
  color: #ffe07a;
  -webkit-text-stroke-color: #1d5fa8;
}

/* --- Layout primitives --------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(56px, 9vw, 112px);
  position: relative;
}

.stack > * + * {
  margin-top: var(--s4);
}

.grid {
  display: grid;
  gap: var(--s5);
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-card-body);
  max-width: 56ch;
}

/* A lede that sits on the sky rather than inside a card. See .panel. */
.lede.panel {
  max-width: 60ch;
}

.eyebrow {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-card-meta);
  margin: 0 0 var(--s2);
}

/*
 * An eyebrow that sits on the sky rather than inside a card. It is small text,
 * so it needs the full 4.5:1, and #31567A only manages 2.24:1 against the top
 * of the gradient - it gets a surface rather than a darker tint. See .panel.
 */
.eyebrow--sky {
  display: inline-block;
  background: rgba(255, 253, 246, 0.94);
  border-radius: var(--r-pill);
  padding: 6px var(--s4);
  margin-bottom: var(--s4);
}

.center {
  text-align: center;
}

/* `p` carries a reading measure, so a centred paragraph also has to be
   centred as a BOX - text-align alone leaves it hard against the left edge.
   This covers both `.center p` and a `p` that is itself `.center`. */
.center p,
.center .lede,
p.center,
.lede.center {
  margin-inline: auto;
}

/* Screen-reader-only, but focusable (the skip link). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: var(--z-overlay);
  background: var(--card-cream);
  color: var(--ink-card-title);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-pill);
  box-shadow: 0 6px 0 var(--card-bevel);
  transition: top var(--react-up) var(--ease-out);
}

.skip-link:focus {
  top: var(--s4);
}
