/* Mobile-only first-screen corrections. Desktop layout is intentionally left
   to the existing stylesheets. */

/* The artwork is mirrored by the desktop wrapper and mirrored back by each
   slide. Keep that orientation constant in every carousel state. Only the
   opacity changes, including while crossing the responsive breakpoint. */
.hero-slide,
.hero-slide.is-active,
.hero-slide.is-leaving,
.hero-slide.is-entering {
  transform: none !important;
  transition: opacity .42s ease !important;
}
.hero-slide.is-entering { animation: hero-crossfade .42s ease both !important; }
@keyframes hero-crossfade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (min-width: 821px) {
  .hero-slide,
  .hero-slide.is-active,
  .hero-slide.is-leaving,
  .hero-slide.is-entering { transform: scaleX(-1) !important; }
}

@media (hover: none), (pointer: coarse) {
  .floating-entries,
  .whole-weather-panel,
  .weather-preview-card { display: none !important; }

}

/* Phone portrait: separate copy, actions and artwork into clear regions. */
@media (max-width: 600px) {
  .floating-entries,
  .whole-weather-panel,
  .weather-preview-card { display: none !important; }

  .hero { height: max(650px, calc(100svh - 68px)); min-height: 0; }
  .hero-content {
    position: relative;
    z-index: 4;
    align-items: center;
    height: 100%;
    padding-top: clamp(24px, 4.5svh, 42px);
    padding-bottom: 250px;
  }
  .hero-content > .eyebrow,
  .hero-content > h1,
  .hero-content > .hero-description,
  .hero-content > .hero-primary {
    width: min(100%, 360px);
    text-align: center;
  }
  .hero-content > .eyebrow { justify-content: center; }
  .hero .age-badge { top: 10px; right: auto; bottom: auto; left: 10px; width: 42px; }
  .hero h1 { margin-top: 10px; font-size: clamp(36px, 10.5vw, 46px); line-height: 1.1; }
  .hero-content > .hero-description {
    max-width: 21em;
    margin: 10px auto 0;
    font-size: 13px;
    line-height: 1.5;
  }
  .hero-primary { width: min(100%, 350px); margin-top: 13px; }
  .hero-primary .button { min-height: 54px; padding-block: 10px; font-size: 19px; }
  .hero-primary p.hero-web-label { margin-top: 7px; }
  .hero-trust { margin-top: 8px; padding-top: 8px; }
  .hero-trust span { padding-inline: 7px; font-size: 10px; }
  .hero-mobile-downloads { gap: 7px; margin-top: 8px; }
  .hero-mobile-card { min-height: 58px; padding: 7px; }
  .hero-mobile-card img { width: 28px; height: 28px; }
  .hero-mobile-copy strong { font-size: 11px; }
  .hero-mobile-copy small { font-size: 9px; }
  .hero-mobile-badge { padding: 2px 4px; font-size: 8px; }

  .hero-art {
    top: auto;
    right: 50%;
    bottom: 24px;
    left: auto;
    width: min(112%, 560px);
    height: min(64vw, 280px);
    aspect-ratio: auto;
    translate: 50% 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent),
                        linear-gradient(180deg, transparent, #000 15%, #000 82%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent),
                linear-gradient(180deg, transparent, #000 15%, #000 82%, transparent);
    mask-composite: intersect;
  }
  .hero-slide { background-position: center 42%; }
  .hero-shade {
    background: linear-gradient(0deg, #1f1f1f 0%, transparent 13%, transparent 32%, #1f1f1f 47%) !important;
  }
  .hero-carousel-controls {
    z-index: 5;
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 50%;
    width: max-content;
    justify-content: center;
    transform: translateX(-50%);
  }
}

@media (max-width: 380px), (max-height: 700px) and (max-width: 600px) {
  .header { height: 60px; }
  .header-inner { padding-inline: 12px; }
  .header nav { top: 59px; }
  .brand img { width: 38px; height: 38px; }
  .brand b { font-size: 18px; }
  .language-switcher summary { padding: 6px; font-size: 12px; }
  .menu-button { padding-inline: 4px; font-size: 23px; }
  .hero { height: max(590px, calc(100svh - 60px)); }
  .hero-content { padding-top: 9px; padding-bottom: 170px; }
  .hero-content > .eyebrow { font-size: 8px; }
  .hero .age-badge { top: 7px; left: 7px; width: 34px; }
  .hero h1 { margin-top: 5px; font-size: 31px; line-height: 1.07; }
  .hero-content > .hero-description { margin-top: 5px; font-size: 11px; line-height: 1.4; }
  .hero-primary { margin-top: 7px; }
  .hero-primary .button { min-height: 44px; padding-block: 7px; font-size: 16px; }
  .hero-primary p.hero-web-label { margin-top: 4px; font-size: 9px; }
  .hero-trust { display: none; }
  .hero-mobile-downloads { margin-top: 6px; }
  .hero-mobile-card { min-height: 46px; padding: 5px; }
  .hero-mobile-card img { width: 22px; height: 22px; }
  .hero-art { bottom: 0; height: min(31svh, 180px); }
  .hero-carousel-controls { bottom: max(5px, env(safe-area-inset-bottom)); gap: 5px; }
  .hero-carousel-controls button { min-width: 27px; height: 27px; }
  .hero-carousel-controls .hero-carousel-toggle { min-width: 43px; }
}

/* iPhone landscape: fit the complete hero below a compact header. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  body {
    background: #171717;
  }
  .header { height: 56px; background: #171717f7; }
  .header-inner {
    width: 100%;
    max-width: none;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    gap: 8px;
  }
  .header nav { top: 55px; }
  .brand img { width: 38px; height: 38px; }
  .brand b { font-size: 18px; }
  .language-switcher summary { padding: 6px; font-size: 12px; }
  .menu-button { padding-inline: 4px; font-size: 22px; }

  .hero {
    width: 100vw;
    height: calc(100svh - 56px);
    min-height: 0;
    margin-inline: 0;
  }
  .hero-content {
    position: relative;
    z-index: 4;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    padding: 4px max(18px, env(safe-area-inset-right)) 6px 50%;
  }
  .hero-content > .eyebrow,
  .hero-content > h1,
  .hero-content > .hero-description,
  .hero-content > .hero-primary {
    width: min(100%, 330px);
    text-align: center;
  }
  .hero-content > .eyebrow { justify-content: center; font-size: 8px; }
  .hero .age-badge { top: 8px; left: 8px; width: 34px; }
  .hero h1 { margin-top: 4px; font-size: clamp(26px, 6vh, 36px); line-height: 1.04; }
  .hero-content > .hero-description { margin-top: 4px; font-size: 10px; line-height: 1.35; }
  .hero-primary { margin-top: 6px; }
  .hero-primary .button { min-height: 38px; padding: 5px 16px; font-size: 15px; }
  .hero-primary p.hero-web-label { margin-top: 3px; font-size: 8px; }
  .hero-trust { margin-top: 5px; padding-top: 5px; }
  .hero-trust span { padding-inline: 5px; font-size: 8px; }
  .hero-mobile-downloads { gap: 6px; margin-top: 5px; }
  .hero-mobile-card { min-height: 40px; padding: 4px 6px; border-radius: 10px; }
  .hero-mobile-card img { width: 22px; height: 22px; padding: 2px; }
  .hero-mobile-copy { gap: 1px; }
  .hero-mobile-copy strong { font-size: 9px; }
  .hero-mobile-copy small { font-size: 8px; }
  .hero-mobile-badge { padding: 1px 3px; font-size: 7px; }

  .hero-art {
    inset: 0 auto 0 0;
    width: 66%;
    height: 100%;
    translate: 0;
    /* A single horizontal mask avoids a hard seam on mobile WebKit. */
    -webkit-mask-image: linear-gradient(to right, #000 48%, transparent 100%);
    mask-image: linear-gradient(to right, #000 48%, transparent 100%);
  }
  .hero-slide { background-position: center; }
  .hero-shade {
    background: linear-gradient(270deg, #1f1f1f 0%, #1f1f1feb 31%, #1f1f1f91 45%, transparent 68%),
                linear-gradient(0deg, #1f1f1f 0%, transparent 16%) !important;
  }
  .hero-carousel-controls {
    z-index: 5;
    right: auto;
    bottom: max(6px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    gap: 5px;
    transform: none;
  }
  .hero-carousel-controls button { min-width: 26px; height: 26px; }
  .hero-carousel-controls .hero-carousel-toggle { min-width: 42px; }

  /* Fit the browser-launch dialog into a short landscape viewport while
     keeping every control reachable; longer dialogs remain scrollable. */
  #modal {
    width: min(480px, calc(100% - 32px));
    max-height: calc(100svh - 20px);
    padding: clamp(12px, 4svh, 18px);
    overflow: auto;
  }
  #modal .modal-close { top: 6px; right: 8px; }
  #modal .modal-eyebrow { margin-bottom: 3px; font-size: 9px; }
  #modal h2 {
    margin: 3px 36px 8px 0;
    padding-bottom: 7px;
    font-size: clamp(18px, 5svh, 23px);
  }
  #modal .launch-state { padding: 8px 12px; }
  #modal .launch-state > span { font-size: 21px; line-height: 1; }
  #modal .launch-state p { margin: 6px 0; font-size: 12px; line-height: 1.4; }
  #modal .launch-state .button { min-height: 38px; margin-top: 4px; padding: 5px 18px; font-size: 13px; }
}

/* Above the desktop breakpoint the artwork wrapper is mirrored; reverse the
   mask so its transparent edge still faces the copy on the right. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) and (min-width: 821px) {
  .hero-art {
    -webkit-mask-image: linear-gradient(to left, #000 48%, transparent 100%);
    mask-image: linear-gradient(to left, #000 48%, transparent 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide.is-entering { animation: none !important; }
}
