/* ===========================
   INDEX.CSS — Scrollytelling Homepage  (FIXED)
   =========================== */

/* ---------- 3D Canvas (fixed background) ---------- */
#car-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  /* FIX: start fully visible; GSAP will control opacity smoothly via scrub */
  opacity: 1;
  /* Smooth transition acts as a safety net for non-GSAP opacity changes */
  transition: opacity 0.6s ease;
  will-change: opacity;
}

/* ---------- Scroll container ---------- */
#scroll-container {
  position: relative;
  z-index: 1;
}

/* ---------- Scroll sections ---------- */
.scroll-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem 1.5rem;
}

.section-content {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Hero section ---------- */
.hero-section {
  text-align: center;
  padding-top: calc(var(--header-height, 80px) + 2rem);
}

.hero-main-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: #fff;
  margin: 0 0 1.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  font-weight: 700;
}

.hero-buttons {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  font-size: 1rem;
  padding: 0.7rem 1.6rem;
  text-shadow: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

/* Scroll indicator */
.scroll-indicator {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
}

.scroll-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

@keyframes scrollBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

/* ---------- Section split (title + text side by side) ---------- */
.section-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.section-title {
  font-family: var(--brand-font);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 4px;

  /* Initial hidden state — GSAP fromTo overrides these explicitly */
  opacity: 0;
  will-change: transform, opacity;
}

.section-text {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 600px;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);

  /* Initial hidden state */
  opacity: 0;
  will-change: transform, opacity;
}

/* Direction hints — read by JS to know starting translateX */
.from-left {
  transform: translateX(-120px);
}

.from-right {
  transform: translateX(120px);
}

/* ---------- News card ---------- */
.news-card {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 700px;
  margin: 0 auto;

  /* Initial hidden state */
  opacity: 0;
  transform: scale(0.9) translateY(40px);
  will-change: transform, opacity;
}

.news-title {
  font-family: var(--brand-font);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--accent);
  margin: 0 0 1.5rem;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.news-body {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.news-image-wrap {
  flex: 0 0 120px;
}

.news-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.news-text-wrap {
  flex: 1;
}

.news-announcement {
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.news-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 0.8rem;
  line-height: 1.6;
}

.news-greeting {
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0;
  font-style: italic;
  font-weight: 600;
}

/* ---------- KPI Section ---------- */
.kpi-section {
  min-height: 50vh;
}

.kpis {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;

  /* Initial hidden state */
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

.kpi-card {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  text-align: center;
  min-width: 140px;
  flex: 1;
  max-width: 220px;
}

.kpi-card strong {
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.kpi-card p {
  color: #fff;
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
}

/* ---------- Splash screen ---------- */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: #b0b0b0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 500ms ease, visibility 500ms ease;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  color: #fff;
  padding: 0.9rem 1.5rem;
  width: 90%;
  max-width: 740px;
  position: relative;
  padding-top: 1.6rem;
}

.splash-title {
  font-family: "GreatsRaceItalic";
  font-size: 1.0rem;
  margin: 0 0 0.6rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}

.splash-letters {
  display: inline-block;
  line-height: 1;
}

.splash-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 220ms cubic-bezier(.2, .8, .2, 1),
    transform 220ms cubic-bezier(.2, .8, .2, 1);
  color: #fff;
  font-weight: 800;
  letter-spacing: 1px;
  will-change: transform, opacity;
  font-size: 2.4rem;
}

.splash-letter.space {
  width: 0.5rem;
  display: inline-block;
}

.splash-letter[data-index="0"],
.splash-letter[data-index="1"],
.splash-letter[data-index="2"] {
  color: var(--accent);
}

.splash-overlay.hidden .splash-letter {
  opacity: 1;
  transform: none;
}

.splash-bar {
  width: 100%;
  height: 14px;
  background: #3d3d3d;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
  margin-top: 0.6rem;
}

.splash-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 120ms linear;
}

.splash-percent {
  margin-top: 0.6rem;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

body.splash-active {
  overflow: hidden;
}

.splash-gif-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 3;
}

.splash-gif {
  max-width: 220px;
  width: 40%;
  height: auto;
  display: block;
  pointer-events: none;
}

.splash-car-wrap {
  position: absolute;
  left: 0;
  top: 9.0rem;
  width: 100%;
  height: 48px;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.splash-car {
  position: absolute;
  top: 0;
  left: 0;
  width: 84px;
  height: auto;
  transform: translateX(0);
  transition: left 120ms linear;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  pointer-events: none;
  display: block;
  object-fit: contain;
  background: transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .scroll-section {
    padding: 1.5rem 1rem;
  }

  .section-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .news-body {
    flex-direction: column;
    text-align: center;
  }

  .news-image-wrap {
    flex: none;
  }

  .news-card {
    padding: 1.5rem;
  }

  .kpi-card {
    min-width: 100px;
    padding: 1rem;
  }

  .kpi-card p {
    font-size: 1.4rem;
  }
}

@media (max-width: 600px) {
  .splash-car {
    width: 60px;
  }

  .splash-car-wrap {
    height: 40px;
    top: 2.2rem;
  }

  .splash-title {
    font-size: 1.6rem;
  }

  .splash-letter {
    font-size: 1.6rem;
  }

  .splash-gif {
    max-width: 140px;
    width: 48%;
  }
}

@media (max-width: 480px) {
  .kpis {
    flex-direction: column;
    align-items: center;
  }

  .kpi-card {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 430px) and (orientation: portrait) {
  .splash-gif {
    max-width: 80px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 0.4rem;
    pointer-events: none;
    z-index: 3;
  }

  .splash-car-wrap {
    top: 5.2rem;
    height: 48px;
    z-index: 1;
    overflow: visible;
  }

  .splash-car {
    width: 60px;
    top: 0;
    transition: left 120ms linear, top 120ms linear;
  }

  .splash-title {
    font-size: 1.6rem;
  }

  .splash-letter {
    font-size: 1.6rem;
  }
}