/* Design tokens. Source: docs/design/design-tokens.md (designer spec + sampled values).
   Light theme only at launch. */
:root {
  /* color: designer spec */
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F3F2EF;
  --gold: #C9974E;
  --gold-strong: #8B5E26;
  --text: #101314;
  --text-2: #626A6A;
  --text-3: #454B4C;          /* intro paragraphs (sampled) */
  --border: #E6E3DC;
  --border-control: #858078;  /* input, select, textarea, search boundaries: 3.4:1 on --surface-2 (WCAG 1.4.11) */
  --selected-bg: #F8F0E3;
  --cream: #FCF2E4;           /* numbered cards, soft panels (sampled) */

  --success: #16804A;
  --error: #C93434;
  --warning: #B7791F;
  --info: #2563EB;

  /* colour roles (R-95): --gold is decoration only on light grounds (2.6:1 on white), never text there;
     gold text uses --gold-strong (5.4:1) and darkens to --gold-deep on hover.
     Filled controls rest on the drawn taupe and take --gold-strong, the spec's «gold on hover», on hover. */
  --action: #857355;          /* resting fill: buttons, the selected filter, accordion toggles. The drawn #877456 one step darker: white text 4.6:1 */
  --action-hover: var(--gold-strong);
  --action-pressed: #714A1C;  /* filled control while pressed */
  --gold-deep: #714A1C;       /* gold text and outlines on hover */
  --btn-primary: var(--action);
  --btn-primary-text: #FFFFFF;
  --btn-disabled: #D6D6D2;

  /* named colours that recur across stylesheets (R-92) */
  --ink: #1A1E1C;             /* dark grounds: photo slides without a photo, the feature banner, medals */
  --silver: #94A3B8;          /* second place: podium rank, silver accents */
  --error-bg: #FBEDED; --error-line: #F1C9C9;      /* error alert */
  --success-bg: #EAF5EF; --success-line: #C3E3D1;  /* success alert */

  /* frame */
  --banner-from: #FEF6EA;
  --banner-to: #E4C294;
  --footer-from: #7E5521;     /* footer gradient, end side: a dark gold, so light text passes AA everywhere (R-72) */
  --footer-to: #4A443A;       /* footer gradient, start side */
  --footer-text: rgb(255 255 255 / .85);  /* footer links and tagline: 4.9:1 or more on the whole gradient */
  --footer-bar: #0A0E0E;

  /* type: Almarai, ratio about 1.25, 12 px floor (§1.2) */
  --font: "Almarai", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-latin-logo: "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);    /* 36 → 56 */
  --fs-h1: clamp(1.875rem, 1.45rem + 1.8vw, 2.75rem);       /* 30 → 44 */
  --fs-h2: clamp(1.5rem, 1.1rem + 1.65vw, 2.5rem);          /* 24 → 40: section headings as the frames draw them */
  --fs-h2-sm: clamp(1.5rem, 1.2rem + 1.3vw, 2.125rem);      /* 24 → 34: large figures, card and dialog titles */
  --fs-h3: clamp(1.25rem, 1.15rem + .45vw, 1.5rem);         /* 20 → 24 */
  --fs-h4: clamp(1.125rem, 1.08rem + .2vw, 1.25rem);        /* 18 → 20 */
  --fs-lead: clamp(1.0625rem, 1rem + .25vw, 1.25rem);       /* 17 → 20 */
  --fs-body: clamp(1rem, .97rem + .12vw, 1.0625rem);        /* 16 → 17 */
  --fs-ui: 1rem;                                           /* 16 */
  --fs-small: .875rem;                                     /* 14 */
  --fs-xs: .75rem;                                         /* 12, the floor */
  --fs-banner: var(--fs-h1);
  --lh-body: 1.8;
  --lh-heading: 1.3;
  --measure: 70ch;

  /* space: 4 px base */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* shape: three tiers + round (§1.3) */
  --r-sm: 8px;     /* inputs, badges, chips */
  --r-md: 12px;    /* buttons, cards, panels */
  --r-lg: 24px;    /* hero, feature panels, media frames */
  --r-full: 999px;
  --radius-sm: var(--r-sm); --radius-md: var(--r-sm); --radius-lg: var(--r-md); --radius-xl: var(--r-md); --radius-full: var(--r-full);
  --shadow-sm: 0 2px 10px rgb(16 19 20 / .07);             /* resting card on the page background: soft, as drawn */
  --shadow-raised: 0 8px 24px rgb(16 19 20 / .08);         /* hover on clickable cards, featured item */
  --shadow-overlay: 0 16px 40px rgb(16 19 20 / .16);       /* menus, drawer, dialogs */
  --shadow-card: var(--shadow-sm);
  --shadow-pop: var(--shadow-overlay);

  /* layout */
  --content-max: 1320px;
  --gutter: 60px;
  --header-h: 68px;
  --banner-h: 226px;
  --section-gap: 96px;
  --gap: 16px;
  --gap-lg: 24px;
  --control-h: 48px;
  --control-h-sm: 40px;
  --control-h-lg: 56px;       /* search and filter bars: the field, its selects and its buttons (R-67) */
  --target-min: 44px;

  --focus: 0 0 0 3px rgb(201 151 78 / 0.55);
  /* motion: colour and border changes take --dur; things that grow, move or turn take --dur-slow */
  --ease: cubic-bezier(.2, .7, .2, 1);       /* entering */
  --ease-in: cubic-bezier(.4, 0, 1, 1);      /* leaving */
  --dur-1: 120ms;  /* colour, opacity on hover/press */
  --dur-2: 200ms;  /* open/close: accordion, menu, tabs */
  --dur-3: 320ms;  /* drawer, dialog, slide change */
  --dur: var(--dur-1);
  --dur-slow: var(--dur-3);
}

@media (max-width: 1100px) {
  :root { --gutter: 32px; --section-gap: 72px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --section-gap: 56px; --banner-h: 160px; }
}
