/* ================================================================
   FORGE — Motion & Animation Layer
   Adds cinematic motion without changing colors, type, or layout.
   ================================================================ */

/* Honor user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Scroll-triggered reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }

/* ── Floating hero objects ── */
.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.float-obj {
  position: absolute;
  opacity: 0.08;
  color: var(--accent);
  will-change: transform;
}
.float-obj--a {
  top: 12%; left: 8%;
  width: 280px; height: 280px;
  animation: float-a 17s ease-in-out infinite;
}
.float-obj--b {
  top: 38%; right: 10%;
  width: 200px; height: 200px;
  animation: float-b 23s ease-in-out infinite;
  opacity: 0.06;
}
.float-obj--c {
  bottom: 14%; left: 38%;
  width: 160px; height: 160px;
  animation: float-c 12s ease-in-out infinite;
  opacity: 0.10;
}
@keyframes float-a {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  33%      { transform: translate3d(-12px,-28px,0) rotate(4deg); }
  66%      { transform: translate3d(8px,-14px,0) rotate(-3deg); }
}
@keyframes float-b {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  50%      { transform: translate3d(-18px,-22px,0) rotate(-6deg); }
}
@keyframes float-c {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  40%      { transform: translate3d(14px,-18px,0) rotate(3deg); }
  70%      { transform: translate3d(-6px,-30px,0) rotate(-4deg); }
}

/* ── Glowing accent line — disabled, replaced by hero clip-mask reveal ── */
.glow-line { display: none; }

/* ── Hero headline: clip-mask reveal ──
   Each line is a clip frame; the inner span translates up from below.
   Slow, deliberate, no overshoot. The accent line glows softly after settling.
*/
.hero-headline { line-height: 1.02; }
.hero-headline .hl-line {
  display: block;
  overflow: hidden;
  padding: 0 0.08em 0.04em 0.04em; /* prevent italic tail + descender clip */
  /* line-height comes from .h-display */
}
.hero-headline .hl-inner {
  display: inline-block;
  transform: translate3d(0, 110%, 0);
  opacity: 0;
  transition:
    transform 1.05s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.9s  cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.hero-headline.is-in .hl-inner {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}
/* Stagger — slow, unhurried */
.hero-headline.is-in .hl-line:nth-child(1) .hl-inner { transition-delay: 0.10s; }
.hero-headline.is-in .hl-line:nth-child(2) .hl-inner { transition-delay: 0.32s; }
.hero-headline.is-in .hl-line:nth-child(3) .hl-inner { transition-delay: 0.54s; }
.hero-headline.is-in .hl-line:nth-child(4) .hl-inner { transition-delay: 0.78s; }

/* Accent word — subtle glow that fades in AFTER it lands */
.hero-headline .hl-accent {
  font-style: italic;
  position: relative;
  text-shadow: 0 0 0 transparent;
  transition:
    transform 1.05s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.9s  cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 1.2s ease-out 1.85s,
    color 1.2s ease-out 1.85s;
}
.hero-headline.is-in .hl-accent {
  text-shadow:
    0 0 18px rgba(139, 186, 60, 0.35),
    0 0 42px rgba(139, 186, 60, 0.18);
}

/* Eyebrow + sub-block: simple opacity fade after the headline completes */
.hero-eyebrow,
.hero-sub {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.hero-eyebrow.is-in {
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}
.hero-sub.is-in {
  opacity: 1;
  transform: none;
  transition-delay: 1.95s; /* lands after the last headline line + accent glow begins */
}

@media (prefers-reduced-motion: reduce) {
  .hero-headline .hl-inner,
  .hero-eyebrow,
  .hero-sub {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Magnetic / 3D tilt prep ── */
.mag-btn {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  will-change: transform;
}
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ── Page transition wipe ── */
.page-wipe {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--accent);
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
  transform-origin: left;
}
.page-wipe.in  { animation: wipe-in  0.32s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.page-wipe.out { animation: wipe-out 0.32s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
@keyframes wipe-in  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0% 0 0); } }
@keyframes wipe-out { from { clip-path: inset(0 0 0 0); }   to { clip-path: inset(0 0 0 100%); } }

/* ── Nav fade-in on load ── */
.topnav { animation: nav-fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes nav-fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Horizontal scroll track for "How it works" ── */
.h-scroll-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 1fr);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.h-scroll-track::-webkit-scrollbar { display: none; }
.h-scroll-track > * {
  scroll-snap-align: start;
  border-right: 1px solid var(--hairline);
  padding: 40px 32px;
  min-height: 280px;
}
.h-scroll-progress {
  height: 2px;
  background: var(--hairline);
  margin-top: 0;
  position: relative;
  overflow: hidden;
}
.h-scroll-progress::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: var(--p, 0%);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.1s linear;
}

/* ── Counter ── */
.counter { font-variant-numeric: tabular-nums; }

/* ── Image frames ── */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-frame--photo img {
  filter: saturate(0.35) brightness(0.9);
  transition: filter 0.4s ease;
}
.img-frame--photo:hover img {
  filter: saturate(0.55) brightness(1.0);
}
.img-frame__meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: rgba(0,0,0,0.62);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3);
}
.img-frame__corner {
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
}
.img-frame__corner--tl { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; }
.img-frame__corner--tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; }
.img-frame__corner--bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; }
.img-frame__corner--br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }

.ar-4-3 { aspect-ratio: 4/3; }
.ar-3-2 { aspect-ratio: 3/2; }
.ar-1-1 { aspect-ratio: 1/1; }
