/* ── Gridgeist Splash Intro ── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070a0e;
  overflow: hidden;
}

.splash[hidden] { display: none; }

/* ── Light sweep (headlight pass) ── */
.splash__sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.splash__sweep::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(to bottom, transparent 15%, #f26b3a 50%, transparent 85%);
  box-shadow: 0 0 80px 25px rgba(242, 107, 58, 0.35);
  animation: sweep 0.45s cubic-bezier(0.4, 0, 0.15, 1) forwards;
}

@keyframes sweep {
  0%   { left: -5%; opacity: 0.9; }
  100% { left: 110%; opacity: 0; }
}

/* ── Scene container ── */
.splash__scene {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  animation: scene-impact 0.12s ease 0.3s;
}

@keyframes scene-impact {
  0%, 100% { transform: translateX(0); }
  30%      { transform: translateX(-5px); }
  70%      { transform: translateX(3px); }
}

/* ── Track area ── */
.splash__track {
  position: relative;
  width: 160px;
  height: 100px;
  flex-shrink: 0;
}

/* ── Grid marks (slam in from left with motion trail) ── */
.splash__mark {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #f26b3a;
  opacity: 0;
  transform: translateX(-350px) scaleX(3);
  animation: mark-slam 0.32s cubic-bezier(0.22, 1.5, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 0.055s + 0.12s);
}

@keyframes mark-slam {
  0% {
    opacity: 0;
    transform: translateX(-350px) scaleX(3);
    box-shadow: 100px 0 30px rgba(242, 107, 58, 0.4);
  }
  60% {
    opacity: var(--op);
    transform: translateX(6px) scaleX(0.9);
    box-shadow: 0 0 12px rgba(242, 107, 58, 0.25);
  }
  80% {
    transform: translateX(-2px) scaleX(1.02);
  }
  100% {
    opacity: var(--op);
    transform: translateX(0) scaleX(1);
    box-shadow: 0 0 0 transparent;
  }
}

/* ── Kerbs (track boundaries) ── */
.splash__kerb {
  position: absolute;
  left: 0;
  width: 100%;
  height: 5px;
  display: flex;
  gap: 5px;
  clip-path: inset(0 100% 0 0);
  animation: kerb-draw 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.58s;
}

.splash__kerb--top    { top: 0; }
.splash__kerb--bottom { bottom: 0; }

.splash__kerb span {
  flex: 1;
  border-radius: 1.5px;
  background: #f26b3a;
}

.splash__kerb span:nth-child(1) { opacity: .50; }
.splash__kerb span:nth-child(2) { opacity: .32; }
.splash__kerb span:nth-child(3) { opacity: .20; }
.splash__kerb span:nth-child(4) { opacity: .12; }
.splash__kerb span:nth-child(5) { opacity: .07; }
.splash__kerb span:nth-child(6) { opacity: .04; }

@keyframes kerb-draw {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* ── Start/finish line ── */
.splash__startline {
  position: absolute;
  left: 2px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(236, 242, 248, 0.35) 0px,
    rgba(236, 242, 248, 0.35) 4px,
    transparent 4px,
    transparent 10px
  );
  opacity: 0;
  animation: startline-flash 0.4s ease forwards;
  animation-delay: 0.7s;
}

@keyframes startline-flash {
  0%  { opacity: 0; }
  35% { opacity: 0.8; }
  100%{ opacity: 0.2; }
}

/* ── Wordmark ── */
.splash__wordmark {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.splash__word {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 52px;
  line-height: 1;
  opacity: 0;
  white-space: nowrap;
}

.splash__word--grid {
  color: #f26b3a;
  letter-spacing: 0.34em;
  animation: text-slam 0.28s cubic-bezier(0.22, 1.25, 0.36, 1) forwards;
  animation-delay: 0.82s;
}

.splash__word--geist {
  color: #ecf2f8;
  letter-spacing: 0.15em;
  animation: ghost-materialize 0.55s ease forwards;
  animation-delay: 1.0s;
}

@keyframes text-slam {
  0% {
    opacity: 0;
    transform: translateX(-50px) scale(1.2);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes ghost-materialize {
  0% {
    opacity: 0;
    filter: blur(18px);
    letter-spacing: 0.5em;
  }
  45% {
    opacity: 0.6;
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    letter-spacing: 0.15em;
  }
}

/* ── Ambient glow ── */
.splash__glow {
  position: absolute;
  width: 500px;
  height: 300px;
  border-radius: 30px;
  background: radial-gradient(ellipse, rgba(242, 107, 58, 0.18) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  animation: glow-surge 0.7s ease forwards;
  animation-delay: 0.85s;
}

@keyframes glow-surge {
  0%  { opacity: 0; transform: scale(0.3); }
  40% { opacity: 1; }
  100%{ opacity: 0.35; transform: scale(1.4); }
}

/* ── Content wrapper (scene + button) ── */
.splash__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* ── Enter button ── */
.splash__enter {
  opacity: 0;
  background: transparent;
  border: 1.5px solid rgba(236, 242, 248, 0.35);
  color: #ecf2f8;
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 999px;
  cursor: pointer;
  animation: enter-appear 0.5s ease forwards;
  animation-delay: 1.8s;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.splash__enter:hover {
  border-color: #f26b3a;
  color: #f26b3a;
  box-shadow: 0 0 20px rgba(242, 107, 58, 0.2);
}

@keyframes enter-appear {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Ringrider crossfade logo ── */
.splash__ringrider {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 2;
}

.splash__ringrider--visible {
  opacity: 1;
}

/* ── Scene fade-out ── */
.splash__content {
  transition: opacity 0.4s ease;
}

.splash__content--hidden {
  opacity: 0;
}

/* ── Exit ── */
.splash--exit {
  animation: splash-out 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes splash-out {
  0%   { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.08); filter: blur(4px); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .splash__scene {
    flex-direction: column;
    gap: 20px;
  }

  .splash__track {
    width: 140px;
    height: 88px;
  }

  .splash__mark {
    width: 15px;
    height: 15px;
  }

  .splash__word {
    font-size: 36px;
  }
}
