/*
 * Homepage hero: the paper-plane journey.
 *
 * Two modes share this markup. Without the `journey-cinematic` class on <html>
 * (no WebGL, reduced motion, Save-Data, or the module failed to load) the hero
 * is a single static screen: sky gradient, headline and the calculator. With
 * it, the section grows to several viewports and the stage pins while
 * js/hero-journey.js drives the WebGL scene and the chapter copy from scroll.
 */

.journey {
  --j-ink: #0b1633;
  --j-ink-soft: #3a4763;
  --j-muted: #5b6784;
  --j-yellow: #ffc93c;
  --j-yellow-deep: #f5b400;
  --j-gutter: max(20px, calc((100vw - 1152px) / 2 + 32px));

  position: relative;
  /* Slide under the sticky navbar so the sky runs to the top of the window. */
  margin-top: -64px;
  background: linear-gradient(180deg, #6fa9ec 0%, #cfe4fb 58%, #eef6ff 100%);
  color: var(--j-ink);
  font-family: 'Poppins', sans-serif;
}

.journey-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  overflow: hidden;
}

/* ---------- Static sky (fallback, and the backdrop while WebGL loads) ---------- */

.journey-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 78% 38%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    radial-gradient(90% 30% at 30% 100%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    radial-gradient(70% 26% at 90% 96%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #5f9fea 0%, #cde3fb 62%, #f1f7ff 100%);
  transition: opacity 0.9s ease;
}

.journey-sky-plane {
  position: absolute;
  right: 12%;
  top: 30%;
  width: clamp(90px, 12vw, 170px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(11, 22, 51, 0.18));
  transform: rotate(-8deg);
  animation: journey-float 6s ease-in-out infinite;
}

@keyframes journey-float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-12px) rotate(-5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .journey-sky-plane { animation: none; }
}

.journey-canvas,
.journey-whiteout,
.journey-pins,
.journey-rail,
.journey-scroll-hint {
  display: none;
}

/* ---------- Chapters ---------- */

.journey-chapters {
  position: relative;
  display: flex;
  width: 100%;
}

.chapter {
  display: none;
  width: 100%;
  align-items: center;
  padding: 112px var(--j-gutter) 72px;
}

.chapter[data-chapter="0"] {
  display: flex;
}

.chapter-copy {
  position: relative;
  isolation: isolate;
  max-width: 560px;
}

/* A soft halo keeps the copy readable over any part of the scene. */
.chapter-copy::before {
  content: '';
  position: absolute;
  inset: -80px -120px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
}

.chapter-takeoff .chapter-copy {
  max-width: 720px;
}

.chapter-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--j-muted);
}

.chapter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--j-yellow);
  box-shadow: 0 0 0 4px rgba(255, 201, 60, 0.28);
}

.journey .chapter-title {
  margin: 14px 0 18px;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(40px, 5.8vw, 84px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--j-ink);
}

.journey .chapter-title-hero {
  font-size: clamp(42px, 5.2vw, 78px);
}

.chapter-title mark {
  color: inherit;
  padding: 0 0.06em;
  background: linear-gradient(transparent 58%, var(--j-yellow) 58%, var(--j-yellow) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.journey .chapter-text {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.55;
  color: var(--j-ink-soft);
}

.journey .chapter-text-large {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
  color: var(--j-ink);
}

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 22px;
}

.journey-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--j-ink);
  text-decoration: underline;
  text-decoration-color: rgba(11, 22, 51, 0.25);
  text-underline-offset: 5px;
}

.journey-link:hover {
  color: var(--j-ink);
  text-decoration-color: var(--j-yellow-deep);
}

.journey-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.journey-btn:hover {
  transform: translateY(-2px);
}

.journey-btn-primary {
  background: var(--j-yellow);
  color: var(--j-ink);
  box-shadow: 0 12px 28px -12px rgba(245, 180, 0, 0.9);
}

.journey-btn-primary:hover {
  background: #ffbf1a;
  color: var(--j-ink);
}

.journey-btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(11, 22, 51, 0.14);
  color: var(--j-ink);
}

.journey-btn-ghost:hover {
  background: #fff;
  color: var(--j-ink);
}

.journey-btn:focus-visible,
.journey-link:focus-visible,
.journey-rail button:focus-visible {
  outline: 2px solid var(--j-ink);
  outline-offset: 3px;
}

/* ---------- Calculator, restyled for the hero (markup and IDs unchanged) ---------- */

.journey .calculator-form {
  max-width: 580px;
  margin: 28px 0 0;
  padding: 10px 10px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 28px 60px -28px rgba(11, 22, 51, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.journey .form-row {
  gap: 8px;
}

.journey .form-input {
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f3f6fb;
  font-family: inherit;
  color: var(--j-ink);
}

.journey .form-input::placeholder {
  color: #7a859c;
}

.journey .form-input:focus {
  border-color: var(--j-yellow-deep);
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.35);
}

.journey .submit-btn {
  min-width: 190px;
  border-radius: 12px;
  background: var(--j-yellow);
  color: var(--j-ink);
  font-family: inherit;
  font-weight: 700;
}

.journey .submit-btn:hover {
  background: #ffbf1a;
  box-shadow: 0 12px 24px -10px rgba(245, 180, 0, 0.9);
}

.journey .loading-spinner {
  border-color: rgba(11, 22, 51, 0.2);
  border-top-color: var(--j-ink);
}

/* The toggle row and insurance badge carry inline styles from before. */
.journey #urlToggleContainer {
  margin-top: 10px !important;
}

.journey #insuranceBadge {
  margin-top: 6px !important;
  font-size: 13px !important;
}

.journey #insuranceBadge img {
  height: 22px !important;
}

/* ---------- Chapter extras ---------- */

.chapter-steps,
.chapter-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 30px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.chapter-steps li,
.chapter-route li {
  position: relative;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(11, 22, 51, 0.08);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--j-ink);
  transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

/* Connector between pills, sitting in the column gap. */
.chapter-steps li + li::before,
.chapter-route li + li::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -24px;
  width: 18px;
  height: 1.5px;
  background: rgba(11, 22, 51, 0.3);
}

.chapter-steps li {
  color: var(--j-muted);
}

.chapter-steps li.is-active {
  background: var(--j-yellow);
  box-shadow: none;
  color: var(--j-ink);
}

.chapter-route li:nth-child(2) {
  background: var(--j-ink);
  color: #fff;
  box-shadow: none;
}

/* ================= Cinematic mode ================= */

.journey-cinematic .journey {
  height: 600vh;
}

.journey-cinematic .journey-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}

.journey-cinematic .journey.is-ready .journey-sky {
  opacity: 0;
}

.journey-cinematic .journey-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.journey-cinematic .journey.is-ready .journey-canvas {
  opacity: 1;
}

.journey-cinematic .journey-whiteout {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, #fffaf2 0%, #fdf0de 100%);
}

.journey-cinematic .journey-chapters {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.journey-cinematic .chapter {
  display: flex;
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}

.journey-cinematic .chapter[data-chapter="0"] {
  opacity: 1;
  visibility: visible;
}

.journey-cinematic .chapter-copy {
  pointer-events: auto;
}

.journey-cinematic .chapter-centered {
  justify-content: center;
  align-items: flex-start;
  padding-top: 17vh;
  text-align: center;
}

.journey-cinematic .chapter-centered .chapter-copy {
  max-width: 820px;
}

.journey-cinematic .chapter-centered .chapter-text {
  margin: 0 auto;
}

/* Globe labels, positioned every frame from the 3D pins. */
.journey-cinematic .journey-pins {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.journey-pin {
  position: absolute;
  left: 0;
  top: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(11, 22, 51, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.journey-pin.is-visible {
  opacity: 1;
}

.journey-pin-home {
  background: var(--j-yellow);
  color: var(--j-ink);
}

.journey-cinematic .journey-scroll-hint {
  display: flex;
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--j-muted);
}

.journey-scroll-hint span {
  position: relative;
  width: 1.5px;
  height: 34px;
  overflow: hidden;
  background: rgba(11, 22, 51, 0.15);
}

.journey-scroll-hint span::after {
  content: '';
  position: absolute;
  left: 0;
  top: -50%;
  width: 100%;
  height: 50%;
  background: var(--j-ink);
  animation: journey-hint 1.8s ease-in-out infinite;
}

@keyframes journey-hint {
  to { top: 100%; }
}

/* Chapter rail */
.journey-cinematic .journey-rail {
  display: flex;
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 6px;
}

.journey-rail button {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.journey-rail button::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: rgba(11, 22, 51, 0.28);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.journey-rail button.is-active::before {
  background: var(--j-ink);
  transform: scale(1.45);
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.7);
}

.journey-rail button::after {
  content: attr(aria-label);
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--j-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.journey-rail button:hover::after,
.journey-rail button:focus-visible::after {
  opacity: 1;
}

/* ================= Small screens ================= */

@media (max-width: 767px) {
  .journey .chapter-title {
    font-size: clamp(36px, 11vw, 52px);
  }

  .journey .chapter-title-hero {
    font-size: clamp(40px, 12vw, 58px);
  }

  .journey .calculator-form {
    margin-top: 20px;
  }

  .journey .submit-btn {
    min-width: 0;
  }

  .chapter-copy::before {
    inset: -40px -24px;
  }

  .journey-cinematic .journey {
    height: 520vh;
  }

  /* Copy sits low; the plane is framed in the upper part of the screen. */
  .journey-cinematic .chapter,
  .journey-cinematic .chapter-centered {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 88px 16px calc(28px + env(safe-area-inset-bottom));
    text-align: left;
  }

  .journey-cinematic .chapter-centered .chapter-text {
    margin: 0;
  }

  .journey-cinematic .chapter::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62%;
    pointer-events: none;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 10%, rgba(255, 255, 255, 0));
  }

  .journey-cinematic .journey-rail,
  .journey-cinematic .journey-scroll-hint {
    display: none;
  }

  .chapter-steps,
  .chapter-route {
    gap: 8px 26px;
  }

  .journey-sky-plane {
    top: 16%;
    right: 10%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-scroll-hint span::after { animation: none; }
}

/* Lenis (smooth scroll), from its stylesheet minus the iframe rule, which
   would block clicks on the testimonial embeds. */
html.lenis,
html.lenis body {
  height: auto;
}

html.lenis {
  scroll-behavior: auto !important;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch] {
  overscroll-behavior: contain;
}
