/*
 * Homepage hero carousel (index.html only). Slide 1 is the existing phone
 * mockup from shared.css, untouched; slide 2 promotes the live Recharge
 * service with the Recharge page's own photo and operator logos. Everything
 * here is scoped under .hero-carousel and uses the shared design tokens.
 */
.hero-carousel { --hero-stage-w: 440px; --hero-gap: 72px; position: relative; min-width: 0; }

/* Room for the phone's backdrop and shadow without shifting the layout. */
.hero-carousel-viewport {
  margin: -24px -36px -44px; padding: 24px 36px 44px;
  overflow: hidden; touch-action: pan-y;
}
/* Slides share one grid cell (height = tallest slide). Off-stage slides
   wait one slide width + gap to the right, beyond the viewport clip; the
   incoming slide enters from the right and the outgoing one exits left,
   so every automatic change moves right to left, including the wrap. */
.hero-carousel-track { display: grid; }
.hero-slide {
  grid-area: 1 / 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end;
  transform: translateX(calc(100% + var(--hero-gap)));
  transition: transform 700ms cubic-bezier(.22, .8, .24, 1);
}
.hero-slide.is-active { transform: none; }
.hero-slide.is-leaving, .hero-slide.from-left { transform: translateX(calc(-100% - var(--hero-gap))); }
.hero-slide.no-transition { transition: none; }

/* Slide 1 — the existing mockup, with the launch badge beneath it. */
.hero-carousel .device-stage {
  width: min(var(--hero-stage-w), 100%); flex-direction: column; justify-content: center;
}
.hero-carousel .launch-pill { grid-column: auto; justify-self: auto; margin: 22px 0 0; }

/* Slide 2 — Recharge. */
.recharge-promo {
  position: relative; width: min(var(--hero-stage-w), 100%); aspect-ratio: 4 / 5; max-height: 580px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  border-radius: var(--radius-feature); border: 1px solid var(--border-default);
  background: var(--bg-subtle); box-shadow: var(--shadow-raised);
}
.recharge-promo-media, .recharge-promo-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.recharge-promo-media img { object-fit: cover; object-position: 50% 22%; }
.recharge-promo-panel {
  position: relative; margin: 14px; padding: 20px 20px 18px; text-align: left;
  background: var(--surface-primary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-section); box-shadow: var(--shadow-raised);
}
.recharge-promo-status {
  display: inline-flex; align-items: center; margin: 0 0 12px; padding: 5px 10px;
  border-radius: var(--radius-pill); background: var(--success-soft); color: var(--success-text);
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.recharge-promo-title {
  margin: 0 0 8px; color: var(--text-primary); font-size: 22px; font-weight: 900;
  line-height: 1.15; letter-spacing: -.02em;
}
.recharge-promo-text { margin: 0 0 16px; color: var(--text-secondary); font-size: 14px; font-weight: 500; line-height: 1.55; }
.recharge-promo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.recharge-promo-operators { display: inline-flex; align-items: center; gap: 12px; }
.recharge-promo-operators img { height: 22px; width: auto; }

/* Indicators + pause control, centred under the slide stage. */
.hero-carousel-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(var(--hero-stage-w), 100%); margin: 20px 0 0 auto;
}
.hero-carousel-dots { display: flex; align-items: center; gap: 2px; }
.hero-carousel-dot {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-pill);
  display: grid; place-items: center; background: transparent; cursor: pointer;
}
.hero-carousel-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--border-strong);
  transition: width var(--motion-normal) ease, background-color var(--motion-normal) ease;
}
.hero-carousel-dot[aria-current="true"]::before { width: 22px; background: var(--accent-fill); }
.hero-carousel-toggle {
  width: 28px; height: 28px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  background: var(--surface-primary); color: var(--text-secondary);
}
.hero-carousel-toggle:hover { color: var(--text-primary); border-color: var(--border-strong); }
.hero-carousel-toggle-icon { box-sizing: border-box; width: 8px; height: 9px; border-left: 2.5px solid currentColor; border-right: 2.5px solid currentColor; }
.hero-carousel-toggle[data-state="paused"] .hero-carousel-toggle-icon {
  width: 0; height: 0; margin-left: 2px; border-right: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor;
}
.hero-carousel-dot:focus-visible, .hero-carousel-toggle:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}

@media (max-width: 1080px) {
  .hero-slide { justify-content: center; }
  .hero-carousel-controls { margin-inline: auto; }
}
@media (max-width: 640px) {
  .hero-carousel { --hero-stage-w: 360px; }
  /* Stacked on phones so the panel never covers the photo's subject. */
  .recharge-promo { aspect-ratio: auto; max-height: none; justify-content: flex-start; }
  .recharge-promo-media { position: relative; display: block; height: 230px; }
  .recharge-promo-title { font-size: 20px; }
  .recharge-promo-panel { margin: -32px 12px 12px; padding: 18px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-carousel-dot::before { transition: none; }
}

/*
 * Homepage Recharge promo (native <dialog>, opened by home-hero.js). Photo
 * and operator logos are the Recharge page's own assets.
 */
.promo-modal {
  width: min(760px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-feature);
  background: var(--surface-primary); color: var(--text-primary); box-shadow: var(--shadow-float);
  overflow: auto;
}
.promo-modal::backdrop { background: rgba(18, 20, 26, 0.38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.promo-modal[open] { animation: promo-modal-in 280ms cubic-bezier(.16, .8, .24, 1); }
.promo-modal[open]::backdrop { animation: promo-backdrop-in 280ms ease; }
@keyframes promo-modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes promo-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.promo-modal-inner { position: relative; display: grid; grid-template-columns: 5fr 6fr; min-height: 380px; }
.promo-modal-media { position: relative; display: block; min-height: 100%; background: var(--bg-subtle); }
.promo-modal-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.promo-modal-body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 44px 40px 36px; }
/* Eyebrow label, same treatment as the homepage .hero-kicker. */
.promo-modal-badge {
  display: block; margin: 0 0 14px; color: var(--accent-text);
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.promo-modal-title { margin: 0 0 12px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 900; line-height: 1.12; letter-spacing: -.02em; }
.promo-modal-text { margin: 0 0 26px; color: var(--text-secondary); font-size: 15.5px; font-weight: 500; line-height: 1.6; }
.promo-modal-operators { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; }
.promo-modal-operators img { height: 22px; width: auto; }
.promo-modal-close {
  position: absolute; z-index: 2; top: 14px; right: 14px; width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center; cursor: pointer; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--surface-primary); color: var(--text-secondary);
  box-shadow: var(--shadow-resting);
}
.promo-modal-close:hover { color: var(--text-primary); border-color: var(--border-strong); }
.promo-modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.promo-modal-close:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

@media (max-width: 640px) {
  .promo-modal-inner { grid-template-columns: 1fr; min-height: 0; }
  .promo-modal-media { height: 190px; min-height: 0; }
  .promo-modal-body { padding: 24px 20px 22px; }
  .promo-modal-title { font-size: 23px; }
  .promo-modal-text { margin-bottom: 20px; font-size: 15px; }
  .promo-modal-cta { align-self: stretch; justify-content: center; text-align: center; }
  .promo-modal-operators { margin-top: 18px; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .promo-modal[open], .promo-modal[open]::backdrop { animation: none; }
}
