/* Photography: reference images for the hero, the gallery and the share step. */

/* Hero: a real photo sits behind the 3D stage and fades into the dark page. */
.hero-photo {
  position: absolute;
  inset: 6% -8% 6% 12%;
  z-index: 0;
  width: calc(100% + 8%);
  height: 88%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  opacity: 0.45;
  filter: saturate(0.8) contrast(1.05);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40%);
  mask-image: linear-gradient(to right, transparent, #000 40%);
  pointer-events: none;
}

.hero-stage {
  position: relative;
  z-index: 1;
}

/* Gallery: photos fill their tiles, the caption sits above them. */
.gallery-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gallery-tile:hover .gallery-photo {
    transform: scale(1.04);
  }
}

/* Share step, shown only after a generation. */
.share-form {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.share-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.share-form .button {
  justify-self: start;
}

/* Hero card: keep its top bar on one line and leave the 3D object visible on phones. */
.hero-card-top {
  white-space: nowrap;
  gap: var(--space-3);
}

/* Phones: the photo stays inside the screen and dissolves into the page on every side. */
@media (max-width: 959px) {
  .hero-photo {
    inset: 4% 0 10%;
    width: 100%;
    height: 86%;
    opacity: 0.32;
    -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 45%, #000 35%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 70% at 50% 45%, #000 35%, transparent 100%);
  }
}

/* Closing call to action: the fire sits on the section's bottom edge, right where the footer's black begins,
   under the glow. cta-fire.js frames the camera so the coal bed touches the canvas bottom. */
.final-cta {
  --fire-h: clamp(13rem, 34vw, 20rem);
  padding-block-end: calc(var(--fire-h) * 0.9);
}

.cta-fire {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 50%;
  inline-size: min(100vw, 40rem);
  block-size: var(--fire-h);
  translate: -50% 0;
  pointer-events: none;
}

.cta-fire canvas {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.cta-fire.is-live canvas {
  opacity: 1;
}
