/* HOW IT WORKS: pinned stopwatch scene (signature moment). Dial left, steps right; phone sits inside the dial. */
.how {
  --D: min(700px, calc((100svh - var(--head-h) - 64px) * .9375), 46vw);
  position: relative; isolation: isolate;
}
.how__pin {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--head-h) + 20px) 0 28px; overflow: clip;
  background:
    radial-gradient(70% 60% at 0% 100%, rgba(11, 143, 227, .14), transparent 70%),
    linear-gradient(180deg, #121a3a 0%, #10173a 100%);
}
.how__glow {
  position: absolute; z-index: -1; left: calc(50% - var(--wrap) / 2 + var(--D) / 2); top: 54%;
  width: calc(var(--D) * 1.5); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 160, 28, .22), rgba(11, 143, 227, .12) 55%, transparent 100%);
  pointer-events: none;
}
.how__grid {
  display: grid; grid-template-columns: var(--D) minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: clamp(40px, 5vw, 96px); align-items: center; align-content: center;
}
.how__scene { display: contents; }
.how__head { grid-column: 2; grid-row: 1; align-self: end; display: grid; gap: 16px; }
.how__head .lede { font-size: clamp(1.05rem, 1.2vw, 1.18rem); }

/* ---------- the dial ---------- */
.how__stage { grid-column: 1; grid-row: 1 / span 2; position: relative; width: var(--D); aspect-ratio: 600 / 640; }
.how__dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.how__dial .tick { stroke: rgba(255, 255, 255, .85); stroke-width: 2; stroke-linecap: round; transition: stroke .25s; }
.how__dial .tick--major { stroke: #fff; stroke-width: 4; }
.how.is-live .how__dial .tick:not(.is-on) { stroke: rgba(255, 255, 255, .2); }
.how.is-live .how__dial .tick.is-on { stroke: #f7b84d; }
.how.is-live .how__dial .tick--major.is-on { stroke: #fff; }
.how__dial .dial__labels text { fill: rgba(255, 255, 255, .55); font-family: var(--display); font-weight: 600; font-size: 22px; }
.how__dial .dial__arc { stroke-dasharray: 1595 2000; }
.how__dial .node circle { fill: var(--lime); stroke: var(--ink); stroke-width: 4; transform-box: fill-box; transform-origin: center; transition: fill .35s var(--ease), transform .45s var(--ease); }
.how__dial .node text { fill: var(--ink); font-family: var(--display); font-weight: 800; font-size: 20px; transition: fill .35s; }
.how.is-live .how__dial .node:not(.is-on) circle { fill: #1c2550; stroke: rgba(255, 255, 255, .35); stroke-width: 2; transform: scale(.82); }
.how.is-live .how__dial .node:not(.is-on) text { fill: rgba(255, 255, 255, .7); }
.how.is-live .how__dial .node.is-on circle { animation: nodePop .6s var(--ease); }
@keyframes nodePop { 0% { transform: scale(.8); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
.how.is-in .dial__tipglow { animation: tipGlow 1.6s ease-in-out infinite; }
@keyframes tipGlow { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }

.how__done {
  position: absolute; left: 0; top: 2.5%; z-index: 3; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 9px 16px 9px 10px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-weight: 800; font-size: 1rem;
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .6);
}
.how.on-ink .how__done { color: var(--ink); }
.how__done i, .sheet__ok i, .save__row i { display: block; width: 24px; height: 24px; border-radius: 50%; flex: none; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.6 3.6 7.4-8.2' fill='none' stroke='%23121a3a' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.how.is-live .how__done:not(.is-done) i { background: transparent; box-shadow: inset 0 0 0 2px #b9c4d8; }
.how.is-live .how__done.is-done { animation: donePop .6s var(--ease); }
@keyframes donePop { 0% { transform: scale(.9); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- the phone (a real device shape, so real device corners) ---------- */
.how__phone {
  --fs: calc(var(--D) * .0235);
  position: absolute; left: 33.667%; top: 21.875%; width: 32.667%; height: 62.5%; perspective: 1000px; z-index: 2;
}
.phone {
  position: relative; width: 100%; height: 100%; padding: 4.2%;
  border-radius: 16% / 7.8%; background: linear-gradient(150deg, #39457a 0%, #0b1029 45%, #1a2350 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22), 0 0 0 1px rgba(0, 0, 0, .4), 0 50px 70px -30px rgba(0, 0, 0, .75), 0 0 60px -10px rgba(11, 143, 227, .35);
  transform-style: preserve-3d;
}
.phone__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  border-radius: 12.5% / 5.9%; background: #0d1330; font-size: var(--fs); line-height: 1.25; color: var(--ink);
}
.phone__island { position: absolute; left: 50%; top: 6.4%; width: 30%; height: 3.6%; transform: translate(-50%, -50%); background: #05070f; border-radius: 999px; z-index: 6; }
.phone__glare {
  position: absolute; inset: 0; z-index: 7; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(60% 40% at var(--gx, 20%) var(--gy, 12%), rgba(255, 255, 255, .22), transparent 70%),
              linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .07) 48%, transparent 56%);
}
.scr { position: absolute; inset: 0; overflow: hidden; }
.scr img:not(.scr__logo) { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.scr--home { z-index: 1; background: #fff; }
.scr--signin { z-index: 2; }
.scr--travel { z-index: 3; background: #f6f6f6; }
.scr--redeem { z-index: 4; }
.scr--save { z-index: 5; }
/* the home screen is the complete still frame; JS brings the other screens in on scroll */
.scr:not(.scr--home) { display: none; }

.scr__zoom { position: absolute; inset: 0; transform-origin: 50% 61%; }
.scr__hl {
  position: absolute; left: 5.74%; top: 47.86%; width: 27.6%; height: 11.97%;
  border: 3px solid var(--lime); border-radius: 14% / 15%; box-shadow: 0 0 0 4px rgba(166, 210, 43, .3), 0 8px 18px -6px rgba(18, 26, 58, .4);
  opacity: 0;
}
.scr__ping {
  position: absolute; left: 50%; top: 13%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45em; padding: .45em .8em; border-radius: 0 .7em 0 0;
  background: #fff; font-weight: 700; font-size: .78em; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); opacity: 0;
}
.scr__ping i { width: .6em; height: .6em; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(166, 210, 43, .7); }
.how.is-in .scr__ping i { animation: ping 1.6s infinite; }

.scr--signin { background: #fff; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: .8em; padding: 18% 11% 10%; }
.scr__logo { width: 46%; height: auto; margin: 0 auto 1em; }
.scr__field { display: grid; gap: .3em; }
.scr__field small { font-size: .72em; font-weight: 700; color: var(--grey); }
.scr__field b { display: block; height: 2.3em; border-radius: 0 .55em 0 0; background: #eef2f8; box-shadow: inset 0 0 0 1px #d8e0ec; position: relative; overflow: hidden; }
.scr__fill::after { content: ""; position: absolute; left: .7em; top: 50%; width: 62%; height: .5em; margin-top: -.25em; background: #b9c4d8; border-radius: 2px; transform-origin: left; transform: scaleX(var(--f, 1)); }
.scr__hi { text-align: center; font-family: var(--display); font-weight: 750; font-size: 1.1em; margin: -.6em 0 .2em; }
.scr__zoom2 { position: absolute; inset: 0; transform-origin: 20% 58%; }
.scr__dots { display: block; font-style: normal; padding: 0 .7em; line-height: 2.3em; font-size: 1em; letter-spacing: .1em; color: var(--ink); font-weight: 800; }
.scr__btn { margin-top: .6em; display: grid; place-items: center; height: 2.6em; border-radius: 999px; background: var(--lime); font-weight: 800; color: var(--ink); }

.scr__pick { position: absolute; left: 3.4%; top: 49%; width: 37.8%; height: 20.6%; border: 3px solid var(--lime); border-radius: 0 9% 0 0 / 0 7% 0 0; box-shadow: 0 0 0 4px rgba(166, 210, 43, .3); opacity: 0; }
.scr__tap { position: absolute; left: 22.2%; top: 58%; width: 30%; aspect-ratio: 1; margin: -15% 0 0 -15%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .9) 0 18%, rgba(166, 210, 43, .55) 19% 60%, transparent 61%); border: 2px solid rgba(166, 210, 43, .9); opacity: 0; }

.scr--redeem { background: rgba(8, 12, 30, .6); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74%; padding: 1em 1.1em 1.2em; justify-content: space-between; background: #fff; border-radius: 0 1.6em 0 0;
  display: flex; flex-direction: column; align-items: center; gap: .7em; text-align: center;
}
.sheet__grab { width: 22%; height: .3em; border-radius: 999px; background: #d3dcea; }
.sheet strong { font-family: var(--display); font-weight: 750; font-size: 1.12em; }
.sheet__code { position: relative; width: 74%; aspect-ratio: 1; padding: 5%; background: #fff; box-shadow: inset 0 0 0 1.5px #d3dcea; border-radius: 0 .8em 0 0; overflow: hidden; }
.sheet__code svg { width: 100%; height: 100%; }
.sheet__scan { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--lime); box-shadow: 0 0 12px 3px rgba(166, 210, 43, .7); opacity: 0; }
.how.is-in .scr--redeem .sheet__scan { animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0% { top: 4%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: 96%; opacity: 0; } }
.sheet__alt { width: 100%; display: grid; place-items: center; height: 2.4em; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--ink); font-weight: 800; font-size: .85em; }
.sheet__ok { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; font-size: .85em; color: #3a4266; }
.sheet__ok i, .save__row i { width: 1.3em; height: 1.3em; }

.scr--save { background: #f5f8fc; padding: 22% 9% 8%; display: flex; flex-direction: column; gap: .35em; }
.scr--save > strong { font-family: var(--display); font-weight: 750; font-size: 1.35em; }
.scr--save > small { font-size: .78em; font-weight: 600; color: var(--grey); }
.save__chart { width: 100%; height: auto; margin: .6em 0 .5em; overflow: visible; background: #fff; border-radius: 0 .8em 0 0; box-shadow: 0 0 0 1px #e1e8f2; padding: 4%; }
.save__bar { fill: #cfe0f3; }
.save__bar:last-of-type { fill: var(--blue); }
.save__dot { transform-box: fill-box; transform-origin: center; }
.how.is-in .save__dot { animation: dotPulse 1.4s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.save__row { display: flex; align-items: center; gap: .6em; padding: .55em .7em; background: #fff; border-radius: 0 .55em 0 0; box-shadow: 0 0 0 1px #e1e8f2; }
.save__row b { flex: 1; height: .5em; border-radius: 2px; background: #cdd6e4; }
.save__row:nth-of-type(2) b { flex: .7; }
.save__row:nth-of-type(3) b { flex: .85; }

/* ---------- the steps ---------- */
.how__list { grid-column: 2; grid-row: 2; align-self: start; position: relative; margin-top: clamp(18px, 3.2vh, 40px); padding-left: 26px; }
.how__rail { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .12); }
.how__rail i { position: absolute; inset: 0; background: linear-gradient(180deg, var(--orange), var(--lime)); transform-origin: top; transform: scaleY(var(--p, 1)); }
.how__mark { position: absolute; left: 14px; right: 0; top: 0; height: 0; border-radius: var(--r-sm); background: linear-gradient(90deg, rgba(166, 210, 43, .14), rgba(28, 37, 80, .6) 60%); box-shadow: inset 2px 0 0 var(--lime); opacity: 0; visibility: hidden; pointer-events: none; }
.how__steps { list-style: none; margin: 0; padding: 0; position: relative; }
.how__step {
  display: grid; grid-template-columns: clamp(2.4rem, 3vw, 3rem) minmax(0, 1fr); gap: 0 14px; align-items: baseline;
  padding: clamp(9px, 1.45vh, 16px) 14px clamp(9px, 1.45vh, 16px) 0; position: relative;
}
.how__n::before { content: attr(data-n); }
.how__n { font-family: var(--display); font-weight: 750; font-size: clamp(1.7rem, 2.3vw, 2.3rem); line-height: 1; color: var(--lime); text-align: right; transition: color .35s; }
.how__txt h3 { font-size: clamp(1.15rem, 1.45vw, 1.45rem); color: #fff; margin-bottom: 3px; transition: color .35s; }
.how__txt p { font-size: clamp(.98rem, 1.05vw, 1.05rem); line-height: 1.45; color: #c9d1ea; transition: color .35s; }
.how.is-live .how__step .how__n { color: rgba(255, 255, 255, .34); }
.how.is-live .how__step .how__txt h3 { color: #b7c0dd; }
.how.is-live .how__step .how__txt p { color: #9aa4c7; }
.how.is-live .how__step.is-done .how__n { color: var(--lime-deep); }
.how.is-live .how__step.is-on .how__n { color: var(--lime); }
.how.is-live .how__step.is-on .how__txt h3 { color: #fff; }
.how.is-live .how__step.is-on .how__txt p { color: #dfe5f5; }

/* ---------- phones: pinned compact scene, phone beside the dial ---------- */
@media (max-width: 760px) {
  .how__pin { display: block; min-height: 0; padding: clamp(72px, 18vw, 96px) 0 0; }
  .how__glow { left: 30%; top: 70%; width: 160vw; }
  .how__grid { display: block; }
  .how__head { padding-bottom: 28px; }
  .how__scene {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: auto auto auto;
    grid-template-areas: "dial list" "phone phone" "done done"; column-gap: 16px; row-gap: 14px; align-content: center; align-items: center;
    min-height: calc(100svh - var(--head-h)); padding: 12px 0 20px;
  }
  .how__stage { display: contents; }
  .how__dial { position: relative; inset: auto; grid-area: dial; width: 100%; height: auto; align-self: end; }
  .how__phone { --fs: clamp(11px, 3.6vw, 15px); grid-area: phone; position: relative; left: auto; top: auto; width: min(60vw, calc((100svh - var(--head-h) - 270px) * .49)); height: auto; aspect-ratio: 196 / 400; justify-self: center; }
  .how__list { grid-area: list; align-self: center; margin: 0; padding: 14px 0 0; }
  .how__rail { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; }
  .how__rail i { transform-origin: left; transform: scaleX(var(--p, 1)); }
  .how__mark { display: none; }
  .how__done { grid-area: done; position: relative; left: auto; top: auto; justify-self: center; font-size: .92rem; padding: 7px 14px 7px 8px; margin: 0; }
  .how__done i { width: 18px; height: 18px; }
  .how__step { grid-template-columns: auto minmax(0, 1fr); padding: 8px 0; gap: 0 10px; }
  .how__n { text-align: left; font-size: 1.6rem; }
  .how__txt h3 { font-size: 1.2rem; }
  .how__txt p { font-size: .95rem; }
  /* reduced motion and no JS: one column, the whole list readable */
  .how:not(.is-live) .how__scene { grid-template-columns: minmax(0, 1fr); grid-template-areas: "dial" "list" "phone" "done"; min-height: 0; }
  .how:not(.is-live) .how__dial { width: min(72%, 300px); justify-self: center; }
  /* live: one step at a time, stacked in the same cell */
  .how.is-live .how__steps { display: grid; }
  .how.is-live .how__step { grid-area: 1 / 1; opacity: 0; transform: translateY(14px); transition: opacity .4s var(--ease), transform .5s var(--ease); }
  .how.is-live .how__step.is-on { opacity: 1; transform: none; }
  .how.is-live .how__step .how__n, .how.is-live .how__step.is-on .how__n { color: var(--lime); font-size: 2.2rem; }
  .how.is-live .how__step .how__txt h3 { color: #fff; }
  .how.is-live .how__step .how__txt p { color: #dfe5f5; }
}
@media (max-width: 380px) {
  .how__scene { column-gap: 12px; }
  .how__txt h3 { font-size: 1.1rem; }
}
