:root {
  --primary-maroon: #7A1C1C;
  --accent-gold: #D4AF37;
  --dark-slate: #1A1A1A;
  --bg-cream: #FAF8F5;
  --text-muted: #5F6B7A;
  --white: #FFFFFF;
}

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

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-cream); }
::-webkit-scrollbar-thumb { background: var(--primary-maroon); border-radius: 10px; border: 2px solid var(--bg-cream); }
::-webkit-scrollbar-thumb:hover { background: #541010; }

::selection { background: var(--primary-maroon); color: var(--white); }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background-color: var(--bg-cream);
  background-image: radial-gradient(rgba(122, 28, 28, 0.04) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--dark-slate);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(122, 28, 28, 0.1);
  transition: all 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.school-crest {
  height: 130px;
  width: 130px;
  object-fit: contain;
  background: var(--white);
  border-radius: 50%;
  padding: 16px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  margin-bottom: -45px;
  position: relative;
  z-index: 200;
  border: 3px solid var(--primary-maroon);
}

.logo-area:hover .school-crest {
  transform: scale(1.04);
}

.logo-text { display: flex; flex-direction: column; }
.school-name {
  font-weight: 800;
  font-size: 1.45rem;
  background: linear-gradient(90deg, var(--primary-maroon) 0%, #C33535 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.school-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.main-menu { display: flex; gap: 2rem; align-items: center; }
.main-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-menu a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-gold);
  transition: width 0.3s ease;
}

.main-menu a:hover, .main-menu a.active {
  color: var(--primary-maroon);
}
.main-menu a:hover::after, .main-menu a.active::after {
  width: 100%;
}

@keyframes portalPulse {
  0% { box-shadow: 0 4px 15px rgba(122, 28, 28, 0.2), 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { box-shadow: 0 4px 15px rgba(122, 28, 28, 0.2), 0 0 0 10px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 4px 15px rgba(122, 28, 28, 0.2), 0 0 0 0 rgba(212, 175, 55, 0); }
}

.main-menu a.portal-link {
  background: linear-gradient(135deg, var(--primary-maroon) 0%, #541010 100%);
  color: var(--accent-gold) !important;
  padding: 12px 26px !important;
  border-radius: 30px;
  border: 1px solid rgba(212, 175, 55, 0.6) !important;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(122, 28, 28, 0.3);
  animation: portalPulse 3s infinite;
  transition: all 0.3s ease;
}
.main-menu a.portal-link::after { display: none; }

.main-menu a.portal-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(122, 28, 28, 0.5);
  animation: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary-maroon);
  cursor: pointer;
}

@media (max-width: 992px) {
  .main-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 10px 20px 25px 20px;
    box-shadow: 0 20px 30px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(122, 28, 28, 0.1);
    gap: 0;
    z-index: 999;
  }
  .main-menu a {
    padding: 15px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
  }
  .main-menu a:last-child {
    border-bottom: none;
    margin-top: 15px;
  }
  .main-menu.open {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }
  .menu-toggle { display: block; }

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

  .school-crest {
    height: 80px;
    width: 80px;
    padding: 8px;
    margin-bottom: -15px;
  }
  .header-inner {
    padding: 10px 0;
  }
}

.nexus-page-transition {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.nexus-fade-out {
  opacity: 0;
  transform: translateY(10px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}