/* ==========================================================================
   MATHSWITHAMAL.COM - APPLE-INSPIRED WHITE-FIRST DESIGN SYSTEM
   ========================================================================== */

/* --- CSS RESET & BASE STYLES --- */
:root {
  /* Canvas & Neutral Palette (White-First) */
  --bg-primary: #FFFFFF;
  --bg-surface: #F8FAFC;
  --bg-surface-elevated: #F1F5F9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.75);
  --bg-glass-card-hover: rgba(248, 250, 252, 0.9);

  /* Typography Palette (High-Contrast Dark Navy / Slate) */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-accent: #1E40AF;

  /* Brand Accents (Extracted directly from Maths With Amal Logo) */
  --primary-blue: #1E40AF;    /* Logo "Amal" Royal Blue */
  --primary-blue-hover: #1D4ED8;
  --accent-teal: #0D9488;     /* Logo Circular Dashed Ring Teal */
  --accent-gold: #D97706;     /* Logo "Maths With" Script Gold */
  --accent-purple: #7C3AED;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #1E40AF 0%, #0D9488 100%);
  --gradient-gold: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  --gradient-glow: radial-gradient(circle, rgba(30, 64, 175, 0.08) 0%, rgba(255, 255, 255, 0) 70%);

  /* Borders & Shadows */
  --border-glass: rgba(15, 23, 42, 0.08);
  --border-glass-active: rgba(30, 64, 175, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 40px rgba(30, 64, 175, 0.12);

  /* Fonts (Apple Product Aesthetic) */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --font-math: 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout Spacing */
  --container-max: 1280px;
  --header-height: 80px;
  --border-radius-sm: 10px;
  --border-radius-md: 20px;
  --border-radius-lg: 32px;
  --border-radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  background-color: var(--bg-primary);
}

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

/* Custom Selection */
::selection {
  background-color: rgba(30, 64, 175, 0.15);
  color: var(--primary-blue);
}

/* Links & Buttons Reset */
a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FFFFFF;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* --- UTILITY CLASSES --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.section-padding {
  padding: clamp(4rem, 8vw, 8rem) 0;
}

.text-gradient {
  background: linear-gradient(135deg, #1E40AF 0%, #0D9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glass-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-glass-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Section Header Styles */
.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--border-radius-full);
  background: rgba(30, 64, 175, 0.06);
  border: 1px solid rgba(30, 64, 175, 0.15);
  color: var(--primary-blue);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1.7;
}

/* Button Component Styles (Apple Pill Style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: #CBD5E1;
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.4);
}

/* Scroll Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle Scale-In reveal class for key visuals, images, and maps */
.reveal-on-scroll.scale-in {
  opacity: 0;
  transform: translateY(15px) scale(0.97);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.scale-in.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-on-scroll.scale-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Scroll offset for sticky header navigation target */
section[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}


