/* =====================================================
   CORE STYLES - Design System Foundation
   Variables, Reset, Typography, Utilities, Grid
   ===================================================== */

:root {
  /* ---- Font Families (DM Serif Display + Inter) ---- */
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Spacing System (V3) ---- */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-2xl: 80px;
  --spacing-xxl: 120px;

  /* ---- Typography Scale (Major Third 1.250 · Base 18px) ---- */
  --text-xs: 0.64rem;
  --text-sm: 0.8rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.563rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --text-4xl: 3.052rem;

  /* Legacy aliases (backward compat) */
  --font-h1: 3.052rem;
  --font-h2: 3rem;
  --font-h3: 1.563rem;
  --font-h4: 1.25rem;
  --font-body-size: 1rem;
  --font-small: 0.8rem;
  --line-height-heading: 1.2;
  --line-height-body: 1.7;

  /* ---- Primary Colors ---- */
  --color-primary: #1A1A1A;
  --color-primary-light: #333333;
  --color-primary-dark: #0A0A0A;

  /* ---- Accent & Brand Colors (Warm Spectrum) ---- */
  --color-accent: #FABC1C;
  --color-accent-hover: #FF833E;
  --color-accent-warm: #FF833E;
  --color-accent-hot: #FF6611;
  --color-accent-soft: #FFA7A7;
  --color-accent-text: #1A1A1A;
  --color-yellow: #FABC1C;
  --color-orange: #FF833E;
  --color-orange-dark: #FF6611;
  --color-pink: #FFA7A7;

  /* ---- Secondary Colors ---- */
  --color-blue: #0DBDF6;
  --color-blue-dark: #1877F2;
  --color-green-dark: #077069;
  --color-green-pulse: #4ADE80;

  /* ---- Backgrounds ---- */
  --color-bg: #FFFFFF;
  --color-bg-alt: #FAFAF5;
  --color-bg-elevated: #FFFFFF;
  --color-bg-dark: #1A1A1A;
  --color-bg-yellow: #FFF5E0;

  /* ---- Text ---- */
  --color-text-main: #1A1A1A;
  --color-text-secondary: #525252;
  --color-text-muted: #8A8A8A;
  --color-text-inverse: #FFFFFF;

  /* ---- Borders ---- */
  --color-border: #1A1A1A;
  --color-border-light: #E5E5E5;
  --color-border-subtle: #F0F0F0;

  /* ---- Semantic Colors ---- */
  --color-success: #4ADE80;
  --color-warning: #FF6611;
  --color-info: #0DBDF6;

  /* ---- Gradients ---- */
  --gradient-premium: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  --gradient-accent: linear-gradient(135deg, #FABC1C 0%, #FF833E 100%);
  --gradient-warm: linear-gradient(135deg, #FF833E 0%, #FF6611 100%);
  --gradient-brand: linear-gradient(135deg, #FABC1C 0%, #FF833E 60%, #FF6611 150%);
  --gradient-shine: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 3px rgba(26,26,26,0.04), 0 2px 6px rgba(26,26,26,0.03);
  --shadow-md: 0 2px 4px rgba(26,26,26,0.04), 0 6px 16px rgba(26,26,26,0.06), 0 12px 28px rgba(26,26,26,0.04);
  --shadow-lg: 0 4px 8px rgba(26,26,26,0.04), 0 10px 28px rgba(26,26,26,0.08), 0 20px 52px rgba(26,26,26,0.06);
  --shadow-hover: 0 8px 20px rgba(26,26,26,0.08), 0 20px 40px rgba(26,26,26,0.08), 0 28px 56px rgba(26,26,26,0.04);
  --shadow-accent: 0 4px 14px rgba(250,188,28,0.3), 0 8px 28px rgba(250,188,28,0.2);
  --shadow-glow: 0 0 44px rgba(250,188,28,0.15);

  /* ---- Border Radius ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* ---- Transitions ---- */
  --ease-premium: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-base: 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  --transition-slow: 0.5s cubic-bezier(0.23, 1, 0.32, 1);

  /* ---- RGB Companions ---- */
  --color-bg-rgb: 255, 255, 255;
  --color-text-main-rgb: 26, 26, 26;
  --color-accent-rgb: 250, 188, 28;
  --color-warning-rgb: 255, 102, 17;
  --color-info-rgb: 13, 189, 246;
  --color-primary-rgb: 26, 26, 26;

  /* ---- Layout ---- */
  --container-max-width: 1600px;
  --container-padding: 48px;

  /* ---- Blob Settings (decorative background elements) ---- */
  --blob-color-r: 180;
  --blob-color-g: 180;
  --blob-color-b: 180;
  --blob-opacity: 0.5;
  --blob-blur: 50px;
  --blob-size: 1;
  --blob-animation-speed: 25s;
}

/* =====================================================
   RESET & GLOBAL
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: var(--line-height-body, 1.7);
  color: var(--color-text-main, #1a1a1a);
  background-color: var(--color-bg, #ffffff);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Hidden initially for page load animation - GSAP reveals */
  visibility: hidden;
  /* Safety net: show page if GSAP fails to load */
  animation: fallback-reveal 0s 2s forwards;
}

@keyframes fallback-reveal {
  to { visibility: visible; }
}

/* Text selection — branded accent across all palettes */
::selection {
  background: rgba(var(--color-accent-rgb, 250, 188, 28), 0.3);
  color: var(--color-text-main, #1a1a1a);
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: var(--line-height-heading, 1.2);
  margin-bottom: var(--spacing-sm, 16px);
}

h1 {
  font-size: var(--font-h1, 3.052rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2 {
  font-size: var(--font-h2, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h3 {
  font-size: var(--font-h3, 1.563rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h4 {
  font-size: var(--font-h4, 1.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  font-size: var(--text-base, 1rem);
  margin-bottom: var(--spacing-sm, 16px);
  max-width: 70ch;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max-width, 1200px);
  margin: 0 auto;
  padding: 0 var(--container-padding, 24px);
}

.section-spacing {
  padding: var(--spacing-2xl, 80px) 0;
  scroll-margin-top: 100px;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.text-center {
  text-align: center;
}

.text-center p {
  margin-left: auto;
  margin-right: auto;
}

.text-secondary {
  color: var(--color-text-secondary, #525252);
}

.bg-alt {
  background-color: var(--color-bg-alt, #FAFAF5);
}

/* Flex utilities */
.flex-icon-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm, 16px);
  margin-bottom: var(--spacing-md, 24px);
}

.flex-icon-heading .icon {
  font-size: 3rem;
}

/* Margin utilities */
.mb-xl {
  margin-bottom: var(--spacing-2xl, 80px);
}

.mb-lg {
  margin-bottom: var(--spacing-xl, 48px);
}

.mb-md {
  margin-bottom: var(--spacing-md, 24px);
}

.mt-md {
  margin-top: var(--spacing-md, 24px);
}

.mt-lg {
  margin-top: var(--spacing-xl, 48px);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Max-width utilities */
.max-w-900 {
  max-width: 900px;
}

.max-w-25ch {
  max-width: 25ch;
}

/* Typography utilities */
.text-sm {
  font-size: 0.9em;
}

.text-xs {
  font-size: 0.8rem;
}

.text-lg {
  font-size: 1.15em;
  line-height: 1.5;
}

.text-white {
  color: #fff;
}

/* Visual utilities */
.opacity-70 {
  opacity: 0.7;
}

/* Dark Section */
.section-dark {
  background: var(--color-text-main, #1a1a1a);
  color: #fff;
}

.section-dark h2 {
  color: #fff;
}

/* =====================================================
   GRID SYSTEM
   ===================================================== */

.grid {
  display: grid;
  gap: var(--spacing-xl, 48px);
  contain: layout style;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
