/* =========================================================
   Home Hero  (Figma node 2132:105 — 1512 × 798)
   ========================================================= */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 798px;
  /* header = 98px tall; extra bottom padding puts the row's centre at 50% + 20px like Figma */
  padding-top: 98px;
  padding-bottom: 58px;
  background-color: var(--color-bg);
  background-image: url("../../assets/images/hero-bg.webp");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* ---------- Decorative layers ---------- */

/* Soft light beam from the top-left (Figma 2132:108) */
.hero__beam {
  position: absolute;
  z-index: -1;
  left: calc(10% + 132.51px);
  top: 50px;
  width: 146.6px;
  height: 842.55px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 100%);
  filter: blur(40px);
  opacity: 0.7;
  transform: translate(-50%, -50%) rotate(150.02deg) scaleY(-1);
  pointer-events: none;
}

/* Fade into the next section (Figma 2132:106) */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 161px;
  background: linear-gradient(180deg, rgba(13, 17, 23, 0) 0%, rgba(13, 17, 23, 0.55) 45%, var(--color-bg-fade) 100%);
  pointer-events: none;
}

/* ---------- Content row ---------- */
.hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 21.677px;
  flex: 0 1 696px;
  min-width: 0;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hero__heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* "Scan it • Scale it • Pour it" */
.hero__tagline {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.hero__dot {
  position: relative;
  flex: none;
  width: 6px;
  height: 10px;
}

.hero__dot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-amber);
}

.hero__title {
  font-size: 68px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.36px;
  color: var(--color-white);
}

.hero__title-accent {
  color: var(--color-amber);
}

.hero__desc {
  font-size: 24px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ---------- Store badges ----------
   The exported SVGs include 34px of padding for their glow shadow.
   The link box is the visible badge; the image overflows it exactly
   like the Figma layer (inset -62.96% / -20.99%). */
.hero__stores {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.store-badge {
  --badge-h: 54px;
  position: relative;
  display: block;
  flex: none;
  height: var(--badge-h);
  border-radius: 12px;
  transition: transform 0.25s var(--ease-out), filter 0.25s ease;
}

.store-badge--apple  { aspect-ratio: 162 / 54; }
.store-badge--google { aspect-ratio: 182.25 / 54; }

.store-badge img {
  position: absolute;
  top: -62.96%;
  height: 225.93%;
  max-width: none;
  pointer-events: none;
}

.store-badge--apple img  { left: -20.99%; width: 141.98%; }
.store-badge--google img { left: -18.66%; width: 137.72%; }

.store-badge:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

/* ---------- Phone mockup (frame → screen → mask) ----------
   All children are positioned in % of the 441 × 580 Figma box,
   so the whole mockup scales by changing --phone-w only. */
.phone {
  --phone-w: 441px;
  position: relative;
  flex: none;
  width: var(--phone-w);
  aspect-ratio: 441 / 580;
}

.phone__glow {
  position: absolute;
  z-index: -1;
  left: -60.46%;
  top: -18.79%;
  width: 236.5%;
  height: 109.8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.06) 80%, rgba(255, 255, 255, 0) 100%);
  filter: blur(50px);
  pointer-events: none;
}

.phone__device {
  position: absolute;
  inset: 0;
  animation: phone-float 6s ease-in-out infinite;
}

.phone__frame {
  position: absolute;
  left: 16.26%;
  top: -0.86%;
  width: 67.66%;
  height: 99.74%;
  max-width: none;
  filter: drop-shadow(0 30px 30px rgba(0, 0, 0, 0.35));
}

.phone__screen {
  position: absolute;
  left: 21.864%;
  top: 3.398%;
  width: 56.147%;
  height: 92.072%;
  -webkit-mask-image: url("../../assets/images/screen-mask.png");
          mask-image: url("../../assets/images/screen-mask.png");
  -webkit-mask-size: 99.539% 99.893%;
          mask-size: 99.539% 99.893%;
  -webkit-mask-position: 50% 0;
          mask-position: 50% 0;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

.phone__screen img {
  width: 100%;
  height: 100%;
}

@keyframes phone-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* =========================================================
   Responsive
   ========================================================= */

/* Small laptops */
@media (max-width: 1199px) {
  .hero__title { font-size: 60px; }
  .hero__desc  { font-size: 21px; }
  .phone       { --phone-w: 380px; }
}

/* Tablets — stack & centre */
@media (max-width: 991px) {
  .hero {
    min-height: 0;
    padding-top: 128px;
    padding-bottom: 24px;
    background-position: right top;
  }

  .hero__inner {
    flex-direction: column;
    gap: 40px;
  }

  .hero__content {
    flex: none;
    align-items: center;
    max-width: 640px;
    text-align: center;
  }

  .hero__heading,
  .hero__tagline {
    align-items: center;
    justify-content: center;
  }

  .hero__tagline { align-items: flex-end; }

  .hero__title { font-size: 56px; }
  .hero__desc  { font-size: 20px; }
  .hero__stores { justify-content: center; }
  .phone { --phone-w: 400px; }

  .hero__beam { left: 12%; }
}

/* Mobile — matches mobile_version (430 wide) */
@media (max-width: 767px) {
  .hero {
    padding-top: 89px;
    padding-bottom: 6px;
    background-size: cover;
  }

  .hero__inner {
    gap: 24px;
  }

  .hero__content {
    gap: 22px;
  }

  .hero__tagline {
    gap: 8px;
    font-size: 12px;
  }

  .hero__dot { height: 9px; }
  .hero__dot::before { top: 0; }

  .hero__heading { gap: 7px; }

  .hero__title {
    font-size: 40px;
    letter-spacing: -0.8px;
  }

  .hero__desc {
    max-width: 358px;
    font-size: 16px;
  }

  .hero__stores { gap: 9px; }
  .store-badge  { --badge-h: 41.7px; }

  .phone { --phone-w: min(352.8px, 86vw); }

  .hero__beam {
    left: 30%;
    top: 0;
    opacity: 0.45;
  }

  .hero::after { height: 90px; }
}

@media (max-width: 359px) {
  .hero__title { font-size: 36px; }
  .hero__stores { gap: 8px; }
  .store-badge  { --badge-h: 37px; }
}

/* =========================================================
   Phones & tablets: lighter effects for smooth scrolling
   (no endless animation, no live blur filters)
   ========================================================= */
@media (max-width: 991px), (hover: none) and (pointer: coarse) {
  .phone__device { animation: none; }

  /* same soft beam, drawn with a gradient instead of blur(40px) */
  .hero__beam {
    filter: none;
    width: 240px;
    background: radial-gradient(50% 55% at 50% 22%,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.08) 45%,
      rgba(255, 255, 255, 0) 100%);
  }

  /* glow already fades out via the gradient — drop the blur(50px) */
  .phone__glow {
    filter: none;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.035) 65%, rgba(255, 255, 255, 0) 100%);
  }
}
