/* ──────────────────────────────────────────────────
   ix.css  — Sitewide animation layer
   Loaded after brand-new.css on every page.
   Uses unique .ix-* prefixes + targeted selectors
   to avoid conflicts with brand-new.css overrides.
────────────────────────────────────────────────── */

/* ── Scroll reveal ────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(0.16,1,0.3,1),
              transform .6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .06s; }
.reveal[data-d="2"] { transition-delay: .13s; }
.reveal[data-d="3"] { transition-delay: .20s; }
.reveal[data-d="4"] { transition-delay: .27s; }
.reveal[data-d="5"] { transition-delay: .34s; }
.reveal[data-d="6"] { transition-delay: .41s; }

/* ── Aurora background orbs ───────────────────── */
.ix-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}
.ix-orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  pointer-events: none;
}
.ix-o1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(27,79,114,.52) 0%, transparent 68%);
  filter: blur(72px);
  top: -320px; left: -150px;
  animation: ixAuroraA 20s ease-in-out infinite;
}
.ix-o2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(77,161,217,.36) 0%, transparent 65%);
  filter: blur(56px);
  top: -80px; right: -50px;
  animation: ixAuroraB 14s ease-in-out infinite;
}
.ix-o3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(232,222,196,.11) 0%, transparent 70%);
  filter: blur(48px);
  bottom: -100px; left: 45%;
  animation: ixAuroraC 18s ease-in-out infinite;
}
/* Ensure hero content sits above aurora */
.hero > *:not(.ix-aurora),
.hub-hero > *:not(.ix-aurora),
.hero-box > *:not(.ix-aurora) {
  position: relative;
  z-index: 1;
}

/* ── Hero text line-reveal ────────────────────── */
.ix-line { display: block; overflow: hidden; }
.ix-inner {
  display: block;
  transform: translateY(110%);
  animation: ixLineUp .9s cubic-bezier(0.16,1,0.3,1) forwards;
  will-change: transform;
}
.ix-line:nth-child(1) .ix-inner { animation-delay: .10s; }
.ix-line:nth-child(2) .ix-inner { animation-delay: .25s; }
.ix-line:nth-child(3) .ix-inner { animation-delay: .40s; }
.ix-line:nth-child(4) .ix-inner { animation-delay: .55s; }

/* Sequential hero entrance */
.ix-enter {
  opacity: 0;
  transform: translateY(14px);
  animation: ixFadeUp .8s cubic-bezier(0.16,1,0.3,1) forwards;
  animation-delay: var(--d, 0s);
}

/* ── Kicker badge shimmer ─────────────────────── */
.kicker {
  position: relative;
  overflow: hidden;
}
.kicker::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  animation: ixShimmer 4s ease-in-out infinite 1.5s;
  pointer-events: none;
}
.k-dot { animation: ixDotGlow 2.2s ease-in-out infinite; }

/* ── Hero card float ──────────────────────────── */
.ix-float {
  animation: ixFloat 7s ease-in-out infinite;
  will-change: transform;
}

/* ── Scan line (inside .crest-stage) ─────────── */
.crest-stage {
  position: relative;
  overflow: hidden;
}
.crest-stage::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(77,161,217,.7) 30%,
    rgba(255,255,255,.5) 50%,
    rgba(77,161,217,.7) 70%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(77,161,217,.6);
  animation: ixScanLine 3.5s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

/* ── Spotlight on tilt cards (JS sets --mx/--my) ─ */
.ix-spot {
  position: relative;
  overflow: hidden;
}
.ix-spot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(27,79,114,.07),
    transparent 65%
  );
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}
.ix-spot:hover::before { opacity: 1; }
.ix-spot > * { position: relative; z-index: 1; }

/* ── Topic / syllabus card hover ──────────────── */
.topic {
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease,
              background .2s ease,
              transform .22s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.topic::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #1B4F72;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .28s cubic-bezier(0.34,1.56,0.64,1);
  border-radius: 0 2px 2px 0;
  z-index: 2;
}
.topic:hover {
  transform: translateX(4px) !important;
  border-color: rgba(27,79,114,.3) !important;
  background: #E8F0F7 !important;
}
.topic:hover::after { transform: scaleY(1); }
.topic .bullet { transition: transform .22s ease; }
.topic:hover .bullet { transform: scale(1.5); }

/* ── Spinning gradient price border ───────────── */
.price-wrap {
  position: relative;
  border-radius: 14px;
  padding: 2px;
  overflow: hidden;
}
.price-wrap::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,   transparent 30%,
    rgba(77,161,217,.65) 40%,
    rgba(27,79,114,.85) 50%,
    rgba(232,222,196,.5) 60%,
    transparent 70%,  transparent 100%
  );
  animation: ixSpinBorder 5s linear infinite;
  z-index: 0;
  pointer-events: none;
}
.price-wrap > * { position: relative; z-index: 1; }

/* ── FAQ accordion — pre-collapse on load ─────── */
/* ix.css loads in <head>, so this fires before first paint */
.faq-item .faq-a {
  display: grid !important;
  grid-template-rows: 0fr;
  overflow: hidden !important;
  transition: none; /* disabled until JS adds .ix-ready */
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.faq-item .faq-a > * {
  overflow: hidden;
  min-height: 0;
}
.faq-item.open .faq-a {
  grid-template-rows: 1fr;
}
/* Enable smooth transition only after JS wires up handler */
.faq-item.ix-ready .faq-a {
  transition: grid-template-rows .3s cubic-bezier(0.16,1,0.3,1) !important;
}

/* .faq-body pattern (index.html — already handled by page CSS, kept for consistency) */
.faq-item .faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s cubic-bezier(0.16,1,0.3,1);
}
.faq-item.open .faq-body { grid-template-rows: 1fr; }
.faq-body-inner { overflow: hidden; }

.faq-chev {
  transition: transform .26s cubic-bezier(0.34,1.56,0.64,1), color .18s ease;
}
.faq-item.open .faq-chev {
  transform: rotate(180deg);
  color: #1B4F72;
}

/* ── Button radial glow (mouse position via JS) ── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,.18),
    transparent 60%
  );
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
  border-radius: inherit;
}
.btn:hover::after { opacity: 1; }

/* ── Modal entrance ───────────────────────────── */
.pay-box, .modal-box, .pw-card {
  animation: ixModalIn .28s cubic-bezier(0.16,1,0.3,1);
}

/* ── Keyframes ────────────────────────────────── */
@keyframes ixAuroraA {
  0%,100% { transform: translate(0,0) scale(1); }
  25%     { transform: translate(70px,50px) scale(1.06); }
  50%     { transform: translate(-50px,90px) scale(.94); }
  75%     { transform: translate(90px,-40px) scale(1.1); }
}
@keyframes ixAuroraB {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(-80px,60px) scale(1.12); }
  66%     { transform: translate(60px,-50px) scale(.9); }
}
@keyframes ixAuroraC {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(-70px,-90px) scale(1.18); }
}
@keyframes ixShimmer {
  0%       { left: -100%; }
  50%,100% { left: 220%; }
}
@keyframes ixDotGlow {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(77,164,106,.6); }
  50%     { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(77,164,106,0); }
}
@keyframes ixLineUp  { to { transform: translateY(0); } }
@keyframes ixFadeUp  { to { opacity: 1; transform: translateY(0); } }
@keyframes ixFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
@keyframes ixScanLine {
  0%   { top: -2px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes ixSpinBorder { to { transform: rotate(360deg); } }
@keyframes ixModalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ── Nav drawer interior base styles ─────────── */
/* brand-new.css defines the container/animation but not the interior layout */
.nav-drawer-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 14px 12px 18px !important;
  border-bottom: 1px solid var(--hairline, #E3E8ED) !important;
  min-height: 64px !important;
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 0 !important;
  background: var(--surface, #fff) !important;
  z-index: 2 !important;
}

.nav-drawer-section {
  padding: 18px 20px 5px !important;
  font-size: 10.5px !important;
  font-weight: 750 !important;
  letter-spacing: .11em !important;
  text-transform: uppercase !important;
  color: var(--ink-4, #8995A2) !important;
}

.nav-drawer-link {
  display: flex !important;
  align-items: center !important;
  padding: 0 20px !important;
  color: var(--ink-2, #2B3944) !important;
  font-size: 15px !important;
  font-weight: 550 !important;
  min-height: 48px !important;
  transition: background .15s ease, color .15s ease, padding-left .18s cubic-bezier(0.34,1.56,0.64,1) !important;
}

.nav-drawer-link:hover,
.nav-drawer-link.active {
  background: var(--brand-tint, #E8F0F7) !important;
  color: var(--brand, #1B4F72) !important;
  padding-left: 26px !important;
}

.nav-drawer-divider {
  border: none !important;
  border-top: 1px solid var(--hairline, #E3E8ED) !important;
  margin: 8px 0 !important;
}

.nav-drawer-cta {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 10px 18px 18px !important;
  padding: 13px 20px !important;
  border-radius: 10px !important;
  font-weight: 750 !important;
  font-size: 15px !important;
  min-height: 48px !important;
  background: var(--brand, #1B4F72) !important;
  color: #fff !important;
  transition: background .18s ease, transform .15s ease, box-shadow .2s ease !important;
}

.nav-drawer-cta:hover {
  background: var(--brand-ink, #123855) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(27,79,114,.3) !important;
}

/* ── Drawer stagger entrance ─────────────────── */
@keyframes ixDrawerItem {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: none; }
}

.nav-drawer.re-drawer.open > * {
  animation: ixDrawerItem .36s cubic-bezier(0.16,1,0.3,1) both;
}
.nav-drawer.re-drawer.open > *:nth-child(1)  { animation-delay: .04s; }
.nav-drawer.re-drawer.open > *:nth-child(2)  { animation-delay: .09s; }
.nav-drawer.re-drawer.open > *:nth-child(3)  { animation-delay: .13s; }
.nav-drawer.re-drawer.open > *:nth-child(4)  { animation-delay: .16s; }
.nav-drawer.re-drawer.open > *:nth-child(5)  { animation-delay: .19s; }
.nav-drawer.re-drawer.open > *:nth-child(6)  { animation-delay: .22s; }
.nav-drawer.re-drawer.open > *:nth-child(7)  { animation-delay: .24s; }
.nav-drawer.re-drawer.open > *:nth-child(8)  { animation-delay: .26s; }
.nav-drawer.re-drawer.open > *:nth-child(9)  { animation-delay: .28s; }
.nav-drawer.re-drawer.open > *:nth-child(10) { animation-delay: .30s; }
.nav-drawer.re-drawer.open > *:nth-child(11) { animation-delay: .32s; }
.nav-drawer.re-drawer.open > *:nth-child(12) { animation-delay: .34s; }

/* ── Language toggle button ───────────────────── */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--hairline, #E3E8ED);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink-3, #5A6875);
  transition: border-color .18s ease, color .18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-btn:hover {
  border-color: var(--brand, #1B4F72);
  color: var(--ink-1, #0E1B25);
}
.lang-sep {
  color: var(--hairline, #E3E8ED);
  font-size: 10px;
  line-height: 1;
}
.lang-opt.active {
  color: var(--brand, #1B4F72);
  font-weight: 700;
}

/* Hide from mobile nav bar — it lives in the drawer */
@media (max-width: 760px) {
  .re-nav .lang-btn {
    display: none !important;
  }
}

/* Undo brand-new.css button[aria-label] 44x44 rule inside drawer */
.nav-drawer .lang-btn {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: auto !important;
  padding: 7px 14px !important;
  font-size: 12px !important;
  margin: 6px 18px 2px !important;
}

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .ix-inner  { transform: none !important; }
  .ix-enter  { opacity: 1 !important; transform: none !important; }
  .reveal    { opacity: 1 !important; transform: none !important; }
  .faq-item .faq-a { transition: none !important; }
  .nav-drawer.re-drawer.open > * { animation: none !important; opacity: 1 !important; transform: none !important; }
}
