/*
 * Design tokens, from the Figma Color, Typography, Spacing and Interface
 * states pages. The site is dark. Cards and sections can opt into the sand
 * surface with data-surface="sand"; there is no light theme.
 */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-400.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-600.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-700.woff2") format("woff2");
}

@font-face {
  font-family: "Cal Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/cal-sans-400.woff2") format("woff2");
}

:root {
  /* Palette */
  --ink-base: #0b0b0b;
  --ink-card: #151515;
  --stone-dark: #2a2a2a;
  --stone-border: #33322f;
  --stone-text: #44413c;
  --stone-caption: #59544d;
  --sand-paper: #f3efe6;
  --sand-beige: #e9e3d7;
  --sand-soft: #d6d1c4;
  --sand-border: #ccc5b9;
  --sand-muted: #bdb9b0;
  --sand-caption: #b8b2a8;
  --paper-white: #ffffff;

  /* Status tones. Each has a light accent (icons, dates, dots, callout edges
     on the dark surface), a very dark background for the alert banner, and a
     deep color for accents on the sand surface. */
  --status-info: #79cdff;
  --status-info-bg: #0b2447;
  --status-info-on-sand: var(--stone-text);
  --status-success: #86efac;
  --status-success-bg: #073a30;
  --status-success-on-sand: #166534;
  --status-error: #ffb4a5;
  --status-error-bg: #460916;
  --status-error-on-sand: #991b1b;
  --status-warning: #fcc26d;
  --status-warning-bg: #763800;
  --status-warning-on-sand: var(--status-warning-bg);

  /* Game status: text on background */
  --game-rescheduled-text: #fcd99b;
  --game-rescheduled-bg: #352918;
  --game-location-changed-text: #93c5fd;
  --game-location-changed-bg: #152535;
  --game-canceled-text: #fca5a5;
  --game-canceled-bg: #33191b;

  /* Semantic roles (dark surface, the default) */
  --surface-page: var(--ink-base);
  --surface-card: var(--ink-card);
  --surface-raised: var(--stone-dark);
  --text-primary: var(--paper-white);
  --text-muted: var(--sand-muted);
  --text-caption: var(--sand-caption);
  --text-credit: #7f7a71; /* footer Kirby credit: 4.6:1 on --ink-base, just above the 4.5:1 AA minimum, so it stays quiet */
  --border: var(--stone-border);
  --border-strong: var(--sand-soft);

  /* Buttons: primary and secondary families, per state */
  --button-primary-text: var(--ink-base);
  --button-primary-bg: var(--paper-white);
  --button-primary-border: var(--paper-white);
  --button-primary-hover-bg: var(--sand-paper);
  --button-primary-active-bg: var(--sand-soft);
  --button-secondary-text: var(--paper-white);
  --button-secondary-bg: var(--ink-card);
  --button-secondary-border: var(--sand-soft);
  --button-secondary-hover-bg: var(--stone-dark);
  --button-secondary-active-bg: var(--stone-border);

  /* Focus and disabled */
  --focus-ring: var(--paper-white);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --disabled-opacity: 0.32;
  --min-tap-target: 44px;

  /* Type families */
  --font-heading: "Cal Sans", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;

  /*
   * Fluid type. Each step interpolates from its 390px (mobile) size to its
   * 1440px (desktop) size. Nothing falls below 14px: the 12px and 13px
   * Figma sizes are raised to 14px.
   */
  --text-eyebrow: 14px;
  --text-small: 14px;
  --text-schedule: 16px;
  --text-badge: 13px;
  --text-body: clamp(15px, calc(15px + 3 * (100vw - 390px) / 1050), 18px);
  --text-lead: clamp(17px, calc(17px + 5 * (100vw - 390px) / 1050), 22px);
  --text-label: clamp(17px, calc(17px + 1 * (100vw - 390px) / 1050), 18px);
  --text-heading-brand: 22px;
  --text-heading-title: clamp(21px, calc(21px + 9 * (100vw - 390px) / 1050), 30px);
  --text-heading-section: clamp(26px, calc(26px + 14 * (100vw - 390px) / 1050), 40px);
  --text-heading-page: clamp(35px, calc(35px + 29 * (100vw - 390px) / 1050), 64px);
  --text-heading-hero: clamp(40px, calc(40px + 72 * (100vw - 390px) / 1050), 112px);

  --tracking-eyebrow: 1.6px;
  --leading-body: 1.45;
  --leading-tight: 1.05;

  /* Spacing scale */
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-14: 14px;
  --space-16: 16px;
  --space-18: 18px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-36: 36px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-80: 80px;

  /* Layout */
  --page-gutter: clamp(24px, calc(24px + 48 * (100vw - 390px) / 1050), 72px);
  --page-max: 1440px;
  --grid-gap: var(--space-24);
  --section-gap: var(--space-36);
  --radius-control: 8px;
  --radius-card: 8px;
  --radius-badge: 6px;
}

@media (min-width: 1025px) {
  :root {
    --radius-control: 6px;
  }
}

/* Sand surface: a card or section that opts in switches roles, not components. */
[data-surface="sand"],
.forms-block {
  --surface-card: var(--sand-paper);
  --surface-raised: var(--sand-beige);
  --text-primary: var(--ink-base);
  --text-muted: var(--stone-text);
  --text-caption: var(--stone-caption);
  --border: var(--sand-border);
  --border-strong: var(--ink-base);
  --focus-ring: var(--ink-base);

  /* Primary stays white on sand (the Calendar button specimen). */
  --button-primary-hover-bg: var(--sand-beige);
  --button-primary-active-bg: var(--sand-soft);
  --button-secondary-text: var(--ink-base);
  --button-secondary-bg: var(--sand-beige);
  --button-secondary-border: var(--sand-border);
  --button-secondary-hover-bg: var(--sand-soft);
  --button-secondary-active-bg: var(--sand-border);

  background: var(--surface-card);
  color: var(--text-primary);
}
