/*
 * Launch My Games design tokens (Daybreak).
 *
 * The single source of truth for the launch site, benchmarks pages, and the
 * reference the app's onboarding mirrors. Every value here is documented in
 * ../DESIGN.md; change both together. Components never hard-code a colour,
 * size, radius, spacing step or duration that has a token.
 */

:root {
  color-scheme: dark;

  /* ---------- Colour ---------- */

  /* Canvas and surfaces. The canvas is true black, never a tinted near-black. */
  --color-canvas: #000000;
  --color-surface: #1d1d1f;            /* cards, windows, frames */
  --color-surface-raised: #2c2c2e;     /* a control sitting on a surface: selected segment, key */
  --color-surface-sunken: #111113;     /* wells inside a surface: illustration screens */
  --color-nav: rgba(22, 22, 23, 0.72); /* translucent bar over the canvas, with backdrop blur */

  /* Lines. Hairlines separate; they never box content for decoration. */
  --color-hairline: #333336;
  --color-hairline-strong: #48484a;

  /* Text. All pairs below meet WCAG AA on --color-canvas and --color-surface. */
  --color-text: #f5f5f7;               /* 19.3:1 on canvas */
  --color-text-secondary: #86868b;     /* 5.8:1 on canvas, 4.6:1 on surface */
  --color-text-on-accent: #ffffff;     /* on --color-accent-fill only */

  /* The one accent hue (210deg blue), in two roles. */
  --color-accent: #2997ff;             /* links, focus rings, highlights on dark: 7.0:1 on canvas */
  --color-accent-fill: #0071e3;        /* filled buttons; white text on it is 4.7:1 */
  --color-accent-fill-hover: #0077ed;
  --color-accent-fill-active: #006edb;
  --color-accent-glow: rgba(41, 151, 255, 0.35);

  /* Status, used only where the app itself shows status. */
  --color-status-ready: #30d158;
  --color-status-warning: #ff9f0a;

  /* Window chrome in product mock-ups. */
  --color-window-close: #ff5f57;
  --color-window-minimise: #febc2e;
  --color-window-zoom: #28c840;

  /*
   * Signature gradient: "Daybreak". Reserved for the "No Rosetta" headline,
   * the hero horizon that sits under it, and our own benchmark bars/numbers.
   * Every stop is at least 9.5:1 on the canvas, so gradient text stays readable
   * everywhere along it.
   */
  --daybreak-sky: #74b9ff;
  --daybreak-lilac: #b4a2ff;
  --daybreak-dawn: #ffbe98;
  --gradient-signature: linear-gradient(
    90deg,
    var(--daybreak-sky) 0%,
    var(--daybreak-lilac) 48%,
    var(--daybreak-dawn) 100%
  );
  /* The same light, spent as glow rather than ink. */
  --gradient-horizon-glow: radial-gradient(
    50% 50% at 50% 50%,
    rgba(180, 162, 255, 0.3) 0%,
    rgba(116, 185, 255, 0.12) 50%,
    rgba(0, 0, 0, 0) 100%
  );

  /* Light, not shadow: on black, depth comes from a lit top edge. */
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-frame: 0 40px 120px -40px rgba(41, 151, 255, 0.18), 0 24px 60px -24px rgba(0, 0, 0, 0.9);

  /* ---------- Typography ---------- */

  /* System fonts only; Apple's font files are never embedded. */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  /*
   * Scale (px): 12 / 14 / 17 / 21 / 28 / 40 / 56 / 80 / 176.
   * The three display steps are fluid between a mobile and a desktop size.
   * Big type is set tight: tracking and leading both drop as size rises.
   */
  --text-legal: 0.75rem;     /* 12: footer, fine print */
  --text-caption: 0.875rem;  /* 14: captions, labels in figures */
  --text-body: 1.0625rem;    /* 17: body copy */
  --text-lead: clamp(1.1875rem, 0.95rem + 0.9vw, 1.3125rem);   /* 19 -> 21: intro paragraphs */
  --text-title: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);        /* 22 -> 28: item titles */
  --text-headline-s: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);   /* 28 -> 40 */
  --text-headline: clamp(2.25rem, 1.3rem + 4.4vw, 5rem);       /* 36 -> 80: section headlines */
  --text-display: clamp(2.75rem, 0.5rem + 11.2vw, 11rem);      /* 44 -> 176: the hero mark (fits 390px cleanly) */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-display: 0.94;
  --leading-headline: 1.04;
  --leading-title: 1.18;
  --leading-lead: 1.38;
  --leading-body: 1.5;
  --leading-caption: 1.43;

  --tracking-display: -0.045em;
  --tracking-headline: -0.03em;
  --tracking-title: -0.015em;
  --tracking-body: -0.01em;
  --tracking-caption: 0;

  /* Body copy never runs past this measure (about 65 characters). */
  --measure: 34em;

  /* ---------- Radii ---------- */

  /* Radius grows with the object: a control is tighter than a window. */
  --radius-xs: 6px;      /* segment inside a small segmented control, keycaps */
  --radius-s: 10px;      /* small tiles in illustrations */
  --radius-m: 14px;      /* status card (matches the app), list wells */
  --radius-l: 22px;      /* app windows in mock-ups */
  --radius-xl: 32px;     /* display frames, the diagram's process boundary */
  --radius-pill: 999px;  /* buttons and segmented controls */

  /* ---------- Spacing ---------- */

  /* 4px base. Sections breathe; components stay tight. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --space-section: clamp(72px, 4rem + 5vw, 150px);  /* vertical padding of a page section (two meet between sections) */
  --space-gutter: clamp(20px, 4vw, 48px);           /* page side margin */

  --width-content: 980px;  /* text-led sections */
  --width-wide: 1180px;    /* figures and two-column layouts */
  --height-nav: 52px;

  /* ---------- Motion ---------- */

  /*
   * One orchestrated moment (the hero on load) and one explained reveal
   * (the architecture diagram). Everything else answers the user.
   * prefers-reduced-motion: reduce sets every duration to 0 below.
   */
  --duration-instant: 120ms;  /* hover and press feedback */
  --duration-fast: 200ms;     /* state cross-fades; matches the app's 0.2 s easeInOut */
  --duration-base: 640ms;     /* scroll reveals */
  --duration-slow: 1400ms;    /* the hero sequence */
  --stagger: 90ms;            /* gap between items revealed together */
  --reveal-distance: 24px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);      /* arrivals */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);   /* state changes */

  /* ---------- Focus ---------- */

  --focus-ring: 0 0 0 2px var(--color-canvas), 0 0 0 4px var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
    --stagger: 0ms;
    --reveal-distance: 0px;
  }
}
