/* ==========================================================================
   ICOSIOR — Hero Sequence Styles
   Hardware canvas frame-scrub with linear progress, 4-act caption layers,
   and seamless gradient blend into following content.
   ========================================================================== */

.ico-seq {
  --ico-cyan: var(--cyan, #00f0ff);
  --ico-violet: var(--violet, #8b5cf6);
  --ico-lime: var(--lime, #c8ff35);
  --ico-text: var(--text, #f8fafc);
  --ico-muted: var(--muted, #94a3b8);
  --progress: 0;

  position: relative;
  /* Scroll distance proportional to frame count (139 frames): ~5.5-6 viewport heights */
  height: calc(139 * 4.2svh);
  background: #000;
  color: var(--ico-text);
  font-family: var(--font-sans);
  cursor: default;
  contain: paint layout;
}

.ico-seq__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ico-seq__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* Atmospheric vignette & bottom blend into #030305 page background */
.ico-seq__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0, 0, 0, calc(0.48 - var(--progress) * 0.2)) 0%, transparent 75%),
    radial-gradient(ellipse at center, transparent 50%, rgba(3, 3, 5, 0.7) 100%),
    linear-gradient(to bottom, rgba(3, 3, 5, 0.6) 0%, transparent 16%, transparent 72%, rgba(3, 3, 5, 0.95) 94%, #030305 100%);
}

/* Captions: GPU-only transform & opacity transitions (zero blur-filter repaints) */
.ico-seq__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--pad);
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 3;
}

.ico-seq__caption.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.ico-seq__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ico-cyan);
  margin-bottom: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ico-seq__eyebrow::before,
.ico-seq__eyebrow::after {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.ico-seq__title {
  font-family: var(--font-head);
  font-size: clamp(2.3rem, 5.8vw, 5.2rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 54rem;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.85);
  text-wrap: balance;
}

.ico-seq__title em {
  font-style: normal;
  background: linear-gradient(120deg, #fff 0%, var(--ico-cyan) 45%, var(--ico-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ico-seq__sub {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--ico-muted);
  max-width: 42rem;
  margin: 1.4rem auto 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.95);
  text-wrap: balance;
}

.ico-seq__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.8rem;
}

.ico-seq__pills span {
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ico-text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ico-seq__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.ico-seq__btn {
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.ico-seq__btn:hover {
  transform: translateY(-2px);
}
.ico-seq__btn--primary {
  background: var(--ico-cyan);
  color: #020204;
  box-shadow: 0 0 30px var(--cyan-glow);
}
.ico-seq__btn--primary:hover {
  background: #fff;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
}
.ico-seq__btn--ghost {
  border: 1px solid var(--border-strong);
  background: rgba(10, 14, 24, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ico-text);
}
.ico-seq__btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Scroll hint indicator */
.ico-seq__hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ico-muted);
  opacity: calc(1 - var(--progress) * 8);
  pointer-events: none;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.25s ease;
}
.ico-seq__hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--ico-cyan), transparent);
  animation: ico-hint 1.8s ease-in-out infinite;
}
@keyframes ico-hint {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Preload progress bar */
.ico-seq__loader {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.6s ease;
  z-index: 10;
}
.ico-seq__loader.is-done {
  opacity: 0;
  pointer-events: none;
}
.ico-seq__loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ico-cyan), var(--ico-violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.12s linear;
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .ico-seq {
    height: calc(139 * 3.4svh);
  }
  .ico-seq__title {
    font-size: clamp(2rem, 8.5vw, 3.2rem);
  }
  .ico-seq__sub {
    font-size: 0.95rem;
  }
  .ico-seq__pills span {
    font-size: 0.75rem;
    padding: 0.4rem 0.85rem;
  }
  .ico-seq__ctas {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }
  .ico-seq__btn {
    width: 100%;
    justify-content: center;
  }
}

/* Reduced motion fallback: unpin stage and show static frame & stacked captions */
@media (prefers-reduced-motion: reduce) {
  .ico-seq {
    height: auto !important;
  }
  .ico-seq__sticky {
    position: relative !important;
    height: auto !important;
    min-height: 80vh;
    padding: 100px 0 60px;
  }
  .ico-seq__caption {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    margin-bottom: 40px;
  }
  .ico-seq__hint,
  .ico-seq__loader {
    display: none !important;
  }
}
