/*
 * The home hero, from the design system's Hero card: the photo stays still; gold embroidery
 * stitches itself around the copy, gold dust drifts up, the title rises word by word then catches a sheen, the buttons
 * get a passing light, and a real piece floats in a glass card that tilts with the pointer.
 * Layers: photo (-2) · scrim (-1) · embroidery and dust (0) · copy (1) · floating card (2).
 */

.hero {
  --thread: var(--champagne);
  --hero-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* The photograph itself stays still. */

/* 2 · embroidery and dust */
.hero-fx {
  position: absolute;
  inset: 73px 0 0;
  z-index: 0;
  pointer-events: none;
}

/* Arches around the copy, in the open room left of the models; they move a little more than the photo. */
.hero-embroidery {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 34vw;
  height: 100%;
  transform: translate3d(calc(var(--px, 0px) * -1.6), calc(var(--py, 0px) * -1.6), 0);
  transition: transform 1.2s var(--hero-ease);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--champagne) 20%, transparent));
  opacity: 0.38;
}

.hero-embroidery path,
.hero-embroidery circle {
  fill: none;
  stroke: var(--thread);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-embroidery .stitch {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  animation: hero-stitch 3.2s var(--hero-ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes hero-stitch {
  to { stroke-dashoffset: 0; }
}

.hero-embroidery .bead {
  fill: var(--thread);
  stroke: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-bead 0.6s var(--hero-ease) forwards, hero-glint 3.6s ease-in-out infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) + 0.6s);
}

@keyframes hero-bead {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes hero-glint {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.hero-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
}

/* 3 · the words */
.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--thread);
}

.hero-copy .eyebrow::before {
  width: 34px;
  height: 1px;
  content: "";
  background: currentColor;
  transform-origin: inline-start;
  animation: hero-rule 1.2s var(--hero-ease) 0.3s both;
}

@keyframes hero-rule {
  from { transform: scaleX(0); }
}

/* The photo, title, text and buttons are on screen from the first paint (the browser counts the hero as loaded and
   visitors on slow phones never see an empty band); the motion only moves them, it never hides them. */
.hero-copy h1 .word {
  display: inline-block;
  animation: hero-word 0.7s var(--hero-ease) both;
  animation-delay: calc(var(--i) * 0.05s);
}

@keyframes hero-word {
  from { transform: translateY(10px); }
}

/* Once the words have risen, a gold light sweeps across the whole line now and then. */
.hero-copy h1 .sheen {
  background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--champagne) 48%, #fffaf2 52%, #fff 60%, #fff 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-sheen 6s ease-in-out 2.4s infinite;
}

@keyframes hero-sheen {
  0% { background-position: 100% 0; }
  45%, 100% { background-position: 0 0; }
}

.hero-copy > p {
  animation: hero-fade 0.7s var(--hero-ease) 0.15s both;
}

.hero-actions {
  animation: hero-fade 0.7s var(--hero-ease) 0.25s both;
}

@keyframes hero-fade {
  from { transform: translateY(8px); }
}

/* A light passing over the design button every few seconds. */
.hero-actions .glass-button {
  position: relative;
  overflow: hidden;
}

.hero-actions .glass-button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: hero-swipe 4.5s ease-in-out 3s infinite;
  pointer-events: none;
}

@keyframes hero-swipe {
  0% { transform: translateX(-120%); }
  30%, 100% { transform: translateX(120%); }
}

/* 4 · the floating glass card (a real piece), bottom right over the photo */
.hero-float {
  position: absolute;
  right: clamp(20px, 3.4vw, 48px);
  bottom: clamp(24px, 3.4vw, 48px);
  z-index: 2;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 250px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform 0.6s var(--hero-ease), border-color 0.2s ease;
  animation: hero-card 1s var(--hero-ease) 2.2s both;
}

.hero-float:hover {
  border-color: var(--thread);
}

@keyframes hero-card {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

.hero-float img {
  display: block;
  width: 72px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
}

.hero-float > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hero-float strong {
  overflow: hidden;
  font-size: 0.95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-float-price {
  color: var(--thread);
  font-weight: 800;
}

.hero-float-stars {
  color: var(--thread);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.hero-float small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: rgba(255, 250, 242, 0.75);
  font-size: 0.78rem;
}

.hero-float .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--thread);
  animation: hero-pulse 2s ease-out infinite;
}

@keyframes hero-pulse {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--champagne) 60%, transparent); }
  to { box-shadow: 0 0 0 8px color-mix(in srgb, var(--champagne) 0%, transparent); }
}

/* Stacked banner (photo above the copy): the card sits on the photo's bottom corner, never over the words. */
@media (max-width: 1180px) {
  .hero {
    container-type: inline-size;
  }

  .hero-float {
    top: calc(73px + 56.28cqw - 130px);
    bottom: auto;
    width: 230px;
  }
}

/* Phones: the embroidery fades behind the copy and the photo is too small to carry the card. */
@media (max-width: 760px) {
  .hero-embroidery {
    left: -10%;
    width: 90%;
    opacity: 0.22;
  }

  .hero-float {
    display: none;
  }
}

/* Visitors who ask for less motion get the still banner. */
@media (prefers-reduced-motion: reduce) {
  .hero-embroidery,
  .hero-float {
    transform: none;
    transition: none;
    animation: none;
  }

  .hero-embroidery .stitch {
    stroke-dashoffset: 0;
    animation: none;
  }

  .hero-embroidery .bead,
  .hero-copy h1 .word,
  .hero-copy > p,
  .hero-actions,
  .hero-float {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }

  .hero-copy h1 .sheen,
  .hero-actions .glass-button::after,
  .hero-float .dot,
  .hero-copy .eyebrow::before {
    animation: none;
  }

  .hero-dust {
    display: none;
  }
}
