/* Review proposal: keep the approved type scale and let the hero fit its content. */
:root {
  --hero-inline-space: 40px;
  --hero-menu-space: 40px;
  --hero-menu-control-height: 56px;
  --hero-nav-clearance: 48px;
  --hero-content-bottom: 40px;
}
.hero__header {
  padding: var(--hero-menu-space);
}
.hero {
  scroll-margin-top: 8px;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--hero-menu-space) + var(--hero-menu-control-height)
    + var(--hero-nav-clearance));
  padding-bottom: var(--hero-content-bottom);
}
.hero__content {
  position: relative;
  bottom: auto;
  left: var(--hero-inline-space);
}
/* Preserve the photo's head and foot room on wide, short screens.
   The original photograph is close to 1.9:1; allow only a small vertical crop.
   Content may still make the hero taller when it needs more space. */
@media (min-width: 641px) {
  .hero {
    min-height: max(min(712px, 90svh), calc((100vw - 16px) / 2));
  }
}
@media (max-width: 1120px) {
  :root {
    --hero-inline-space: 32px;
    --hero-menu-space: 32px;
    --hero-content-bottom: 32px;
  }
}
@media (max-width: 640px) {
  :root {
    --hero-inline-space: 0px;
    --hero-menu-space: 16px;
    --hero-content-bottom: 0px;
  }
  .hero {
    height: auto;
    min-height: clamp(620px, calc(100svh - 8px), 724px);
  }
  .hero__content {
    width: 100%;
  }
  .hero h1 {
    max-height: none;
    overflow: visible;
  }
}

/* Paso 03: allow 2.5 seconds after the title settles before confirming purchase.
   Shift confirmation, veil, summary and timeline end together by 2350ms. */
.virtual-card-sequence .is-playing .purchase-review-screen__cta {
  animation-delay: 10250ms;
}
.virtual-card-sequence .is-playing .phone-success-transition__veil {
  animation-delay: 10610ms;
}
.virtual-card-sequence .is-playing .phone-screen-summary,
.virtual-card-sequence .is-playing .phone-screen-summary-cta-mask {
  animation-delay: 10870ms;
}
@media (max-width: 767.98px) {
  .virtual-card-mobile__card--step-3.is-mobile-active .purchase-review-screen__cta {
    animation-delay: 3400ms;
  }
  .virtual-card-mobile__card--step-3.is-mobile-active .phone-success-transition__veil {
    animation-delay: 3770ms;
  }
  .virtual-card-mobile__card--step-3.is-mobile-active .phone-screen-summary,
  .virtual-card-mobile__card--step-3.is-mobile-active .phone-screen-summary-cta-mask {
    animation-delay: 4190ms;
  }
}

/* Open the physical-card review directly, without traversing pinned steps. */
html:has(#physical-card-section:target) {
  scroll-behavior: auto;
}

/* Mobile card: keep copy, photograph and CTA in independent layout rows. */
@media (max-width: 599px) {
  .physical-card {
    display: grid;
    grid-template-areas: "heading" "media" "cta";
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    height: auto;
    padding: 24px;
    background: linear-gradient(145deg, #f3f4f7, #ffffff 60%, #f0f2f5);
  }
  .physical-card__header {
    grid-area: heading;
    position: static;
    padding: 0;
  }
  .physical-card > picture {
    grid-area: media;
    position: relative;
    display: block;
    justify-self: center;
    width: min(100%, 344px);
    aspect-ratio: 1376 / 1900;
    overflow: hidden;
    /* Feather only the background edges of the photo into the surface. */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%,
      #000 88%, transparent),
      linear-gradient(to bottom, transparent, #000 3%,
      #000 92%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%,
      #000 88%, transparent),
      linear-gradient(to bottom, transparent, #000 3%,
      #000 92%, transparent);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
  .physical-card__background {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    object-position: center 68%;
  }
  .physical-card__cta {
    grid-area: cta;
    position: static;
    justify-self: start;
    max-width: 100%;
  }
}

/* Keep the top edge of the desktop card inside the shorter desktop frame. */
@media (min-width: 1280px) and (max-width: 1919px) {
  .physical-card__background {
    object-position: center 47%;
  }
}

/* Notification is optional; reserve the text and CTA area before revealing it. */
.hero:not([data-notification-fit="visible"]) .payment-notifications {
  visibility: hidden;
}

/* Grow the complete statement composition beyond the former 48px ceiling.
   Keep the established layout below 1524px and cap growth on very wide screens. */
@media (min-width: 1524px) {
  .statement-sequence {
    --statement-font-size: clamp(48px, 3.15vw, 88px);
    --statement-visual-size: calc(var(--statement-font-size) * 5.708333333);
    --statement-list-gap: calc(var(--statement-font-size) / 3);
  }
  .auto-screen__headline {
    line-height: var(--statement-row-height);
  }
  .auto-visual__reveal,
  .auto-visual__track {
    width: var(--statement-visual-size);
  }
  .auto-visual__panel {
    width: var(--statement-visual-size);
    height: var(--statement-visual-size);
    flex-basis: var(--statement-visual-size);
  }
  .auto-visual__category {
    width: 100%;
    height: 100%;
  }
  .auto-visual__car {
    top: 23.37445%;
    left: 11.83029%;
    width: 85.13066%;
    height: 56.75328%;
  }
  .auto-visual__rating {
    top: 49.66533%;
    left: 12.94197%;
    width: 22.28905%;
    height: 24.14745%;
  }
  .auto-visual__avatar {
    width: 99.19439%;
    height: 91.56036%;
  }
  .auto-visual__score {
    top: 67.69542%;
    width: 100%;
    height: 32.30557%;
    font-size: calc(var(--statement-font-size) * 0.416625);
  }
  .auto-visual__score > span:first-child {
    margin-left: 13.34491%;
  }
  .auto-visual__star {
    width: calc(var(--statement-font-size) * 0.296875);
    height: calc(var(--statement-font-size) * 0.296875);
    margin-left: 5.79644%;
    font-size: calc(var(--statement-font-size) * 0.270833333);
    line-height: 1.096153846;
  }
}

/* Keep the phone opaque through screen crossfades, so its shadow is stable.
   This backing stays inside the metal shell, including its rounded corners. */
.virtual-card-sequence .phone-assembly::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 2% 5%;
  border-radius: 1.464cqw;
  background: #111111;
  pointer-events: none;
}
.virtual-card-sequence .phone-viewport {
  /* Half a layout pixel is hidden beneath the shell, absorbing subpixel seams.
     Mobile inherits this geometry before its existing 1.82 scale. */
  top: calc(2.15% - 0.5px);
  right: calc(5.26% - 0.5px);
  bottom: calc(2.15% - 0.5px);
  left: calc(5.49% - 0.5px);
  background: #f4f5f9;
}
