/* Home video hero with preserved layout, fallback, and scroll-to-directory behavior. */
html:has(.journey) {
  scroll-behavior: auto;
}

body:has(.journey)::before {
  display: none;
}

.hero.journey {
  display: block;
  min-height: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: auto;
  background: #0c1015;
  border-bottom: 1px solid var(--line);
}

.journey-stage {
  position: relative;
  display: grid;
  align-items: center;
  height: clamp(500px, 56.25vw, calc(100svh - 76px));
  padding-bottom: 52px;
  isolation: isolate;
  overflow: clip;
}

.journey .journey-world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  aspect-ratio: auto;
  border-radius: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 68% 82%, rgba(42, 132, 172, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 50% at 88% 35%, rgba(118, 128, 142, 0.12), transparent 70%),
    linear-gradient(90deg, #0c1015 0%, #141a22 38%, #1c232c 72%, #222931 100%);
}

.journey .journey-world::before {
  display: none;
}

.journey .studio-canvas,
.journey .studio-poster,
.journey-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.journey .studio-poster {
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 100%);
}

.journey-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 16, 21, 0.96) 0%, rgba(12, 16, 21, 0.82) 28%, rgba(12, 16, 21, 0.18) 50%, transparent 66%),
    linear-gradient(180deg, rgba(12, 16, 21, 0.45) 0%, transparent 14%, transparent 84%, rgba(12, 16, 21, 0.65) 100%);
  z-index: 1;
}

.journey-content {
  position: relative;
  z-index: 2;
  padding-block: 56px;
  pointer-events: none;
}

.journey-content a {
  pointer-events: auto;
}

.journey-copy-stack {
  width: 46%;
  max-width: 560px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-4);
  border: 1px solid rgba(203, 213, 225, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(11, 14, 20, 0.80);
  color: #cbd5e1;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.journey-copy h1 {
  font-size: clamp(2.125rem, 3.8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-4);
  color: #f5f7fa;
  text-wrap: balance;
}

.journey-lead {
  color: #d6e0ec;
  font-size: clamp(0.96875rem, 1.15vw, 1.0625rem);
  line-height: 1.65;
  max-width: 46ch;
  margin: 0 0 var(--space-6);
  text-wrap: pretty;
}

.journey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  align-items: center;
  max-width: 46%;
  margin: 0;
}

.journey .button-primary {
  background: #00d4eb;
  color: #041318;
  border: 1px solid #00d4eb;
  border-radius: var(--radius-element);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 212, 235, 0.24);
  min-height: 44px;
}

.journey .button-primary:hover {
  background: #3ce6f9;
  border-color: #3ce6f9;
  transform: none;
}

.journey-about {
  min-height: 44px;
  font-size: var(--text-sm);
  color: #e2e8f0;
}

.journey-about:hover {
  color: #ffffff;
}

.journey-bottom {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.journey-scene-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #a6b7cc;
  text-shadow: 0 1px 10px rgba(12, 16, 21, 0.9);
}

.journey .motion-toggle {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid rgba(184, 201, 226, 0.3);
  background: rgba(12, 16, 21, 0.86);
  color: #e2eaf4;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.journey .motion-toggle:hover {
  color: #ffffff;
  border-color: rgba(184, 201, 226, 0.55);
  background: rgba(20, 27, 36, 0.94);
}

.journey ~ #proyectos {
  padding-top: 44px;
  scroll-margin-top: 0;
}

@media (max-width: 1000px) {
  .journey-stage {
    height: auto;
    min-height: min(560px, calc(100svh - 68px));
  }

  .journey-content {
    padding-block: 44px;
  }

  .journey-copy-stack {
    width: 48%;
    max-width: 420px;
  }

  .journey-copy h1 {
    font-size: clamp(2rem, 4.3vw, 2.75rem);
    margin-bottom: 16px;
  }

  .journey-lead {
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 22px;
  }

  .journey-actions {
    max-width: 48%;
    gap: 16px;
  }

  .journey .studio-poster,
  .hero-background-video {
    object-fit: cover;
    object-position: right center;
    mask-image: none;
  }

  .journey ~ #proyectos {
    padding-top: 32px;
  }
}

@media (min-width: 601px) and (max-width: 850px) {
  .journey .journey-world {
    background: #292c30;
  }

  .journey .studio-poster,
  .journey .hero-background-video {
    inset: auto 0 32px auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    mask-image: linear-gradient(180deg, transparent, #000 8%);
  }

  .journey-vignette {
    background:
      linear-gradient(90deg, rgba(12, 16, 21, 0.96), rgba(12, 16, 21, 0.78) 28%, rgba(12, 16, 21, 0.16) 50%, transparent 64%),
      linear-gradient(180deg, #0c1015, transparent 28%, transparent 87%, #0c1015);
  }
}

@media (max-width: 600px) {
  .journey-stage {
    display: block;
    min-height: 700px;
    padding-bottom: 370px;
  }

  .journey-content {
    padding-top: 32px;
    padding-bottom: 24px;
  }

  .journey-copy-stack {
    width: 100%;
    max-width: 480px;
  }

  .journey-copy h1 {
    font-size: clamp(2rem, 8vw, 2.625rem);
    max-width: 440px;
    margin-bottom: 16px;
  }

  .journey-lead {
    font-size: 0.9375rem;
    line-height: 1.65;
    max-width: 410px;
    margin-bottom: 22px;
  }

  .journey-actions {
    max-width: 100%;
    gap: 16px 20px;
  }

  .journey .journey-world {
    background: #292c30;
  }

  .journey-vignette {
    background: linear-gradient(
      180deg,
      #0c1015 0%,
      rgba(12, 16, 21, 0.97) 25%,
      rgba(12, 16, 21, 0.86) 35%,
      rgba(12, 16, 21, 0.42) 45%,
      transparent 59%,
      transparent 88%,
      #0c1015 100%
    );
  }

  .journey .studio-poster,
  .journey .hero-background-video {
    inset: auto 0 44px auto;
    width: 160%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: right bottom;
    mask-image: linear-gradient(180deg, transparent, #000 8%);
  }

  .journey-bottom {
    bottom: 12px;
    gap: 12px;
  }

  .journey .motion-toggle {
    min-height: 44px;
    padding: 8px 14px;
  }
}

.hero-background-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 100%);
  pointer-events: none;
  opacity: 0;
}

.is-video-ready .hero-background-video {
  opacity: 1;
}

.is-video-ready .journey-picture {
  opacity: 0;
}

.journey .motion-toggle[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-background-video {
    display: none;
  }

  .video-hero .journey-picture {
    opacity: 1 !important;
  }
}

@media print {
  .journey-world,
  .journey-vignette,
  .journey-bottom {
    display: none !important;
  }

  .journey-stage {
    display: block;
    aspect-ratio: auto;
    min-height: 0;
    padding: 0;
  }

  .journey-content {
    padding: 25px 0;
  }

  .journey-copy-stack {
    width: 100%;
  }

  .journey-copy h1 {
    color: #000000;
  }
}
