/* 
 * Interact - Main Stylesheet
 * Fonts and base styles
 */

@import url('https://fonts.googleapis.com/css2?family=Hedvig+Letters+Serif:opsz@12..24&family=Rethink+Sans:wght@400;500;600;700;800&display=swap');

body {
  font-family: 'Rethink Sans', sans-serif;
  background-color: white;
  color: rgba(0, 0, 0, 0.7);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-serif {
  font-family: 'Hedvig Letters Serif', serif;
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #001cd6, #E31B40);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  z-index: 100;
  transition: transform 0.15s linear;
}

/* ─── Apple-style Reveal System ─────────────────────────────────────── */

/* Base state: hidden, shifted down, slightly blurred */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Cards: enter with a 3D tilt + rise + blur */
.reveal-rotate {
  opacity: 0;
  transform: translateY(56px) perspective(1000px) rotateX(-6deg) scale(0.97);
  transition:
    opacity 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: bottom center;
}
.reveal-rotate.active {
  opacity: 1;
  transform: translateY(0) perspective(1000px) rotateX(0deg) scale(1);
  will-change: auto;
}

/* Stagger children with clean cascade */
.reveal-stagger-container .reveal-stagger-item {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-stagger-container.active .reveal-stagger-item {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* ─── Clients Carousel ─────────────────────────────────────── */
.clients-carousel {
  overflow: hidden;
}
.clients-carousel .animate-scroll {
  display: flex;
  /* duplicate set makes width 200% */
  animation: scroll 20s linear infinite;
}
.clients-carousel .animate-scroll:hover {
  animation-play-state: paused;
}
.clients-carousel .logo {
  height: 64px;
  margin: 0 24px;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}
.clients-carousel .logo:hover {
  filter: grayscale(0%);
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Each section fades into the next via a masked gradient edge */
section::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 10;
}
section.bg-white::after {
  background: linear-gradient(to bottom, transparent, white);
}
section.bg-\[#f6fdff\]::after {
  background: linear-gradient(to bottom, transparent, #f6fdff);
}

/* ─── Nav ────────────────────────────────────────────────────────────── */
header {
  transition: background 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Hero Specific ──────────────────────────────────────────────────── */
#hero-statue {
  will-change: transform;
}
#hero-zeta {
  will-change: transform;
}

/* ─── Parallax & Blob ────────────────────────────────────────────────── */
.parallax-el {
  will-change: transform;
}

/* ─── Blob sway: GPU-native CSS animation, zero JS per frame ─── */
/* --base-rotate / --blob-duration set once at init by main.js   */
@keyframes blob-sway {
  0%   { transform: rotate(calc(var(--base-rotate, 0deg) - 5deg)); }
  50%  { transform: rotate(calc(var(--base-rotate, 0deg) + 5deg)); }
  100% { transform: rotate(calc(var(--base-rotate, 0deg) - 5deg)); }
}
.blob {
  pointer-events: none;
  position: absolute;
  user-select: none;
  animation: blob-sway var(--blob-duration, 30s) ease-in-out infinite;
}

/* ─── Apple-style smooth scroll ──────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ─── Stacked Slide System ───────────────────────────────────────────── */
/*
 * Each .stack-slide is sticky at top:0.
 * As the user scrolls, new slides rise from below and cover the previous.
 * JS applies a scale-down to "bury" slides as they go behind.
 */

#stack-root {
  /* The root container — no special styles needed,
     sections handle their own stickiness */
}

.stack-slide {
  position: sticky;
  top: 0;
  /* Rounded top corners so each slide looks like a rising card */
  border-radius: 20px 20px 0 0;
  /* Clip the background image to the rounded corners */
  overflow: hidden;
  /* Origin at top so scale shrinks downward */
  transform-origin: top center;
  will-change: transform, border-radius;
  /* Smooth depth transitions */
  transition: border-radius 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hero is the base — no top rounding needed, it's the background layer */
.stack-slide:first-child {
  border-radius: 0;
}

/* A subtle top shadow so cards look lifted */
.stack-slide:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  z-index: 1;
  pointer-events: none;
}


/* Custom Animation for Pulse */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ─── Mobile Menu ────────────────────────────────────────────────────── */

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #001cd6;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
}
body.menu-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.menu-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 32px 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              visibility 0.4s;
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}
.mobile-menu-nav a {
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Rethink Sans', sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.55);
  padding: 16px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              color 0.3s ease;
}
.mobile-menu-nav a:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.mobile-menu.open .mobile-menu-nav a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.open .mobile-menu-nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.open .mobile-menu-nav a:nth-child(2) { transition-delay: 0.10s; }
.mobile-menu.open .mobile-menu-nav a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-menu-nav a:nth-child(4) { transition-delay: 0.20s; }
.mobile-menu.open .mobile-menu-nav a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu.open .mobile-menu-nav a:nth-child(6) { transition-delay: 0.30s; }

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
  color: #001cd6;
}

.mobile-menu-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 16px 32px;
  background: #001cd6;
  color: white;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background 0.3s ease;
}
.mobile-menu.open .mobile-menu-cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.35s;
}
.mobile-menu-cta:hover {
  background: #0014a3;
}

body.menu-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

