/* ==========================================================================
   RJP site starter: design tokens
   CONFIDENTIAL to RJP.design. Clean room: values come from the Design Library
   notes (medians of the model sites), never from captured third-party code.

   Sources
   - Frame, spacing, buttons, page: layout-architecture.md pattern 14
   - Type scale: typography.md pattern 0 ("RJP starter tokens")
   - Color roles: colour-imagery.md decision guide (one base + one accent,
     tinted near-black text, body 7:1+, one 1px line system)
   - Motion: motion-interaction.md "The motion budget"
   Fonts for the "default" theme preview (Google, OFL, not bundled; read by
   scripts/build.mjs for the ?theme= switch):
   https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..500&family=Manrope:wght@400..700&display=swap

   HOW A BRAND PUSHES THESE
   Only touch the "BRAND OVERRIDE POINTS" block (or load a theme file from
   css/themes/ after this file). Components read the ROLE tokens, never raw
   hex, so a brand changes in one place. Run `node tests/run.mjs` after any
   color change: it recomputes every contrast pair (tests/output/contrast.md).
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------------
     BRAND OVERRIDE POINTS (themes override only this block)
     --------------------------------------------------------------------- */

  /* Type families. Defaults are Google Fonts (OFL) from Ross's liked list:
     Fraunces (serif) + Manrope (sans). Fonts are NOT bundled. For a client
     build, license the faces and self-host subset WOFF2 (see README).
     The "... Fallback" faces are metric-matched local fonts (see base.css)
     so the swap does not shift the layout. */
  --font-display: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Manrope Fallback", "Helvetica Neue", Arial, sans-serif;
  --display-weight: 400;          /* serif display 300-400; grotesk 500-600 */
  --display-tracking: -0.01em;    /* serif 0 to -0.01em; grotesk -0.02 to -0.04em */
  --display-case: none;           /* sentence case by default; caps only for heavy faces */
  --display-italic: italic;       /* accent words inside headings (<em>) */

  /* Palette. Light set = the page base (white or ONE warm off-white).
     Dark set = footer, bands, dark media themes. One accent, used in few places. */
  --brand-paper: #ffffff;
  --brand-paper-alt: #f4f2ee;
  --brand-ink: #16202b;           /* tinted near-black */
  --brand-ink-muted: #4c5560;
  --brand-night: #14202d;         /* deep navy-black */
  --brand-night-alt: #1c2a39;
  --brand-night-ink: #ffffff;
  --brand-night-muted: #c4cbd3;
  --brand-accent: #1f3550;        /* deep low-chroma navy */
  --brand-on-accent: #ffffff;
  --brand-accent-on-paper: #1f3550;   /* accent used as text on the light base */
  --brand-accent-on-night: #c9d6e6;   /* accent used as text on the dark set */
  --brand-error: #a8261b;
  --brand-error-on-night: #ffb4a8;
  --brand-scrim: 10 14 18;        /* RGB triplet for photo overlays */

  /* Shape: pick ONE set per brand. Square = editorial, luxury, hospitality.
     Soft = builders, product, tech: media 16px (12-24), control 4-8px.
     Never pills (no Buttons-Reuse site used them). */
  --radius-media: 0px;
  --radius-control: 0px;
  --radius-round: 999px;          /* arrow and pause circles ONLY */

  /* ---------------------------------------------------------------------
     TYPE SCALE (fluid 390 -> 1440, rem + vw so 200% zoom works)
     --------------------------------------------------------------------- */
  --fs-display-xl: clamp(3.5rem, 2.2rem + 5.33vw, 7rem);       /* 56 -> 112, bold brand hero only */
  --fs-h1: clamp(2.5rem, 1.757rem + 3.05vw, 4.5rem);           /* 40 -> 72 */
  --fs-h2: clamp(1.875rem, 1.457rem + 1.71vw, 3rem);           /* 30 -> 48 */
  --fs-statement: clamp(1.625rem, 1.3rem + 1.33vw, 2.5rem);    /* 26 -> 40 */
  --fs-intro: clamp(1.75rem, 1.25rem + 2.05vw, 3rem);          /* 28 -> 48, intro statement on white */
  --fs-h3: clamp(1.375rem, 1.143rem + 0.952vw, 2rem);          /* 22 -> 32, card titles */
  --fs-lead: clamp(1.125rem, 1.032rem + 0.381vw, 1.375rem);    /* 18 -> 22 */
  --fs-body: 1rem;                                             /* 16, never under */
  --fs-small: 0.875rem;                                        /* 14, legal and captions */
  --fs-label: 0.8125rem;                                       /* 13 caps */
  --fs-button: 0.78125rem;                                     /* 12.5 caps */
  --fs-nav: 0.875rem;                                          /* 14 */

  --lh-display: 1.04;
  --lh-h2: 1.12;
  --lh-statement: 1.25;
  --lh-h3: 1.15;
  --lh-body: 1.55;
  --lh-label: 1.3;
  --tracking-label: 0.14em;
  --tracking-button: 0.12em;

  /* ---------------------------------------------------------------------
     FRAME AND SPACING (layout-architecture.md pattern 14)
     --------------------------------------------------------------------- */
  --page-max: 1440px;
  --margin: clamp(16px, 3.5vw, 56px);        /* 390 -> 16, 1440 -> ~50 */
  --gutter: clamp(12px, 1.4vw, 24px);
  --card-gap: clamp(12px, 1.2vw, 20px);
  --section-y: clamp(64px, 8vw, 120px);
  --section-y-tight: clamp(40px, 5vw, 80px);
  --section-y-loose: clamp(96px, 11vw, 168px);
  --head-to-content: clamp(32px, 4.5vw, 64px);
  --stack-2xs: 4px;
  --stack-xs: 8px;
  --stack-s: 16px;
  --stack-m: 24px;
  --stack-l: 40px;
  --stack-xl: 64px;
  --measure-statement: 880px;
  --measure-text: 34rem;
  --measure-h1: 14ch;

  /* Lines: one 1px system */
  --line-w: 1px;

  /* Buttons */
  --btn-h: 48px;
  --btn-px: 28px;
  --btn-weight: 600;
  --btn-gap: 12px;
  --link-underline-offset: 6px;

  /* Page */
  --nav-h: 76px;                  /* top state */
  --nav-h-solid: 64px;            /* scrolled state, 56-90 */
  --hero-h: max(600px, 92svh);

  /* Overlays sized to the photo (colour-imagery.md): 20% calm, 35-45% busy,
     60% under a serif headline on video. The text corner reaches --scrim-text. */
  --scrim-top: 0.64;              /* behind the clear nav bar, fades out by 260px */
  --scrim-text: 0.62;             /* floor under hero, band and selector text (base.css .text-scrim) */
  --scrim-card: 0.62;             /* floor under card titles */

  /* ---------------------------------------------------------------------
     MOTION (two curves; no bounce)
     --------------------------------------------------------------------- */
  --dur-ui: 0.25s;                /* hover color 0.15-0.3 */
  --dur-nav: 0.3s;
  --dur-swap: 0.45s;              /* tab / slide cross-fade 0.3-0.5 */
  --dur-zoom: 0.7s;               /* image zoom 0.6-0.8, scale 1.03-1.05 */
  --dur-reveal: 0.7s;             /* reveal on enter 0.6-0.8 */
  --rise: 32px;                   /* 24-40 */
  --zoom: 1.04;
  --ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-long: cubic-bezier(0.16, 1, 0.3, 1);

  --z-nav: 50;
  --z-menu: 60;
}

/* ==========================================================================
   ROLE TOKENS (components read only these)
   A surface re-maps the roles, so any component works on light or dark.
   ========================================================================== */
:root,
[data-surface="light"] {
  --surface: var(--brand-paper);
  --surface-alt: var(--brand-paper-alt);
  --text: var(--brand-ink);
  --text-muted: var(--brand-ink-muted);
  --link: var(--brand-accent-on-paper);
  --line: color-mix(in srgb, var(--brand-ink) 16%, transparent);
  --line-strong: color-mix(in srgb, var(--brand-ink) 62%, var(--brand-paper)); /* form controls, 3:1+ */
  --focus: var(--brand-ink);
  --error: var(--brand-error);
  --btn-bg: var(--brand-accent);
  --btn-text: var(--brand-on-accent);
  color-scheme: light;
}

[data-surface="light-alt"] {
  --surface: var(--brand-paper-alt);
  --surface-alt: var(--brand-paper);
}

[data-surface="dark"] {
  --surface: var(--brand-night);
  --surface-alt: var(--brand-night-alt);
  --text: var(--brand-night-ink);
  --text-muted: var(--brand-night-muted);
  --link: var(--brand-accent-on-night);
  --line: color-mix(in srgb, var(--brand-night-ink) 22%, transparent);
  --line-strong: color-mix(in srgb, var(--brand-night-ink) 60%, var(--brand-night));
  --focus: var(--brand-night-ink);
  --error: var(--brand-error-on-night);
  --btn-bg: var(--brand-night-ink);
  --btn-text: var(--brand-night);
  color-scheme: dark;
}

/* Text set over photos and video. The scrim guarantees the contrast
   (tests check white on the scrim composited over pure white). */
[data-surface="media"] {
  --text: #ffffff;
  --text-muted: rgb(255 255 255 / 0.9);
  --link: #ffffff;
  --line: rgb(255 255 255 / 0.32);
  --line-strong: rgb(255 255 255 / 0.7);
  --focus: #ffffff;
  --btn-bg: #ffffff;
  --btn-text: var(--brand-ink);
}
