/* ============================================
   PERFObuzz — base.css
   Design Tokens, Reset, @font-face, Typography
   ============================================ */

/* ---- CSS Reset (Modern, minimal) ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

ul, ol {
  list-style: none;
}

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

fieldset {
  border: none;
}

/* ---- Fonts ----
   Self-hosted. Drop the 5 .woff2 files in /assets/fonts/ with these exact names. */
@font-face {
  font-family: 'Onest';
  src: url('/assets/fonts/onest-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/assets/fonts/onest-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/assets/fonts/onest-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Onest';
  src: url('/assets/fonts/onest-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ============================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================ */

:root {
  /* ---- Core Color Palette ---- */
  --void-black: #09090B;
  --obsidian: #0D0F12;
  --midnight: #18181B;
  --slate: #27272A;
  --slate-light: #3F3F46;
  --indigo: #4F46E5;
  --indigo-light: #6366F1;
  --indigo-dark: #4338CA;
  --teal: #0E4D44;
  --teal-light: #14B8A6;
  --lime: #BEF264;
  --lime-dark: #A3E635;
  --persimmon: #E55B4B;
  --persimmon-light: #F87171;

  /* ---- Semantic Colors ---- */
  --bg-primary: var(--void-black);
  --bg-secondary: var(--obsidian);
  --bg-surface: var(--midnight);
  --bg-surface-alt: var(--slate);
  --accent: var(--indigo);
  --accent-hover: var(--indigo-light);
  --accent-dark: var(--indigo-dark);
  --cta: var(--lime);
  --cta-hover: var(--lime-dark);
  --cta-text: var(--void-black);
  --urgent: var(--persimmon);
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --border: var(--slate);
  --border-light: var(--slate-light);

  /* ---- Typography ---- */
  --font-heading: 'Onest', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Onest', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-accent: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  /* ---- Type Scale (Major Third: 1.25) ---- */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.375vw, 1.375rem);
  --text-xl: clamp(1.2rem, 1.05rem + 0.7vw, 2rem);
  --text-2xl: clamp(1.45rem, 1.2rem + 1.3vw, 3rem);
  --text-3xl: clamp(1.6rem, 1.25rem + 1.8vw, 3.25rem);
  --text-4xl: clamp(1.9rem, 1.3rem + 2.6vw, 3.75rem);

  /* ---- Spacing Scale (base: 8px) ---- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.5rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-10: 5rem;
  --space-12: 6rem;
  --space-16: 8rem;
  --space-20: 10rem;

  /* ---- Layout ---- */
  --container-max: 1200px;
  --container-padding: clamp(1.25rem, 4vw, 3rem);
  --section-gap: clamp(3.25rem, 6vw, 6rem);
  --nav-height: 72px;

  /* ---- Radii ---- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

  /* ---- Transitions ---- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

::selection {
  background-color: var(--indigo);
  color: var(--text-primary);
}

/* Container */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  text-wrap: pretty;
  max-width: 70ch;
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* One highlighted keyword per major heading → Cognitive Indigo */
.title-accent {
  color: var(--accent);
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400; /* Instrument Serif Regular Italic keyword (all sections except Hero/FAQ) */
  font-size: 1.08em; /* serif reads smaller than Onest at equal size */
}

/* Shared teal icon utility (structural / informational icons + bullets) */
.icon-teal {
  color: var(--teal-light);
}

/* Visually hidden (accessible) */
.visually-hidden {
  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 */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

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

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

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

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--slate);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-light);
}