/* ===== How it works: scroll-driven app journey (Home) =====
   6 beats in 3 acts. journey.js sets --t (0..1 progress inside the active beat) and data-beat. */
.journey { background: var(--ink); color: #fff; position: relative; }
.jr-intro { grid-column: 1 / -1; align-self: end; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.12); }
.jr-intro .mono { color: rgba(255,255,255,.6); }
.jr-intro h2 { color: #fff; margin-top: 8px; font-size: 36px; line-height: 40px; }
.jr-intro .hint { color: rgba(255,255,255,.55); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.jr-track { position: relative; height: calc(6 * 80vh + 100vh); }
.jr-anchor { position: absolute; left: 0; width: 1px; height: 1px; }
.jr-sticky { position: sticky; top: 0; height: 100vh; min-height: 600px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, .8fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 56px; row-gap: 0; align-items: center; padding: 40px var(--pad) 24px; }

/* left: acts */
.acts { position: relative; min-height: 250px; }
.act { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.act.on { opacity: 1; transform: none; pointer-events: auto; }
.act .num { font: 12px/16px var(--mono); letter-spacing: .08em; color: var(--puff); text-transform: uppercase; }
.act h3 { font-size: 34px; line-height: 38px; letter-spacing: -.03em; font-weight: 600; margin: 12px 0 14px; max-width: 13ch; }
.act p { color: rgba(255,255,255,.7); font-size: 17px; line-height: 27px; max-width: 440px; }
.beats { display: flex; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.beat { position: relative; overflow: hidden; background: rgba(255,255,255,.08); border: 0; color: rgba(255,255,255,.55); font: 12.5px/16px var(--sans); padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.beat i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--puff); }
.beat.on { color: #fff; background: rgba(255,255,255,.16); }
.beat.done { color: rgba(255,255,255,.8); }
.beat.done i { width: 100%; opacity: .5; }
.beat.on i { width: calc(var(--t, 0) * 100%); }
.beat:focus-visible { outline: 2px solid var(--puff); outline-offset: 2px; }

/* right: callout per beat */
.callouts { position: relative; min-height: 200px; }
.callout { position: absolute; inset: 0 auto auto 0; max-width: 300px; opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.callout.on { opacity: 1; transform: none; }
.callout b { display: block; font-size: 56px; line-height: 56px; letter-spacing: -.04em; font-weight: 600; font-variant-numeric: tabular-nums; }
.callout b small { font-size: 28px; letter-spacing: -.02em; }
.callout span { display: block; color: rgba(255,255,255,.7); font-size: 16px; line-height: 24px; margin-top: 10px; }

/* phone frame (shared) */
/* phone */
.phone { position: relative; width: 340px; height: 700px; border-radius: 52px; background: #0b0b0b; padding: 12px; box-shadow: 0 0 0 1.5px #2a2a2a, 0 40px 80px rgba(0,0,0,.45); margin: 0 auto; }
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; width: 96px; height: 28px; margin-left: -48px; background: #000; border-radius: 20px; z-index: 6; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 41px; background: #fff; color: var(--ink); overflow: hidden; font-size: 13px; line-height: 1.3; }
.sb { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 6px 28px 0; font-size: 13px; font-weight: 600; }
.sb svg { display: block; }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 10px; }
.appbar b { font-size: 17px; letter-spacing: -.02em; }
.appbar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.views { position: absolute; top: 96px; left: 0; right: 0; bottom: 74px; }
.view { position: absolute; inset: 0; padding: 4px 18px 0; opacity: 0; transform: translateX(24px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; overflow: hidden; }
.view.on { opacity: 1; transform: none; pointer-events: auto; }
.view.left { transform: translateX(-24px); }
.v-title { font-size: 22px; line-height: 26px; font-weight: 600; letter-spacing: -.02em; }
.v-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 10px 18px; background: #fff; }
.tabbar span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #9a9a9a; transition: color .3s; }
.tabbar span.on { color: var(--ink); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }

.jr .tabbar { grid-template-columns: repeat(4, 1fr); }

/* phone */
.jr-phone { width: 340px; height: 700px; transform-origin: 50% 50%; }
.jr-phone .phone { margin: 0; }
.jr-phone .screen { transition: background .4s; }
.screen.is-cam { background: #000; }
.screen.is-cam .sb { color: #fff; }
.screen.is-cam .sb svg * { fill: #fff; stroke: #fff; }
.screen.is-cam .appbar, .screen.is-cam .tabbar { opacity: 0; }
.appbar, .tabbar { transition: opacity .3s; }
.appbar .bag { position: relative; display: flex; align-items: center; gap: 10px; }
.appbar .bag svg { width: 22px; height: 22px; }
.appbar .bag em { position: absolute; left: 13px; top: -5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--lipstick); color: #fff; font: 600 10px/16px var(--sans); text-align: center; font-style: normal; transform: scale(0); transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.appbar .bag em.in { transform: scale(1); }
.jv { position: absolute; inset: 0; padding: 4px 18px 0; opacity: 0; transform: translateX(22px); transition: opacity .4s ease, transform .4s ease; pointer-events: none; overflow: hidden; }
.jv.on { opacity: 1; transform: none; pointer-events: auto; }
.jv.past { transform: translateX(-22px); }
.jv.cam { top: -46px; bottom: -74px; padding: 0; }
[data-at] { transition: opacity .35s ease, transform .35s ease; }

/* beat 0: scan */
.cam-top { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 6px 20px 10px; font-size: 13px; font-weight: 600; }
.cam-top .mono { color: rgba(255,255,255,.6); font-size: 10px; }
.cam-frame { position: relative; margin: 0 0; aspect-ratio: 4 / 5; overflow: hidden; background: #111; }
.cam-frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.95); }
.cam-frame .mesh { position: absolute; inset: 0; width: 100%; height: 100%; }
.mesh-l line { stroke: #fff; stroke-width: 2; opacity: calc(clamp(0, (var(--t, 0) * 1.25 - var(--y)) * 8, 1) * .55); }
.mesh-d circle { fill: #fff; opacity: clamp(0, calc((var(--t, 0) * 1.25 - var(--y)) * 12), 1); }
.scanline { position: absolute; left: 0; right: 0; top: calc(var(--t, 0) * 110% - 5%); height: 70px; transform: translateY(-100%); background: linear-gradient(180deg, rgba(246,212,218,0), rgba(246,212,218,.35)); border-bottom: 2px solid var(--puff); opacity: calc(1 - clamp(0, (var(--t, 0) - .85) * 8, 1)); }
.guide { position: absolute; inset: 0; width: 100%; height: 100%; }
.guide ellipse { fill: none; stroke: rgba(255,255,255,.8); stroke-width: 5; }
.cam-hint { display: flex; align-items: center; gap: 12px; color: #fff; padding: 18px 20px; }
.cam-hint svg { width: 48px; height: 48px; transform: rotate(-90deg); flex-shrink: 0; }
.cam-hint .trk { stroke: rgba(255,255,255,.2); }
.cam-hint .val { stroke: var(--puff); stroke-dasharray: 126; stroke-dashoffset: calc(126 * (1 - var(--t, 0))); }
.cam-hint b { display: block; font-size: 15px; }
.cam-hint small { color: rgba(255,255,255,.6); font-size: 12px; }
.shutter { margin: 4px auto 0; width: 62px; height: 62px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.shutter i { width: 48px; height: 48px; border-radius: 50%; background: #fff; }

/* beat 1: reading */
.rd-img { position: relative; height: 370px; margin: 8px -18px 0; overflow: hidden; background: var(--tile); }
.rd-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.pt { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.35); opacity: 0; transform: scale(0); }
.pt.in { opacity: 1; transform: none; }
.mk { position: absolute; background: #fff; padding: 5px 8px; font-size: 11px; line-height: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.12); opacity: 0; transform: translateY(6px); }
.mk small { display: block; font: 9px/12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mk.in { opacity: 1; transform: none; }
.rd-sum { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.rd-sum b { font-size: 30px; line-height: 32px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rd-sum .sw4 { display: flex; gap: 4px; }
.rd-sum .sw4 i { width: 22px; height: 22px; opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s; }
.rd-sum .sw4.in i { opacity: 1; transform: none; }
.rd-bar { display: flex; gap: 3px; margin-top: 12px; }
.rd-bar i { flex: 1; height: 4px; background: var(--line); }
.rd-bar i.in { background: var(--ink); }

/* beat 2: twins radar */
.jr .radar { position: relative; height: 250px; margin: 4px -18px 0; }
.jr .radar .you { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ink); z-index: 2; }
.jr .radar .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid var(--line); transform: translate(-50%, -50%); }
.jr .radar .r1 { width: 160px; height: 160px; }
.jr .radar .r2 { width: 236px; height: 236px; border-style: dashed; }
.jr .radar .pulse { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; border: 2px solid var(--puff); opacity: 0; }
.jv.on .radar .pulse { animation: jr-pulse 2.4s ease-out infinite; }
.jv.on .radar .pulse.p2 { animation-delay: 1.2s; }
@keyframes jr-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
.jr .radar .tw { position: absolute; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); transform: scale(0); transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.jr .radar .tw.in { transform: scale(1); }
.jr .radar .youlbl { position: absolute; left: 50%; top: calc(50% + 40px); transform: translateX(-50%); background: var(--ink); color: #fff; font: 10px/14px var(--mono); padding: 2px 8px; letter-spacing: .06em; z-index: 3; }
.jr .count { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.jr .count b { font-size: 34px; line-height: 36px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.jr .why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.jr .why span { border: 1px solid var(--line); padding: 5px 9px; font-size: 11px; opacity: 0; transform: translateY(6px); }
.jr .why span.in { opacity: 1; transform: none; }

/* beat 3: picked for you (products ranked by twins) */
.pk-chips { display: flex; gap: 6px; margin-top: 10px; }
.pk-chips span { font-size: 11px; padding: 5px 10px; border: 1px solid var(--line); }
.pk-chips span:first-child { background: var(--ink); border-color: var(--ink); color: #fff; }
.pk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pk { position: relative; opacity: 0; transform: translateY(14px); }
.pk.in { opacity: 1; transform: none; }
.pk .im { position: relative; aspect-ratio: 4 / 5; background: var(--tile) center / cover no-repeat; }
.pk .tr { position: absolute; left: 6px; bottom: 6px; background: #fff; font-size: 10px; line-height: 13px; padding: 3px 6px; }
.pk .tr b { color: var(--lipstick); }
.pk .rank { position: absolute; left: 6px; top: 6px; background: var(--puff); font: 9px/12px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 2px 5px; }
.pk h4 { margin: 6px 0 0; font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; }
.pk h4 span { font-weight: 400; }
.pk small { display: block; color: var(--muted); font-size: 10.5px; }
.tap { position: absolute; left: 50%; top: 45%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(18,18,18,.18); border: 2px solid rgba(255,255,255,.9); opacity: 0; transform: scale(1.6); z-index: 3; }
.tap.in { opacity: 1; transform: scale(1); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(0,0,0,.14); padding: 10px 18px 16px; transform: translateY(105%); transition: transform .45s cubic-bezier(.2,.8,.2,1); z-index: 4; }
.sheet.in { transform: none; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheet .rates2 { margin-top: 8px; }
.sheet .kept { margin-top: 10px; }
.sheet .kept .bar i { width: 72%; }
.sheet .cta2 { display: flex; gap: 8px; margin-top: 12px; }
.sheet .cta2 span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 10px 0; border: 1px solid var(--ink); }
.sheet .cta2 span.pri { background: var(--lipstick); border-color: var(--lipstick); color: #fff; }
/* shared rating blocks (also used in the sheet) */
.jr .rates2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jr .rate2 { border: 1px solid var(--line); padding: 10px; }
.jr .rate2.twin { background: var(--puff); border-color: var(--puff); }
.jr .rate2 .n { font-size: 26px; line-height: 28px; font-weight: 600; letter-spacing: -.03em; }
.jr .rate2 .st { color: var(--lipstick); font-size: 11px; letter-spacing: 1px; }
.jr .rate2 small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.jr .kept .row { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 5px; }
.jr .kept .bar { height: 5px; background: var(--tile); overflow: hidden; }
.jr .kept .bar i { display: block; height: 100%; background: var(--ink); }

/* beat 4: try on */
.to-img { position: relative; height: 340px; margin: 6px -18px 0; overflow: hidden; background: var(--tile); }
.to-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.to-img .after { clip-path: inset(0 calc((1 - var(--wipe, 0)) * 100%) 0 0); }
.to-img .wline { position: absolute; top: 0; bottom: 0; left: calc(var(--wipe, 0) * 100%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.2); }
.to-img .tg { position: absolute; top: 10px; font: 9px/12px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; background: #fff; }
.to-ctl { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.to-ctl .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.to-ctl .sws { display: flex; gap: 6px; }
.to-ctl .sws i { width: 22px; height: 22px; }
.to-ctl .sws i.sel { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.to-ctl .trk2 { height: 4px; background: var(--line); position: relative; }
.to-ctl .trk2 i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(30% + var(--t, 0) * 30%); background: var(--ink); }
.to-ctl .trk2 b { position: absolute; top: -7px; left: calc(30% + var(--t, 0) * 30%); width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.btn-ph { display: block; text-align: center; font-size: 13px; font-weight: 600; padding: 12px 0; background: var(--lipstick); color: #fff; }

/* beat 5: add to bag */
.bg-prod { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.bg-prod .im { width: 92px; height: 115px; background: var(--tile) center / cover no-repeat; flex-shrink: 0; }
.bg-prod b { display: block; font-size: 17px; }
.bg-prod .muted { font-size: 12px; }
.bg-prod .tr { font-size: 11px; margin-top: 6px; }
.bg-prod .tr b { display: inline; font-size: 11px; color: var(--lipstick); }
.addbtn { position: relative; margin-top: 14px; height: 46px; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--lipstick); color: #fff; overflow: hidden; transition: background .3s; }
.addbtn span { position: absolute; transition: transform .35s, opacity .35s; }
.addbtn .b { transform: translateY(120%); opacity: 0; }
.addbtn.in { background: var(--ink); }
.addbtn.in .a { transform: translateY(-120%); opacity: 0; }
.addbtn.in .b { transform: none; opacity: 1; }
.bag-sheet .line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.bag-sheet .line .im { width: 40px; height: 50px; background: var(--tile) center / cover no-repeat; flex-shrink: 0; }
.bag-sheet .line div { flex: 1; }
.bag-sheet .line small { display: block; color: var(--muted); font-size: 10.5px; }
.bag-sheet .up { background: var(--tile); padding: 8px 10px; font-size: 11.5px; display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.bag-sheet .up b { color: var(--lipstick); }
.bag-sheet .tot { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin: 10px 0; }

/* responsive */
@media (max-width: 1100px) {
  .jr-sticky { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 10px; padding: 14px var(--pad) 8px; align-items: start; justify-items: center; }
  .jr-intro { padding-bottom: 6px; }
  .jr-intro h2, .jr-intro .hint { display: none; }
  .jr-left { width: 100%; }
  .acts { min-height: 84px; width: 100%; }
  .act h3 { font-size: 22px; line-height: 26px; margin: 6px 0 0; max-width: none; }
  .act p { display: none; }
  .beats { margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .beats::-webkit-scrollbar { display: none; }
  .beat { flex-shrink: 0; }
  .callouts { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .jr *, .jr *::before { transition: none !important; animation: none !important; }
}
