/* Variables de color */
:root {
  --navy: #0a1628;
  --blue: #1a3a6b;
  --accent: #e8a020;
  --white: #ffffff;
  --road: #1e2a3a;
  --stripe: #e8a020;
}

/* Reset y estilos base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  color: var(--white);
}

/* ── Fondo cielo ── */
#sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  background: linear-gradient(180deg, #001a4d 0%, #0a3a80 50%, #1a5a9b 100%);
  z-index: 1;
}

/* Estrellas */
.star {
  position: absolute;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
  border-radius: 50%;
  animation: twinkle var(--d) ease-in-out infinite;
  z-index: 2;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Nubes */
#clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 70%;
  z-index: 3;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: radial-gradient(ellipse 60% 40% at 50% 40%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  border-radius: 100px;
  animation: float var(--cd) linear infinite;
}

@keyframes float {
  0% { transform: translateX(-110vw); }
  100% { transform: translateX(110vw); }
}

/* ── CARRETERA ── */
.road-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(180deg, #1a2a3a 0%, #0d1620 100%);
  z-index: 4;
  overflow: hidden;
}

.road {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
    rgba(50, 70, 90, 0.6) 0%,
    rgba(30, 42, 58, 0.8) 50%,
    rgba(10, 20, 40, 1) 100%);
}

.road-stripe {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 80px,
      rgba(232, 160, 32, 0.7) 80px,
      rgba(232, 160, 32, 0.7) 100px
    );
  background-position: center 50%;
  background-size: auto 8px;
  background-repeat: repeat-x;
}

.road-dust {
  position: absolute;
  bottom: 30%;
  left: 0;
  width: 100%;
  height: 5%;
  background: linear-gradient(to bottom, rgba(200, 150, 100, 0.3), transparent);
  z-index: 5;
  pointer-events: none;
}

/* ── BUS ── */
.bus-track {
  position: absolute;
  bottom: 8%;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.bus {
  position: absolute;
  bottom: 0;
  left: -380px;
  animation: busMove 8s linear infinite;
}

@keyframes busMove {
  0% { left: -380px; }
  100% { left: 110%; }
}

.exhaust {
  position: absolute;
  bottom: 22px;
  right: -2px;
}

.puff {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(180, 180, 200, 0.55);
  border-radius: 50%;
  animation: puffOut var(--pd) ease-out infinite;
  bottom: 0;
}

@keyframes puffOut {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0.6; }
  100% { transform: translate(20px, -30px) scale(2.5); opacity: 0; }
}

/* ── CONTENEDOR PRINCIPAL ── */
.container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 150px;
  text-align: center;
  gap: 20px;
}

/* ── LOGO ── */
.logo-wrap {
  position: relative;
  z-index: 10;
  text-align: center;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrap img {
  height: auto;
  max-width: 540px;
  width: clamp(150px, 80vw, 500px);
  max-height: 150px;
  filter: drop-shadow(0 0 20px rgba(232, 160, 32, 0.45));
  animation: logoGlow 3.5s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { filter: drop-shadow(0 0 10px rgba(232, 160, 32, 0.3)); }
  to { filter: drop-shadow(0 0 28px rgba(232, 160, 32, 0.7)); }
}

/* ── CONTENIDO ── */
.content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 600px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(232, 160, 32, 0.12);
  border: 1px solid rgba(232, 160, 32, 0.35);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 3px;
  margin: 0 auto;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--white);
  letter-spacing: -0.01em;
  margin: 0;
}

h1 .accent { color: var(--accent); }

.subtitle {
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
  margin: 0;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ── BARRA DE PROGRESO ── */
.progress-wrap {
  max-width: 320px;
  margin: 0 auto;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
}

.progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(232, 160, 32, 0.3);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  animation: fillBar 3s ease-out 0.6s forwards;
}

@keyframes fillBar {
  to { width: 65%; }
}

/* ── CONTACTO ── */
.contact-strip {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.25s;
}

.contact-item:hover {
  color: var(--accent);
}

.contact-item svg {
  width: 14px;
  height: 14px;
  fill: var(--accent);
  flex-shrink: 0;
}

/* ── RESPONSIVE DESIGN ── */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
  h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
  }

  .progress-wrap {
    max-width: 280px;
  }
}

/* Móviles grandes (481px - 767px) */
@media (max-width: 768px) {
  body {
    justify-content: flex-start;
    padding-top: 20px;
  }

  .container {
    gap: 15px;
    padding: 15px;
  }

  .logo-wrap {
    margin-bottom: 10px;
  }

  .logo-wrap img {
    max-height: 100px;
    width: clamp(100px, 70vw, 350px);
  }

  .content {
    padding: 0 1rem;
    gap: 1rem;
  }

  h1 {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
  }

  .subtitle {
    font-size: clamp(0.85rem, 2vw, 1rem);
  }

  .progress-wrap {
    max-width: 250px;
  }

  .contact-item {
    font-size: 0.75rem;
  }

  #sky {
    height: 60%;
  }

  .road-wrap {
    height: 40%;
  }

  .bus-track {
    bottom: 10%;
    height: 100px;
  }

  .bus {
    left: -340px;
    animation: busMove 7s linear infinite;
  }

  .bus svg {
    width: 300px;
    height: auto;
  }
}

/* Móviles pequeños (320px - 480px) */
@media (max-width: 480px) {
  body {
    justify-content: flex-start;
    padding-top: 15px;
  }

  .container {
    gap: 12px;
    padding: 10px;
  }

  .logo-wrap {
    margin-bottom: 8px;
  }

  .logo-wrap img {
    max-height: 80px;
    width: clamp(80px, 60vw, 250px);
  }

  .content {
    padding: 0 0.8rem;
    gap: 0.8rem;
  }

  h1 {
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  }

  .badge {
    font-size: 0.65rem;
    padding: 5px 12px;
  }

  .subtitle {
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  }

  .progress-wrap {
    max-width: 220px;
  }

  .progress-bar {
    height: 4px;
  }

  .progress-label {
    font-size: 0.65rem;
  }

  .contact-item {
    font-size: 0.7rem;
    gap: 5px;
  }

  .contact-item svg {
    width: 12px;
    height: 12px;
  }

  #sky {
    height: 55%;
  }

  .road-wrap {
    height: 45%;
  }

  .bus-track {
    bottom: 12%;
    height: 80px;
  }

  .bus {
    left: -300px;
    animation: busMove 6s linear infinite;
  }

  .bus svg {
    width: 270px;
    height: auto;
  }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .container {
    gap: 10px;
    padding: 10px;
  }

  .logo-wrap {
    margin-bottom: 5px;
    max-height: 70px;
  }

  .logo-wrap img {
    max-height: 60px;
  }

  .content {
    gap: 0.5rem;
  }

  h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    margin: 0;
  }

  .subtitle {
    font-size: 0.8rem;
    margin: 0;
  }

  .progress-wrap {
    max-width: 200px;
  }

  .progress-bar {
    height: 3px;
  }

  .contact-item {
    font-size: 0.65rem;
    gap: 4px;
  }

  #sky {
    height: 50%;
  }

  .road-wrap {
    height: 50%;
  }

  .bus-track {
    bottom: 15%;
    height: 70px;
  }

  .bus {
    left: -280px;
    animation: busMove 5s linear infinite;
  }

  .bus svg {
    width: 250px;
    height: auto;
  }
}

/* Accesibilidad - Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
