/* =========================================================================
   SPOLYOU — Design Tokens
   Navy & Teal pharmaceutical identity: crisp navy primary, restrained teal
   accent, silver-gray and pale blue for section differentiation. Aligned
   to the official SPOLYOU brand mark.
   ========================================================================= */

:root,
[data-theme='light'] {
  /* Surfaces — ice white / pale blue, not warm paper */
  --color-bg: #f4f8fa;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-surface-offset: #eaf2f6;
  --color-surface-offset-2: #dde9ee;
  --color-surface-dynamic: #cfdce3;
  --color-divider: #cfdce3;
  --color-border: #cfdce3;

  /* Text — brand navy ink */
  --color-text: #072654;
  --color-text-muted: #536b78;
  --color-text-faint: #5f7280;
  --color-text-inverse: #f4f8fa;

  /* Primary accent — brand navy */
  --color-primary: #072654;
  --color-primary-hover: #041a3b;
  --color-primary-active: #041a3b;
  --color-primary-highlight: #eaf2f6;
  --color-primary-rgb: 7, 38, 84;

  /* Secondary accent — brand teal (sparingly: active states, small labels, icon accents, thin rules) */
  --color-forest: #0b7f89;
  --color-forest-hover: #08636c;
  --color-forest-highlight: #eaf2f6;

  /* Status */
  --color-error: #9c3b2e;
  --color-error-highlight: #ecd6cf;
  --color-success: #3f6b3a;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows — tone-matched to cool ice surface */
  --shadow-sm: 0 1px 2px oklch(0.25 0.03 250 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.25 0.03 250 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.25 0.03 250 / 0.16);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1280px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Fraunces', 'Boska', Georgia, serif;
  --font-body: 'General Sans', -apple-system, sans-serif;

  color-scheme: light;
}

[data-theme='dark'] {
  --color-bg: #061426;
  --color-surface: #0a2038;
  --color-surface-2: #0d2945;
  --color-surface-offset: #0d2945;
  --color-surface-offset-2: #113456;
  --color-surface-dynamic: #16406a;
  --color-divider: #24455f;
  --color-border: #24455f;

  --color-text: #eff6f8;
  --color-text-muted: #a7bbc5;
  --color-text-faint: #90a8b4;
  --color-text-inverse: #f4f8fa;

  --color-primary: #36a8b0;
  --color-primary-hover: #6bc4d7;
  --color-primary-active: #2c8990;
  --color-primary-highlight: #0d2945;
  --color-primary-rgb: 54, 168, 176;

  --color-forest: #36a8b0;
  --color-forest-hover: #6bc4d7;
  --color-forest-highlight: #0d2945;
  --btn-primary-text: #061426;

  --color-error: #d98c73;
  --color-error-highlight: #3a231c;
  --color-success: #7ea36f;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 24px 56px oklch(0 0 0 / 0.55);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #061426;
    --color-surface: #0a2038;
    --color-surface-2: #0d2945;
    --color-surface-offset: #0d2945;
    --color-surface-offset-2: #113456;
    --color-surface-dynamic: #16406a;
    --color-divider: #24455f;
    --color-border: #24455f;
    --color-text: #eff6f8;
    --color-text-muted: #a7bbc5;
    --color-text-faint: #90a8b4;
    --color-text-inverse: #f4f8fa;
    --color-primary: #36a8b0;
    --color-primary-hover: #6bc4d7;
    --color-primary-active: #2c8990;
    --color-primary-highlight: #0d2945;
    --color-forest: #36a8b0;
    --color-forest-hover: #6bc4d7;
    --color-forest-highlight: #0d2945;
    --btn-primary-text: #061426;
    --color-error: #d98c73;
    --color-error-highlight: #3a231c;
    color-scheme: dark;
  }
}

/* =========================================================================
   Type Scale — fluid clamp()
   ========================================================================= */
:root {
  --text-xs: clamp(0.75rem, 0.71rem + 0.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.02rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.4vw, 3.4rem);
  --text-3xl: clamp(2.5rem, 1.2rem + 3.8vw, 4.6rem);
  --text-4xl: clamp(2.75rem, 1.3rem + 4.2vw, 5.2rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.2rem);

  /* 4px spacing system */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* =========================================================================
   Utility Layer
   ========================================================================= */
.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}
.container--wide {
  max-width: var(--content-wide);
}
.container--narrow {
  max-width: var(--content-narrow);
}

section {
  /* editorial rhythm: generous but not cavernous — the previous 8rem cap left
     visible voids above card grids on wide screens */
  padding-block: clamp(var(--space-14), 7vw, var(--space-24));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-forest);
}
.eyebrow::before {
  content: '';
  width: 20px;
  height: 1.5px;
  background: currentColor;
  display: inline-block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-3);
  max-width: 20ch;
}
.section-lede {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 58ch;
  margin-top: var(--space-4);
}

.text-accent {
  color: var(--color-forest);
}
.text-forest {
  color: var(--color-forest);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-full);
  min-height: 44px;
  white-space: nowrap;
  transition:
    background var(--transition-interactive),
    color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive),
    border-color var(--transition-interactive);
}
.btn-primary {
  background: var(--color-forest);
  color: var(--btn-primary-text, #ffffff);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-forest-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  background: var(--color-forest-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid oklch(from var(--color-text) l c h / 0.22);
}
.btn-ghost:hover {
  border-color: var(--color-forest);
  color: var(--color-forest);
}

/* =========================================================================
   Scroll reveal (opacity/clip-path only — no CLS)
   ========================================================================= */
.reveal {
  opacity: 1;
}
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  .reveal-up {
    opacity: 0;
    clip-path: inset(28% 0 0 0);
    animation:
      reveal-fade linear both,
      reveal-clip linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
}
@keyframes reveal-fade {
  to {
    opacity: 1;
  }
}
@keyframes reveal-clip {
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up {
    opacity: 1 !important;
    clip-path: none !important;
    animation: none !important;
  }
}
