/* ============================================================
   MILLER THE FARMER — design tokens (makeover, matched to the book)
   One source of truth for every stylesheet and the 3D HUDs. Loaded
   first; older names in site.css map onto these.

   The book's look: bright flat vector cartoon. Pale cyan sky with
   white clouds, layered blue mountains, glossy lime-to-grass green
   rolling hills, a red barn with white X doors, green-and-yellow
   tractor and combine, a red tractor with orange-yellow wheels, a
   wooden picket fence, hay bales, golden wheat and tall corn.
   Narration sits in cream rounded boxes in hand-lettered CAPITALS.
   The logo is yellow / lime green / magenta with a dark outline.
   Everything here is sampled from or matched to the book pages.
   ============================================================ */
@font-face {
  font-family: "Patrick Hand";
  src: url("../assets/fonts/patrickhand.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
:root {
  /* type */
  --font-display: "Fredoka", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --font-book: "Patrick Hand", "Comic Sans MS", cursive;   /* the book's narration boxes: use in CAPS */
  --fs-hero: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem);
  --fs-h1: clamp(1.8rem, 1.3rem + 2vw, 2.8rem);
  --fs-h2: clamp(1.4rem, 1.15rem + 1.1vw, 2rem);
  --fs-h3: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-small: .9rem;
  --lh-tight: 1.1; --lh-body: 1.55;

  /* book palette */
  --sky-top: #8ee7ee;  --sky-mid: #a3f3f9;  --sky-low: #dffafa;   /* cover and page skies */
  --cloud: #ffffff;
  --mountain: #5b8fc9; --mountain-far: #8fb8e0; --mountain-snow: #eef6ff;
  --hill-lime: #b9e441; --hill-grass: #9ed426; --hill-deep: #4a974a; --hill-shadow: #3b6e33;
  --barn-red: #d9332b; --barn-dark: #9b1c1c; --barn-trim: #ffffff;
  --tractor-green: #2f9e3f; --tractor-green-dark: #1f6e2c; --tractor-yellow: #f5c400;
  --red-tractor: #c91a26; --wheel-orange: #f6a21a;
  --combine-green: #2a8a68;
  --wood: #b5814f; --wood-dark: #7d4a2a; --fence: #c98a4f;
  --hay: #e8c25a; --hay-dark: #c79a2e; --wheat: #f2cf5b; --corn-stalk: #586a2d;
  --cream: #f8f2d6;   /* narration box */
  --cream-edge: #e9dfb4;
  --logo-yellow: #fff200; --logo-lime: #3fe21a; --logo-magenta: #ff1fb4; --logo-outline: #2b1a10;
  --party-pink: #ff7aa8; --party-orange: #ffa53a; --party-blue: #3db8f5;

  /* semantic */
  --bg: #f4fcfd;
  --bg-sky: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 30%, var(--sky-low) 62%, #f6fdf0 100%);
  --surface: #ffffff;
  --surface-2: var(--cream);
  --surface-glass: rgba(255, 255, 255, .78);
  --surface-hud: rgba(248, 242, 214, .94);   /* in-game panels = the book's cream boxes */
  --border: rgba(43, 26, 16, .12);
  --border-strong: rgba(43, 26, 16, .28);
  --outline: var(--logo-outline);            /* chunky cartoon outlines on buttons, badges */
  --text: #2b1a10;
  --text-2: #5e4433;
  --text-on-color: #ffffff;
  --accent: var(--barn-red);                 /* primary action */
  --accent-2: var(--tractor-yellow);         /* rewards, stars */
  --accent-3: var(--tractor-green);          /* go, success */
  --link: #1f6fa8;
  --good: var(--tractor-green); --warn: var(--wheel-orange); --bad: var(--barn-red);
  --focus: #1f6fa8;

  /* space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px;

  /* radius */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 32px; --r-pill: 999px;

  /* depth: flat cartoon with a bold drop, like the book's sticker-style shapes */
  --shadow-1: 0 1px 2px rgba(43, 26, 16, .08), 0 2px 8px rgba(43, 26, 16, .06);
  --shadow-2: 0 2px 4px rgba(43, 26, 16, .08), 0 10px 26px rgba(43, 26, 16, .12);
  --shadow-3: 0 8px 16px rgba(43, 26, 16, .12), 0 24px 56px rgba(43, 26, 16, .18);
  --shadow-press: 0 5px 0 rgba(43, 26, 16, .28);
  --glow-gold: 0 0 0 4px rgba(245, 196, 0, .45), 0 8px 28px rgba(245, 196, 0, .45);
  --blur-glass: saturate(150%) blur(12px);

  /* motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 140ms; --t-med: 260ms; --t-slow: 520ms;

  /* layout */
  --wrap: 1180px; --wrap-narrow: 760px; --header-h: 68px; --tabbar-h: 72px;
  --tap: 48px;
}

/* ---- extension (shell builder): soft tints + page bands, all derived from the book palette ---- */
:root {
  --tint-grass: #e6f6c4;   /* pale of --hill-lime */
  --tint-sky: #dcf6f8;     /* pale of --sky-top */
  --tint-barn: #fbe0dc;    /* pale of --barn-red */
  --tint-hay: #fbefc6;     /* pale of --hay */
  --tint-orange: #fde3c0;  /* pale of --wheel-orange */
  --meadow: #eef8d8;       /* page band under the hills */
  --meadow-deep: #d9efaa;
  --paper: #fffdf3;        /* card paper, a touch warmer than white */
  --outline-soft: rgba(43, 26, 16, .82);
  --shadow-sticker: 0 6px 0 rgba(43, 26, 16, .9);        /* chunky cartoon drop under outlined cards */
  --shadow-sticker-sm: 0 4px 0 rgba(43, 26, 16, .9);
  --shadow-sticker-press: 0 1px 0 rgba(43, 26, 16, .9);
  --border-cartoon: 3px solid var(--outline);
  --barn-red-text: #b3241f; /* AA on cream and white for small text */
  --green-text: #2c7a2e;    /* AA on white for small text */
}
@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; --t-slow: 0ms; }
}
