/* =========================================================
   SEBAYTE PLAYFUL ANIMATIONS & TRANSITIONS
   Child-friendly entrance, hover, menu, and accessibility effects.
========================================================= */


/* =========================================================
   1. ANIMATION VARIABLES
========================================================= */

:root {
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);

  --transition-fast: 180ms ease;
  --transition-smooth: 320ms var(--ease-soft);
}


/* =========================================================
   2. GLOBAL MOTION SETTINGS
========================================================= */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}


/* =========================================================
   3. HEADER ENTRANCE
========================================================= */

header {
  position: relative;
  z-index: 1000;

  /*
    "backwards" applies the starting animation styles during
    the delay without leaving a permanent transform afterward.
  */
  animation: header-drop 700ms var(--ease-soft) backwards;
}


/* =========================================================
   4. LOGO ANIMATION
========================================================= */

.logo img {
  transform-origin: center;

  animation: logo-pop 900ms 120ms var(--ease-pop) backwards;

  transition:
    transform var(--transition-smooth),
    filter var(--transition-smooth);
}

.logo img:hover {
  transform: translateY(-3px) rotate(-2deg) scale(1.04);
  filter: drop-shadow(0 10px 10px rgba(64, 52, 111, 0.18));
}


/* =========================================================
   5. NAVIGATION LINK ANIMATIONS
========================================================= */

/*
  Padding is included in the normal state so the navigation
  does not jump or change size when a link is hovered.
*/

.nav-list a {
  display: block;
  padding: 0.55rem 0.8rem;

  border-radius: 999px;
  background-color: transparent;

  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.nav-list li {
  opacity: 1;
  animation: nav-item-in 500ms var(--ease-soft) backwards;
}

/* Staggered desktop navigation entrance. */

.nav-list li:nth-child(1) {
  animation-delay: 220ms;
}

.nav-list li:nth-child(2) {
  animation-delay: 300ms;
}

.nav-list li:nth-child(3) {
  animation-delay: 380ms;
}

.nav-list li:nth-child(4) {
  animation-delay: 460ms;
}

.nav-list li:nth-child(5) {
  animation-delay: 540ms;
}

.nav-list li:nth-child(6) {
  animation-delay: 620ms;
}

.nav-list a:hover {
  color: white;
  background-color: var(--purple);

  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 16px rgba(64, 52, 111, 0.22);
}


/* =========================================================
   6. KEYBOARD FOCUS STYLES
========================================================= */

.nav-list a:focus-visible,
.btn:focus-visible,
.menu-button:focus-visible,
#call:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}


/* =========================================================
   7. MOBILE MENU BUTTON
========================================================= */

.menu-button {
  transform-origin: center;

  transition:
    transform var(--transition-fast),
    color var(--transition-fast);
}

.menu-button:hover {
  color: var(--red);
  transform: rotate(8deg) scale(1.1);
}


/* =========================================================
   8. HERO BACKGROUND BUBBLES
========================================================= */

main::before,
main::after {
  content: "";
  position: absolute;
  z-index: 0;

  border-radius: 50%;
  pointer-events: none;
}

main::before {
  top: -5rem;
  left: -4rem;

  width: clamp(9rem, 18vw, 18rem);
  aspect-ratio: 1;

  background: rgba(255, 230, 109, 0.62);

  animation: bubble-float 5s ease-in-out infinite;
}

main::after {
  right: -3rem;
  bottom: -3rem;

  width: clamp(7rem, 14vw, 14rem);
  aspect-ratio: 1;

  background: rgba(255, 179, 195, 0.5);

  animation: bubble-float 6s 800ms ease-in-out infinite reverse;
}


/* =========================================================
   9. HERO CARD ENTRANCES
========================================================= */

.text,
.article {
  z-index: 1;
  will-change: transform, opacity;

  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth);
}

.text {
  animation: card-in-left 850ms 180ms var(--ease-soft) backwards;
}

.article {
  animation: card-in-right 850ms 300ms var(--ease-soft) backwards;
}

.text:hover,
.article:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 55px rgba(64, 52, 111, 0.23);
}


/* =========================================================
   10. HERO TITLE ANIMATIONS
========================================================= */

.title-top {
  transform-origin: left center;
  animation: title-bounce 850ms 500ms var(--ease-pop) backwards;
}

.sebayte,
.reading {
  display: inline-block;

  transition:
    transform var(--transition-fast),
    text-shadow var(--transition-fast);
}

.sebayte:hover {
  transform: rotate(-2deg) scale(1.03);
  text-shadow: 0 5px 0 rgba(20, 173, 0, 0.14);
}

.reading:hover {
  transform: rotate(2deg) scale(1.03);
  text-shadow: 0 5px 0 rgba(220, 20, 60, 0.12);
}


/* =========================================================
   11. STAGGERED HERO CONTENT
========================================================= */

.program,
.program-mobile,
.intro,
.intro-definition,
.top-intro,
.research,
.btn {
  opacity: 1;
  animation: reveal-up 650ms var(--ease-soft) backwards;
}

.program,
.program-mobile {
  animation-delay: 650ms;
}

.intro {
  animation-delay: 740ms;
}

.intro-definition,
.top-intro {
  animation-delay: 830ms;
}

.research {
  animation-delay: 920ms;
}

.btn {
  animation-delay: 1.01s;
}


/* =========================================================
   12. HERO CONTENT HOVER EFFECTS
========================================================= */

.program,
.program-mobile,
.intro-definition,
.top-intro,
.research {
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth),
    border-color var(--transition-smooth);
}

.program:hover,
.program-mobile:hover {
  transform: rotate(-1.5deg) scale(1.03);
  box-shadow: 0 8px 0 rgba(64, 52, 111, 0.12);
}

.intro-definition:hover,
.top-intro:hover {
  transform: translateX(6px);
  box-shadow: 0 12px 25px rgba(64, 52, 111, 0.12);
}

.research:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 20px 40px rgba(64, 52, 111, 0.3);
}


/* =========================================================
   13. HERO IMAGE ANIMATION
========================================================= */

main img {
  animation: image-pop 900ms 520ms var(--ease-pop) backwards;

  transition:
    transform 450ms var(--ease-soft),
    box-shadow 450ms var(--ease-soft),
    filter 450ms var(--ease-soft);
}

main img:hover {
  transform: scale(1.025) rotate(0.6deg);
  box-shadow: 0 24px 50px rgba(64, 52, 111, 0.24);
  filter: saturate(1.05);
}


/* =========================================================
   14. ARTICLE TEXT ENTRANCE
========================================================= */

.article h2,
.article p {
  opacity: 1;
  animation: reveal-up 600ms var(--ease-soft) backwards;
}

.article h2 {
  animation-delay: 850ms;
}

.article p {
  animation-delay: 950ms;
}


/* =========================================================
   15. CALL-TO-ACTION BUTTON
========================================================= */

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

/* Moving shine effect. */

.btn::after {
  content: "";
  position: absolute;
  z-index: -1;

  top: -50%;
  left: -35%;

  width: 25%;
  height: 200%;

  background: rgba(255, 255, 255, 0.42);
  transform: rotate(25deg) translateX(-250%);

  transition: transform 650ms var(--ease-soft);
}

.btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 30px rgba(220, 20, 60, 0.32);
}

.btn:hover::after {
  transform: rotate(25deg) translateX(700%);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}


/* =========================================================
   16. CALL LINK
========================================================= */

#call {
  border-radius: 999px;

  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

#call:hover {
  color: white;
  background-color: var(--green);
  transform: translateY(-2px);
}


/* =========================================================
   17. MISSION & LOWER-PAGE TRANSITIONS
========================================================= */

.about-title,
.mission-paragraph,
.mission-image,
.owner,
#why-choose-title,
#why-us-container,
.bottom-text-container,
.students-outside {
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth);
}


/* =========================================================
   18. LOWER-PAGE IMAGE EFFECTS
========================================================= */

.mission-image img,
.owner img,
.books img,
.students-outside img {
  transition:
    transform 450ms var(--ease-soft),
    box-shadow 450ms var(--ease-soft),
    filter 450ms var(--ease-soft);
}

.mission-image img:hover {
  transform: translateY(-7px) rotate(-0.8deg) scale(1.015);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.24);
}

.owner img:hover {
  transform: rotate(2deg) scale(1.04);
  box-shadow: 0 16px 30px rgba(255, 192, 203, 0.28);
}

.books img {
  animation: book-float 3.8s ease-in-out infinite;
}

.books img:hover {
  rotate: -4deg;
  scale: 1.08;
  filter: saturate(1.08);
}


/* =========================================================
   19. LIST ITEM INTERACTIONS
========================================================= */

#why-us-container li,
.bottom-text-container li {
  transition:
    transform var(--transition-fast),
    color var(--transition-fast);
}

#why-us-container li:hover,
.bottom-text-container li:hover {
  color: var(--red);
  transform: translateX(8px);
}


/* =========================================================
   20. IMAGE BANNER INTERACTIONS
========================================================= */

.learningtodayheader,
.outsidetext {
  transition:
    background-color var(--transition-smooth),
    transform var(--transition-smooth),
    letter-spacing var(--transition-smooth);
}

.learningtodayheader:hover,
.outsidetext:hover {
  background-color: rgba(220, 20, 60, 0.88);
  letter-spacing: 0.02em;
  transform: translateY(-3px);
}


/* =========================================================
   21. MOBILE MENU ANIMATION — 1024px AND SMALLER
========================================================= */

@media (max-width: 1024px) {
  .nav-list.active {
    animation: mobile-menu-drop 380ms var(--ease-soft) both;
  }

  .nav-list.active li {
    animation: mobile-link-in 350ms var(--ease-soft) both;
  }

  .nav-list.active li:nth-child(1) {
    animation-delay: 70ms;
  }

  .nav-list.active li:nth-child(2) {
    animation-delay: 120ms;
  }

  .nav-list.active li:nth-child(3) {
    animation-delay: 170ms;
  }

  .nav-list.active li:nth-child(4) {
    animation-delay: 220ms;
  }

  .nav-list.active li:nth-child(5) {
    animation-delay: 270ms;
  }

  .nav-list.active li:nth-child(6) {
    animation-delay: 320ms;
  }
}


/* =========================================================
   22. ANIMATION KEYFRAMES
========================================================= */

@keyframes header-drop {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logo-pop {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-7deg);
  }

  70% {
    transform: scale(1.06) rotate(2deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes nav-item-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-in-left {
  from {
    opacity: 0;
    transform: translateX(-45px) rotate(-1.5deg);
  }

  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes card-in-right {
  from {
    opacity: 0;
    transform: translateX(45px) rotate(1.5deg);
  }

  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes title-bounce {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.9) rotate(-2deg);
  }

  70% {
    transform: translateY(-4px) scale(1.025) rotate(0.5deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes image-pop {
  0% {
    opacity: 0;
    transform: scale(0.88) rotate(2deg);
  }

  75% {
    transform: scale(1.02) rotate(-0.5deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes bubble-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(10px, -12px, 0) scale(1.04);
  }
}

@keyframes book-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes mobile-menu-drop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes mobile-link-in {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   23. REDUCED-MOTION ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}