/* Motion system and mobile safeguards — Sakey Educa */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-width: 0;
}

h1,
h2,
h3,
h4,
p,
a,
button,
summary,
.eyebrow,
.kicker,
.address-line,
.service-list strong,
.contact-whatsapp strong {
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

main,
section,
.section-shell,
.nav-shell,
.footer-shell,
.hero-grid,
.hero-grid > *,
.services-grid > *,
.structure-grid > *,
.faq-grid > *,
.contact-grid > * {
  min-width: 0;
  max-width: 100%;
}

.site-header {
  padding-top: env(safe-area-inset-top, 0px);
  transition: box-shadow 280ms ease, background-color 280ms ease;
}

.site-header.is-scrolled {
  background: rgba(254, 254, 254, 0.97);
  box-shadow: 0 12px 34px rgba(38, 40, 42, 0.09);
}

.scroll-progress {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #33cc99 0%, #f05a24 72%, #f05a24 100%);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.motion-ready .hero .eyebrow,
.motion-ready .hero h1,
.motion-ready .hero-copy > p,
.motion-ready .hero-actions,
.motion-ready .address-line {
  opacity: 0;
  animation: sakey-hero-in 760ms cubic-bezier(0.2, 0.75, 0.22, 1) forwards;
}

.motion-ready .hero h1 { animation-delay: 90ms; }
.motion-ready .hero-copy > p { animation-delay: 180ms; }
.motion-ready .hero-actions { animation-delay: 270ms; }
.motion-ready .address-line { animation-delay: 350ms; }

.motion-ready .hero-visual {
  opacity: 0;
  animation: sakey-visual-in 980ms 180ms cubic-bezier(0.16, 0.8, 0.2, 1) forwards;
}

.motion-ready .orbit-one { animation: sakey-float-one 6.6s 1.25s ease-in-out infinite; }
.motion-ready .orbit-two { animation: sakey-float-two 7.4s 1.6s ease-in-out infinite; }
.motion-ready .orbit-three { animation: sakey-float-three 6.9s 1.4s ease-in-out infinite; }
.motion-ready .visual-center { animation: sakey-center-breathe 7.2s 1.25s ease-in-out infinite; }
.motion-ready .eyebrow i { animation: sakey-dot-pulse 2.8s ease-in-out infinite; }
.motion-ready .morning-symbol { animation: sakey-symbol-breathe 6.5s ease-in-out infinite; }
.motion-ready .floating-whatsapp { animation: sakey-whatsapp-pulse 7s 2s ease-in-out infinite; }

.motion-ready .reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 720ms cubic-bezier(0.2, 0.75, 0.22, 1),
    transform 720ms cubic-bezier(0.2, 0.75, 0.22, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.motion-ready .reveal.reveal-soft {
  transform: translate3d(0, 18px, 0) scale(0.985);
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.service-list button:hover i,
.service-list button:focus-visible i {
  transform: translateX(5px);
}

.service-list i {
  transition: transform 220ms ease;
}

.differential-card::after {
  transition: transform 450ms cubic-bezier(0.2, 0.75, 0.22, 1);
}

.differential-card:hover::after {
  transform: scale(1.28);
}

@keyframes sakey-hero-in {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes sakey-visual-in {
  from { opacity: 0; transform: translate3d(24px, 0, 0) scale(0.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes sakey-float-one {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.35deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(0.45deg); }
}

@keyframes sakey-float-two {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0.35deg); }
  50% { transform: translate3d(0, 9px, 0) rotate(-0.45deg); }
}

@keyframes sakey-float-three {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-5px, -8px, 0); }
}

@keyframes sakey-center-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.018); }
}

@keyframes sakey-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(240, 90, 36, 0.12); }
  50% { box-shadow: 0 0 0 10px rgba(240, 90, 36, 0.045); }
}

@keyframes sakey-symbol-breathe {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(1.5deg) scale(1.025); }
}

@keyframes sakey-whatsapp-pulse {
  0%, 72%, 100% { transform: translate3d(0, 0, 0); box-shadow: 0 14px 40px rgba(38, 40, 42, 0.24); }
  78% { transform: translate3d(0, -4px, 0); box-shadow: 0 19px 44px rgba(38, 40, 42, 0.3); }
  84% { transform: translate3d(0, 0, 0); }
}

@media (max-width: 760px) {
  .section-shell,
  .nav-shell,
  .footer-shell {
    width: min(calc(100% - 30px), 620px);
  }

  .nav-links {
    top: 100%;
  }

  .hero {
    padding-top: clamp(38px, 10vw, 54px);
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 11vw, 3.15rem);
    line-height: 0.99;
    overflow-wrap: normal;
    word-break: normal;
    -webkit-hyphens: none;
    hyphens: none;
  }

  .hero h1 em,
  .hero-copy > p,
  .eyebrow,
  .service-list strong,
  .contact-whatsapp strong {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    -webkit-hyphens: none;
    hyphens: none;
  }

  .hero-visual {
    width: 100%;
    max-width: 100%;
    min-height: 440px;
    border-radius: 38px;
  }

  .hero-visual::before {
    inset: 18px;
  }

  .floating-whatsapp {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    max-width: calc(100% - 24px);
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: clamp(2.1rem, 10.2vw, 2.72rem);
  }

  .hero-visual {
    min-height: 405px;
  }

  .orbit {
    width: 130px;
  }

  .orbit-one { left: 1%; }
  .orbit-two { right: 1%; }
  .orbit-three { right: 2%; }

  .visual-center {
    width: min(184px, 54vw);
  }

  .key-path::after {
    width: 130px;
  }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 2rem; }
  .hero-visual { min-height: 390px; }
  .orbit { width: 122px; padding: 13px; }
  .floating-whatsapp { min-width: 0; }
}

.footer-credit {
  white-space: nowrap;
}

.footer-credit::before {
  margin-inline: 0.55em;
  content: "•";
}

.space-gallery {
  position: relative;
  min-width: 0;
  min-height: 550px;
  overflow: hidden;
  border-radius: 38px;
  background: var(--gray);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.gallery-viewport,
.gallery-slide {
  position: absolute;
  inset: 0;
}

.gallery-slide {
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.035);
  transition: opacity 850ms ease, transform 5.8s ease;
}

.gallery-slide.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.gallery-slide::after {
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(24, 26, 27, 0.82));
  content: "";
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-slide:first-child img { object-position: 50% 64%; }
.gallery-slide:nth-child(2) img { object-position: 50% 56%; }

.gallery-slide figcaption {
  position: absolute;
  z-index: 2;
  right: 150px;
  bottom: 30px;
  left: 28px;
  max-width: 420px;
  color: var(--white);
}

.gallery-slide figcaption strong {
  display: block;
  margin-bottom: 5px;
  color: var(--white);
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
}

.gallery-slide figcaption span {
  display: block;
  color: rgba(254, 254, 254, 0.82);
  font-size: 0.76rem;
  line-height: 1.5;
}

.space-gallery .space-badge {
  z-index: 3;
  top: 24px;
  right: auto;
  bottom: auto;
  left: 24px;
  max-width: calc(100% - 48px);
}

.gallery-controls {
  position: absolute;
  z-index: 4;
  right: 22px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-arrow,
.gallery-dot {
  border: 0;
  cursor: pointer;
}

.gallery-arrow {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: rgba(254, 254, 254, 0.92);
  color: var(--ink);
  font-size: 1rem;
  transition: transform 180ms ease, background 180ms ease;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  background: var(--green);
  transform: translateY(-2px);
}

.gallery-dots {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(38, 40, 42, 0.62);
  backdrop-filter: blur(8px);
}

.gallery-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  background: rgba(254, 254, 254, 0.5);
  transition: width 220ms ease, background 220ms ease;
}

.gallery-dot.is-active {
  width: 22px;
  background: var(--green);
}

@media (max-width: 520px) {
  .footer-credit {
    display: block;
    margin-top: 4px;
  }

  .footer-credit::before {
    content: none;
  }

  .space-gallery {
    min-height: 500px;
    border-radius: 28px;
  }

  .gallery-slide figcaption {
    right: 20px;
    bottom: 78px;
    left: 20px;
  }

  .space-gallery .space-badge {
    top: 18px;
    left: 18px;
    max-width: calc(100% - 36px);
  }

  .gallery-controls {
    right: 18px;
    bottom: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }

  .motion-ready .hero .eyebrow,
  .motion-ready .hero h1,
  .motion-ready .hero-copy > p,
  .motion-ready .hero-actions,
  .motion-ready .address-line,
  .motion-ready .hero-visual,
  .motion-ready .orbit,
  .motion-ready .visual-center,
  .motion-ready .eyebrow i,
  .motion-ready .morning-symbol,
  .motion-ready .floating-whatsapp,
  .motion-ready .gallery-slide,
  .motion-ready .reveal,
  .motion-ready .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .motion-ready .visual-center {
    transform: translate(-50%, -50%) !important;
  }
}
