:root {
  --primary: #164194;
  --primary-dark: #0f2c64;
  --secondary: #6f95dd;
  --bg: #f6f9ff;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --border: #dbe7ff;
  --shadow: 0 10px 26px rgba(12, 45, 104, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 46%, #f7faff 100%);
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: 86px 0;
}

.section-alt {
  background: var(--bg);
}

.section-title {
  font-family: "Merriweather", serif;
  font-size: clamp(1.75rem, 2.4vw, 2.35rem);
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 800px;
}

.topbar {
  background: #edf3ff;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: #334155;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.topbar a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  position: relative;
}

.logo {
  display: block;
  text-decoration: none;
  width: min(100%, 390px);
}

.logo img {
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  border: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  font-size: 0.96rem;
  transition: color 0.25s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--primary-dark);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.mobile-menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mega {
  position: relative;
}

.mega-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
}

.mega-toggle::after {
  content: " ▾";
  font-size: 0.85rem;
}

.mega-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: min(820px, 92vw);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 44px rgba(7, 34, 84, 0.18);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mega:hover .mega-panel,
.mega:focus-within .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.mega-card {
  display: block;
  text-decoration: none;
  background: #f7faff;
  border: 1px solid #dfe8ff;
  border-radius: 12px;
  padding: 14px;
}

.mega-card:hover {
  border-color: #c4d6ff;
  background: #f1f7ff;
}

.mega-card strong {
  display: block;
  color: var(--primary-dark);
  margin-bottom: 4px;
  font-size: 0.94rem;
}

.mega-card span {
  color: #5f6c85;
  font-size: 0.84rem;
  line-height: 1.4;
}

.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(8, 28, 64, 0.9), rgba(22, 65, 148, 0.72)),
    var(--hero-bg, url("https://www.samhsschool.com/images/banner-slider/slide-img-1.jpg")) center/cover no-repeat;
  transform: scale(1.03);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
  filter: brightness(0.78);
}

.video-note {
  margin-top: 16px;
  font-size: 0.8rem;
  opacity: 0.9;
}

.hero-content {
  position: relative;
  text-align: center;
  width: min(880px, 90%);
  animation: fadeUp 0.8s ease both;
}

.hero-content h2 {
  font-family: "Merriweather", serif;
  font-size: clamp(1.8rem, 3.7vw, 3rem);
  margin-bottom: 14px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.25);
}

.hero-content p {
  margin: 0 auto 20px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  max-width: 760px;
  opacity: 0.95;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.3);
  -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.2);
}

.quote-box {
  margin: 0 auto 24px;
  max-width: 760px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 500;
  transition: opacity 0.4s ease;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary {
  background: #fff;
  color: var(--primary-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-blue {
  background: var(--primary);
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.page-hero {
  min-height: 44vh;
}

.grid-two {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 26px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: #b7ceff;
}

.feature-card .icon {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #dbe6ff;
  box-shadow: var(--shadow);
  background: #fff;
}

.gallery-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 26px;
  align-items: stretch;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.pillar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.pillar h3 {
  color: var(--primary-dark);
  margin-bottom: 7px;
  font-size: 1.08rem;
}

.split-highlight {
  background: linear-gradient(140deg, #102f6a, #1b4eaa);
  color: #e8f0ff;
}

.split-highlight .section-title {
  color: #ffffff;
}

.split-highlight .section-subtitle {
  color: #d7e6ff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.2;
  color: #ffffff;
}

.stat-card span {
  color: #e5edff;
  font-size: 0.92rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contact-list {
  list-style: none;
  display: grid;
  gap: 10px;
  color: #334155;
}

.contact-list strong {
  color: var(--primary-dark);
}

.map-frame {
  width: 100%;
  min-height: 300px;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

footer {
  background: linear-gradient(160deg, #0e2c5d, #143f83);
  color: #dbeafe;
  padding-top: 44px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr;
  gap: 22px;
  padding-bottom: 28px;
}

.footer-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.footer-links,
.footer-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: #dbeafe;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

[data-animate] {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.7s ease forwards;
  animation-play-state: paused;
}

[data-animate].show {
  animation-play-state: running;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .grid-two,
  .intro-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pillars-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1100;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 34px rgba(8, 40, 94, 0.14);
    padding: 14px;
    display: grid;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
  }

  .nav-links.open {
    max-height: 70vh;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    display: block;
    padding: 8px 4px;
  }

  .mega-panel {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: 100%;
    box-shadow: none;
    border-radius: 12px;
    margin-top: 8px;
    padding: 12px;
  }

  .mega-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-wrap {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-links {
    width: 100%;
  }

  .topbar .container {
    flex-direction: column;
  }

  .feature-grid,
  .gallery-grid,
  .pillars-grid,
  .stats-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 68vh;
  }

  .page-hero {
    min-height: 38vh;
  }
}
