/* ==========================================================================
   Little Pumpkins Montessori - Core Design System & Design Tokens
   Strict Light Theme (Warm Parchment #FBEEE0 Canvas & Warm Charcoal #2A2420 Text)
   ========================================================================== */

/* Google Fonts now loaded via <link rel="preconnect"> + <link rel="stylesheet">
   in each page's <head>, not @import — an @import here forced the browser to
   fully parse this file before it could even discover the font request. */

:root {
  /* Soft Ivory Cream Base Canvas — #FEF9F2 Base */
  --bg-cream: #FEF9F2;
  --bg-cream-alt: #F7EFE3;
  --bg-card: #F7EFE3;
  --bg-paper: #FEF9F2;

  /* Typography Colors — Warm Charcoal, Never Pure Black */
  --text-main: #2A2420;
  --text-muted: #5C544D;
  --text-light: #857B72;
  --text-ink: #2A2420;

  /* Primary Accent: Orange-Amber Palette (#F5871F to #FCB040) */
  --amber-primary: #F5871F;
  --amber-secondary: #FCB040;
  --amber-dark: #D66D0C;
  --amber-glow: rgba(245, 135, 31, 0.2);
  --grad-amber: linear-gradient(135deg, #F5871F 0%, #FCB040 100%);
  --grad-amber-soft: linear-gradient(135deg, rgba(245, 135, 31, 0.12) 0%, rgba(252, 176, 64, 0.2) 100%);

  /* Cool Counterweight Accent: Fresh Teal Palette */
  --navy-teal-dark: #1B3A4B;
  --navy-teal: #2C8FA6;
  --navy-teal-light: #E3F5FA;
  --navy-teal-glow: rgba(44, 143, 166, 0.15);
  --grad-navy-teal: linear-gradient(135deg, #2272A3 0%, #2C8FA6 100%);

  /* Secondary Earth & Paper Cut Tones */
  --earth-sage: #086A1E;
  --paper-cut-blue: #0047AB;
  --earth-sand: #EADBC8;

  /* Typography Tokens */
  --font-serif: 'Fraunces', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Elevation Shadows (Soft Layered Depth Staged on Light Surfaces) */
  --shadow-sm: 0 4px 12px rgba(42, 36, 32, 0.04);
  --shadow-md: 0 10px 24px rgba(42, 36, 32, 0.06);
  --shadow-lg: 0 20px 48px rgba(42, 36, 32, 0.08);
  --shadow-amber: 0 14px 32px rgba(245, 135, 31, 0.28);
  --shadow-navy: 0 14px 32px rgba(34, 114, 163, 0.22);

  /* Border Tokens */
  --border-light: rgba(42, 36, 32, 0.09);
  --border-medium: rgba(42, 36, 32, 0.16);

  /* Radius Tokens */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;

  /* Motion Curves */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hero H1 — black base, orange accent */
h1 {
  color: var(--text-main);
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Fluid base: 14px at 320px → 15.5px at 1280px → 17.5px at 1920px → 19px at 2560px */
  font-size: clamp(14px, 0.55vw + 9.9px, 19px);
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-cream);
  color: var(--text-main);
  /* Normalize scrollbar gutter across Chrome & Firefox:
     Chrome's page scrollbar belongs to html, not body. This reserves
     the gutter space so vw-based values compute identically in both browsers */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-cream);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Base Canvas Enforcement — Guarantee #FBEEE0 Canvas Dominance */
main, section, header, footer {
  background-color: transparent;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 2.8vw + 0.5rem, 3.8rem);
}

h2 {
  font-size: clamp(1.65rem, 2.2vw + 0.4rem, 3rem);
}

h3 {
  font-size: clamp(1.15rem, 1.2vw + 0.4rem, 1.75rem);
}

p {
  font-size: clamp(0.9rem, 0.45vw + 0.75rem, 1.05rem);
  color: var(--text-muted);
}

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

/* Container System — fluid, never rigid */
.container {
  width: min(92%, 1600px);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 56px);
}

.container-narrow {
  width: min(88%, 900px);
  margin: 0 auto;
}

.scene-padding {
  padding: clamp(48px, 7vw, 112px) 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-amber { color: var(--amber-primary); }
.text-navy { color: var(--navy-teal-dark); }
.text-muted { color: var(--text-muted); }

/* Accent Gradients */
.text-grad-amber {
  background: var(--grad-amber);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-grad-navy {
  background: var(--grad-navy-teal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Primary Amber Buttons */
.btn-amber {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.7vw, 10px);
  padding: clamp(10px, 0.7vw + 4px, 14px) clamp(20px, 1.6vw + 6px, 32px);
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 0.4vw + 0.62rem, 1.05rem);
  font-weight: 600;
  color: #FFFFFF;
  background: var(--grad-amber);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(245, 135, 31, 0.28);
  cursor: pointer;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.15s ease;
}

/* Fluid Liquid Wave Sweep Overlay */
.btn-amber::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.45) 50%,
      transparent 100%);
  transform: translateX(-160%) skewX(-22deg);
  opacity: 0;
  pointer-events: none;
}

.btn-amber:hover {
  transform: translateX(6px) translateZ(0);
  box-shadow: 0 10px 28px rgba(245, 135, 31, 0.38);
}

.btn-amber:hover::after {
  animation: btnWaveSweep 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes btnWaveSweep {
  0% {
    transform: translateX(-160%) skewX(-22deg);
    opacity: 0;
  }

  30% {
    opacity: 0.6;
  }

  100% {
    transform: translateX(200%) skewX(-22deg);
    opacity: 0;
  }
}

.btn-amber:active {
  transform: translateY(0px) scale(0.97) translateZ(0);
  box-shadow: 0 4px 14px rgba(245, 135, 31, 0.30);
  transition-duration: 0.06s;
}

/* Secondary Button ("Watch Our Story" - Fast & Clicky Tactile Slide) */
.btn-play-story {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 0.8vw, 14px);
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: var(--font-sans);
  font-size: clamp(0.92rem, 0.4vw + 0.65rem, 1.08rem);
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  border-radius: var(--radius-full);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform, color;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease;
}

.btn-play-story:hover {
  color: var(--amber-primary);
  transform: translateX(6px) translateZ(0);
}

.btn-play-story:active {
  transform: translateX(2px) scale(0.97) translateZ(0);
  transition-duration: 0.06s;
}

/* Right-shake click animation (shared by Watch Our Story & Contact Us) */
@keyframes btnRightShake {
  0%   { transform: translateX(0)   translateZ(0); }
  20%  { transform: translateX(7px) translateZ(0); }
  45%  { transform: translateX(3px) translateZ(0); }
  65%  { transform: translateX(6px) translateZ(0); }
  80%  { transform: translateX(2px) translateZ(0); }
  100% { transform: translateX(0)   translateZ(0); }
}

.btn-right-shake {
  animation: btnRightShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Navy-Teal Counterweight Buttons */
.btn-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.8vw, 12px);
  padding: clamp(9px, 0.9vw, 14px) clamp(16px, 1.8vw, 28px);
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 0.8vw + 0.38rem, 0.95rem);
  font-weight: 600;
  color: #FFFFFF;
  background: var(--grad-navy-teal);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-navy);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-navy:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(27, 58, 75, 0.3);
}

/* Outer Outline Buttons */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.7vw, 10px);
  padding: clamp(9px, 0.9vw, 14px) clamp(16px, 1.8vw, 28px);
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 0.8vw + 0.38rem, 1rem);
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--amber-primary);
  color: var(--amber-primary);
  transform: translateY(-2px);
}

/* Scene Layout Frames */
.scene-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-cream);
  overflow: hidden;
}

/* Accessible Kinetic Typography Styling */
.kinetic-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 3.4vw + 0.5rem, 5rem);
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.08;
  letter-spacing: -0.02em;
  display: block;
}

.kinetic-word {
  display: inline-block;
  white-space: pre;
  will-change: transform, opacity;
}

/* Preferred Reduced Motion Accessibility Support */
@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;
  }

  .kinetic-word {
    opacity: 1 !important;
    transform: none !important;
  }

  .mask-wipe, .wipe-reveal {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .parallax-layer {
    transform: none !important;
  }
}

/* ============================================================
   GLOBAL MOBILE — appended for full site responsiveness pass
   ============================================================ */

/* iOS Safari: prevent zoom on input focus (must be ≥16px) */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: max(16px, 0.88rem) !important;
  }
}

/* Fluid container on very small phones */
@media (max-width: 390px) {
  .container {
    padding-left: clamp(14px, 4vw, 20px);
    padding-right: clamp(14px, 4vw, 20px);
  }
}

/* Scene containers: prevent full-viewport lock on mobile */
@media (max-width: 768px) {
  .scene-container {
    min-height: auto !important;
    padding: clamp(80px, 16vw, 120px) 0 clamp(48px, 8vw, 80px);
  }
}

/* Kinetic headline: ensure it wraps properly on phones */
@media (max-width: 480px) {
  .kinetic-headline {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.015em !important;
  }
}
@media (max-width: 390px) {
  .kinetic-headline {
    font-size: clamp(1.75rem, 8.5vw, 2.5rem) !important;
  }
}

/* Landscape / notched phone: respect safe area on left/right */
@media (max-width: 768px) {
  .container,
  .container-narrow {
    padding-left: max(clamp(16px, 4vw, 32px), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(16px, 4vw, 32px), env(safe-area-inset-right, 0px));
  }
}
