/* ==========================================================================
   VADR landing · section 01 "How it works"
   1. Section + heading   2. Product-page parts   3. Sticky steps + stage
   4. The flow, one state per step (js/how.js sets #shop[data-at])   5. Phones
   ========================================================================== */

:root {
  --navy: #013763;
  --steel: #4F748F;
  --paper: #F4F5F7;
  --line: rgba(255, 255, 255, .1);
}

/* the nav gets a backing once the hero has scrolled away */
.merge-page .nav { transition: background .3s, backdrop-filter .3s, opacity .9s, transform .9s; }
.merge-page.is-scrolled .nav {
  background: rgba(11, 18, 32, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/* 1. Section + heading ------------------------------------------------------ */
.how {
  position: relative; z-index: 8; /* above the hero layers (clothes are 7), so the fade softens the hero edge */
  /* section 02 follows, so the page is long enough for the last step to reach the middle without extra space */
  padding: clamp(140px, 18vh, 220px) var(--gutter) clamp(140px, 18vh, 220px);
  background: var(--ink);
}
/* this one has top padding, so a menu link skips it to land on the headline like the others
   (section.how outranks base.css section[id]) */
section.how { scroll-margin-top: calc(clamp(96px, 14vh, 140px) - clamp(140px, 18vh, 220px)); }
/* melts the bottom of the planet into the section, so there is no seam */
.how::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 70px; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0), var(--ink));
}
.how__head { max-width: 1280px; margin: 0 auto clamp(40px, 8vh, 96px); }
.how h2 {
  max-width: 14ch;
  font-size: clamp(36px, 4.6vw, 80px); font-weight: 600; line-height: 1; letter-spacing: -.04em;
}
.how h2 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;
}
.how__head > p { margin-top: 20px; max-width: 520px; color: var(--muted); font-size: clamp(15px, 1.15vw, 18px); line-height: 1.55; }
.how h3 { font-size: clamp(20px, 1.6vw, 26px); font-weight: 600; letter-spacing: -.02em; }
.how li p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.how li p b { color: var(--white); font-weight: 600; }

/* 2. Product-page parts ----------------------------------------------------- */
.shop__bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  background: #E7E9EE; font-family: var(--mono); font-size: 11px; color: #6b7280;
}
.shop__bar i { width: 9px; height: 9px; border-radius: 50%; background: #c9cdd5; }
.shop__bar span { margin-left: 8px; }
.t { color: #7fb4ff; } .a { color: #9ad0e6; } .s { color: var(--amber-1); }

/* product photo: the piece, which cross-fades to him wearing it */
.shop__photo { position: relative; overflow: hidden; background: linear-gradient(180deg, #e9ecf1, #dfe3ea); }
.shop__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .7s, transform .9s; }
.shop__photo .is-piece { object-fit: contain; padding: 14%; }
.shop__photo .is-man { object-fit: cover; object-position: 50% 8%; opacity: 0; transform: scale(1.04); }
.is-worn .is-piece { opacity: 0; transform: scale(.96); }
.is-worn .is-man { opacity: 1; transform: none; }
.mock__tag {
  position: absolute; left: 12px; top: 12px; padding: 5px 9px; border-radius: 999px;
  background: rgba(11, 18, 32, .78); color: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .03em;
  opacity: 0; transform: translateY(-4px); transition: opacity .4s .2s, transform .4s .2s;
}
.is-worn .mock__tag { opacity: 1; transform: none; }

.mock__btn {
  display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 10px;
  font-size: 13px; font-weight: 600; transition: background .3s, box-shadow .3s, transform .3s, opacity .4s;
}
.mock__btn--vadr { background: var(--navy); color: #fff; }
/* cart and notify share one slot; each slides to its done label */
.mock__btn--cart, .mock__btn--notify { position: relative; overflow: hidden; }
.mock__btn--cart { background: var(--ink); color: #fff; }
.mock__btn--notify { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.mock__btn--cart span, .mock__btn--notify span { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.mock__btn--cart span + span, .mock__btn--notify span + span { position: absolute; inset: 0; display: grid; place-items: center; transform: translateY(100%); }
.mock__btn--cart span + span { background: #1f7a4d; }
.mock__btn--notify span + span { background: var(--navy); color: #fff; }
.is-done .mock__btn--cart span:first-child, .is-notified .mock__btn--notify span:first-child { transform: translateY(-140%); }
.is-done .mock__btn--cart span + span, .is-notified .mock__btn--notify span + span { transform: none; }

.mock__label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.mock__sizes { display: flex; gap: 8px; margin-top: 10px; }
.mock__sizes i {
  flex: 1; display: grid; place-items: center; height: 42px; border-radius: 10px;
  border: 1px solid #d5d9e0; font-style: normal; font-size: 14px; font-weight: 600; color: #374151;
  transition: background .35s, color .35s, border-color .35s, box-shadow .35s, transform .35s;
}
.is-sized .mock__sizes .is-pick {
  background: var(--navy); border-color: var(--navy); color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 116, 143, .28); transform: translateY(-2px);
}
.is-sized.is-soldout .mock__sizes .is-pick { background: #fff; color: #9ca3af; border-color: #c3cad5; box-shadow: none; text-decoration: line-through; }

/* 3. Sticky steps + stage ---------------------------------------------------- */
/* each step is as tall as the stage, so the card centres on the step and its gold line */
.how-b { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px); max-width: 1280px; margin: 0 auto; }
.how-b__steps { list-style: none; }
.how-b__step {
  min-height: 50vh; display: flex; flex-direction: column; justify-content: center;
  --rail: var(--line);
  padding-left: 28px; border-left: 1px solid var(--rail);
  opacity: .32; transition: opacity .5s, border-color .5s;
}
.how-b__step.is-on { opacity: 1; --rail: var(--amber-1); }
.how-b__num { font-family: var(--mono); font-size: 12px; color: var(--amber-1); margin-bottom: 14px; }
.how-b h3 { font-size: clamp(26px, 2.4vw, 40px); }
.how-b li p { font-size: clamp(15px, 1.15vw, 18px); max-width: 420px; }

/* the editor and the product page share one spot; step 1 shows the editor, then it gives way to the page */
/* as tall as one step and pinned at the screen's middle, so it sits level with the first and last steps too */
.how-b__stage {
  --shift: clamp(0px, calc((100vw - 1280px) / 2 - 48px), 120px); /* nudged right into the spare side space on wide screens */
  position: sticky; top: 25vh; height: 50vh; display: grid; align-content: center;
  margin: 0 calc(-1 * var(--shift)) 0 var(--shift);
}
.how-b__stage > * { grid-area: 1 / 1; min-width: 0; transition: opacity .55s, transform .65s cubic-bezier(.2, .8, .2, 1); }
.shop {
  position: relative; width: 100%; border-radius: 18px; background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
}
.shop__bar { border-radius: 18px 18px 0 0; }
.shop__body { display: grid; grid-template-columns: 1.1fr 1fr; }
.shop__photo { aspect-ratio: 4 / 5; border-radius: 0 0 0 18px; }
.shop__info { display: flex; flex-direction: column; gap: 6px; padding: clamp(18px, 2.4vw, 34px); }
.shop__brand { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
.shop__name { font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -.02em; }
.shop__price { font-size: 15px; color: #374151; }
.shop__tryon { margin-top: 14px; }
.shop__size { margin-top: 18px; }
.shop__sizehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop__rec {
  padding: 4px 9px; border-radius: 999px; background: rgba(79, 116, 143, .14); color: var(--navy);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.shop__stock { position: relative; display: block; height: 18px; margin-top: 10px; font-size: 12px; font-weight: 600; }
.shop__stock span { position: absolute; left: 0; top: 0; padding-left: 14px; white-space: nowrap; transition: opacity .4s; }
.shop__stock span::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: currentColor; }
.shop__stock span:first-child { color: #1f7a4d; }
.shop__stock span + span { color: #b4472f; opacity: 0; }
.is-soldout .shop__stock span:first-child { opacity: 0; }
.is-soldout .shop__stock span + span { opacity: 1; }
.shop__buy { display: grid; margin-top: 12px; }
.shop__buy > * { grid-area: 1 / 1; }
.shop__buy .mock__btn--notify { opacity: 0; transform: translateY(6px); }
.is-soldout .shop__buy .mock__btn--cart { opacity: 0; transform: translateY(-6px); }
.is-soldout .shop__buy .mock__btn--notify { opacity: 1; transform: none; }

/* step 1: the theme file; the three VADR lines type themselves in */
.editor {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 18px; background: #0E1626; color: #d6deeb;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1);
}
.editor__bar {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
  background: #152038; font-family: var(--mono); font-size: 11px; color: #8a97ad;
}
.editor__bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a3754; }
.editor__bar span { margin-left: 8px; }
.editor__copy {
  margin-left: auto; height: 26px; padding: 0 12px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .16); font-family: var(--mono); font-size: 11px; color: #d6deeb;
  transition: background .2s;
}
.editor__copy:hover { background: rgba(255, 255, 255, .08); }
.editor__code {
  /* centred in the card, so the new lines sit level with the step text */
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  list-style: none; counter-reset: ln; padding: clamp(20px, 3vw, 40px) 0;
  transform: translateY(-20px); /* half the top bar up: the code block sits at the card's (and the step text's) middle */
  font-family: var(--mono); font-size: clamp(12px, 1.1vw, 17px); line-height: 1.85;
}
.editor__code li { counter-increment: ln; padding-right: 20px; white-space: pre; }
.editor__code li::before {
  content: counter(ln); display: inline-block; width: 3.4em; padding-right: 1.4em; text-align: right; color: #3b4862;
}
.editor__code .is-new { background: rgba(255, 198, 118, .07); box-shadow: inset 2px 0 0 var(--amber-1); }
.editor__code .is-new > span { display: inline-block; vertical-align: top; clip-path: inset(0 100% 0 0); }
.editor__saved {
  position: absolute; right: 16px; bottom: 16px; padding: 7px 12px; border-radius: 999px;
  background: rgba(31, 122, 77, .18); color: #7fd6a6; font-family: var(--mono); font-size: 11px;
  opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s;
}
.c { color: #6b7a94; }

/* the VADR upload panel, over the product photo */
.shop__upload {
  position: absolute; inset: 10%; display: flex; flex-direction: column; gap: 8px;
  padding: clamp(12px, 1.4vw, 20px); border-radius: 14px; background: #fff;
  box-shadow: 0 24px 60px rgba(11, 18, 32, .28);
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .45s, transform .5s cubic-bezier(.2, .8, .2, 1);
}
.shop__upload strong { font-size: clamp(15px, 1.2vw, 18px); letter-spacing: -.01em; }
.shop__drop {
  position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden;
  border: 1.5px dashed #c3cad5; border-radius: 10px; background: #f6f7f9;
  font-size: 12px; color: #6b7280;
}
.shop__drop img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%;
  opacity: 0; transform: translateY(-18px) scale(1.06); transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.is-picked .shop__drop img { opacity: 1; transform: none; }
.shop__drop span { transition: opacity .3s; }
.is-picked .shop__drop span { opacity: 0; }
.shop__progress { height: 4px; border-radius: 4px; background: #e5e8ee; overflow: hidden; }
.shop__progress span { display: block; height: 100%; width: 0; background: var(--steel); }
.is-up .shop__progress span { width: 100%; transition: width 1.6s cubic-bezier(.4, 0, .2, 1); }
.shop__fitting { font-family: var(--mono); font-size: 10px; color: var(--steel); opacity: 0; transition: opacity .4s .3s; }
.is-up .shop__fitting { opacity: 1; }

/* 4. The flow: 1 code · 2 Try on appears · 3 upload · 4 result, size, buy --- */
.shop .shop__tryon { opacity: 0; transform: scale(.94); }
.shop__rec, .shop__stock { transition: opacity .5s .3s; }
.shop:not([data-at="4"]) .shop__rec, .shop:not([data-at="4"]) .shop__stock { opacity: 0; }
.shop__buy { transition: opacity .5s; }
.shop:not([data-at="4"]) .shop__buy { opacity: .4; }

.how-b__stage[data-at="1"] .shop { opacity: 0; transform: translateY(18px) scale(.97); }
.how-b__stage:not([data-at="1"]) .editor { opacity: 0; transform: translateY(-18px) scale(.97); pointer-events: none; }
.how-b__stage[data-at="1"] .editor__code .is-new > span { clip-path: inset(0 0 0 0); transition: clip-path .8s steps(30) .4s; }
.how-b__stage[data-at="1"] .editor__code .is-new:nth-child(6) > span { transition-delay: 1.1s; }
.how-b__stage[data-at="1"] .editor__code .is-new:nth-child(7) > span { transition-delay: 1.8s; }
.how-b__stage[data-at="1"] .editor__saved { opacity: 1; transform: none; transition-delay: 2.7s; }
.shop:not([data-at="1"]) .shop__tryon { opacity: 1; transform: none; }
.shop[data-at="2"] .shop__tryon { box-shadow: 0 0 0 5px rgba(79, 116, 143, .35); animation: ping 1.8s ease-in-out infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 9px rgba(79, 116, 143, .12); } }
.shop[data-at="3"] .shop__tryon { background: var(--steel); }
.shop[data-at="3"] .shop__upload { opacity: 1; transform: none; }

/* 5. Phones ----------------------------------------------------------------- */
@media (max-width: 900px) {
  .how-b { grid-template-columns: 1fr; gap: 0; }
  .how-b__stage { order: -1; top: 64px; height: auto; margin: 0; padding: 12px 0 20px; z-index: 2; background: var(--ink); }
  .how-b__step { min-height: 40vh; }
  .shop__body { grid-template-columns: 1fr 1fr; }
  .shop__info { padding: 12px; gap: 3px; }
  .shop__name { font-size: 17px; }
  .shop__price { font-size: 13px; }
  .shop__tryon { margin-top: 8px; }
  .mock__btn { height: 32px; font-size: 11px; }
  .shop__size { margin-top: 8px; }
  .shop__rec { padding: 3px 6px; font-size: 9px; }
  .mock__label { font-size: 9px; }
  .mock__sizes { gap: 4px; margin-top: 6px; }
  .mock__sizes i { height: 28px; font-size: 11px; border-radius: 7px; }
  .shop__stock { margin-top: 6px; font-size: 10px; }
  .shop__buy { margin-top: 6px; }
  .shop__upload { inset: 6%; gap: 5px; padding: 10px; }
  .shop__upload strong { font-size: 13px; }
  .editor__code { padding: 14px 0; font-size: 10.5px; line-height: 1.9; transform: none; }
  .editor__code li::before { width: 2.6em; padding-right: 1em; }
  .editor__saved { right: 10px; bottom: 10px; font-size: 10px; }
}
