/*
 * Motion layer for the EIU Applied Agentic AI website.
 * Kept separate from the page CSS so the original layout and content remain intact.
 */

:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-spring: cubic-bezier(0.2, 0.85, 0.32, 1.22);
  --motion-gold: #f4dfb0;
  --motion-navy: #082945;
}

/* Scroll reveal: elements stay visible when JavaScript is unavailable. */
html.motion-ready .motion-reveal {
  opacity: 0;
  translate: 0 28px;
  filter: blur(5px);
  transition:
    opacity 760ms var(--motion-ease),
    translate 760ms var(--motion-ease),
    filter 760ms var(--motion-ease);
  transition-delay: var(--motion-delay, 0ms);
}

html.motion-ready .motion-reveal[data-motion-state="visible"] {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
}

html.motion-ready .motion-reveal[data-motion-direction="left"] {
  translate: -34px 0;
}

html.motion-ready .motion-reveal[data-motion-direction="right"] {
  translate: 34px 0;
}

html.motion-ready .motion-reveal[data-motion-state="visible"][data-motion-direction] {
  translate: 0 0;
}

/* Existing logo image: subtle movement without changing its source or size. */
.logo-box {
  transform-origin: center;
  transition:
    translate 320ms var(--motion-spring),
    box-shadow 320ms ease,
    filter 320ms ease;
}

.logo-box .official-logo {
  transition: transform 520ms var(--motion-ease);
}

@media (hover: hover) and (pointer: fine) {
  .logo-box:hover {
    translate: 0 -4px;
    filter: saturate(1.05);
  }

  .logo-box:hover .official-logo {
    transform: scale(1.035);
  }

  .demo-app-card:hover,
  .benefit-card:hover,
  .session-card:hover,
  .hospitality-card:hover,
  .price-card:hover {
    translate: 0 -5px;
  }
}

.demo-app-card,
.benefit-card,
.session-card,
.hospitality-card,
.price-card {
  transition:
    translate 320ms var(--motion-ease),
    box-shadow 320ms ease,
    border-color 320ms ease;
}

/* Pointer highlight follows the user's cursor over selected surfaces. */
.motion-surface {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  isolation: isolate;
}

.motion-pointer-highlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(
      420px circle at var(--pointer-x) var(--pointer-y),
      rgba(244, 223, 176, 0.15),
      transparent 62%
    );
  opacity: 0;
  transition: opacity 260ms ease;
}

.motion-surface:hover > .motion-pointer-highlight,
.motion-surface:focus-within > .motion-pointer-highlight {
  opacity: 1;
}

/* Click ripple is injected only into links and buttons by interactions.js. */
.motion-ripple-host {
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.motion-ripple-position {
  position: relative;
}

.motion-ripple {
  position: absolute !important;
  z-index: 20 !important;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.54);
  translate: -50% -50%;
  scale: 0;
  animation: motionRipple 620ms ease-out forwards;
}

@keyframes motionRipple {
  55% {
    opacity: 0.28;
  }

  100% {
    opacity: 0;
    scale: 22;
  }
}

/* New campus visual; no hard text is added to the visible page. */
.campus-showcase {
  position: relative;
  z-index: 3;
  padding: 76px 0 88px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(45, 127, 180, 0.13), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(179, 145, 89, 0.16), transparent 31%),
    linear-gradient(180deg, #ffffff, #fbfaf7);
}

.campus-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(8, 41, 69, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 41, 69, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}

.campus-stage {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --photo-x: 0px;
  --photo-y: 0px;
  position: relative;
  z-index: 1;
  margin: 0;
  outline: none;
  cursor: zoom-in;
  perspective: 1200px;
  -webkit-tap-highlight-color: transparent;
}

.campus-stage:focus-visible .campus-photo-frame {
  outline: 4px solid rgba(45, 127, 180, 0.55);
  outline-offset: 6px;
}

.campus-photo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1733 / 908;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 32px;
  background: #dce6ea;
  box-shadow:
    0 38px 85px rgba(4, 28, 49, 0.21),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  transform:
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition:
    transform 180ms ease-out,
    box-shadow 420ms var(--motion-ease);
}

.campus-photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 27%, rgba(255, 255, 255, 0.20) 44%, transparent 60%),
    linear-gradient(to top, rgba(4, 28, 49, 0.18), transparent 30%);
  translate: -110% 0;
  transition: translate 900ms var(--motion-ease);
}

.campus-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(244, 223, 176, 0.44) inset;
}

.campus-stage:hover .campus-photo-frame {
  box-shadow:
    0 45px 105px rgba(4, 28, 49, 0.27),
    0 2px 0 rgba(255, 255, 255, 0.86) inset;
}

.campus-stage:hover .campus-photo-frame::before,
.campus-stage.is-activated .campus-photo-frame::before {
  translate: 110% 0;
}

.campus-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform:
    translate3d(var(--photo-x), var(--photo-y), 0)
    scale(1.025);
  transition:
    transform 240ms ease-out,
    filter 500ms ease;
  will-change: transform;
}

.campus-stage:hover .campus-photo {
  filter: saturate(1.045) contrast(1.025);
}

.campus-scan-line {
  position: absolute !important;
  z-index: 4 !important;
  top: -12%;
  right: 0;
  left: 0;
  height: 20%;
  pointer-events: none;
  opacity: 0.55;
  background: linear-gradient(to bottom, transparent, rgba(244, 223, 176, 0.3), transparent);
  filter: blur(2px);
  animation: campusScan 7s ease-in-out infinite;
}

@keyframes campusScan {
  0%, 15% {
    translate: 0 -20%;
    opacity: 0;
  }

  38% {
    opacity: 0.6;
  }

  72%, 100% {
    translate: 0 620%;
    opacity: 0;
  }
}

.education-ai-icon {
  position: absolute !important;
  z-index: 5 !important;
  width: clamp(48px, 6vw, 72px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #f8e6bc;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(18, 63, 104, 0.93), rgba(4, 28, 49, 0.92));
  box-shadow:
    0 18px 42px rgba(4, 28, 49, 0.3),
    0 0 28px rgba(244, 223, 176, 0.14) inset;
  backdrop-filter: blur(12px);
  animation: educationIconFloat 5.6s ease-in-out infinite;
}

.education-ai-icon svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.education-ai-icon.icon-brain {
  top: 9%;
  left: -2.7%;
}

.education-ai-icon.icon-graduation {
  top: -3%;
  right: 9%;
  animation-delay: -1.4s;
}

.education-ai-icon.icon-book {
  right: -2.4%;
  bottom: 12%;
  animation-delay: -2.8s;
}

.education-ai-icon.icon-spark {
  bottom: -3.5%;
  left: 10%;
  animation-delay: -4.2s;
}

@keyframes educationIconFloat {
  0%, 100% {
    translate: 0 0;
    rotate: -2deg;
  }

  50% {
    translate: 0 -12px;
    rotate: 3deg;
  }
}

/* Accessible full-screen image viewer, opened by click/tap on the campus photo. */
.motion-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
  visibility: hidden;
  opacity: 0;
  background: rgba(2, 14, 25, 0.88);
  backdrop-filter: blur(16px);
  transition:
    opacity 280ms ease,
    visibility 280ms ease;
}

.motion-lightbox.is-open {
  visibility: visible;
  opacity: 1;
}

.motion-lightbox img {
  display: block;
  max-width: min(1500px, 94vw);
  max-height: 88vh;
  border-radius: 22px;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.55);
  opacity: 0;
  scale: 0.94;
  transition:
    opacity 360ms ease 80ms,
    scale 500ms var(--motion-spring) 80ms;
}

.motion-lightbox.is-open img {
  opacity: 1;
  scale: 1;
}

.motion-lightbox-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  font: 300 28px/1 Arial, sans-serif;
  transition:
    rotate 260ms var(--motion-ease),
    background 260ms ease;
}

.motion-lightbox-close:hover {
  rotate: 90deg;
  background: rgba(255, 255, 255, 0.2);
}

body.motion-lock {
  overflow: hidden;
}

@media (max-width: 760px) {
  .campus-showcase {
    padding: 54px 0 62px;
  }

  .campus-photo-frame {
    border-radius: 23px;
  }

  .education-ai-icon {
    border-radius: 16px;
  }

  .education-ai-icon.icon-brain {
    left: -1.5%;
  }

  .education-ai-icon.icon-book {
    right: -1.5%;
  }
}

@media (max-width: 520px) {
  .campus-showcase .container {
    width: min(100% - 24px, 1160px);
  }

  .education-ai-icon.icon-brain {
    top: 6%;
  }

  .education-ai-icon.icon-graduation {
    top: -8%;
    right: 7%;
  }

  .education-ai-icon.icon-book {
    bottom: 7%;
  }

  .education-ai-icon.icon-spark {
    bottom: -8%;
    left: 7%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.motion-ready .motion-reveal,
  html.motion-ready .motion-reveal[data-motion-direction],
  html.motion-ready .motion-reveal[data-motion-state="visible"],
  .campus-photo,
  .campus-photo-frame,
  .logo-box,
  .logo-box .official-logo {
    opacity: 1 !important;
    translate: 0 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .education-ai-icon,
  .campus-scan-line,
  .motion-ripple {
    animation: none !important;
  }
}

/* Animated invitation above the four interactive demo applications. */
.demo-experience-attractor {
  position: relative;
  z-index: 2;
  width: fit-content;
  max-width: min(100%, 650px);
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 26px auto 34px;
  padding: 11px 14px 11px 12px;
  overflow: visible;
  isolation: isolate;
  cursor: pointer;
  color: #ffffff;
  border: 1px solid rgba(244, 223, 176, 0.72);
  border-radius: 999px;
  outline: none;
  background:
    linear-gradient(
      120deg,
      #041c31 0%,
      #123f68 47%,
      #082945 100%
    );
  box-shadow:
    0 18px 42px rgba(4, 28, 49, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  font-family: inherit;
  text-align: left;
  transform-origin: center;
  animation: demoAttractorFloat 3s ease-in-out infinite;
  transition:
    transform 260ms var(--motion-ease),
    box-shadow 260ms ease;
}

.demo-experience-attractor::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(
      105deg,
      transparent 25%,
      rgba(255, 255, 255, 0.20) 43%,
      rgba(244, 223, 176, 0.30) 50%,
      transparent 66%
    );
  background-size: 230% 100%;
  animation: demoAttractorShine 3.6s ease-in-out infinite;
}

.demo-experience-attractor::after {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -2;
  pointer-events: none;
  border: 1px solid rgba(179, 145, 89, 0.44);
  border-radius: inherit;
  opacity: 0;
  animation: demoAttractorRing 2.4s ease-out infinite;
}

.demo-experience-attractor:hover {
  transform: scale(1.025);
  box-shadow:
    0 23px 54px rgba(4, 28, 49, 0.30),
    0 0 30px rgba(179, 145, 89, 0.20);
}

.demo-experience-attractor:focus-visible {
  box-shadow:
    0 0 0 4px rgba(45, 127, 180, 0.26),
    0 20px 48px rgba(4, 28, 49, 0.27);
}

.demo-attractor-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  border-radius: 50%;
  background:
    linear-gradient(
      145deg,
      #fff3d2,
      var(--gold-300)
    );
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.22),
    0 0 0 6px rgba(244, 223, 176, 0.09);
  font-size: 20px;
  animation: demoAttractorSpark 1.7s ease-in-out infinite;
}

.demo-attractor-copy {
  min-width: 0;
  display: block;
  flex: 1;
}

.demo-attractor-copy strong,
.demo-attractor-copy small {
  display: block;
}

.demo-attractor-copy strong {
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1.25;
}

.demo-attractor-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  line-height: 1.4;
}

.demo-attractor-arrow {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--gold-200);
  border: 1px solid rgba(244, 223, 176, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.075);
  font-size: 18px;
  font-weight: 900;
  animation: demoAttractorArrow 1.35s ease-in-out infinite;
}

.demo-attractor-cursor {
  position: absolute !important;
  z-index: 4 !important;
  right: -16px;
  bottom: -15px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--gold-600);
  box-shadow: 0 9px 23px rgba(4, 28, 49, 0.28);
  animation: demoAttractorCursor 2.3s var(--motion-ease) infinite;
}

.demo-attractor-cursor svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: var(--navy-950);
  stroke-width: 1;
  stroke-linejoin: round;
}

.demo-app-card.is-callout {
  z-index: 6;
  animation: demoCardInvitation 900ms var(--motion-spring) both !important;
}

.demo-app-card.is-callout .demo-card-icon {
  animation: demoInvitationIcon 720ms var(--motion-spring) both !important;
}

@keyframes demoAttractorFloat {
  0%, 100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -5px;
  }
}

@keyframes demoAttractorShine {
  0%, 22% {
    background-position: 130% 0;
    opacity: 0;
  }

  42% {
    opacity: 1;
  }

  72%, 100% {
    background-position: -130% 0;
    opacity: 0;
  }
}

@keyframes demoAttractorRing {
  0% {
    opacity: 0.62;
    scale: 0.98;
  }

  80%, 100% {
    opacity: 0;
    scale: 1.08;
  }
}

@keyframes demoAttractorSpark {
  0%, 100% {
    rotate: -7deg;
    scale: 0.92;
  }

  50% {
    rotate: 8deg;
    scale: 1.08;
  }
}

@keyframes demoAttractorArrow {
  0%, 100% {
    translate: 0 -2px;
  }

  50% {
    translate: 0 4px;
  }
}

@keyframes demoAttractorCursor {
  0%, 28%, 100% {
    translate: 8px 7px;
    scale: 0.9;
  }

  48%, 62% {
    translate: -3px -3px;
    scale: 1;
  }

  55% {
    scale: 0.82;
  }
}

@keyframes demoCardInvitation {
  0% {
    translate: 0 0;
    scale: 1;
    box-shadow: var(--shadow-sm);
  }

  45% {
    translate: 0 -12px;
    scale: 1.035;
    border-color: rgba(179, 145, 89, 0.72);
    box-shadow:
      0 24px 54px rgba(4, 28, 49, 0.20),
      0 0 0 4px rgba(244, 223, 176, 0.32);
  }

  100% {
    translate: 0 0;
    scale: 1;
    box-shadow: var(--shadow-sm);
  }
}

@keyframes demoInvitationIcon {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }

  45% {
    transform: rotate(-8deg) scale(1.18);
  }
}

@media (max-width: 600px) {
  .demo-experience-attractor {
    width: 100%;
    min-height: 62px;
    margin: 22px auto 28px;
    padding-right: 11px;
  }

  .demo-attractor-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .demo-attractor-copy strong {
    font-size: 13px;
  }

  .demo-attractor-copy small {
    display: none;
  }

  .demo-attractor-arrow {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }

  .demo-attractor-cursor {
    right: -5px;
    bottom: -13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-experience-attractor,
  .demo-experience-attractor::before,
  .demo-experience-attractor::after,
  .demo-attractor-icon,
  .demo-attractor-arrow,
  .demo-attractor-cursor,
  .demo-app-card.is-callout,
  .demo-app-card.is-callout .demo-card-icon {
    animation: none !important;
  }
}
