/* ============================================
   MS EDUCATORS — Custom Styles
   ============================================ */

:root {
  --navy-950: #081226;
  --navy-900: #0b1b3a;
  --navy-800: #12264e;
  --gold-400: #f5c16c;
  --gold-500: #e8a33d;
  --cream: #faf7f1;
  --ink: #16233f;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

.font-display { font-family: "Fraunces", Georgia, serif; }

::selection { background: var(--gold-500); color: var(--navy-950); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-500), var(--navy-800)); border-radius: 99px; border: 3px solid var(--cream); }

/* ---------- Utilities ---------- */
.glass {
  background: rgba(8, 18, 38, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(245, 193, 108, 0.18);
}

.text-gradient-gold {
  background: linear-gradient(120deg, #f9d58a 0%, #e8a33d 55%, #f5c16c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bg-mesh {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(245, 193, 108, 0.18), transparent 60%),
    radial-gradient(1000px 700px at -10% 20%, rgba(46, 88, 170, 0.22), transparent 55%),
    linear-gradient(160deg, #0b1b3a 0%, #081226 70%);
}

.bg-mesh-gold {
  background:
    radial-gradient(900px 480px at 90% 10%, rgba(255, 255, 255, 0.7), transparent 55%),
    radial-gradient(1000px 600px at 0% 100%, rgba(245, 193, 108, 0.35), transparent 60%),
    linear-gradient(135deg, #e8a33d 0%, #f5c16c 60%, #e8a33d 100%);
}

.gold-line { height: 3px; border-radius: 99px; background: linear-gradient(90deg, var(--gold-500), transparent); }

.card-3d { transition: transform .45s cubic-bezier(.22,.61,.36,1), box-shadow .45s; }
.card-3d:hover { transform: translateY(-10px); box-shadow: 0 30px 60px -15px rgba(8,18,38,.25); }

/* ---------- Formula chips ---------- */
.formula-chip {
  font-family: "Fraunces", Georgia, serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: floaty 9s ease-in-out infinite;
  user-select: none;
}
.formula-a { animation-duration: 8s; }
.formula-b { animation-duration: 11s; animation-delay: 1.2s; }
.formula-c { animation-duration: 9.5s; animation-delay: 2.4s; }
.formula-d { animation-duration: 12s; animation-delay: .6s; }

@keyframes spin-slow { to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 26s linear infinite; }

/* ---------- Pulse dot ---------- */
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(245, 193, 108, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(245, 193, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 193, 108, 0); }
}
.pulse-dot { animation: pulse-dot 2s infinite; }

/* ---------- Hero slider ---------- */
.hero-slide { opacity: 0; transition: opacity 1.1s ease; z-index: 1; }
.hero-slide.active { opacity: 1; z-index: 10; }

.hero-slide .hero-media { animation: kenburns 24s ease-in-out infinite alternate; }
.hero-slide.active .hero-caption > * { animation: rise .9s cubic-bezier(.22,.61,.36,1) both; }
.hero-slide.active .hero-caption > *:nth-child(1) { animation-delay: .15s; }
.hero-slide.active .hero-caption > *:nth-child(2) { animation-delay: .32s; }
.hero-slide.active .hero-caption > *:nth-child(3) { animation-delay: .5s; }
.hero-slide.active .hero-caption > *:nth-child(4) { animation-delay: .68s; }

@keyframes kenburns {
  from { transform: scale(1.05) translate(0, 0); }
  to { transform: scale(1.18) translate(-2%, -2%); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(42px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-dot { transition: all .3s ease; }
.hero-dot.active { width: 3rem; background: var(--gold-500); }

/* ---------- Marquee ---------- */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { width: max-content; animation: marquee 40s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(38px); transition: opacity .8s ease, transform .8s cubic-bezier(.22,.61,.36,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }

/* ---------- Floating blobs ---------- */
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-22px) rotate(6deg); } }
.floaty { animation: floaty 9s ease-in-out infinite; }
.floaty-slow { animation: floaty 13s ease-in-out infinite reverse; }

/* ---------- Section eyebrow ---------- */
.eyebrow {
  letter-spacing: .32em;
}

/* ---------- Cards ---------- */
.feature-card:hover .feature-icon { transform: rotate(-8deg) scale(1.12); }
.feature-icon { transition: transform .4s ease; }

.program-card .program-shade { opacity: 0; transition: opacity .5s ease; }
.program-card:hover .program-shade { opacity: 1; }
.program-card:hover .program-cta { transform: translateX(0); opacity: 1; }
.program-cta { transform: translateX(-16px); opacity: 0; transition: all .45s ease; }

/* ---------- Testimonials ---------- */
.testimonial-slide { display: none; }
.testimonial-slide.active { display: block; animation: rise .6s ease both; }

/* ---------- Accordion ---------- */
.acc-answer { max-height: 0; overflow: hidden; transition: max-height .5s cubic-bezier(.22,.61,.36,1); }
.acc-item.open .acc-answer { max-height: 300px; }
.acc-item.open .acc-icon { transform: rotate(45deg); }
.acc-icon { transition: transform .35s ease; }

/* ---------- Floaty nav links underline ---------- */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
  transition: width .35s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---------- Photo frames ---------- */
.frame-gold { position: relative; }
.frame-gold::after {
  content: "";
  position: absolute; inset: 1.1rem -1.1rem -1.1rem 1.1rem;
  border: 2px solid var(--gold-500); border-radius: 1.25rem; z-index: 0;
  pointer-events: none;
}

/* ---------- Grid pattern overlay ---------- */
.grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---------- Back to top ---------- */
.back-top { opacity: 0; visibility: hidden; transition: .35s ease; }
.back-top.show { opacity: 1; visibility: visible; }
/* ============================================================
   Design primitives
   ------------------------------------------------------------
   The page templates repeated these exact utility chains 20-30
   times each, which meant a single spacing or colour change had to
   be made in a dozen places. These classes are the shared system;
   templates compose them instead of re-spelling Tailwind.

   Everything here is plain CSS (not Tailwind utilities) so it is
   never affected by whether the CDN scanner sees the markup.
   ============================================================ */

/* ---------- Page frame ---------- */
.shell {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 1024px) {
  .shell { padding-inline: 2rem; }
}

/* Vertical rhythm. Sections alternate light/dark, so one scale for both.
   The two values map 1:1 onto the paddings the templates used most, so
   normalising onto them does not change any page's spacing. */
.section       { padding-block: 6rem; }
.section-tight { padding-block: 5rem; }
.section-loose { padding-block: 7rem; }
/* For a section that sits directly under a hero and wants less air on top. */
.section-lead  { padding-top: 4rem; padding-bottom: 5rem; }
@media (min-width: 1024px) {
  .section       { padding-block: 8rem; }
  .section-tight { padding-block: 7rem; }
  .section-loose { padding-block: 9rem; }
  .section-lead  { padding-top: 6rem; padding-bottom: 7rem; }
}

.section-dark {
  position: relative;
  overflow: hidden;
  background: var(--navy-950);
  color: #fff;
}
/* ---------- Section heading block ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .32em;
  color: var(--gold-500);
}
.eyebrow--center { justify-content: center; }

/* The short rule that flanks an eyebrow. */
.rule {
  flex: none;
  width: 3rem;
  height: 1px;
  background: var(--gold-500);
}

.h-section {
  margin-top: 1.25rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.875rem, 1.35rem + 2.1vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy-900);
}
.h-section--center { margin-inline: auto; }

.h-card {
  margin-top: 1.5rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-900);
}

.lead {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #475569;
}
.copy {
  margin-top: 1rem;
  line-height: 1.75;
  color: #475569;
}
.copy-tight { margin-top: .5rem; }

.heading-block { max-width: 42rem; }
.heading-block--center { margin-inline: auto; text-align: center; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid #f1f5f9;
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.75rem;
  box-shadow: 0 18px 32px -24px rgba(8, 18, 38, .35);
  transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s;
}
.card:hover { box-shadow: 0 36px 60px -30px rgba(8, 18, 38, .45); }
.card--lg { padding: 2rem; }
@media (min-width: 1024px) { .card--lg { padding: 2.5rem; } }

/* Frosted card for dark sections. */
.card-glass {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, .05);
  padding: 2.25rem;
  backdrop-filter: blur(6px);
  transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s;
}
@media (min-width: 1024px) { .card-glass { padding: 2.75rem; } }

.card-gold {
  border-radius: 1.5rem;
  background:
    radial-gradient(900px 480px at 90% 10%, rgba(255, 255, 255, .7), transparent 55%),
    radial-gradient(1000px 600px at 0% 100%, rgba(245, 193, 108, .35), transparent 60%),
    linear-gradient(135deg, #e8a33d 0%, #f5c16c 60%, #e8a33d 100%);
  padding: 2rem;
  transition: transform .45s cubic-bezier(.22, .61, .36, 1), box-shadow .45s;
}
@media (min-width: 1024px) { .card-gold { padding: 2.5rem; } }

/* ---------- Icon tiles ---------- */
.icon-tile {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: none;
  border-radius: 1rem;
  background:
    radial-gradient(900px 480px at 90% 10%, rgba(255, 255, 255, .7), transparent 55%),
    radial-gradient(1000px 600px at 0% 100%, rgba(245, 193, 108, .35), transparent 60%),
    linear-gradient(135deg, #e8a33d 0%, #f5c16c 60%, #e8a33d 100%);
  color: var(--navy-950);
  box-shadow: 0 12px 24px -14px rgba(8, 18, 38, .6);
}
.icon-tile--sm { width: 2.5rem; height: 2.5rem; border-radius: .75rem; }
.icon-tile--lg { width: 4rem; height: 4rem; border-radius: 1.25rem; }
.icon-tile--navy { background: var(--navy-900); color: var(--gold-400); }

.icon-tile svg { width: 1.75rem; height: 1.75rem; }
.icon-tile--sm svg { width: 1.25rem; height: 1.25rem; }
.icon-tile--lg svg { width: 2rem; height: 2rem; }

/* Subject icon uploaded from the media library — sits where the SVG would. */
.subject-icon { display: block; width: 50%; height: 50%; object-fit: contain; }

/* ---------- Pills, badges, stats ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: 999px;
  padding: .375rem 1rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  background: rgba(8, 18, 38, .05);
  color: var(--navy-900);
}
.pill--navy { background: var(--navy-950); color: var(--gold-400); }
.pill--ink  { background: rgba(8, 18, 38, .1); color: var(--navy-950); }
.pill--gold { background: var(--gold-400); color: var(--navy-950); }

.stat-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
}
.stat-label {
  margin-top: .75rem;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: rgba(245, 193, 108, .85);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 1rem 2.5rem;
  font-weight: 600;
  text-align: center;
  transition: all .35s ease;
}
.btn--sm { padding: .625rem 1.5rem; font-size: .875rem; }

.btn-gold {
  background: var(--gold-400);
  color: var(--navy-950);
}
.btn-gold:hover {
  background: var(--gold-500);
  box-shadow: 0 20px 34px -18px rgba(245, 193, 108, .6);
  transform: translateY(-2px);
}

/* Outline button that sits on a dark section. */
.btn-outline-light {
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}
.btn-outline-light:hover { border-color: var(--gold-400); color: var(--gold-400); }

/* Primary CTA on a light section. Gold is reserved for dark sections, so a
   light background gets a solid navy button instead. */
.btn-navy {
  background: var(--navy-900);
  color: #fff;
}
.btn-navy:hover {
  background: var(--navy-800);
  box-shadow: 0 20px 34px -18px rgba(11, 27, 58, .55);
  transform: translateY(-2px);
}

.btn-outline-navy {
  border-color: var(--navy-900);
  color: var(--navy-900);
}
.btn-outline-navy:hover { background: var(--navy-900); color: #fff; }

.btn svg { width: 1rem; height: 1rem; }

/* ---------- Misc ---------- */
.blob {
  position: absolute;
  border-radius: 999px;
  background: rgba(245, 193, 108, .1);
  filter: blur(3rem);
}

.divider-gold {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
}

/* Screen-reader-only text that reveals itself on focus. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--gold-400);
  color: var(--navy-950);
  font-weight: 600;
  border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

/* Respect a reduced-motion preference across every animation above. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Dark-section variants of the shared heading parts. */
.eyebrow--light { color: var(--gold-400); }
.rule--light { background: var(--gold-400); }
.h-section--light { color: #fff; }

/* Safety net so a heading inside a dark section stays legible even when the
   author forgets the --light modifier. Darker gold reads better on navy. */
.section-dark .eyebrow,
.bg-mesh .eyebrow { color: var(--gold-400); }
.section-dark .rule,
.bg-mesh .rule { background: var(--gold-400); }
.section-dark .h-section,
.bg-mesh .h-section { color: #fff; }

/* Shared link-with-arrow used on subject/program cards. */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.75rem;
  font-weight: 600;
  color: var(--navy-900);
  transition: color .35s ease;
}
.arrow-link svg { width: 1rem; height: 1rem; transition: transform .35s ease; }
.group:hover .arrow-link { color: var(--gold-500); }
.group:hover .arrow-link svg { transform: translateX(.375rem); }

/* Numbered step marker on dark sections. */
.step-number {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(245, 193, 108, .3);
}

/* Card + scroll-reveal pairing used by the page templates. */
.card--reveal.reveal, .card--reveal { transition: transform .45s cubic-bezier(.22,.61,.36,1), box-shadow .45s, opacity .8s ease; }
.card--sm { padding: 1.75rem; }
.icon-tile--xl { width: 5rem; height: 5rem; border-radius: 1.25rem; }
.icon-tile--xl svg { width: 2.5rem; height: 2.5rem; }
.card-glass--edge:hover { border-color: rgba(245, 193, 108, .4); }
.h-card--light { color: #fff; }
.lead--light, .copy--light { color: #cbd5e1; }
.copy--sm { margin-top: .5rem; font-size: .875rem; line-height: 1.75; }

/* ---------- Gallery: hover zoom badge ---------- */
.gal-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 9999px;
  background: rgba(8, 18, 38, .78);
  border: 1px solid rgba(245, 193, 108, .55);
  color: var(--gold-400, #f5c16c);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.gal-card:hover .gal-zoom,
.gal-open:focus-visible .gal-zoom { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Gallery lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.lb[hidden] { display: none; }
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, .93);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lb-stage {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(68rem, 100%);
  text-align: center;
  animation: lb-in .28s ease both;
}
.lb-stage img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.lb-stage figcaption {
  margin-top: 1rem;
  font-size: .95rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.lb-count {
  position: absolute;
  top: 1.4rem;
  left: 1.5rem;
  z-index: 2;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  color: #94a3b8;
}
.lb-btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.lb-btn:hover {
  background: rgba(245, 193, 108, .18);
  border-color: rgba(245, 193, 108, .7);
  color: var(--gold-400, #f5c16c);
}
.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

@keyframes lb-in {
  from { opacity: 0; transform: scale(.965); }
  to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .lb-prev { left: .6rem; top: auto; bottom: 1rem; transform: none; }
  .lb-next { right: .6rem; top: auto; bottom: 1rem; transform: none; }
  .lb-stage figcaption { padding: 0 3.5rem; }
}
