/* ==========================================================================
   PGIS — style.css
   Base layer: reset, design tokens, global typography.
   Design tokens are defined ONCE here as CSS custom properties (TRD §3).
   No component/page CSS may hardcode a hex color or px size — reference
   these tokens instead.
   ========================================================================== */

:root {
  /* Color
     NOTE: --color-primary, --color-error, and --color-success are darkened
     from the original UIUX-Plan §3 proposal (#5B8DEF / #D64545 / #2F9E58).
     Those shades fail WCAG AA (4.5:1) for normal-size text in the roles
     they're actually used in (button labels, links, form status) — UIUX
     §3 and TRD §6 both flag this exact check as required before ship.
     Darkened here to pass AA while keeping the same hue; pending final
     school sign-off per PRD §11, a real palette should re-verify this. */
  --color-primary: #3E6FD1;
  --color-primary-dark: #2F5FC4;
  --color-accent-yellow: #FFD166;
  --color-accent-green: #72C472;
  --color-accent-coral: #FF8A65;
  --color-accent-pink: #F38BA8;
  --color-bg: #FFF9F0;
  --color-text: #263238;
  --color-text-muted: #5A6570;
  --color-white: #FFFFFF;
  --color-error: #C0392B;
  --color-success: #1E8449;
  --color-border: #E7DFCF;

  /* Type */
  --font-heading: 'Fredoka', 'Baloo 2', 'Nunito', sans-serif;
  --font-body: 'Nunito', 'Poppins', 'Inter', sans-serif;

  /* Type scale — fluid, mobile-first (clamp: min, preferred, max) */
  --text-h1: clamp(2.5rem, 5vw + 1rem, 3.5rem);   /* 40 - 56px */
  --text-h2: clamp(1.75rem, 3vw + 1rem, 2.25rem); /* 28 - 36px */
  --text-h3: clamp(1.25rem, 1.5vw + 1rem, 1.5rem); /* 20 - 24px */
  --text-body: 1rem;         /* 16px — mobile minimum, never smaller */
  --text-body-lg: 1.125rem;  /* 18px */
  --text-small: 0.875rem;    /* 14px */

  /* Spacing — 8px base unit */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  /* Layout */
  --container-max: 1280px;
  --radius-card: 16px;
  --radius-pill: 999px;

  /* Motion */
  --transition-fast: 200ms ease;
  --transition-base: 400ms ease;

  /* Elevation */
  --shadow-card: 0 4px 16px rgba(38, 51, 56, 0.08);
  --shadow-card-hover: 0 12px 28px rgba(38, 51, 56, 0.14);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Base typography / document
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

p {
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Layout primitive
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section-placeholder {
  padding-block: var(--space-8);
}

/* --------------------------------------------------------------------------
   Accessibility baseline — visible focus states everywhere (TRD §6)
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-card);
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-3);
}

/* Visually-hidden but screen-reader accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
