/* Motion layer — transform & opacity only */
:root {
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-duration: 0.65s;
}

html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto !important;
}

/* ---------- Preloader (JS-inserted only) ---------- */
.pom-preloader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 0.85rem;
  background: #000;
  pointer-events: none;
  transition: opacity 0.55s var(--motion-ease), visibility 0.55s;
}

.pom-preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

.pom-preloader__line {
  width: min(180px, 40vw);
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.pom-preloader__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--main, #7ca7eb);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.9s var(--motion-ease);
}

.pom-preloader.is-active .pom-preloader__fill {
  transform: scaleX(1);
}

.pom-preloader__count {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

/* ---------- Scroll progress ---------- */
.pom-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100001;
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--main, #7ca7eb);
  opacity: 0.9;
}

/* ---------- Reveal — hide only when JS confirmed ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

html.js [data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

html.pom-reduce [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.reveal,
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero split ---------- */
html.js .hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

html.js .hero__title .word {
  display: inline-block;
  transform: translate3d(0, 110%, 0);
  opacity: 0;
  transition: transform 0.7s var(--motion-ease), opacity 0.7s var(--motion-ease);
}

html.js .hero__title.is-hero-in .word {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

html.js .hero.is-waiting .hero__subtitle,
html.js .hero.is-waiting .hero__meta,
html.js .hero.is-waiting .hero__cta {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

.hero__subtitle,
.hero__meta,
.hero__cta {
  transition: opacity 0.6s var(--motion-ease), transform 0.6s var(--motion-ease);
}

html.js .hero.is-hero-ready .hero__subtitle,
html.js .hero.is-hero-ready .hero__meta,
html.js .hero.is-hero-ready .hero__cta {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.js .hero.is-hero-ready .hero__subtitle {
  transition-delay: 0.08s;
}

html.js .hero.is-hero-ready .hero__meta {
  transition-delay: 0.16s;
}

html.js .hero.is-hero-ready .hero__cta {
  transition-delay: 0.24s;
}

html.pom-reduce .hero__title .word,
html.pom-reduce .hero.is-waiting .hero__subtitle,
html.pom-reduce .hero.is-waiting .hero__meta,
html.pom-reduce .hero.is-waiting .hero__cta {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* ---------- Custom cursor ---------- */
.pom-cursor,
.pom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100002;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
}

.pom-cursor {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #fff;
}

.pom-cursor-ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  transition: border-color 0.25s var(--motion-ease);
}

.pom-cursor.is-on,
.pom-cursor-ring.is-on {
  opacity: 1;
}

.pom-cursor-ring.is-hover {
  border-color: var(--main, #7ca7eb);
}

.pom-cursor.is-hover {
  background: var(--main, #7ca7eb);
}

@media (pointer: fine) and (min-width: 768px) {
  html.pom-cursor-on,
  html.pom-cursor-on * {
    cursor: none !important;
  }

  html.pom-cursor-on input,
  html.pom-cursor-on textarea,
  html.pom-cursor-on select,
  html.pom-cursor-on #applyModal,
  html.pom-cursor-on #applyModal * {
    cursor: auto !important;
  }
}

@media (pointer: coarse), (max-width: 767px) {
  .pom-cursor,
  .pom-cursor-ring {
    display: none !important;
  }
}

/* ---------- Link underline ---------- */
.nav__links a,
.footer__links a {
  position: relative;
}

.nav__links a::after,
.footer__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--motion-ease);
}

.nav__links a:hover::after,
.nav__links a:focus-visible::after,
.footer__links a:hover::after,
.footer__links a:focus-visible::after {
  transform: scaleX(1);
}

.nav__links a.is-leave::after,
.footer__links a.is-leave::after {
  transform-origin: right center;
}

/* ---------- Cards ---------- */
.bento-card__visual {
  position: relative;
  overflow: hidden;
}

.bento-card__visual img {
  transition: transform 0.65s var(--motion-ease);
  transform: scale(1);
}

.bento-card:hover .bento-card__visual img {
  transform: scale(1.05);
}

.bento-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35));
  opacity: 0;
  transition: opacity 0.55s var(--motion-ease);
  pointer-events: none;
  z-index: 1;
}

.bento-card:hover .bento-card__visual::after {
  opacity: 1;
}

.program-card__glyph {
  transition: transform 0.65s var(--motion-ease);
}

.program-card:hover .program-card__glyph {
  transform: scale(1.05);
}

/* ---------- Magnetic / header compact / parallax ---------- */
.btn.is-magnetic {
  transition: transform 0.35s var(--motion-ease);
  will-change: transform;
}

.nav.is-compact {
  /* layers on existing is-scrolled solid treatment */
}

.why__media img.pom-parallax {
  will-change: transform;
}

/* ---------- Page transitions ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: var(--motion-ease);
}

::view-transition-old(root) {
  animation-name: pom-fade-out;
}

::view-transition-new(root) {
  animation-name: pom-fade-in;
}

@keyframes pom-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes pom-fade-in {
  from {
    opacity: 0;
  }
}

@media (max-width: 767px) {
  html.js [data-reveal] {
    transform: translate3d(0, 16px, 0);
    transition-duration: 0.45s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pom-preloader,
  .pom-progress,
  .pom-cursor,
  .pom-cursor-ring {
    display: none !important;
  }

  .bento-card__visual img,
  .program-card__glyph,
  .btn.is-magnetic,
  .why__media img.pom-parallax {
    transform: none !important;
    transition: none !important;
  }
}
