/* ============================================
   Apex Academy - Premium School Website
   Design System & Styles
   ============================================ */

/* ----- CSS Custom Properties ----- */
:root {
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --primary-darker: #075985;
  --primary-light: #7dd3fc;
  --primary-lighter: #e0f2fe;
  --primary-subtle: #f0f9ff;

  --secondary: #1e3a5f;
  --secondary-light: #2d5a8e;

  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;

  --accent2: #8b5cf6;
  --accent2-light: #a78bfa;

  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-on-primary: #ffffff;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
  --bg-gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  --bg-gradient-warm: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --bg-gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --bg-gradient-dark: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 20px rgba(14,165,233,0.3);
  --shadow-gold: 0 0 20px rgba(245,158,11,0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container-max: 1280px;
  --container-narrow: 900px;
  --header-height: 80px;

  --z-nav: 1000;
  --z-overlay: 999;
  --z-modal: 1100;
  --z-tooltip: 1200;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-gradient);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition-base); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 700; color: var(--neutral-800); }
::selection { background: var(--primary); color: white; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--neutral-100); }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* ----- Typography ----- */
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h4 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
h5 { font-size: clamp(1rem, 1.5vw, 1.3rem); }
h6 { font-size: 1rem; }

.display-heading {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-label::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

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

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  transform: translateX(-100%);
  transition: transform 0.4s;
}

.btn:hover::after { transform: translateX(0); }

.btn-primary {
  background: var(--bg-gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(14,165,233,0.4);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(14,165,233,0.5);
  transform: translateY(-2px);
  color: white;
}

.btn-secondary {
  background: var(--bg-gradient-warm);
  color: white;
  box-shadow: 0 4px 15px rgba(245,158,11,0.4);
}

.btn-secondary:hover {
  box-shadow: 0 8px 30px rgba(245,158,11,0.5);
  transform: translateY(-2px);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-outline-light {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline-light:hover {
  border-color: white;
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.05rem;
}

/* ----- Header / Navigation ----- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--header-height);
  transition: var(--transition-base);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(203,213,225,0.3);
}

.header.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--neutral-800);
  z-index: calc(var(--z-nav) + 2);
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--bg-gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(14,165,233,0.3);
}

.logo span { color: var(--primary); }

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  position: relative;
}

.nav-link:hover { color: var(--primary); background: var(--primary-lighter); }

.nav-link.active {
  color: var(--primary);
  background: var(--primary-lighter);
  font-weight: 600;
}

.nav-cta {
  padding: 10px 24px;
  background: var(--bg-gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
  margin-left: 8px;
}

.nav-cta:hover { box-shadow: 0 6px 20px rgba(14,165,233,0.4); transform: translateY(-1px); color: white; }

/* Mobile Menu */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  z-index: calc(var(--z-nav) + 2);
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--neutral-700);
  border-radius: 2px;
  transition: var(--transition-base);
  transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ----- Hero Section ----- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--header-height);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 40%, #dbeafe 100%);
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}

.hero-particle:nth-child(1) { width: 400px; height: 400px; background: var(--primary); top: -100px; right: -100px; animation: float 20s ease-in-out infinite; }
.hero-particle:nth-child(2) { width: 250px; height: 250px; background: var(--accent); bottom: -50px; left: -50px; animation: float 25s ease-in-out infinite reverse; }
.hero-particle:nth-child(3) { width: 150px; height: 150px; background: var(--accent2); top: 40%; right: 10%; animation: float 18s ease-in-out infinite 2s; }
.hero-particle:nth-child(4) { width: 300px; height: 300px; background: var(--primary-light); bottom: 20%; right: -80px; opacity: 0.1; animation: float 22s ease-in-out infinite 1s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(5deg); }
  66% { transform: translate(-20px, 20px) rotate(-3deg); }
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px 24px;
  position: relative;
  z-index: 2;
}

.hero-text h1 {
  margin-bottom: 20px;
}

.hero-text h1 .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 540px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--neutral-200);
}

.hero-stat h3 {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 800;
}

.hero-stat p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.hero-image-wrapper::before {
  content: '';
  position: absolute;
  inset: -10px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  opacity: 0.3;
  animation: morphBlob 12s ease-in-out infinite;
}

@keyframes morphBlob {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 70% 30% 30% 70% / 60% 60% 40% 40%; }
}

.hero-image-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
}

.hero-image-main svg {
  width: 60%;
  height: 60%;
  opacity: 0.9;
}

.hero-badge {
  position: absolute;
  padding: 12px 20px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: floatBadge 4s ease-in-out infinite;
}

.hero-badge-1 { top: 10%; right: -10%; animation-delay: 0s; }
.hero-badge-2 { bottom: 15%; left: -10%; animation-delay: 2s; }

.hero-badge .badge-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-lighter);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ----- Sections ----- */
.section {
  padding: 100px 0;
  position: relative;
}

.section-alt { background: var(--bg-secondary); }

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.section-header.left-aligned { text-align: left; }
.section-header.left-aligned p { margin: 0; }

/* ----- Cards ----- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

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

.card-image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.card-image img,
.card-image svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.card:hover .card-image img,
.card:hover .card-image svg { transform: scale(1.08); }

.card-body {
  padding: 28px;
}

.card-body h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.card-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.card-link:hover { gap: 12px; color: var(--primary-dark); }

/* ----- Grid Layouts ----- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

/* ----- Features Grid ----- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.feature-card {
  background: white;
  padding: 36px 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-100);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--primary-lighter);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--primary);
  transition: var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: var(--primary);
  color: white;
  transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ----- Marquee / Infinite Scroll ----- */
.marquee-wrap {
  overflow: hidden;
  background: var(--primary-lighter);
  padding: 20px 0;
  position: relative;
}

.marquee-wrap::before,
.marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.marquee-wrap::before { left: 0; background: linear-gradient(to right, var(--primary-lighter), transparent); }
.marquee-wrap::after { right: 0; background: linear-gradient(to left, var(--primary-lighter), transparent); }

.marquee {
  display: flex;
  gap: 60px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.marquee-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----- About Section Split ----- */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image-main {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
}

.about-image-main svg { width: 50%; height: 50%; opacity: 0.7; }

.about-exp-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--bg-gradient-primary);
  color: white;
  padding: 24px 32px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.about-exp-badge h3 { font-size: 2.2rem; color: white; }
.about-exp-badge p { font-size: 0.8rem; opacity: 0.9; font-weight: 500; }

.about-text h2 { margin-bottom: 20px; }

.about-text .lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
}

.about-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
}

.about-feature-item .check {
  width: 24px;
  height: 24px;
  background: var(--primary-lighter);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ----- Timeline ----- */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--neutral-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 3px var(--primary);
}

.timeline-item h4 { font-size: 1.1rem; margin-bottom: 6px; }
.timeline-item .date { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.timeline-item p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ----- Gallery ----- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.gallery-item:nth-child(1) { grid-row: span 2; aspect-ratio: auto; }
.gallery-item:nth-child(6) { grid-column: span 2; }

.gallery-item-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: var(--transition-slow);
}

.gallery-item:nth-child(1) .gallery-item-bg { background: linear-gradient(135deg, #0ea5e9, #1e3a5f); }
.gallery-item:nth-child(2) .gallery-item-bg { background: linear-gradient(135deg, #f59e0b, #d97706); }
.gallery-item:nth-child(3) .gallery-item-bg { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.gallery-item:nth-child(4) .gallery-item-bg { background: linear-gradient(135deg, #10b981, #059669); }
.gallery-item:nth-child(5) .gallery-item-bg { background: linear-gradient(135deg, #ec4899, #db2777); }
.gallery-item:nth-child(6) .gallery-item-bg { background: linear-gradient(135deg, #0ea5e9, #8b5cf6); }
.gallery-item:nth-child(7) .gallery-item-bg { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: var(--transition-base);
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item:hover .gallery-item-bg { transform: scale(1.08); }

.gallery-item-overlay h4 { color: white; font-size: 1rem; }

/* ----- Faculty Cards ----- */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.faculty-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.faculty-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.faculty-avatar {
  width: 100%;
  aspect-ratio: 1;
  background: var(--primary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.faculty-avatar svg {
  width: 40%;
  height: 40%;
  color: var(--primary);
  opacity: 0.6;
}

.faculty-avatar .social-links {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition-base);
}

.faculty-card:hover .social-links { opacity: 1; }

.social-link {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.social-link:hover { background: var(--primary); color: white; }

.faculty-info { padding: 24px 20px; }
.faculty-info h4 { font-size: 1.1rem; margin-bottom: 4px; }
.faculty-info .role { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.faculty-info p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* ----- Testimonials ----- */
.testimonials-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.testimonial-card {
  background: white;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 5rem;
  line-height: 1;
  color: var(--primary-lighter);
  font-family: var(--font-display);
}

.testimonial-card .stars {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.testimonial-card blockquote {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.testimonial-author h5 { font-size: 0.95rem; margin-bottom: 2px; }
.testimonial-author span { font-size: 0.8rem; color: var(--text-muted); }

/* ----- Stats Counter ----- */
.stats-section {
  background: var(--bg-gradient-primary);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  position: relative;
  z-index: 2;
}

.stat-item {
  text-align: center;
  color: white;
}

.stat-item .number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-item .label {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 500;
}

.stat-item .icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

/* ----- CTA Section ----- */
.cta-section {
  padding: 100px 0;
  background: var(--bg-gradient-dark);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(14,165,233,0.15) 0%, transparent 70%);
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.cta-content h2 {
  color: white;
  margin-bottom: 16px;
}

.cta-content p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  margin-bottom: 36px;
  line-height: 1.8;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ----- Footer ----- */
.footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.8);
  padding: 80px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 50px;
  margin-bottom: 50px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand .logo-icon { box-shadow: none; }

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.8;
  opacity: 0.7;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  transition: var(--transition-base);
}

.footer-social a:hover { background: var(--primary); }

.footer h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.7;
  transition: var(--transition-base);
}

.footer-links a:hover { opacity: 1; color: var(--primary-light); }

.footer-contact li {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer-contact .icon { flex-shrink: 0; margin-top: 3px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a:hover { color: var(--primary-light); }

/* ----- Page Hero (Inner Pages) ----- */
.page-hero {
  padding: 160px 0 80px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(14,165,233,0.1) 0%, transparent 60%);
}

.page-hero-content { position: relative; z-index: 2; }
.page-hero h1 { margin-bottom: 12px; }
.page-hero .breadcrumb { font-size: 0.9rem; color: var(--text-secondary); }
.page-hero .breadcrumb a { color: var(--primary); }
.page-hero .breadcrumb .sep { margin: 0 8px; color: var(--text-muted); }

/* ----- Contact Form ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: white;
  transition: var(--transition-base);
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-lighter);
}

textarea.form-control { min-height: 140px; resize: vertical; }

.contact-info-grid {
  display: grid;
  gap: 24px;
}

.contact-info-card {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-100);
}

.contact-info-card .icon-wrap {
  width: 50px;
  height: 50px;
  background: var(--primary-lighter);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}

.contact-info-card h5 { font-size: 1rem; margin-bottom: 4px; }
.contact-info-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ----- Accordion / FAQ ----- */
.accordion { display: flex; flex-direction: column; gap: 12px; }

.accordion-item {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-100);
}

.accordion-header {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  background: none;
  cursor: pointer;
  transition: var(--transition-base);
}

.accordion-header:hover { color: var(--primary); }

.accordion-header .icon {
  font-size: 1.2rem;
  transition: var(--transition-base);
  flex-shrink: 0;
}

.accordion-item.active .accordion-header .icon { transform: rotate(45deg); color: var(--primary); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.accordion-item.active .accordion-body {
  max-height: 500px;
}

.accordion-body-inner {
  padding: 0 24px 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ----- Back to Top ----- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--bg-gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: var(--transition-base);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }

/* ----- Program / Academics ---- */
.program-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid var(--neutral-100);
}

.program-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--primary-light);
}

.program-card-header {
  padding: 28px;
  background: var(--primary-lighter);
  display: flex;
  align-items: center;
  gap: 16px;
}

.program-card-header .icon {
  width: 52px;
  height: 52px;
  background: var(--bg-gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.program-card-header h3 { font-size: 1.15rem; }

.program-card-body { padding: 24px 28px; }

.program-card-body ul li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--neutral-100);
}

.program-card-body ul li:last-child { border-bottom: none; }

.program-card-body ul li::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
}

/* ----- Events ----- */
.event-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid var(--neutral-100);
}

.event-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(6px);
  border-color: var(--primary-light);
}

.event-date {
  text-align: center;
  background: var(--primary-lighter);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.event-date .day {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.event-date .month {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.event-info h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.event-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.event-meta span { display: flex; align-items: center; gap: 4px; }
.event-info p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ----- Values Section ----- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
}

.value-card {
  text-align: center;
  padding: 40px 24px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid var(--neutral-100);
}

.value-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.value-card .icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: var(--primary-lighter);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--primary);
  transition: var(--transition-base);
}

.value-card:hover .icon {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.value-card h4 { font-size: 1.15rem; margin-bottom: 10px; }
.value-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ----- Blog / News Cards ----- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.blog-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--primary-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
}

.blog-card-image .category {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.blog-card-body { padding: 24px; }
.blog-card-body .meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.blog-card-body h4 { font-size: 1.15rem; margin-bottom: 10px; transition: var(--transition-base); }
.blog-card:hover h4 { color: var(--primary); }
.blog-card-body p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }

/* ----- Admissions ----- */
.admissions-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  counter-reset: step;
}

.admissions-step {
  text-align: center;
  padding: 36px 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  counter-increment: step;
}

.admissions-step::before {
  content: counter(step);
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  background: var(--bg-gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(14,165,233,0.3);
}

.admissions-step h4 { font-size: 1.1rem; margin: 12px 0 8px; }
.admissions-step p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ----- Animations ----- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.stagger-children > .animate { transition-delay: calc(var(--i, 0) * 0.1s); }

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-subtitle { margin: 0 auto 36px; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .hero-badge-1 { right: 0; }
  .hero-badge-2 { left: 0; }

  .about-split { grid-template-columns: 1fr; gap: 40px; }
  .about-image { max-width: 450px; margin: 0 auto; }

  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item:nth-child(1) { grid-row: auto; }
  .gallery-item:nth-child(6) { grid-column: auto; }
}

@media (max-width: 768px) {
  :root { --header-height: 64px; }
  .container { padding: 0 16px; }
  .section { padding: 60px 0; }
  .page-hero { padding: 120px 0 50px; }

  .nav-list {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: 100px 30px 30px;
    gap: 4px;
    box-shadow: var(--shadow-xl);
    transition: right 0.4s ease;
    align-items: stretch;
    z-index: var(--z-nav);
  }

  .nav-list.open { right: 0; }

  .nav-link {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .nav-cta { margin: 8px 0 0; text-align: center; }

  .mobile-toggle { display: flex; }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: calc(var(--z-nav) - 1);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-base);
  }

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

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stat h3 { font-size: 1.6rem; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .stat-item .number { font-size: 2.2rem; }

  .testimonials-slider { grid-template-columns: 1fr; }

  .event-card { grid-template-columns: 1fr; gap: 16px; }
  .event-date { flex-direction: row; gap: 8px; padding: 12px; }
  .event-date .day { font-size: 1.4rem; }

  .about-features { grid-template-columns: 1fr; }

  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .timeline { padding-left: 30px; }
  .timeline-item::before { left: -22px; width: 10px; height: 10px; }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 280px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 280px; }
  .btn { padding: 12px 24px; }
}

/* ----- Preloader ----- */
.preloader {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden { opacity: 0; visibility: hidden; }

.preloader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--neutral-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- Accessibility ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ----- Print ----- */
@media print {
  .header, .mobile-toggle, .back-to-top, .preloader, .cta-section { display: none; }
  body { background: white; color: black; }
  .section { padding: 30px 0; }
}
