:root {
  /* ============================================================
     Theme: Deep Indigo / Midnight Slate — warm academic gateway
     ============================================================ */
  --bg-dark: #060913;

  --glow-core: rgba(139, 92, 246, 0.42);   /* Violet */
  --glow-edge: rgba(232, 121, 249, 0.14);  /* Warm fuchsia edge */
  --accent: #A78BFA;       /* Violet-400 */
  --accent-warm: #F0ABFC;  /* Fuchsia-300, warms the gradient */

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-soft: #D9D3F5;

  --glass-bg: rgba(24, 20, 51, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 24px;
  --orb-blur: 62px;

  --radius-panel: 24px;
  --shadow-panel: 0 25px 50px -12px rgba(0, 0, 0, 0.55);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --focus-ring: 2px solid #C4B5FD;
}

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

html { overflow-x: hidden; }

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* ---------- Ambient glow: two slow, soft orbs (calm — not the
   reactor-pulse treatment used on the root gateway; this page's
   brief asks for a warm, encouraging mood, not high-octane) ---------- */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.orb-primary {
  width: clamp(360px, 48vw, 640px);
  height: clamp(360px, 48vw, 640px);
  background: radial-gradient(circle, var(--glow-core) 0%, var(--glow-edge) 50%, transparent 70%);
  filter: blur(var(--orb-blur));
  animation: driftPrimary 28s var(--ease) infinite;
}

.orb-accent {
  width: clamp(200px, 26vw, 340px);
  height: clamp(200px, 26vw, 340px);
  background: radial-gradient(circle, rgba(240, 171, 252, 0.28) 0%, transparent 70%);
  filter: blur(50px);
  top: 62%;
  left: 58%;
  animation: driftAccent 24s var(--ease) infinite;
}

@keyframes driftPrimary {
  0%   { transform: translate3d(0, 0, 0) scale(1);           opacity: 0.85; }
  25%  { transform: translate3d(30px, -24px, 0) scale(1.05); opacity: 0.95; }
  50%  { transform: translate3d(-20px, -46px, 0) scale(0.97);opacity: 1; }
  75%  { transform: translate3d(-38px, 14px, 0) scale(1.04); opacity: 0.9; }
  100% { transform: translate3d(0, 0, 0) scale(1);           opacity: 0.85; }
}

@keyframes driftAccent {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1);     opacity: 0.75; }
  50%      { transform: translate3d(-24px, 20px, 0) scale(1.12); opacity: 0.95; }
}

.gateway-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 720px;
  padding: clamp(1rem, 4vw, 2rem);
}

/* ---------- Glassmorphism panel ---------- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-panel);
  padding: clamp(2.5rem, 6vw, 3.75rem) clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  box-shadow: var(--shadow-panel);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-panel { background: rgba(10, 8, 26, 0.92); }
  .glass-modal { background: rgba(10, 8, 26, 0.96); }
}

/* ---------- Staggered entrance (calm fade + rise, matches the
   family's baseline choreography) ---------- */
@keyframes revealUp {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.logo-mark {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
  opacity: 0;
  animation: revealUp 0.6s var(--ease) 0.05s both;
}
.logo-mark span { color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-warm);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: revealUp 0.6s var(--ease) 0.18s both;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.title {
  font-size: clamp(1.6rem, 1.15rem + 2.1vw, 2.35rem);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
  opacity: 0;
  animation: revealUp 0.65s var(--ease) 0.3s both;
}

.title .highlight {
  display: block;
  margin-top: 0.4rem;
  font-weight: 800;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: clamp(0.92rem, 0.85rem + 0.3vw, 1.05rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 46ch;
  margin: 0 auto clamp(1.75rem, 4vw, 2.25rem);
  opacity: 0;
  animation: revealUp 0.65s var(--ease) 0.44s both;
}

.fine-print {
  margin-top: clamp(1.75rem, 4vw, 2.25rem);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0;
  animation: revealUp 0.6s var(--ease) 0.72s both;
}

/* ---------- CTA button ---------- */
.cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: inherit;
  font-size: clamp(0.9rem, 0.85rem + 0.15vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0B0714;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  border: none;
  border-radius: 999px;
  padding: clamp(0.85rem, 2vw, 1rem) clamp(1.75rem, 4vw, 2.25rem);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 26px -8px rgba(139, 92, 246, 0.55);
  opacity: 0;
  animation: revealUp 0.65s var(--ease) 0.58s both;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cta-button:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 34px -8px rgba(139, 92, 246, 0.7);
}
.cta-button:active { transform: translateY(0) scale(0.98); }
.cta-button:focus-visible { outline: var(--focus-ring); outline-offset: 4px; }

.cta-arrow { transition: transform 0.3s var(--ease); }
.cta-button:hover .cta-arrow { transform: translateX(3px); }

/* One-shot light sweep on hover — transform-only, plays once per hover */
.cta-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-130%);
}
.cta-button:hover::before { animation: sheen 0.9s var(--ease); }
@keyframes sheen {
  to { transform: translateX(130%); }
}

/* ============================================================
   Enrollment Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 9, 19, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glass-modal {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.modal-overlay.is-open .glass-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.2s var(--ease);
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-main); }
.modal-close:active { transform: scale(0.92); }
.modal-close:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.18);
}
.modal-body iframe {
  display: block;
  width: 100%;
  min-height: 600px;
  border: 0;
  border-radius: 12px;
  background: #fff; /* Google Forms renders white; avoids a dark flash while loading */
}

.modal-fallback {
  flex-shrink: 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.9rem 1.5rem 1.3rem;
  border-top: 1px solid var(--glass-border);
}
.modal-fallback a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.modal-fallback a:hover { color: var(--accent-warm); }

/* Mobile: modal expands near-full-screen with smooth touch scroll inside */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; }
  .glass-modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .modal-body iframe { min-height: 100%; height: 100%; }
}

/* ============================================================
   Accessibility & performance guardrails
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ambient-orb,
  .badge-dot,
  .cta-button::before {
    animation: none !important;
  }

  .logo-mark, .badge, .title, .lead, .cta-button, .fine-print {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .modal-overlay, .glass-modal {
    transition-duration: 0.01ms !important;
  }
}

a:focus-visible, button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .ambient-orb { filter: blur(40px); }
}
