/* ==========================================================================
   base.css — Design tokens, reset, typography, global defaults, utilities
   ========================================================================== */

/* ── Design Tokens ── */
:root {
  /* Brand Colors */
  --color-primary: #283593;
  --color-primary-light: #5c6bc0;
  --color-primary-dark: #1a237e;
  --color-secondary: #ffa02f;
  --color-secondary-light: #ffc107;
  --color-secondary-dark: #e68a00;

  /* Feather Accent Colors */
  --color-accent-red: #E53935;
  --color-accent-orange: #FFA02F;
  --color-accent-yellow: #FDD835;
  --color-accent-green: #66BB6A;
  --color-accent-cyan: #4DD0E1;
  --color-accent-blue: #42A5F5;

  /* Semantic Colors */
  --color-success: #2e7d32;
  --color-warning: #f9a825;
  --color-error: #c62828;
  --color-info: #1565c0;

  /* Light Theme Surfaces */
  --color-bg: #ffffff;
  --color-bg-warm: #fafafa;
  --color-bg-alt: #f5f5f7;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;

  /* Dark Surfaces (hero, footer, CTA) */
  --color-bg-dark: #0e1538;
  --color-bg-dark-deep: #080d24;
  --color-surface-dark: rgba(255, 255, 255, 0.06);

  /* Text */
  --color-text: #1a1a2e;
  --color-text-secondary: #4a4a68;
  --color-text-light: #6b6b8d;
  --color-text-inverse: #ffffff;
  --color-text-inverse-muted: rgba(255, 255, 255, 0.7);
  --color-muted: #8888a4;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-dark: rgba(255, 255, 255, 0.12);

  --color-focus: #ffa02f;
  --color-link: #283593;
  --color-link-hover: #1a237e;
  --color-link-visited: #5c6bc0;

  /* Gradients */
  --gradient-feather: linear-gradient(135deg, #E53935, #FFA02F, #FDD835, #66BB6A, #42A5F5, #283593);
  --gradient-hero: linear-gradient(160deg, #0e1538 0%, #1a237e 40%, #283593 100%);
  --gradient-cta: linear-gradient(160deg, #1a237e 0%, #283593 50%, #3949ab 100%);
  --gradient-footer: linear-gradient(180deg, #0e1538, #080d24);
  --gradient-text: linear-gradient(135deg, #FFA02F, #E53935, #FDD835, #66BB6A, #42A5F5, #283593);
  --gradient-btn-primary: linear-gradient(135deg, #283593, #3949ab);

  /* Typography */
  --font-family-heading: "Poppins", system-ui, -apple-system, sans-serif;
  --font-family-base: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.75rem;
  --font-size-4xl: 3.5rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-base: 1.6;
  --line-height-loose: 1.8;

  /* Spacing (4px base unit) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 96px;
  --spacing-5xl: 128px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(40, 53, 147, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-reveal: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-stagger: 80ms;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Layout widths */
  --width-content: 720px;
  --width-wide: 1080px;
  --width-max: 1280px;
}

/* ── CSS Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  line-height: var(--line-height-snug);
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

a:visited {
  color: var(--color-link-visited);
}

code {
  font-family: var(--font-family-mono);
}

/* ── Focus states ── */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ── Utilities ── */
.muted {
  color: var(--color-muted);
}

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: var(--z-overlay);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.skip-link:focus {
  top: 0;
}

/* Gradient text utility */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Scroll Reveal ── */
/* Gated behind .js class added by init.js — content stays visible if JS fails */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.js .reveal--left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.js .reveal--right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.js .reveal--scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.reveal.is-visible,
.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--scale.is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger children */
.stagger > .reveal:nth-child(1) { transition-delay: calc(0 * var(--transition-stagger)); }
.stagger > .reveal:nth-child(2) { transition-delay: calc(1 * var(--transition-stagger)); }
.stagger > .reveal:nth-child(3) { transition-delay: calc(2 * var(--transition-stagger)); }
.stagger > .reveal:nth-child(4) { transition-delay: calc(3 * var(--transition-stagger)); }
.stagger > .reveal:nth-child(5) { transition-delay: calc(4 * var(--transition-stagger)); }
.stagger > .reveal:nth-child(6) { transition-delay: calc(5 * var(--transition-stagger)); }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .reveal--left,
  .js .reveal--right,
  .js .reveal--scale {
    opacity: 1;
    transform: none;
  }
}

/* ── Print Styles ── */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  nav,
  .skip-link,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}
