/* ===== Animations & scroll interactions ===== */

/* scroll progress bar */
.progress-bar {
  position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 50; pointer-events: none;
  background: linear-gradient(270deg, var(--mint), var(--mint-2));
  transform-origin: right; transform: scaleX(var(--p, 0));
}

/* nav: links underline, active state */
.nav-pill { transition: background .4s, box-shadow .4s, height .4s; }
.nav.scrolled .nav-pill { height: 68px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); }
.nav ul a { position: relative; transition: color .25s; }
.nav ul a::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -8px; height: 1.5px; background: var(--mint-2);
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav ul a:hover::after, .nav ul a.active::after { transform: scaleX(1); }
.nav-pill { animation: navIn 1s var(--ease) both .1s; }
@keyframes navIn { from { opacity: 0; transform: translateY(-24px) scale(.97); } }

/* ---- hero glow follows the pointer ---- */
.hero-glow {
  position: absolute; left: 50%; top: -200px; width: 1000px; height: 700px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 50% 45% at 50% 50%, rgba(127, 220, 191, .18), rgba(127, 220, 191, .04) 55%, transparent 75%);
  transform: translate3d(calc(-50% + var(--mx, 0px)), calc(var(--my, 0px) + var(--sy, 0px)), 0) scale(var(--gs, 1));
  opacity: var(--go, 1);
}

/* floating particles */
.spark {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; z-index: 0; pointer-events: none;
  background: var(--mint); box-shadow: 0 0 10px 2px rgba(127, 220, 191, .45);
  animation: rise linear infinite; opacity: 0;
}
@keyframes rise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: .8; }
  100% { transform: translate3d(var(--dx, 20px), -620px, 0); opacity: 0; }
}

/* ---- the emblem: draws itself, then turns slowly ---- */
.emblem .em-line { stroke: var(--mint); stroke-width: 1.4; stroke-opacity: .85; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.6s var(--ease) forwards .4s; }
.emblem .em-line.thin { stroke-width: 1; stroke-opacity: .45; animation-delay: .9s; }
.emblem .em-faint { stroke: rgba(201, 242, 227, .22); stroke-width: 1; }
.emblem .em-mark { stroke: #fff; stroke-width: 7; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.6s var(--ease) forwards 1.6s; }
.emblem .em-nodes circle { fill: var(--mint-2); }
.emblem .em-spin { transform-origin: 200px 200px; animation: spin 80s linear infinite; }
.emblem .em-rings { transform-origin: 200px 200px; animation: spin 140s linear infinite reverse; }
.emblem .em-nodes { transform-origin: 200px 200px; animation: spin 40s linear infinite; }
.emblem { filter: drop-shadow(0 0 40px rgba(127, 220, 191, .18)); transform: rotate(var(--er, 0deg)); transition: transform .2s linear; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-card { animation: cardIn 1.2s var(--ease) both 1.4s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) rotate(-3deg); } }
.hero-art { transform: translate3d(0, var(--ay, 0px), 0); }

/* word-by-word reveal of the headline */
.split .w { display: inline-block; opacity: 0; filter: blur(12px); transform: translateY(.45em); transition: opacity .9s, filter .9s, transform 1s var(--ease); transition-delay: calc(var(--i) * 80ms + var(--d, 0ms)); }
.split.in .w { opacity: 1; filter: blur(0); transform: none; }

/* hero content drifts as you scroll past */
.hero-content { transform: translate3d(0, var(--hy, 0px), 0); opacity: var(--ho, 1); will-change: transform, opacity; }

/* shine on mint buttons */
.btn.mint { position: relative; overflow: hidden; }
.btn.mint::after {
  content: ''; position: absolute; inset: 0; transform: translateX(120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
}
.btn.mint:hover::after { animation: shine .9s ease; }
@keyframes shine { to { transform: translateX(-120%) skewX(-20deg); } }

/* scroll cue */
.scroll-cue span { width: 22px; height: 36px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 12px; position: relative; }
.scroll-cue span::after { content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--mint-2); animation: wheel 1.8s ease-in-out infinite; }
.scroll-cue em { font-style: normal; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---- sand ticker ---- */
.ticker { overflow: hidden; padding: 34px 0; position: relative; background: var(--sand); }
.ticker-track { display: flex; gap: 56px; width: max-content; animation: ticker 46s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font-size: clamp(30px, 4.4vw, 60px); font-weight: 400; white-space: nowrap; color: var(--forest); transition: color .3s; }
.ticker-track span:nth-of-type(even) { color: transparent; -webkit-text-stroke: 1px rgba(10, 47, 41, .45); }
.ticker-track span:hover { color: var(--green); -webkit-text-stroke-color: transparent; }
.ticker-track i { align-self: center; width: 22px; height: 22px; flex: none; opacity: .55; background: url(/logo.svg) center / contain no-repeat; filter: invert(1) brightness(.25); }
@keyframes ticker { to { transform: translateX(50%); } }

/* ---- scroll reveal ---- */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s, transform 1s var(--ease); transition-delay: var(--delay, 0ms); }
[data-reveal="zoom"] { transform: translateY(50px) scale(.96); }
[data-reveal].in { opacity: 1; transform: none; }

/* section title underline sweep */
.section-title { position: relative; }

/* ---- cards ---- */
.card { position: relative; isolation: isolate; transition: transform .5s var(--ease), box-shadow .4s; }
.course { transition: transform .6s var(--ease), box-shadow .4s, opacity .9s; }
.course:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

/* steps: number fills in */
.step .num { transition: color .8s var(--ease) .3s; }
.step.in .num { color: rgba(127, 220, 191, .08); }

/* back to top */
.to-top {
  position: fixed; left: 22px; bottom: 22px; z-index: 40; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; background: var(--forest); border: 0; color: var(--mint); cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { position: absolute; inset: 1px; width: 48px; height: 48px; transform: rotate(-90deg); }
.to-top circle { fill: none; stroke: var(--mint-2); stroke-width: 2; stroke-dasharray: 138; stroke-dashoffset: calc(138 - 138 * var(--p, 0)); }

.cursor-glow { display: none; }

/* ---- phones and touch screens: lighter effects so scrolling stays smooth ---- */
@media (hover: none), (max-width: 860px) {
  .nav-pill { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 47, 41, .9); }
  .split .w { filter: none; transition: opacity .7s, transform .8s var(--ease); transition-delay: calc(var(--i) * 60ms); }
  .spark { box-shadow: none; }
  .emblem { filter: none; }
  .ticker-track { animation-duration: 30s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal], .split .w { opacity: 1 !important; transform: none !important; filter: none !important; }
  .emblem .em-line, .emblem .em-mark { stroke-dashoffset: 0; }
  .spark { display: none; }
}
