/* effects.css — Estados dos efeitos de scroll (GSAP) e fallbacks */

/* Enquanto o GSAP controla, elementos de reveal começam invisíveis.
   Sem GSAP / reduced-motion (html.fx-off) tudo fica visível. */
html.fx-on [data-reveal],
html.fx-on [data-animate] { visibility: hidden; }

/* Título revelado palavra por palavra */
[data-split] .w { display: inline-block; white-space: pre; }
html.fx-on [data-split] .w { color: var(--split-from, var(--text-4)); }
html.fx-off [data-split] .w { color: inherit; }

/* === MARQUEE === */
.marquee {
  overflow: clip;
  padding-block: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  width: max-content;
  white-space: nowrap;
  padding-inline: 24px;
  will-change: transform;
}

.marquee-track span {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-1);
  line-height: 1;
}

.marquee-track span.dot {
  -webkit-text-stroke: 0;
  color: var(--accent);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 0;
}

.marquee-track span.solid { color: var(--accent); }

html.fx-off .marquee-track { animation: marquee-drift 40s linear infinite; }

@keyframes marquee-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-25%); }
}

/* === CAPÍTULOS (Como funciona) === */
.chapters { position: relative; }

.chapters-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
}

.chapters-visual,
.chapters-copy { position: relative; }

.chapter-visual,
.chapter-text { position: relative; }

.chapters-counter { display: none; }

@media (min-width: 1024px) {
  .chapters { height: 320vh; padding-block: 0; }

  .chapters-sticky {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .chapters-sticky .container { width: 100%; }
  .chapters-sticky .section-header { margin-bottom: clamp(24px, 4vh, 48px); }

  .chapters-track {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
    min-height: 380px;
  }

  .chapters-visual,
  .chapters-copy { display: grid; }

  .chapter-visual,
  .chapter-text {
    grid-area: 1 / 1;
    will-change: transform, opacity;
  }

  html.fx-on .chapter-visual:not([data-chapter="1"]),
  html.fx-on .chapter-text:not([data-chapter="1"]) { opacity: 0; visibility: hidden; }

  .chapters-counter {
    position: absolute;
    right: 0;
    bottom: -8px;
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-3);
  }

  .chapters-counter .chapters-current {
    font-size: var(--text-2xl);
    color: var(--text-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none !important; }
  .chapters { height: auto; }
  .chapters-sticky { position: static; height: auto; }
  .chapter-visual, .chapter-text { opacity: 1 !important; visibility: visible !important; }
}
