/* ==========================================================================
   VADR landing
   05's VADR logo intro → 04's cosmic scene. The copy fills the left third;
   the man stands on the planet in the right two thirds, his head level with
   the headline. Clothes float along the planet's horizon line.
   Positions of the man, horizon and clothes come from js/hero.js.
   ========================================================================== */

/* the page scrolls on to the sections below (css/how.css); the hero is one screen */

.merge {
  position: relative; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(120% 80% at 70% 40%, #101a33 0%, var(--ink) 55%, #060a13 100%);
  user-select: none;
}
.merge__stars, .merge__intro { position: absolute; inset: 0; width: 100%; height: 100%; }
.merge__intro { z-index: 20; pointer-events: none; }

/* the planet: a huge ellipse whose top edge is the glowing horizon line */
.merge__horizon {
  position: absolute; left: 0; top: 0; z-index: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, #0B1220 96%, transparent 100%);
  box-shadow: 0 -2px 0 rgba(255, 198, 118, .55), 0 -30px 120px rgba(247, 169, 86, .28), 0 -6px 30px rgba(255, 198, 118, .25);
}

/* warm glow behind the man */
.merge__glow {
  position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none;
  width: 70vmin; height: 70vmin; margin: -35vmin 0 0 -35vmin; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 169, 86, .3), rgba(247, 169, 86, .07) 60%, transparent 100%);
  filter: blur(10px); animation: glow 6s ease-in-out infinite;
}
@keyframes glow { 50% { opacity: .7; } }

/* the man (js sets left/top/height so his head is level with the headline) */
.man {
  position: absolute; left: 70%; top: 50%; z-index: 3;
  height: min(68vh, 640px); aspect-ratio: 600 / 1080;
  margin-left: calc(min(68vh, 640px) * -600 / 1080 / 2); margin-top: calc(min(68vh, 640px) / -2);
  will-change: transform;
}
.man__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  /* he is a cut-out (assets/images/merge): soft feet, a warm rim so he sits in space */
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 92%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 92%);
  filter: drop-shadow(0 0 18px rgba(255, 198, 118, .18)) drop-shadow(0 0 2px rgba(255, 225, 176, .35));
  opacity: 0; transition: opacity .55s ease;
}
.man__img.is-on { opacity: 1; }
.man__scan {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(56, 210, 253, .55) 50%, transparent 55%);
  background-size: 100% 300%;
  /* clipped to his silhouette (js sets the mask to the worn cut-out) */
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.man__scan.is-on { animation: man-scan .9s ease-in-out; }
@keyframes man-scan { 0% { opacity: 1; background-position: 0 100%; } 100% { opacity: 1; background-position: 0 0; } }

/* copy --------------------------------------------------------------------- */
.merge__copy {
  /* the left third of the page, sitting high */
  position: absolute; z-index: 6; left: var(--gutter); top: clamp(96px, 15vh, 160px);
  width: calc(33.33vw - var(--gutter)); display: flex; flex-direction: column; align-items: flex-start; gap: 22px;
}
.merge__copy h1 { font-size: clamp(48px, 6.6vw, 128px); font-weight: 600; line-height: .98; letter-spacing: -.045em; }
.merge__copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #FFE1B0 0%, var(--amber-1) 40%, var(--amber-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255, 198, 118, .25);
}
.merge__copy p { color: var(--muted); font-size: clamp(15px, 1.2vw, 18px); line-height: 1.55; max-width: 460px; }
.merge__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.merge__note { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* desktop: the copy fills the red frame from the user's sketch (loc.png);
   js/hero.js fitCopy() sizes the headline to fill it. The CTA row hangs
   just under the frame. */
@media (min-width: 901px) {
  .merge__copy {
    left: 6.4vw; top: 12.5vh; width: 51.4vw; height: 49.5vh;
    justify-content: space-between; gap: 0;
  }
  .merge__copy h1 { font-size: 64px; }
  /* the paragraph and CTA ride up a little, closing the gap under the headline */
  .merge__copy p { max-width: none; position: relative; top: -26px; }
  .merge__actions { position: absolute; left: 0; top: calc(100% - 4px); margin: 0; }
}

/* chip (and the hint above it) sit over his head; js places it */
.merge__status {
  position: absolute; z-index: 6; left: 0; top: 0; transform: translate(-50%, -100%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none;
}
.merge__status .play-hint { font-size: 11px; white-space: nowrap; }
.tryon-chip { white-space: nowrap; }
.tryon-chip.is-flash { animation: chip-flash .7s ease; }
@keyframes chip-flash { 30% { border-color: var(--cyan); box-shadow: 0 0 22px rgba(56, 210, 253, .55); } }

/* clothes on the horizon line ------------------------------------------------ */
.clothes { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.cloth {
  position: absolute; left: 0; top: 0; width: 64px; margin-left: -32px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: auto; cursor: pointer; touch-action: none;
  background: none; border: 0; color: #fff; font: inherit; padding: 0;
  will-change: transform, opacity;
}
.cloth__ball {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  color: var(--amber-1);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 60%), rgba(11, 18, 32, .55);
  border: 1px solid rgba(255, 198, 118, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.cloth__ball img { width: 78%; height: 78%; object-fit: contain; }
.cloth__ball svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.cloth__name { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; transition: color .25s; }
.cloth:hover .cloth__ball, .cloth:focus-visible .cloth__ball { border-color: var(--amber-1); box-shadow: 0 0 26px rgba(255, 198, 118, .45), 0 10px 30px rgba(0, 0, 0, .45); transform: translateY(-6px); }
.cloth:hover .cloth__name { color: #fff; }
.cloth:focus-visible { outline: none; }
.cloth.is-worn .cloth__ball { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 22px rgba(56, 210, 253, .4), 0 10px 30px rgba(0, 0, 0, .45); }
.cloth.is-worn .cloth__name { color: var(--cyan); }
.cloth.is-drag { cursor: grabbing; }

/* real clothing photos: no circle, larger, floating free with a soft shadow */
.cloth--piece { width: 231px; margin-left: -115.5px; }
.cloth--piece .cloth__ball {
  width: 231px; height: 198px; border-radius: 0; border: 0; background: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55));
  transition: filter .25s, transform .25s;
}
.cloth--piece .cloth__ball { display: flex; align-items: center; justify-content: center; }
.cloth--piece .cloth__ball img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.cloth--piece:hover .cloth__ball, .cloth--piece:focus-visible .cloth__ball {
  box-shadow: none; filter: drop-shadow(0 0 18px rgba(255, 198, 118, .5)) drop-shadow(0 14px 22px rgba(0, 0, 0, .55));
}
.cloth--piece.is-worn .cloth__ball {
  box-shadow: none; filter: drop-shadow(0 0 16px rgba(56, 210, 253, .55)) drop-shadow(0 14px 22px rgba(0, 0, 0, .55));
}

/* intro → reveal (body.is-in is set by js once the logo bursts) ------------- */
.merge-page .nav, .merge__copy > *, .man, .merge__horizon, .merge__glow, .merge__status, .clothes {
  opacity: 0; transition: opacity 1s ease, translate 1s cubic-bezier(.2, .7, .2, 1);
}
.merge__copy > * { translate: 0 18px; }
.merge-page.is-in .nav, .merge-page.is-in .merge__copy > *, .merge-page.is-in .man,
.merge-page.is-in .merge__horizon, .merge-page.is-in .merge__glow, .merge-page.is-in .merge__status, .merge-page.is-in .clothes {
  opacity: 1; translate: 0 0;
}
.merge-page.is-in .merge__horizon { transition-delay: 0s; }
.merge-page.is-in .man, .merge-page.is-in .merge__glow { transition-delay: .15s; }
.merge-page.is-in .merge__copy > :nth-child(1) { transition-delay: .3s; }
.merge-page.is-in .merge__copy > :nth-child(2) { transition-delay: .42s; }
.merge-page.is-in .merge__copy > :nth-child(3) { transition-delay: .54s; }
.merge-page.is-in .merge__copy > :nth-child(4) { transition-delay: .66s; }
.merge-page.is-in .clothes, .merge-page.is-in .merge__status { transition-delay: .6s; }
.merge-page.is-in .nav { transition-delay: .7s; }

/* phones -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .merge { background: radial-gradient(120% 60% at 50% 40%, #101a33 0%, var(--ink) 55%, #060a13 100%); }
  .merge__copy { left: 16px; right: 16px; top: 74px; transform: none; width: auto; gap: 10px; align-items: center; text-align: center; }
  .merge__copy .badge, .merge__copy p, .merge__note { display: none; }
  .merge__copy h1 { font-size: 34px; }
  .merge__copy h1 br { display: none; }
  .merge__actions { margin-top: 2px; }
  .merge__actions .btn { padding: 11px 20px; font-size: 14px; }
  .man { left: 50%; top: 54%; height: min(46vh, 420px); margin-left: calc(min(46vh, 420px) * -600 / 1080 / 2); margin-top: calc(min(46vh, 420px) / -2); }
  .merge__status .play-hint { display: none; }
  .cloth { width: 54px; margin-left: -27px; }
  .cloth__ball { width: 54px; height: 54px; }
  .cloth__ball svg { width: 26px; height: 26px; }
  .cloth--piece { width: 132px; margin-left: -66px; }
  .cloth--piece .cloth__ball { width: 132px; height: 114px; }
}

/* desktop: the chip sits beside his head (js places it left of his frame) */
@media (min-width: 901px) {
  .merge__status { transform: translate(-100%, 0); flex-direction: column; align-items: flex-end; }
  /* with a mouse it is a tooltip by the cursor instead (js moves it) */
  .merge__status.is-tooltip { z-index: 30; transform: none; align-items: flex-start; }
  .merge__status.is-tooltip > * { transition: opacity .25s ease; }
  .merge__status.is-tooltip.is-away > * { opacity: 0; }
}
