/* Intro overlay ("67" hand animation) + the hero it sits on top of. */

/* =========================================================
   Intro overlay
   ========================================================= */

.intro {
  position: fixed;
  inset: 0;
  /* Above the sticky header (z-index 90) but below the skip-link (200). */
  z-index: 120;
  display: grid;
  place-items: center;
  gap: 0;
  background: var(--bg);
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

/* intro.js sets [hidden] / .is-gone once the exit finishes. Both must win over
   the `display: grid` above, hence the higher-specificity selectors. */
.intro[hidden],
.intro.is-gone {
  display: none !important;
}

/* Locked by intro.js while the overlay is up. */
body.intro-open {
  overflow: hidden;
}

.intro__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  padding-inline: 1rem;
}

.intro__hands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
}

.hand {
  width: clamp(70px, 18vw, 130px);
  height: auto;
  flex: none;
  will-change: transform;
}

/* Themed via `color` because the SVG paths use stroke="currentColor". */
.hand--left {
  color: var(--accent-1);
  /* alternate => a full up+down cycle is 2 x 0.24s = ~0.48s. */
  animation: hand-up-down 0.24s var(--ease) infinite alternate;
}

/* The right hand is the same art mirrored. A static `transform: scaleX(-1)`
   here would be clobbered by the animation's own transform, so the flip is
   baked into every keyframe of its own dedicated animation instead. */
.hand--right {
  color: var(--accent-2);
  animation: hand-down-up-mirrored 0.24s var(--ease) infinite alternate;
}

@keyframes hand-up-down {
  from {
    transform: translateY(-20px) rotate(-8deg);
  }
  to {
    transform: translateY(20px) rotate(8deg);
  }
}

@keyframes hand-down-up-mirrored {
  from {
    transform: scaleX(-1) translateY(20px) rotate(-8deg);
  }
  to {
    transform: scaleX(-1) translateY(-20px) rotate(8deg);
  }
}

.intro__word {
  font-family: var(--font-mono);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: intro-word-in 0.6s var(--ease) both, intro-word-pulse 1.6s var(--ease) 0.6s infinite;
}

@keyframes intro-word-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes intro-word-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.intro__skip {
  position: absolute;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 88px;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-size: var(--step--1);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.intro__skip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.intro__skip:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
  color: var(--text);
}

/* Exit state, added by intro.js. */
.intro.is-leaving {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Belt and braces: intro.js also removes the overlay outright when the user
   prefers reduced motion, but if the script never runs we must not show it. */
@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(88vh, 900px);
  padding-block: clamp(3.5rem, 10vw, 6rem);
  /* Decorative layers are absolutely positioned and can bleed; never sideways. */
  overflow: hidden;
}

/* Faint dot grid, driven by --border so it reads in both themes. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--border-strong) 85%, transparent) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  /* Fade the grid out toward the edges so it never looks like a hard texture. */
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}

/* Soft accent glow blob. */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -18%;
  left: 50%;
  translate: -50% 0;
  width: min(900px, 130%);
  aspect-ratio: 1;
  background: radial-gradient(
      circle at 35% 40%,
      color-mix(in srgb, var(--accent-1) 22%, transparent),
      transparent 60%
    ),
    radial-gradient(
      circle at 68% 55%,
      color-mix(in srgb, var(--accent-2) 20%, transparent),
      transparent 62%
    );
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  animation: hero-in 0.7s var(--ease) both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.hero__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  animation: hero-dot-pulse 2s var(--ease) infinite;
}

@keyframes hero-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.75);
  }
}

.hero__title {
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.hero__lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 6vw, 3.5rem);
  margin-top: clamp(2.5rem, 6vw, 3.75rem);
  padding-top: clamp(1.5rem, 4vw, 2rem);
  border-top: 1px solid var(--border);
}

.hero__stats dt {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.hero__stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .hero__inner,
  .hero__dot {
    animation: none;
  }
}
