/* Reveal system */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

html.reveal-on .reveal:not(.is-inview) {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
}

html.reveal-on .reveal--left:not(.is-inview),
html.reveal-on .reveal--right:not(.is-inview) {
  transform: translateY(24px);
}

html.reveal-on .reveal--scale:not(.is-inview) {
  transform: translateY(16px) scale(0.97);
}

html.reveal-on .reveal.is-inview {
  opacity: 1;
  transform: none;
}

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 70ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 140ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 210ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 280ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 350ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 420ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 490ms; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 560ms; }

/* ========== Hero story sequence ========== */
.hero-story {
  --story-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --story-dur: 25s;
  --story-steps: 5;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hero-story__steps {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-story__step {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 1.85rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.45;
  animation: story-step var(--story-dur) linear infinite;
}

.hero-story__step span {
  font-variant-numeric: tabular-nums;
}

.hero-story__step--1 { animation-delay: 0s; }
.hero-story__step--2 { animation-delay: 5s; }
.hero-story__step--3 { animation-delay: 10s; }
.hero-story__step--4 { animation-delay: 15s; }
.hero-story__step--5 { animation-delay: 20s; }

@keyframes story-step {
  0%,
  19.5% {
    opacity: 1;
    color: #fff;
    border-color: #e85d04;
    background: linear-gradient(135deg, #ff8a3d, #e85d04);
    box-shadow: 0 8px 18px rgba(232, 93, 4, 0.22);
  }
  20%,
  100% {
    opacity: 0.45;
    color: var(--color-muted);
    border-color: var(--color-border);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: none;
  }
}

.hero-story__progress {
  height: 3px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.hero-story__progress i {
  display: block;
  height: 100%;
  width: 20%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a3d, #e85d04);
  animation: story-progress var(--story-dur) linear infinite;
  transform-origin: left center;
}

@keyframes story-progress {
  0%, 19.9% { transform: translateX(0); }
  20%, 39.9% { transform: translateX(100%); }
  40%, 59.9% { transform: translateX(200%); }
  60%, 79.9% { transform: translateX(300%); }
  80%, 99.9% { transform: translateX(400%); }
  100% { transform: translateX(400%); }
}

.hero-story__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: clamp(15rem, 40vw, 22rem);
  border-radius: 1.35rem;
  overflow: hidden;
  background: #1a1816;
  border: 1px solid rgba(229, 225, 219, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 24px 48px rgba(18, 18, 18, 0.12);
}

.hero-story__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.08) 0%, transparent 28%, transparent 72%, rgba(18, 18, 18, 0.18) 100%),
    radial-gradient(ellipse 90% 70% at 50% 45%, transparent 45%, rgba(18, 18, 18, 0.22) 100%);
  z-index: 2;
}

.hero-story__scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  animation: story-scene var(--story-dur) var(--story-ease) infinite;
  z-index: 1;
}

.hero-story__art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.08);
  animation: story-kenburns var(--story-dur) linear infinite;
}

.hero-story__scene--1 { animation-delay: 0s; }
.hero-story__scene--2 { animation-delay: 5s; }
.hero-story__scene--3 { animation-delay: 10s; }
.hero-story__scene--4 { animation-delay: 15s; }
.hero-story__scene--5 { animation-delay: 20s; }

.hero-story__scene--1 .hero-story__art { animation-delay: 0s; }
.hero-story__scene--2 .hero-story__art { animation-delay: 5s; }
.hero-story__scene--3 .hero-story__art { animation-delay: 10s; }
.hero-story__scene--4 .hero-story__art { animation-delay: 15s; }
.hero-story__scene--5 .hero-story__art { animation-delay: 20s; }

@keyframes story-scene {
  0% { opacity: 0; }
  3% { opacity: 1; }
  17% { opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes story-kenburns {
  0%,
  2% { transform: scale(1.08) translate3d(0, 1.5%, 0); }
  17%,
  20% { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1) translate3d(0, 0, 0); }
}

.hero-story__captions {
  position: relative;
  min-height: 5.75rem;
  text-align: center;
}

.hero-story__caption {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  opacity: 0;
  animation: story-caption var(--story-dur) var(--story-ease) infinite;
}

.hero-story__caption--1 { animation-delay: 0s; }
.hero-story__caption--2 { animation-delay: 5s; }
.hero-story__caption--3 { animation-delay: 10s; }
.hero-story__caption--4 { animation-delay: 15s; }
.hero-story__caption--5 { animation-delay: 20s; }

@keyframes story-caption {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  3%,
  17% {
    opacity: 1;
    transform: translateY(0);
  }
  20%,
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.hero-story__kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero-story__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  line-height: 1.2;
}

.hero-story__sub {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(0.84rem, 1.6vw, 0.95rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-muted);
}

@media (prefers-reduced-motion: reduce) {
  html.reveal-on .reveal,
  html.reveal-on .reveal--left,
  html.reveal-on .reveal--right,
  html.reveal-on .reveal--scale,
  html.reveal-on .reveal:not(.is-inview) {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-story__scene,
  .hero-story__caption,
  .hero-story__progress i,
  .hero-story__step,
  .hero-story__art {
    animation: none !important;
  }

  .hero-story__scene--1,
  .hero-story__caption--1,
  .hero-story__step--1 {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-story__scene--1 .hero-story__art {
    transform: none !important;
  }

  .hero-story__scene--2,
  .hero-story__scene--3,
  .hero-story__scene--4,
  .hero-story__scene--5,
  .hero-story__caption--2,
  .hero-story__caption--3,
  .hero-story__caption--4,
  .hero-story__caption--5 {
    opacity: 0 !important;
  }

  .hero-story__step--1 {
    color: #fff !important;
    border-color: #e85d04 !important;
    background: linear-gradient(135deg, #ff8a3d, #e85d04) !important;
  }

  .hero-story__progress i {
    width: 20%;
    transform: none;
  }
}
