/* =============================================================
   Chaitus Media — hero-3d.css
   Hero is a full-bleed GIF with overlaid editorial text. Slow
   parallax + fade on the copy as the user scrolls past.
   File name kept as hero-3d.css for backwards-compat with the
   enqueue handle; behavior is now GIF-driven, not canvas-driven.
============================================================= */

.cm-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: var(--cm-night);
  color: var(--cm-paper);
  isolation: isolate;
}

.cm-hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cm-hero__gif,
.cm-hero__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Slow zoom for life — 18s loop matches the editorial pace. */
  animation: cm-hero-breathe 18s var(--cm-ease-in-out) infinite alternate;
}

.cm-hero__fallback {
  display: none;
}

@keyframes cm-hero-breathe {
  0%   { transform: scale(1.02); }
  100% { transform: scale(1.08); }
}

/* Soft cinematic vignette so the headline always reads. */
.cm-hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 25%, rgba(13, 10, 7, 0.55) 100%),
    linear-gradient(180deg, rgba(13, 10, 7, 0.55) 0%, transparent 25%, transparent 65%, rgba(13, 10, 7, 0.7) 100%);
}

.cm-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  pointer-events: none;
  color: var(--cm-paper);
}

.cm-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  max-width: 1100px;
  /* JS adds is-ready after first paint to fade the copy in. */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s var(--cm-ease-out), transform 1.4s var(--cm-ease-out);
}
.cm-hero.is-ready .cm-hero__copy,
.cm-hero__copy.is-ready {
  opacity: 1;
  transform: translateY(0);
}

.cm-hero__eyebrow {
  font-size: var(--cm-text-xs);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  margin: 0;
  color: rgba(250, 248, 245, 0.78);
  padding-left: 0.5em;
  text-shadow: 0 2px 12px rgba(13, 10, 7, 0.4);
}

.cm-hero__headline {
  font-family: var(--cm-font-display);
  font-weight: 300;
  font-size: clamp(3.5rem, 12vw, 11rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--cm-paper);
  text-wrap: balance;
  text-shadow: 0 4px 30px rgba(13, 10, 7, 0.5);
}

.cm-hero__sub {
  font-family: var(--cm-font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  letter-spacing: 0.01em;
  margin: 0.5rem 0 0;
  color: rgba(250, 248, 245, 0.9);
  text-shadow: 0 2px 18px rgba(13, 10, 7, 0.5);
}

.cm-hero__indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: rgba(250, 248, 245, 0.7);
}
.cm-hero__indicator-label {
  font-size: var(--cm-text-xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.cm-hero__indicator-line {
  display: block;
  width: 1px;
  height: 50px;
  background: linear-gradient(180deg, rgba(250, 248, 245, 0.7), transparent);
  position: relative;
  overflow: hidden;
}
.cm-hero__indicator-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  background: var(--cm-paper);
  animation: cm-hero-tick 2.4s var(--cm-ease-in-out) infinite;
}

@keyframes cm-hero-tick {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(120%); }
  100% { transform: translateY(120%); }
}

.cm-hero__metaline {
  position: absolute;
  bottom: 2.5rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: var(--cm-text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(250, 248, 245, 0.65);
  text-shadow: 0 1px 6px rgba(13, 10, 7, 0.4);
}
.cm-hero__metaline-divider { opacity: 0.45; }

@media (max-width: 768px) {
  .cm-hero__metaline {
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    width: max-content;
    max-width: 90%;
  }
  .cm-hero__indicator { bottom: 6rem; }
}

/* Reduced motion — no breathing zoom, swap to fallback if provided. */
@media (prefers-reduced-motion: reduce) {
  .cm-hero__gif,
  .cm-hero__fallback {
    animation: none;
    transform: none;
  }
  .cm-hero__copy {
    opacity: 1;
    transform: none;
  }
  .cm-hero__indicator { display: none; }
}
