/*
 * BoardGameDrop design tokens: "Tile Drop" (owner decision, 25 September 2026).
 *
 * Board Navy ink on a warm paper page, white cards, cool grey hairlines and
 * one accent: Drop Coral, the colour of the tile that tips out of the grid.
 * Coral marks what moved (a price drop, a deal, the lowest point of a chart)
 * and nothing else. Archivo, set expanded and heavy, carries titles and prices;
 * Inter does all other work. Geometry is a quarter-rounded tile, and the one
 * tilted element on a screen is always coral and always at 15 degrees.
 *
 * Components read these custom properties only. The @font-face rules belong
 * in the site's base template so font URLs carry content hashes.
 */

/* Metric-matched fallbacks, measured against the self-hosted files
   (scripts/build-site-fonts.py): size-adjust matches the average advance width of running
   text, the overrides match the real ascent and descent (hhea, 1000 upm).
   Archivo has two: its text cut (400, normal width) against Arial, and the
   wide headline cut (800 at font-stretch 112%) against Arial Bold, chosen by
   font-stretch so the wide titles do not borrow the text metrics. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("ArialMT");
  size-adjust: 98.63%;
  ascent-override: 89.02%;
  descent-override: 21.29%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 700 900;
  font-stretch: 101% 125%;
  size-adjust: 115.61%;
  ascent-override: 75.95%;
  descent-override: 18.16%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
}

:root {
  color-scheme: light;

  /* ── Colour ────────────────────────────────────────────────────────── */
  --paper: #f6f4ef; /* page */
  --paper-card: #ffffff; /* cards, product fields, offer rows */
  --paper-raised: #ffffff; /* popovers, menus */
  --paper-input: #f1f2f5; /* search and form fields at rest */
  --paper-2: #eceef2; /* hover and selected rows */

  --ink: #15203b; /* Board Navy: logo, headings, prices. 16.1:1 on white */
  --text: #15203b;
  --text-body: #3a4560; /* 9.6:1 on white, 8.7:1 on --paper */
  --text-muted: #5b6478; /* 5.9:1 on white, 5.4:1 on --paper */

  --line: #e3e6ec;
  --line-strong: #c9ced9;

  /* The one accent. --coral is for graphics and large bold type
     (3.6:1 on white); text and small labels use --coral-deep (5.4:1). */
  --coral: #e8553a;
  --coral-deep: #c23a22;
  --on-coral: #ffffff; /* only at >= 19px bold; below that use --coral-deep */
  --coral-tint: #fdeae5; /* chart area fill, deal row highlight */

  /* Functional states only: never decoration. */
  --danger: #b3261e;
  --success: #1f6f4a;

  /* ── The tile ──────────────────────────────────────────────────────── */
  --tilt: 15deg; /* the only angle in the system */
  --tile-radius: 25%; /* a quarter of the tile, as in the mark */

  /* ── Type ──────────────────────────────────────────────────────────── */
  --font-display: 'Archivo', 'Archivo Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif;
  --display-stretch: 112%; /* Archivo wdth axis; 118% for hero sizes */
  --display-stretch-hero: 118%;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-display: 800;

  /* A 1.25 scale from 16 px, fluid for display sizes. */
  --text-display: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  --text-h1: clamp(2rem, 1.5rem + 2vw, 3rem);
  --text-h2: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem);
  --text-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-price-lg: clamp(2.125rem, 1.6rem + 2vw, 2.75rem);
  --text-price: 1.125rem;
  --text-lead: 1.125rem;
  --text-body: 1rem;
  --text-ui: 0.9375rem;
  --text-sm: 0.875rem;
  --text-xs: 0.8125rem;
  --text-caption: 0.75rem;

  --tracking-display: -0.01em;
  --tracking-caps: 0.06em;
  --leading-title: 1.05;
  --leading-snug: 1.3;
  --leading-body: 1.55;

  /* ── Space: 4px canon ──────────────────────────────────────────────── */
  --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;
  --space-20: 80px;
  --gutter: var(--space-4); /* page side gutter on phones */
  --gutter-wide: var(--space-12); /* from 900px */
  --measure: 68ch;

  /* ── Radius ────────────────────────────────────────────────────────── */
  --radius-xs: 4px; /* tags, kbd */
  --radius: 6px; /* buttons, fields, shop marks */
  --radius-lg: 10px; /* cards */
  --radius-xl: 16px; /* sheets, dialogs */
  --radius-pill: 999px; /* never used for badges: badges are tiles */

  /* ── Elevation and motion ──────────────────────────────────────────── */
  --shadow-card: 0 1px 2px rgb(21 32 59 / 0.06);
  --shadow-raised: 0 8px 28px rgb(21 32 59 / 0.14);
  --shadow-tile: 0 6px 16px rgb(21 32 59 / 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration: 180ms;
  --focus-ring: 0 0 0 3px var(--paper-card), 0 0 0 5px var(--ink);
}

/* Dark: Night ground, navy surfaces, paper ink, a lighter coral. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0d1426;
    --paper-card: #16203a;
    --paper-raised: #1d2844;
    --paper-input: #1d2844;
    --paper-2: #222e4d;
    --ink: #f6f4ef;
    --text: #f6f4ef; /* 14.7:1 on --paper-card */
    --text-body: #d5d9e3;
    --text-muted: #a9b1c4; /* 7.5:1 on --paper-card */
    --line: #26314d;
    --line-strong: #3a4766;
    --coral: #f06a4f; /* 5.3:1 on --paper-card */
    --coral-deep: #f58a73; /* text in the accent, 6.7:1 */
    --on-coral: #0d1426;
    --coral-tint: #3a2230;
    --shadow-card: none;
    --shadow-raised: 0 8px 28px rgb(0 0 0 / 0.45);
    --shadow-tile: 0 6px 16px rgb(0 0 0 / 0.4);
    --focus-ring: 0 0 0 3px var(--paper-card), 0 0 0 5px var(--ink);
  }
}

:root[data-theme="dark"],
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1426;
  --paper-card: #16203a;
  --paper-raised: #1d2844;
  --paper-input: #1d2844;
  --paper-2: #222e4d;
  --ink: #f6f4ef;
  --text: #f6f4ef;
  --text-body: #d5d9e3;
  --text-muted: #a9b1c4;
  --line: #26314d;
  --line-strong: #3a4766;
  --coral: #f06a4f;
  --coral-deep: #f58a73;
  --on-coral: #0d1426;
  --coral-tint: #3a2230;
  --shadow-card: none;
  --shadow-raised: 0 8px 28px rgb(0 0 0 / 0.45);
  --shadow-tile: 0 6px 16px rgb(0 0 0 / 0.4);
}

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