:root {
  --primary: #1e3a8a;
  --primary-dark: #152a63;
  --white: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --surface: #f8fafc;
  --line: #dbe5f2;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.14);
  --shadow-card: 0 14px 35px rgba(30, 58, 138, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --nav-h: 78px;
  --ease: 320ms cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: 900ms cubic-bezier(0.19, 1, 0.22, 1);
  --ease-scene: 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 90% 10%, #dbeafe 0%, var(--white) 45%), var(--white);
  overflow-x: hidden;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

main {
  position: relative;
}

.scene {
  min-height: 100vh;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(90px, 10vh, 120px) 0 50px;
  opacity: 0.68;
  transform: scale(0.988);
  filter: saturate(0.9);
  transition: opacity var(--ease-scene), transform var(--ease-scene), filter var(--ease-scene);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  opacity: 0.75;
  pointer-events: none;
  transition: opacity var(--ease-scene);
}

.scene.in-view {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1);
}

.scene.in-view::after {
  opacity: 0;
}

.scene-content {
  width: min(1180px, 92%);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  transform: translateY(24px);
  opacity: 0.72;
  transition: transform var(--ease-smooth), opacity var(--ease-smooth);
}

.scene.in-view .scene-content {
  transform: translateY(0);
  opacity: 1;
}

.eyebrow {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.15;
}

h1 {
  color: var(--white);
  font-size: clamp(2rem, 6vw, 4.5rem);
  max-width: 900px;
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 3.1rem);
  margin-bottom: 0.85rem;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.btn {
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #1e3a8a, #274ab0);
  color: var(--white);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
}

.full {
  width: 100%;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #10255d, #1e3a8a);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.loader-inner {
  text-align: center;
  color: var(--white);
}

.loader-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  display: inline-block;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loader p {
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background var(--ease), box-shadow var(--ease), backdrop-filter var(--ease);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.nav-shell {
  height: var(--nav-h);
  width: min(1180px, 92%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  transition: color var(--ease);
}

.navbar.scrolled .brand {
  color: var(--primary);
}

.desktop-nav {
  display: flex;
  gap: 1.35rem;
}

.desktop-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color var(--ease);
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--ease);
}

.desktop-nav a:hover::after {
  width: 100%;
}

.navbar.scrolled .desktop-nav a {
  color: #0f172a;
}

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  width: 44px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--white);
  margin: 6px 0;
  transition: transform var(--ease), opacity var(--ease), background var(--ease);
}

.navbar.scrolled .menu-toggle span {
  background: var(--primary);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: linear-gradient(160deg, #122860, #1e3a8a);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.menu-close {
  position: absolute;
  top: 28px;
  right: 28px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.mobile-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.5rem;
}

.hero {
  color: var(--white);
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  transform: scale(1.08) translate3d(0, 0, 0);
  will-change: transform;
  transition: transform 260ms linear;
}

.scene-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(10, 26, 66, 0.75), rgba(30, 58, 138, 0.45));
  z-index: 1;
}

.hero-content {
  text-align: center;
  will-change: transform;
  transition: transform 260ms linear;
}

.hero-text {
  max-width: 760px;
  margin: 1rem auto 2rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
}

.about {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.1rem;
  align-items: center;
}

.about-media img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  min-height: 360px;
  object-fit: cover;
}

.about-copy p {
  margin-top: 0.75rem;
}

.academics {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.section-head {
  margin-bottom: 1.4rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.info-card,
.event-card {
  background: var(--white);
  border: 1px solid #e2ebfa;
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.info-card:hover,
.event-card:hover {
  transform: translateY(-7px);
  border-color: #bfd3ff;
  box-shadow: 0 20px 44px rgba(30, 58, 138, 0.2);
}

.info-card h3,
.event-card h3 {
  margin-bottom: 0.55rem;
  color: var(--primary-dark);
}

.admissions {
  background: linear-gradient(120deg, #f7faff, #f1f5ff);
}

.form-wrap {
  max-width: 620px;
  background: var(--white);
  border: 1px solid #d9e5fb;
  border-radius: var(--radius-xl);
  padding: 1.55rem;
  box-shadow: var(--shadow-soft);
}

.form-row {
  margin-bottom: 0.95rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.3rem;
  color: #1f2937;
  font-weight: 500;
}

.form-row input {
  width: 100%;
  border: 1px solid #c9d7f4;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-row input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.error {
  display: block;
  min-height: 1.1rem;
  color: #be123c;
  font-size: 0.82rem;
  margin-top: 0.22rem;
}

.form-success {
  min-height: 1.1rem;
  margin-top: 0.8rem;
  color: #0f766e;
  font-weight: 500;
}

.gallery {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gallery-item {
  border: none;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.gallery-item img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform var(--ease), filter var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.88);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease), visibility var(--ease);
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  width: min(1000px, 90vw);
  max-height: 84vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

.updates {
  background: linear-gradient(160deg, #eef4ff 0%, #f8fbff 100%);
}

.updates-grid .event-card {
  position: relative;
  overflow: hidden;
}

.updates-grid .event-card::before {
  content: "";
  position: absolute;
  inset: -50% auto auto -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(191, 219, 254, 0.45), rgba(191, 219, 254, 0));
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: transform 920ms cubic-bezier(0.16, 1, 0.3, 1), opacity 920ms ease;
}

.reveal.fade-in {
  transform: translateY(0);
}

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

.cards-grid .reveal:nth-child(2) {
  transition-delay: 90ms;
}

.cards-grid .reveal:nth-child(3) {
  transition-delay: 170ms;
}

.gallery-grid .reveal:nth-child(2n) {
  transition-delay: 70ms;
}

.gallery-grid .reveal:nth-child(3n) {
  transition-delay: 130ms;
}

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

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .about-grid,
  .cards-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .scene {
    height: auto;
    min-height: 100vh;
    padding-top: calc(var(--nav-h) + 24px);
    opacity: 1;
    transform: none;
    filter: none;
  }

  .scene::after {
    display: none;
  }

  .scene-content {
    transform: none;
    opacity: 1;
  }

  .gallery-item img {
    height: 260px;
  }

  .hero-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scene,
  .scene-content,
  .reveal,
  .hero-bg,
  .hero-content {
    transition: none;
    animation: none;
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .scene-content {
    width: 90%;
  }

  .form-wrap {
    padding: 1.2rem;
  }

  .menu-close {
    top: 20px;
    right: 20px;
  }
}
