:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #5b6475;
  --primary: #3b6fd9;
  --primary-soft: #e7efff;
  --border: #dfe7f5;
  --shadow: 0 12px 32px rgba(20, 40, 80, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Poppins", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(92%, var(--container));
  margin: 0 auto;
}

.section {
  padding: 80px 0;
}

.section-header {
  max-width: 760px;
  margin-bottom: 36px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--muted);
  margin: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 24px rgba(16, 40, 88, 0.08);
  border-color: rgba(177, 195, 230, 0.45);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: min-height 0.3s ease;
}

.header.scrolled .nav {
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(20, 40, 80, 0.12);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.brand:hover .brand-logo {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 20px rgba(59, 111, 217, 0.22);
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu a {
  position: relative;
  color: #1f2937;
  font-weight: 500;
  transition: color 0.25s ease, transform 0.25s ease;
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #4a78e5, #7aa2ff);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s ease;
}

.menu a:hover,
.menu a.active {
  color: var(--primary);
  transform: translateY(-1px);
}

.menu a:hover::after,
.menu a.active::after {
  transform: scaleX(1);
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 62%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transition: left 0.55s ease;
}

.btn:hover::after {
  left: 150%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 111, 217, 0.3);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border-color: var(--border);
}

.hero {
  min-height: 84vh;
  display: grid;
  place-items: center;
  position: relative;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(18, 40, 83, 0.65), rgba(26, 63, 134, 0.45)),
    var(
      --hero-bg,
      url("assets/hero.jpg")
    )
      center/cover no-repeat;
  transform: translateY(var(--hero-parallax-y, 0px)) scale(1.03);
  transition: transform 0.15s linear;
}

.hero::after {
  content: "";
  position: absolute;
  width: min(50vw, 460px);
  aspect-ratio: 1;
  right: -10%;
  top: -20%;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(131, 170, 255, 0.45), rgba(131, 170, 255, 0));
  filter: blur(8px);
  animation: floatOrb 8s ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  width: min(95%, 900px);
  animation: heroLift 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 auto 30px;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(20, 40, 80, 0.16);
}

.muted {
  color: var(--muted);
}

.highlight-number {
  font-size: 2rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 10px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.announcement-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.announcement-item:last-child {
  border-bottom: 0;
}

.date {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 700;
}

.topper-card {
  text-align: center;
}

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 3px solid var(--primary-soft);
}

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

.gallery-grid img {
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
}

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

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.achievement-card {
  padding: 0;
  overflow: hidden;
}

.achievement-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.achievement-card:hover img {
  transform: scale(1.02);
  filter: brightness(1.03);
}

.achievement-caption {
  padding: 20px 22px 22px;
}

.achievement-caption h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.achievement-caption p {
  margin: 0;
}

.cm-feature {
  max-width: 980px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.cm-feature img {
  width: 100%;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.cm-feature:hover img {
  transform: scale(1.01);
  filter: brightness(1.02);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1100;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(1000px, 94vw);
  max-height: 88vh;
  border-radius: 16px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  background: #fff;
  color: #111;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

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

input,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
}

iframe {
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 240px;
}

.footer {
  background: #0f1f3d;
  color: #dce4f5;
  padding: 50px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 22px;
}

.footer h4 {
  margin-top: 0;
  color: #fff;
}

.socials {
  display: flex;
  gap: 10px;
}

.socials a {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.copy-chip {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  padding: 0 2px;
  border-bottom: 1px dashed currentColor;
}

.copy-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.copy-chip:hover::after,
.copy-chip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.copyright {
  border-top: 1px solid rgba(220, 228, 245, 0.18);
  margin-top: 28px;
  padding-top: 18px;
  color: #b6c5e1;
  font-size: 0.95rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.99);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

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

.history-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.history-list li {
  margin: 10px 0;
}

.history-list strong {
  font-weight: 700;
  color: var(--text);
}

.teacher-card {
  text-align: center;
  padding: 22px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.teacher-avatar {
  width: 86px;
  height: 86px;
  border-radius: 26px;
  object-fit: cover;
  margin: 0 auto 14px;
  border: 3px solid rgba(231, 239, 255, 1);
  transition: transform 0.45s ease;
}

.teacher-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59, 111, 217, 0.25), rgba(122, 162, 255, 0.08), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.teacher-card:hover::before {
  opacity: 1;
}

.teacher-card:hover .teacher-avatar {
  transform: scale(1.06);
}

.teacher-modal {
  position: fixed;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
}

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

.teacher-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.teacher-modal.open::before {
  opacity: 1;
}

.teacher-modal.closing-blur::before {
  opacity: 0;
}

.teacher-modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: #fff;
  color: #111827;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.teacher-modal-close:hover {
  transform: scale(1.05);
}

.teacher-modal-content {
  width: min(1040px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 231, 245, 0.7);
  border-radius: 26px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  padding: 22px;
  align-items: center;
  transform: translateY(8px) scale(0.992);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  will-change: transform, opacity;
}

.teacher-modal.open .teacher-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.teacher-modal.from-tile .teacher-modal-content {
  opacity: 0;
  transform: translateY(0) scale(1);
}

.teacher-modal-photoWrap {
  display: grid;
  place-items: center;
  padding: 10px;
}

.teacher-modal-photo {
  width: 340px;
  height: 340px;
  max-width: 86vw;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(223, 231, 245, 0.85);
  box-shadow: 0 18px 40px rgba(20, 40, 80, 0.18);
  transform: scale(0.98);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.teacher-modal.open .teacher-modal-photo {
  transform: scale(1);
}

.teacher-modal-details {
  padding: 10px 6px;
  opacity: 0;
  transform: translateX(10px) scale(0.998);
  transition: opacity 0.42s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.teacher-modal-actions {
  margin-top: 18px;
}

.teacher-modal-role,
.teacher-modal-bio,
.teacher-modal-actions {
  opacity: 0;
  transform: translateY(8px) scale(0.995);
  transition: opacity 0.34s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.teacher-modal-photo,
.teacher-modal-name {
  opacity: 1;
  transform: none;
}

.teacher-modal.shared-transitioning .teacher-modal-photo,
.teacher-modal.shared-transitioning .teacher-modal-name {
  visibility: hidden;
}

.teacher-modal.shared-transitioning .teacher-modal-details {
  opacity: 0;
  transform: translateX(10px) scale(0.998);
}

.teacher-modal.open .teacher-modal-details {
  opacity: 1;
  transform: translateX(0) scale(1);
  transition-delay: 90ms;
}

.teacher-modal.open .teacher-modal-role {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 130ms;
}

.teacher-modal.open .teacher-modal-bio {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 170ms;
}

.teacher-modal.open .teacher-modal-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 210ms;
}

.teacher-card.source-opening {
  opacity: 0.12;
}

.teacher-fly-clone {
  position: fixed;
  margin: 0;
  z-index: 1300;
  border-radius: 26px;
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1), top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1), height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  pointer-events: none;
  overflow: hidden;
}

/* The fly clone exists only as a moving container.
   Hide its internal image/text so we don't see duplicate photo/name. */
.teacher-fly-clone * {
  opacity: 0 !important;
}

.shared-fly-photo {
  position: fixed;
  z-index: 1310;
  border-radius: 26px;
  object-fit: cover;
  border: 2px solid rgba(231, 239, 255, 1);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1), top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.55s cubic-bezier(0.22, 1, 0.36, 1), height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.shared-fly-name {
  position: fixed;
  z-index: 1310;
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1), top 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    font-size 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

@media (max-width: 860px) {
  .teacher-modal-content {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .teacher-modal-photo {
    width: 260px;
    height: 260px;
    border-radius: 999px;
  }
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-12px, 12px, 0);
  }
}

@keyframes heroLift {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    display: block;
  }

  .menu {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
  }

  .menu.open {
    display: flex;
  }
}

@media (max-width: 760px) {
  .section {
    padding: 64px 0;
  }

  .grid-3,
  .gallery-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .announcement-item {
    flex-direction: column;
    gap: 4px;
  }
}
