/* ==========================================================================
   MATHSWITHAMAL.COM - APPLE-INSPIRED COMPONENTS & SECTIONS
   ========================================================================== */

/* --- CANVAS BACKGROUND --- */
#math-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* --- BRANDED LOADING OVERLAY --- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #FFFFFF;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-logo-box img {
  height: clamp(100px, 15vw, 150px);
  width: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius-md);
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.05));
  animation: loading-pulse 1.8s infinite ease-in-out;
}

@keyframes loading-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.04); opacity: 1; }
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.loading-tagline {
  font-family: var(--font-math);
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --- HEADER & NAVIGATION --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  transition: all var(--transition-normal);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.brand-logo img {
  height: 60px;
  width: auto;
  border-radius: var(--border-radius-md);
  transition: transform var(--transition-normal), filter var(--transition-normal);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.03));
}

.brand-logo:hover img {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 4px 15px rgba(30, 64, 175, 0.08));
}

.brand-name {
  margin-left: 12px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #1E40AF 0%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: opacity var(--transition-normal);
}

.brand-logo:hover .brand-name {
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-blue);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-blue);
  transition: width var(--transition-normal);
  border-radius: var(--border-radius-full);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
}

@media (max-width: 1024px) {
  .nav-links { display: none !important; }
  .mobile-menu-btn { display: block !important; }
}

/* Mobile Drawer Menu */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 400px;
  height: 100dvh;
  background: #FFFFFF;
  z-index: 1001;
  padding: calc(2.5rem + env(safe-area-inset-top, 0px)) calc(2rem + env(safe-area-inset-right, 0px)) calc(2.5rem + env(safe-area-inset-bottom, 0px)) calc(2rem + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: right var(--transition-normal);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

.mobile-nav-drawer.open { right: 0; }

.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.mobile-nav-link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* --- HERO SECTION (APPLE-INSPIRED CINEMATIC) --- */
.hero-section {
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 3rem);
  padding-bottom: 5rem;
  display: flex;
  align-items: center;
  position: relative;
  background: #FFFFFF;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--primary-blue);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.35rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.curriculum-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
  .curriculum-pills { justify-content: center; }
}

.pill {
  padding: 0.45rem 1.1rem;
  border-radius: var(--border-radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.pill:hover {
  background: rgba(30, 64, 175, 0.06);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  transform: translateY(-2px);
}

.hero-portrait-frame {
  position: relative;
  width: 100%;
  max-width: 500px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-surface);
}

.hero-portrait-frame img {
  width: 100%;
  height: 600px;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--transition-slow);
}

.hero-portrait-frame:hover img {
  transform: scale(1.02);
}

/* --- FIRST SCROLL MOMENT (APPLE WHITESPACE STATEMENT) --- */
.whitespace-banner {
  padding: 8rem 0;
  text-align: center;
  background: #FFFFFF;
}

.whitespace-statement {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  max-width: 960px;
  margin: 0 auto 1.5rem auto;
}

@media (max-width: 768px) {
  .whitespace-statement {
    font-size: 2.25rem;
  }
}

.whitespace-subtext {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-blue);
}

/* --- MEET AMAL SECTION --- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 5rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-image-card {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-glass);
}

.about-image-card img {
  width: 100%;
  height: 540px;
  object-fit: cover;
}

/* --- STICKY STORYTELLING SECTION (APPLE PRODUCT SCROLL) --- */
.sticky-story-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  position: relative;
}

@media (max-width: 1024px) {
  .sticky-story-container {
    grid-template-columns: 1fr;
  }
}

.sticky-story-media {
  position: sticky;
  top: 120px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  height: 520px;
}

.sticky-story-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  z-index: 1;
}

.sticky-story-media img.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.sticky-story-media iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
  border: none;
  background: #FFFFFF;
}

.sticky-story-media iframe.active {
  opacity: 1;
  z-index: 3;
}

/* Instagram Reel & Image Responsive Visibility */
@media (max-width: 576px) {
  .desktop-only-media {
    display: none !important;
  }
}
@media (min-width: 577px) {
  .mobile-only-media {
    display: none !important;
  }
}

.story-card-sequence {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.story-step-card {
  background: var(--bg-surface);
  padding: 2.5rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-normal);
}

.story-step-card.active {
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-md);
  background: #FFFFFF;
}

.story-step-tag {
  font-family: var(--font-math);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
}

.story-step-heading {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* --- TYPOGRAPHIC "WHY AMAL?" SEQUENCE --- */
.why-sequence-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

@media (max-width: 1024px) {
  .why-sequence-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .why-sequence-grid {
    grid-template-columns: 1fr;
  }
}

.why-seq-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 3rem 2.25rem;
  border-radius: var(--border-radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.why-seq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background var(--transition-normal);
}

.why-seq-item:hover {
  background: #FFFFFF;
  border-color: var(--primary-blue);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.why-seq-item:hover::before {
  background: var(--primary-blue);
}

.why-seq-number {
  font-family: var(--font-math);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: 1.5rem;
  display: inline-block;
  letter-spacing: 0.1em;
}

.why-seq-word {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.why-seq-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* --- TEACHING PHILOSOPHY FULL-SCREEN --- */
.philosophy-fullscreen {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  padding: 9rem 0;
  text-align: center;
}

.philosophy-logo {
  height: clamp(120px, 18vw, 240px);
  width: auto;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  filter: drop-shadow(0 10px 30px rgba(30, 64, 175, 0.08));
  transition: transform var(--transition-slow);
}

.philosophy-logo:hover {
  transform: scale(1.04);
}

.philosophy-statement {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 900px;
  margin: 0 auto 2rem auto;
}

/* --- A CLASS WITH AMAL / DIGITAL WHITEBOARD SIMULATOR --- */
.whiteboard-container {
  background: #FFFFFF;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 3.5rem;
}

.whiteboard-header {
  background: var(--bg-surface);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
}

.whiteboard-dots {
  display: flex;
  gap: 0.5rem;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #EF4444; }
.dot-yellow { background: #F59E0B; }
.dot-green { background: #10B981; }

.whiteboard-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 480px;
}

@media (max-width: 1024px) {
  .whiteboard-body { grid-template-columns: 1fr; }
}

.whiteboard-canvas-area {
  padding: 2.5rem;
  position: relative;
  background-image: radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.whiteboard-step-display {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 1.75rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
}

.whiteboard-math-notation {
  font-family: var(--font-math);
  font-size: 1.6rem;
  color: var(--primary-blue);
  margin-top: 0.5rem;
  font-weight: 600;
}

.whiteboard-sidebar {
  background: var(--bg-surface);
  padding: 2rem;
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.topic-selector-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.topic-selector-btn:hover, .topic-selector-btn.active {
  background: rgba(30, 64, 175, 0.08);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* --- FULL-WIDTH APPLE CURRICULUM PANELS --- */
.curriculum-fullwidth-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 4rem;
}

.curriculum-panel {
  padding: 3.5rem 3rem;
  border-radius: var(--border-radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-normal);
}



.curriculum-panel:hover {
  background: #FFFFFF;
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.curriculum-panel[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.curriculum-title-large {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--primary-blue);
}

/* --- GLOBAL CLASSROOM MAP --- */
.map-visualizer-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2.2 / 1;
  background: #FFFFFF url('../images/world-map.svg') no-repeat center center;
  background-size: 100% 100%;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  margin-top: 3.5rem;
  box-shadow: var(--shadow-md);
}

#map-canvas {
  width: 100%;
  height: 100%;
}

/* --- EDITORIAL TESTIMONIALS --- */
.testimonial-editorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 4rem;
}

.testimonial-editorial-card {
  padding: 3rem 2.5rem;
  border-radius: var(--border-radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-normal);
}

.testimonial-editorial-card:hover {
  background: #FFFFFF;
  border-color: var(--primary-blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* --- AMAL'S MATHEMATICS NOTES --- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: 3.5rem;
}

.note-card {
  border-radius: var(--border-radius-md);
  background: #FFFFFF;
  border: 1px solid var(--border-glass);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.note-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-md);
}

.note-content { padding: 2rem; }

/* --- FAQ ACCORDION --- */
.faq-container {
  max-width: 840px;
  margin: 3.5rem auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  border-radius: var(--border-radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item.active {
  background: #FFFFFF;
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: 1.75rem 2rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-answer {
  padding: 0 2rem 1.75rem 2rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1.05rem;
  display: none;
}

.faq-item.active .faq-answer { display: block; }

/* --- DEMO SESSION PRIMARY CONVERSION SECTION --- */
.demo-primary-banner {
  background: #FFFFFF;
  border: 1px solid var(--border-glass-active);
  border-radius: var(--border-radius-lg);
  padding: 5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

/* --- MULTI-STEP DEMO BOOKING MODAL (WHITE CLEAN) --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 1.5rem;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #FFFFFF;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 660px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.75rem 2.25rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: 2.25rem; }

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
}

.wizard-step-indicator {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 2;
  transition: all var(--transition-fast);
}

.wizard-step-indicator.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(30, 64, 175, 0.3);
}

.wizard-step-indicator.completed {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #FFFFFF;
}

.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border-radius: var(--border-radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--primary-blue);
  box-shadow: 0 0 10px rgba(30, 64, 175, 0.15);
}

/* --- FOOTER & PERSISTENT MOBILE BAR --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-glass);
  padding: 6rem 0 3rem 0;
  position: relative;
  z-index: 10;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3.5rem;
  margin-bottom: 4rem;
}

/* Footer Links & Socials */
.footer-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  padding: 0.25rem 0;
  display: inline-block;
}

.footer-link:hover {
  color: var(--primary-blue);
}

.footer-social-link {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-social-link:hover {
  color: var(--primary-blue) !important;
}

/* Responsive Stats */
.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
}
.stat-blue { color: var(--primary-blue); }
.stat-teal { color: var(--accent-teal); }
.stat-gold { color: var(--accent-gold); }

@media (min-width: 741px) and (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr !important;
    gap: 3rem 2rem !important;
  }
}

/* --- RESPONSIVE GRIDS, FORMS & LAYOUTS --- */
.cinematic-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.cinematic-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.cinematic-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.cinematic-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cinematic-image-card {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  max-width: 460px;
  width: 100%;
}

.cinematic-image-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem;
  text-align: center;
}

/* Instagram Reel Mobile Replacement */
.instagram-reel-container {
  display: none;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1.8;
  margin: 3.5rem auto 0 auto;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-surface);
}

.instagram-reel-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.banner-cta-btn {
  font-size: 1.15rem;
  padding: 1.1rem 2.75rem;
}

/* Whiteboard text wrap helpers to prevent overflow */
.whiteboard-math-notation, 
#wb-step-code {
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  font-size: clamp(0.95rem, 3.5vw, 1.4rem) !important;
}

/* Accessibility and Touch Targets (WCAG min 44px) */
.mobile-drawer-close-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-primary);
  border-radius: var(--border-radius-full);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.mobile-drawer-close-btn:active {
  background: var(--bg-surface-elevated);
}

.modal-close-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-primary);
  border-radius: var(--border-radius-full);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.modal-close-btn:active {
  background: var(--bg-surface-elevated);
}

.modal-window {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- MOBILE BOTTOM CTA BAR --- */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  padding: 0.75rem 1.5rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 1.5rem;
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   BREAKPOINTS MEDIA QUERIES (FLUID RESPONSIVE SYSTEM)
   ========================================================================== */

/* --- TABLET LANDSCAPE & PORTRAIT INLINE NAV (min-width: 741px) and (max-width: 1024px) --- */
@media (min-width: 741px) and (max-width: 1024px) {

  .site-header .btn-primary {
    display: inline-block !important;
    padding: 0.5rem 1.1rem !important;
    font-size: 0.85rem !important;
  }
  .brand-logo img {
    height: 40px !important;
    border-radius: 10px !important;
  }
  .brand-logo span {
    font-size: 1.15rem !important;
  }
}

/* --- LAPTOP & LARGE TABLET BREAKPOINT (max-width: 1024px) --- */
@media (max-width: 1024px) {
  .hero-actions, .cinematic-actions {
    justify-content: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .curriculum-panel {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
    padding: 2.5rem 2rem !important;
  }
  
  .story-card-sequence {
    gap: 1.5rem;
    width: 100%;
  }

  /* Interactive Whiteboard Sidebar Grid Layout */
  .whiteboard-sidebar {
    border-left: none !important;
    border-top: 1px solid var(--border-glass) !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.75rem;
  }
  
  .whiteboard-sidebar > div:first-child {
    grid-column: 1 / -1;
  }
  
  .whiteboard-sidebar > div:last-child {
    grid-column: 1 / -1;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
  }
  
  .whiteboard-sidebar > div:last-child p {
    margin-bottom: 0 !important;
  }
  
  .whiteboard-sidebar > div:last-child button {
    max-width: 320px;
    margin-top: 0;
  }

  /* Cinematic Section column stack */
  .cinematic-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .cinematic-media-wrapper {
    display: flex;
    justify-content: center;
  }
}

/* --- STANDARD TABLET & MOBILE BREAKPOINT (max-width: 768px) --- */
@media (max-width: 768px) {
  :root {
    --header-height: 80px;
  }

  /* Hide repetitive hero eyebrow branding on mobile */
  .hero-eyebrow {
    display: none !important;
  }

  /* Hide the entire Experience section on mobile to prevent duplicate video rendering */
  .experience-section {
    display: none !important;
  }

  /* Hide header booking button on mobile to save space */
  .site-header .btn-primary {
    display: none;
  }
  
  .about-image-card img {
    height: clamp(300px, 45vh, 450px) !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  /* Sticky Story Mobile/Tablet Layout (Preserving dynamic image swap) */
  .sticky-story-container {
    display: flex;
    flex-direction: column;
  }
  
  .sticky-story-media {
    position: relative !important;
    top: auto !important;
    z-index: 10;
    height: clamp(250px, 40vh, 360px) !important;
    width: 100%;
    margin-bottom: 2.5rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
  }

  .story-step-card {
    padding: 2rem;
    margin-bottom: 1rem;
    background: var(--bg-surface);
  }
  
  .story-step-card.active {
    background: #FFFFFF;
  }
  
  .story-step-card:last-child {
    margin-bottom: 6rem; /* Scroll headroom to allow IntersectionObserver to trigger */
  }
}

/* --- MOBILE HAMBURGER NAVIGATION BREAKPOINT (max-width: 740px) --- */
@media (max-width: 740px) {
  :root {
    --header-height: 72px;
  }
  
  .brand-logo img {
    height: 52px !important;
    border-radius: 12px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

/* --- SMALL MOBILE BREAKPOINT (max-width: 576px) --- */
@media (max-width: 576px) {
  /* Mobile drawer and bottom bar trigger */
  .mobile-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* Prevent bottom bar from blocking footer content */
  }

  .hero-eyebrow {
    font-size: 0.75rem !important;
  }
  
  .hero-subtitle {
    margin-bottom: 2rem;
  }
  
  .hero-portrait-frame img {
    height: clamp(280px, 40vh, 360px) !important;
  }
  
  .map-visualizer-container {
    margin-top: 2rem !important;
  }
  
  .whiteboard-canvas-area {
    padding: 1.5rem !important;
  }
  
  .whiteboard-step-display {
    padding: 1.25rem !important;
  }
  
  .whiteboard-sidebar {
    padding: 1.25rem !important;
    grid-template-columns: 1fr; /* Single column sidebar options */
  }
  
  .whiteboard-sidebar > div:last-child {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 1rem;
  }
  
  .whiteboard-sidebar > div:last-child button {
    max-width: 100%;
  }
  
  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .modal-header {
    padding: 1.25rem 1.25rem !important;
  }
  
  .modal-body {
    padding: 1.5rem 1rem !important;
  }
  
  .wizard-progress {
    margin-bottom: 1.5rem !important;
  }
}

/* --- VERY NARROW VIEWPORTS (max-width: 480px) --- */
@media (max-width: 480px) {
  :root {
    --header-height: 72px;
  }

  .container {
    padding: 0 1.25rem;
  }
  
  .hero-actions, .cinematic-actions {
    flex-direction: column;
    align-items: stretch !important;
    width: 100%;
    gap: 1rem !important;
  }
  
  .hero-actions .btn, .cinematic-actions .btn {
    width: 100%;
    text-align: center;
  }
  
  .mobile-bottom-bar {
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 1rem;
  }
  
  .mobile-bottom-bar img {
    height: 40px !important;
  }
  
  .mobile-bottom-bar .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.8rem !important;
  }
  
  .brand-logo img {
    height: 48px !important;
    border-radius: 11px !important;
  }
  
  .banner-cta-btn {
    width: 100%;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
    display: flex;
    justify-content: center;
  }
  
  section[id] {
    scroll-margin-top: calc(var(--header-height) + 1rem);
  }

  /* Modal buttons vertical stack on mobile review */
  .modal-body form div[style*="display:flex; justify-content:space-between;"],
  .modal-body div[style*="display:flex; justify-content:space-between;"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }
  .modal-body form div[style*="display:flex; justify-content:space-between;"] button,
  .modal-body div[style*="display:flex; justify-content:space-between;"] button {
    width: 100% !important;
  }
}

/* --- CLOSED FOLDABLE & SUPER-NARROW DEVICES BREAKPOINT (max-width: 320px) --- */
@media (max-width: 320px) {
  :root {
    --header-height: 72px;
  }

  .container {
    padding: 0 0.75rem !important;
  }
  
  .hero-headline {
    font-size: clamp(1.65rem, 6vw, 2.25rem) !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }
  
  .btn {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.85rem !important;
  }
  
  .why-seq-item {
    padding: 1.5rem 1rem !important;
  }
  
  .curriculum-panel {
    padding: 1.5rem 1rem !important;
  }
  
  .modal-window {
    border-radius: var(--border-radius-md);
  }
}

/* --- CLASSROOM PREVIEW SECTION --- */
.video-preview-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 5rem;
  align-items: center;
}

.video-preview-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

@media (max-width: 992px) {
  .video-preview-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .video-preview-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .video-preview-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

.video-preview-visual {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 490px;
  margin: 0 auto;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  background: #FFFFFF;
}

.instagram-video-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive Header Brand Name Overrides */
@media (max-width: 768px) {
  .brand-name {
    font-size: 1.4rem;
    margin-left: 12px;
  }
}
@media (max-width: 480px) {
  .brand-name {
    font-size: 1.25rem;
    margin-left: 10px;
  }
}
@media (max-width: 360px) {
  .brand-name {
    font-size: 1.1rem;
    margin-left: 8px;
  }
}

/* --- PREMIUM GRID STAGGER DELAYS --- */
.curriculum-fullwidth-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.curriculum-fullwidth-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.curriculum-fullwidth-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.25s; }
.curriculum-fullwidth-grid .reveal-on-scroll:nth-child(4) { transition-delay: 0.35s; }
.curriculum-fullwidth-grid .reveal-on-scroll:nth-child(5) { transition-delay: 0.45s; }

.why-sequence-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.why-sequence-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.why-sequence-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.25s; }
.why-sequence-grid .reveal-on-scroll:nth-child(4) { transition-delay: 0.35s; }

.testimonial-editorial-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.testimonial-editorial-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.testimonial-editorial-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.25s; }

.notes-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.notes-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.notes-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.25s; }

.stats-grid .reveal-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.stats-grid .reveal-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.stats-grid .reveal-on-scroll:nth-child(3) { transition-delay: 0.25s; }

/* Disable storytelling media transitions on desktop for instant scroll response */
@media (min-width: 1025px) {
  .sticky-story-media img,
  .sticky-story-media iframe {
    transition: none !important;
  }
}



