.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp,
.material-icons {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1 !important;
  box-sizing: content-box;
  overflow: hidden;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   MOTION LAYER
   ============================================================ */
:root {
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --coral: #e4572e;
  --marigold: #f5a623;
  --deep-teal: #0f4c5c;
}

[id] {
  scroll-margin-top: 90px;
}

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 80;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(
    90deg,
    var(--coral) 0%,
    var(--marigold) 55%,
    #9ed8c3 100%
  );
  box-shadow: 0 1px 8px rgba(228, 87, 46, 0.35);
  will-change: transform;
  pointer-events: none;
}

/* ---------- Sticky, frosted header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  transition:
    background-color 0.35s var(--ease-soft),
    box-shadow 0.35s var(--ease-soft),
    backdrop-filter 0.35s var(--ease-soft);
}
#site-header.is-scrolled {
  background-color: rgba(255, 246, 229, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: 0 18px 40px -28px rgba(15, 76, 92, 0.55);
}
#site-header a[href="#top"] svg {
  transition: transform 0.45s var(--ease-soft);
}
#site-header a[href="#top"]:hover svg,
#site-header a[href="#top"]:focus-visible svg {
  transform: scale(1.16) rotate(-8deg);
}

/* Animated nav underline */
nav[aria-label="Main navigation"] ul a {
  position: relative;
}
nav[aria-label="Main navigation"] ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease-soft);
}
nav[aria-label="Main navigation"] ul a:hover::after,
nav[aria-label="Main navigation"] ul a:focus-visible::after {
  transform: scaleX(1);
}

/* ---------- Buttons: shine sweep + glow ---------- */
[data-component-type="button"] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
[data-component-type="button"]::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 45%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
}
[data-component-type="button"]:hover::after,
[data-component-type="button"]:focus-visible::after {
  opacity: 1;
  animation: btn-shine 0.95s var(--ease-soft);
}
[data-component-type="button"]:hover {
  box-shadow: 0 16px 30px -16px rgba(15, 76, 92, 0.65);
}
[data-component-type="button"]:active {
  transform: translateY(0) scale(0.98);
}

/* ---------- Badges ---------- */
[data-component-type="badge"] {
  transition:
    translate 0.3s var(--ease-soft),
    box-shadow 0.3s var(--ease-soft);
}
[data-component-type="badge"]:hover {
  translate: 0 -3px;
  box-shadow: 0 10px 18px -14px rgba(15, 76, 92, 0.6);
}

/* ---------- Hero ---------- */
.hero-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-glow {
  position: absolute;
  z-index: 0;
  width: 560px;
  height: 560px;
  top: -160px;
  right: -140px;
  border-radius: 9999px;
  background: radial-gradient(
    circle at 35% 35%,
    rgba(245, 166, 35, 0.28),
    rgba(245, 166, 35, 0) 68%
  );
  filter: blur(10px);
  pointer-events: none;
  animation: glow-drift 16s ease-in-out infinite alternate;
}
.hero-glow::before {
  content: "";
  position: absolute;
  inset: 34% 24% -22% 22%;
  border-radius: inherit;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(158, 216, 195, 0.35),
    rgba(158, 216, 195, 0) 70%
  );
  animation: glow-drift 12s 1.5s ease-in-out infinite alternate-reverse;
}

.hero-ornaments {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ornament {
  position: absolute;
  display: block;
  line-height: 1;
  animation: floaty 6.5s ease-in-out infinite;
  will-change: transform;
}
.ornament-heart {
  color: rgba(228, 87, 46, 0.3);
  text-shadow: 0 6px 14px rgba(228, 87, 46, 0.15);
}
.ornament-star {
  color: rgba(245, 166, 35, 0.55);
  animation:
    floaty 7s ease-in-out infinite,
    twinkle 3.5s ease-in-out infinite;
}

.hero-copy > * {
  animation: rise-in 0.9s var(--ease-soft) both;
}
.hero-copy > *:nth-child(1) {
  animation-delay: 0.05s;
}
.hero-copy > *:nth-child(2) {
  animation-delay: 0.14s;
}
.hero-copy > *:nth-child(3) {
  animation-delay: 0.24s;
}
.hero-copy > *:nth-child(4) {
  animation-delay: 0.34s;
}
.hero-copy > *:nth-child(5) {
  animation-delay: 0.44s;
}
.hero-copy [data-component-type="badge"] {
  animation: pop-in 0.6s var(--ease-soft) both;
}
.hero-copy [data-component-type="badge"]:nth-child(1) {
  animation-delay: 0.56s;
}
.hero-copy [data-component-type="badge"]:nth-child(2) {
  animation-delay: 0.63s;
}
.hero-copy [data-component-type="badge"]:nth-child(3) {
  animation-delay: 0.7s;
}
.hero-copy [data-component-type="badge"]:nth-child(4) {
  animation-delay: 0.77s;
}

.highlight-word {
  position: relative;
  display: inline-block;
  padding-inline: 0.06em;
  background-image: linear-gradient(
    transparent 60%,
    rgba(245, 166, 35, 0.42) 60%
  );
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: highlight-sweep 0.95s 0.95s var(--ease-soft) forwards;
}

.book-stage {
  perspective: 1100px;
  animation:
    pop-in 0.95s 0.2s var(--ease-soft) both,
    floaty 7.5s 1.3s ease-in-out infinite;
  will-change: transform;
}
.book-backdrop {
  animation: shadow-breathe 7.5s 1.3s ease-in-out infinite;
}
.book-figure {
  transition:
    transform 0.25s ease-out,
    box-shadow 0.35s var(--ease-soft);
  transform-style: preserve-3d;
}
.book-figure::after {
  content: "";
  position: absolute;
  inset: -25% -70%;
  background: linear-gradient(
    100deg,
    transparent 32%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 68%
  );
  transform: translateX(-75%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
}
.book-stage:hover .book-figure::after {
  animation: book-shine 1.15s 0.05s ease-out forwards;
}
.book-stage:hover .book-figure {
  box-shadow: 0 34px 60px rgba(15, 76, 92, 0.28);
}

/* ---------- Scroll reveals ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s var(--ease-soft),
    transform 0.75s var(--ease-soft);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal[data-reveal="left"] {
  transform: translateX(-34px);
}
.js .reveal[data-reveal="right"] {
  transform: translateX(34px);
}
.js .reveal[data-reveal="zoom"] {
  transform: scale(0.9);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Story cards ---------- */
.story-card:hover {
  border-color: rgba(228, 87, 46, 0.38);
  box-shadow:
    0 18px 26px -18px rgba(15, 76, 92, 0.4),
    0 6px 0 rgba(31, 42, 55, 0.08);
}
.story-number {
  transition:
    rotate 0.35s var(--ease-soft),
    scale 0.35s var(--ease-soft);
}
.story-card:hover .story-number {
  rotate: -9deg;
  scale: 1.08;
}

/* ---------- "Why" pillars ---------- */
.why-card {
  transition:
    translate 0.35s var(--ease-soft),
    border-color 0.35s var(--ease-soft);
}
.why-card:hover {
  translate: 0 -6px;
  border-color: #ffd27a;
}
.why-card h3 {
  transition: color 0.35s var(--ease-soft);
}
.why-card:hover h3 {
  color: #ffd27a;
}

/* ---------- Inside-each-story cards ---------- */
.inside-card {
  transition:
    translate 0.35s var(--ease-soft),
    box-shadow 0.35s var(--ease-soft);
}
.inside-card:hover {
  translate: 7px 0;
  box-shadow: 0 16px 30px -22px rgba(15, 76, 92, 0.55);
}
.inside-card > span {
  transition:
    rotate 0.35s var(--ease-soft),
    scale 0.35s var(--ease-soft);
}
.inside-card:hover > span {
  rotate: 6deg;
  scale: 1.08;
}

/* ---------- Challenge cards ---------- */
.challenge-card {
  transition:
    translate 0.35s var(--ease-soft),
    box-shadow 0.35s var(--ease-soft),
    border-color 0.35s var(--ease-soft);
}
.challenge-card:hover {
  translate: 0 -5px;
  border-color: rgba(228, 87, 46, 0.6);
  box-shadow: 0 18px 26px -20px rgba(15, 76, 92, 0.45);
}
.challenge-card .material-symbols-outlined {
  display: inline-block;
  transform-origin: center;
  animation: heartbeat 3.2s ease-in-out infinite;
}
.challenge-card:nth-child(2) .material-symbols-outlined {
  animation-delay: 0.5s;
}
.challenge-card:nth-child(3) .material-symbols-outlined {
  animation-delay: 1s;
}
.challenge-card:nth-child(4) .material-symbols-outlined {
  animation-delay: 1.5s;
}
.challenge-card:nth-child(5) .material-symbols-outlined {
  animation-delay: 2s;
}
.challenge-card:nth-child(6) .material-symbols-outlined {
  animation-delay: 2.5s;
}
.challenge-card:hover .material-symbols-outlined {
  animation-duration: 0.9s;
}

/* ---------- Author quote ---------- */
.quote-mark {
  display: inline-block;
  animation:
    bob 4.5s ease-in-out infinite,
    twinkle 5s ease-in-out infinite;
}
.quote-block {
  position: relative;
}
.quote-block::before {
  content: "";
  position: absolute;
  inset: -24px 10% auto;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(31, 42, 55, 0.25),
    transparent
  );
  transform: scaleX(0);
}
.quote-block.is-visible::before {
  animation: line-grow 1.2s 0.35s var(--ease-soft) forwards;
}
.quote-block::after {
  content: "";
  position: absolute;
  inset: auto 10% -24px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(31, 42, 55, 0.25),
    transparent
  );
  transform: scaleX(0);
}
.quote-block.is-visible::after {
  animation: line-grow 1.2s 0.5s var(--ease-soft) forwards;
}

/* ---------- Author portrait ---------- */
.author-portrait {
  transition:
    scale 0.5s var(--ease-soft),
    rotate 0.5s var(--ease-soft);
}
.author-portrait:hover {
  scale: 1.035;
  rotate: -1.5deg;
}

/* ---------- Keyframes ---------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  60% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(-1.5deg);
  }
}
@keyframes shadow-breathe {
  0%,
  100% {
    transform: translate(14px, 16px) scale(1);
  }
  50% {
    transform: translate(14px, 26px) scale(1.015);
  }
}
@keyframes glow-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-50px, 36px, 0) scale(1.12);
  }
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.95;
  }
}
@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.2);
  }
  24% {
    transform: scale(1);
  }
  36% {
    transform: scale(1.12);
  }
  48% {
    transform: scale(1);
  }
}
@keyframes btn-shine {
  from {
    transform: translateX(0) skewX(-20deg);
  }
  to {
    transform: translateX(420%) skewX(-20deg);
  }
}
@keyframes book-shine {
  0% {
    opacity: 0;
    transform: translateX(-75%) rotate(8deg);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(75%) rotate(8deg);
  }
}
@keyframes highlight-sweep {
  to {
    background-size: 100% 100%;
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes line-grow {
  to {
    transform: scaleX(1);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1023px) {
  #site-header,
  #site-header.is-scrolled {
    position: static;
    background-color: #fff6e5;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  [id] {
    scroll-margin-top: 24px;
  }
}

@media (max-width: 767px) {
  .hero-glow {
    width: 340px;
    height: 340px;
    top: -120px;
    right: -120px;
  }
  .ornament-star {
    display: none;
  }
}
