/* ==========================================================================
   PixelCrate — Design Tokens ("Paper Wireframe / Sketchbook")
   Warm graph paper and charcoal ink. The chrome is strictly monochrome so
   full-colour game pictures stand out like printed cut-outs. Accents
   (highlighter, red pen) are used sparingly.
   Every colour, font, size, shadow and z-index lives here.
   ========================================================================== */

/* ---- Typeface: Plus Jakarta Sans, self-hosted (SIL Open Font License,
   see assets/fonts/OFL.txt). One variable file per subset covers every weight
   from 400 to 800; the browser only downloads the subset a page needs.
   Self-hosting avoids a third-party request to Google on every visit.
   /assets/* is cached as immutable: if you ever replace a font file, give it
   a new name (e.g. -v13-) and update the url() and the <link rel="preload">. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans-v12-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans-v12-latin.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;
}

/* ---- Display / metadata face: Space Mono (SIL Open Font License,
   assets/fonts/OFL-SpaceMono.txt), self-hosted like Plus Jakarta Sans. ---- */
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/space-mono-v17-latin-400.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;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/space-mono-v17-latin-700.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;
}

/* ---- Paper ---- */
:root {
  color-scheme: light;

  /* Surfaces */
  --bg-canvas: #FAF8F5;          /* Warm off-white paper */
  --bg-surface: #FFFFFF;         /* Card / modal paper cut-out */
  --bg-surface-alt: #F1EDE4;     /* Recessed inputs, hover states, footer */
  --grid-dot-color: #DCD6C8;     /* Subtle dot-grid colour */

  /* Ink & borders */
  --ink-primary: #1C1B18;        /* Main charcoal ink: text and borders */
  --ink-secondary: #57534E;      /* Muted pencil annotations / metadata */
  --border-ink: #1C1B18;
  --border-dashed: #8C857B;

  /* Accents (sparingly: active states, the Play call-to-action, badges) */
  --accent-highlighter: #FFE863; /* Yellow highlighter marker fill */
  --accent-red-pen: #E63946;     /* Red editing pen: NEW / HOT stamp borders */
  --accent-red-ink: #C1121F;     /* Red TEXT: #E63946 is under 4.5:1 on white, this is 6.2:1 */
  --on-highlighter: #1C1B18;     /* Text drawn on a highlighter fill */

  /* Shadows & geometry: hard, unblurred offset shadows */
  --shadow-color: var(--ink-primary);   /* colour of every hard offset shadow */
  --shadow-card: 4px 4px 0px var(--ink-primary);
  --shadow-card-hover: 6px 6px 0px var(--ink-primary);
  --shadow-button: 3px 3px 0px var(--ink-primary);
  --shadow-button-active: 1px 1px 0px var(--ink-primary);
  --radius-sm: 2px;
  --radius-md: 4px;
  --border-width: 2px;

  /* Game stage */
  --stage-bg: #1C1B18;           /* Letterbox behind a game */
  --scrim: rgba(28, 27, 24, 0.88); /* "Lights off" dimmer */

  /* ---- Typography ---- */
  --font-display: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3rem;
  --fs-xl: clamp(1.5rem, 1.1rem + 1.7vw, 2.3rem);
  --fs-hero: clamp(1.7rem, 1.1rem + 2.6vw, 3rem);
  --lh-tight: 1.2;
  --lh-base: 1.6;
  --tracking-meta: 0.05em;       /* uppercase mono labels */

  /* ---- Spacing (4px scale) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- Layout ---- */
  --container: 1360px;
  --container-narrow: 820px;
  --gutter: clamp(16px, 3vw, 32px);
  --nav-h: 64px;
  --card-min: 200px;
  --shelf-card: clamp(176px, 21vw, 250px);
  --grid-size: 24px;             /* dot-grid spacing */

  /* ---- Motion: short and tactile; transform/opacity only ---- */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 100ms;
  --dur: 160ms;
  --dur-slow: 320ms;

  /* ---- Ads ---- */
  --ad-clearance: 16px;     /* minimum gap between any ad and the game stage */
  --skyscraper-w: 160px;

  /* ---- Z-index map (low → high). Ads always sit BELOW the game stage. ---- */
  --z-base: 1;
  --z-card: 2;
  --z-ad: 5;
  --z-sticky-ad: 10;
  --z-stage: 20;
  --z-nav: 100;
  --z-scrim: 150;           /* "lights off" dimmer: above the navbar … */
  --z-focus: 160;           /* … the game window and its controls stay above it */
  --z-dropdown: 200;
  --z-stage-fullscreen: 1000;
  --z-toast: 1100;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
