/* 20/30 SOCIAL design tokens (build plan Appendix A.1 and A.2, M3-01).
   The only stylesheet that may hold a colour or size literal.
   Every other stylesheet uses var(--name).

   Breakpoint: ONE breakpoint, 1024px (Q25). Media queries cannot use
   variables, so write it literally: @media (min-width: 1024px) { ... }

   Names beyond Appendix A.1 (added here): --white, --scrim, --card-shadow,
   --space-*, --radius-*, --shadow-*, --font-*, --text-*, --leading-*,
   --control-h, --tap-min, --focus-*, --w-*, --dur-*, --ease-*, --z-*. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Colour, light theme (A.1) */
  --page: #FBF4E8;
  --surface: #FFFFFF;
  --card-border: transparent; /* Q25: no border in light, soft shadow instead */
  --card-shadow: 0 2px 10px rgb(27 33 64 / 0.10);
  --butter: #FFF3D0;
  --chip: #F3E4C8;
  --band-calendar: #F4E7CE;
  --band-testimonial: #E3E7F8;
  --gold: #E6BE6A;
  --go: #2C8458;
  --plum: #3E4084;
  --link: #3E4084;
  --text: #1B2140;
  --ink: #1B2140;
  --muted: #5C5870;
  --outline: #857F96;
  --full: #FCE2D3;
  --cancelled: #FAD3CB;
  --error: #A3271F;
  --on-error: #FFFFFF;     /* text on an --error fill: white in light, Ink in dark */
  --footer: #3E4084;

  /* Fixed colours, same in both themes */
  --white: #FFFFFF; /* text on --go and on the light-theme --error fill */
  --scrim: rgb(27 33 64 / 0.78);

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --gutter: var(--space-4);

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sheet: 0 -4px 24px rgb(27 33 64 / 0.18);
  --shadow-bar: 0 2px 8px rgb(27 33 64 / 0.12);
  --shadow-pop: 0 8px 28px rgb(27 33 64 / 0.22);

  /* Type */
  --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-sm: 0.875rem;   /* 14px: the smallest size on a phone */
  --text-base: 1rem;     /* 16px: body and input text */
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading-body: 1.5;
  --leading-tight: 1.2;

  /* Controls and focus */
  --control-h: 48px;
  --tap-min: 44px;
  --focus-ring-width: 3px;
  --focus-ring-gap: 2px;
  --focus-ring: var(--link);
  /* On dark grounds (footer, later the plum bars) the link colour vanishes: cream ring. */
  --focus-ring-on-dark: var(--page);

  /* Layout widths */
  --w-public: 1200px;
  --w-event-main: 745px;
  --w-event-side: 395px;
  --w-organizer-form: 755px;
  --w-admin-menu: 260px;
  --w-sheet: 500px;
  --strip-h: 12px;
  --header-h: 3.5rem;   /* the pinned public header; scroll-padding-top equals it */

  /* Motion */
  --dur-fast: 150ms;
  --dur-sheet: 250ms;
  --dur-shake: 300ms;
  --dur-pulse: 600ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  /* Stacking */
  --z-bar: 10;
  --z-sheet: 20;
  --z-skip: 30;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #14172B;
    --surface: #2E3774;
    --card-border: #5560A8;
    --card-shadow: none;
    --butter: #FFF3D0;
    --chip: #4A3F2B;
    --band-calendar: #1E2552;
    --band-testimonial: #28296A;
    --gold: #E6BE6A;
    --go: #2C8458;
    --plum: #3E4084;
    --link: #B9B0E8;
    --text: #F6EEDD;
    --ink: #1B2140;
    --muted: #B4AFC6;
    --outline: #8D87AA;
    --full: #4A1F28;
    --cancelled: #63232F;
    --error: #FF9A8F;
    --on-error: #1B2140;
    --footer: #0F1122;
    --focus-ring: var(--link);
    --focus-ring-on-dark: var(--text);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #14172B;
  --surface: #2E3774;
  --card-border: #5560A8;
  --card-shadow: none;
  --butter: #FFF3D0;
  --chip: #4A3F2B;
  --band-calendar: #1E2552;
  --band-testimonial: #28296A;
  --gold: #E6BE6A;
  --go: #2C8458;
  --plum: #3E4084;
  --link: #B9B0E8;
  --text: #F6EEDD;
  --ink: #1B2140;
  --muted: #B4AFC6;
  --outline: #8D87AA;
  --full: #4A1F28;
  --cancelled: #63232F;
  --error: #FF9A8F;
  --on-error: #1B2140;
  --footer: #0F1122;
  --focus-ring: var(--link);
  --focus-ring-on-dark: var(--text);
}
