/* ============ How it works page ============ */

.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--light:hover { background: #f1f1f1; }
.login[aria-current="page"] { border-bottom-color: var(--red); }

/* ---------- Intro ---------- */
.how-hero { padding-block: 64px 24px; }
.how-hero h1 { max-width: 1000px; }
.how-hero .hero__lead { margin-bottom: 40px; }
.how-hero__hint {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
}
.how-hero__arrow {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--ink); color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.how-hero__arrow svg { width: 22px; height: 22px; animation: nudge 1.8s cubic-bezier(.45,0,.25,1) infinite; }
.how-hero__hint:hover .how-hero__arrow { background: var(--red); border-color: var(--red); color: #fff; }
.how-hero__hint:focus-visible { outline: none; }
.how-hero__hint:focus-visible .how-hero__arrow { box-shadow: 0 0 0 4px rgba(244,71,45,.3); }
@keyframes nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(5px); } }

/* ---------- Story layout ---------- */
.story { padding-bottom: 80px; }
.story__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 80px); }
.story__steps { padding-block: 10vh 30vh; }
.step {
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: center;
  opacity: .28; transition: opacity .45s ease;
}
.step.is-active { opacity: 1; }
.step__num { font-family: var(--mono); font-size: 15px; letter-spacing: .2em; color: var(--red); margin-bottom: 18px; }
.step h2 { font-weight: 400; font-size: clamp(30px, 3.2vw, 48px); line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 22px; }
.step p { font-size: clamp(17px, 1.3vw, 21px); line-height: 1.65; color: #2a2a2a; max-width: 540px; margin-bottom: 26px; }
.step__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.step__tags li { font-size: 14px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; }

.story__stage { position: sticky; top: 132px; height: calc(100vh - 156px); min-height: 460px; max-height: 780px; }
.stage {
  position: relative; width: 100%; height: 100%;
  border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(244,71,45,.14), transparent 70%),
    radial-gradient(50% 40% at 10% 95%, rgba(142,140,245,.14), transparent 70%),
    #f8f5f3;
}
.stage__rail { position: absolute; left: 28px; right: 110px; top: 30px; height: 3px; background: rgba(0,0,0,.08); border-radius: 3px; overflow: hidden; }
.stage__rail-fill { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: var(--red); }
.stage__count { position: absolute; right: 28px; top: 20px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.stage__count span { color: var(--ink); }

/* The scene coordinate system: a fixed 520×520 box scaled to fit */
.stage__box {
  position: absolute; left: 50%; top: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -46%) scale(var(--k, 1));
}
.scene {
  --p: 0;
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: scale(.96);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1), visibility 0s linear .5s;
}
.scene.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* ---------- 3D hard drive ---------- */
.hdd-view { position: absolute; width: 0; height: 0; perspective: 1100px; }
.hdd { position: absolute; width: 0; height: 0; transform-style: preserve-3d; }
.hdd__face { position: absolute; left: 0; top: 0; backface-visibility: hidden; }
.hdd__top, .hdd__bottom { width: 200px; height: 140px; border-radius: 6px; }
.hdd__top {
  transform: translate(-50%, -50%) translateZ(12px);
  background:
    linear-gradient(115deg, rgba(255,255,255,.55), transparent 35%, rgba(255,255,255,.25) 60%, transparent 80%),
    repeating-linear-gradient(90deg, #c9ced5 0 2px, #bfc5cd 2px 4px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  overflow: hidden;
}
.hdd__bottom {
  transform: translate(-50%, -50%) rotateY(180deg) translateZ(12px);
  background: linear-gradient(135deg, #3b4450, #1f252d);
}
.hdd__front, .hdd__back { width: 200px; height: 24px; }
.hdd__front {
  transform: translate(-50%, -50%) rotateX(-90deg) translateZ(70px);
  background:
    repeating-linear-gradient(90deg, transparent 0 60px, #d8b04a 60px 63px, transparent 63px 66px) 0 8px / 100% 8px no-repeat,
    linear-gradient(#9aa2ad, #6f7782);
}
.hdd__back { transform: translate(-50%, -50%) rotateX(90deg) translateZ(70px); background: linear-gradient(#8b939e, #5f6772); }
.hdd__left, .hdd__right { width: 24px; height: 140px; }
.hdd__left  { transform: translate(-50%, -50%) rotateY(-90deg) translateZ(100px); background: linear-gradient(90deg, #7a828d, #a3abb5); }
.hdd__right { transform: translate(-50%, -50%) rotateY(90deg) translateZ(100px); background: linear-gradient(90deg, #a3abb5, #6b737e); }

.hdd__screw { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f3f4f6, #7d858f 70%); }
.hdd__screw:nth-child(1) { left: 8px; top: 8px; }
.hdd__screw:nth-child(2) { right: 8px; top: 8px; }
.hdd__screw:nth-child(3) { left: 8px; bottom: 8px; }
.hdd__screw:nth-child(4) { right: 8px; bottom: 8px; }
.hdd__label {
  position: absolute; left: 26px; right: 26px; top: 26px; bottom: 26px;
  background: #fff; border-radius: 3px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.hdd__label strong { font-family: var(--display); font-weight: 400; font-size: 13px; letter-spacing: .04em; }
.hdd__label small { font-family: var(--mono); font-size: 9px; color: #666; }
.hdd__label i {
  margin-top: auto; height: 18px; width: 70%;
  background: repeating-linear-gradient(90deg, #1b1b1b 0 2px, transparent 2px 3px, #1b1b1b 3px 4px, transparent 4px 7px);
}

/* ---------- Scene 1: booking ---------- */
.scene--book { --rot: -40; --c: 0; }
.hdd-view--book { left: 260px; top: 170px; animation: bob 4s ease-in-out infinite; }
.hdd-view--book .hdd { transform: rotateX(58deg) rotateZ(calc(var(--rot) * 1deg)); }
@keyframes bob { 50% { transform: translateY(-10px); } }

.booking {
  position: absolute; left: 70px; top: 300px; width: 380px;
  background: #fff; border-radius: 16px; padding: 20px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.10);
  opacity: var(--c); transform: translateY(calc((1 - var(--c)) * 40px));
}
.booking__head { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.booking__tick { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #1b3a00; font-size: 15px; }
.booking__row {
  display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #eee; font-size: 15px;
  opacity: 0; transform: translateX(-10px); transition: opacity .35s, transform .35s;
}
.booking__row span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.booking__row.is-on { opacity: 1; transform: none; }

/* ---------- Scene 2: GPS collection ---------- */
.map { position: absolute; left: 0; top: 0; width: 520px; height: 380px; border-radius: 20px; overflow: hidden; background: #ece7e3; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.map__svg { width: 100%; height: 100%; display: block; }
.map__roads path { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: round; }
.map__route-base { fill: none; stroke: rgba(0,0,0,.18); stroke-width: 4; stroke-dasharray: 2 10; stroke-linecap: round; }
.map__route { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; }
.map__pin circle { fill: #fff; stroke: var(--ink); stroke-width: 4; }
.map__pin--site circle { stroke: var(--red); }
.map__pin text { font-family: var(--sans); font-size: 15px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.map__van rect, .map__van path { fill: var(--ink); }
.map__wheel { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.map__pulse { fill: var(--red); opacity: .22; transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: .45; } to { transform: scale(1.3); opacity: 0; } }

.gps {
  position: absolute; left: 0; top: 404px;
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 12px 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08); font-size: 15px; font-weight: 500;
}
.gps__dot { width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,.2); }
.sealed {
  position: absolute; right: 0; top: 404px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 18px; font-size: 15px;
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s;
}
.sealed.is-on { opacity: 1; transform: none; }
.sealed strong { color: var(--green); }

/* ---------- Scene 3: transit + erasure ---------- */
.scene--wipe { --t: 0; --w: 0; }
.transit { position: absolute; left: 0; right: 0; top: 10px; display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500; }
.transit__line { flex: 1; height: 3px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 6px, transparent 6px 12px); position: relative; }
.transit__line::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: calc(var(--t) * 100%); background: var(--red); }
.transit__van {
  position: absolute; top: 50%; left: calc(var(--t) * 100%);
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 5px rgba(244,71,45,.25);
}
.transit__van::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }

.hdd-view--wipe { left: 260px; top: 210px; }
.hdd-view--wipe .hdd { transform: rotateX(58deg) rotateZ(-28deg); }
.hdd-view--wipe .hdd__top::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--w) * 100%);
  background: rgba(182,242,58,.35); z-index: 1;
}
.hdd-view--wipe .hdd__top::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: calc(var(--w) * 100%); width: 4px; margin-left: -2px;
  background: var(--green); box-shadow: 0 0 18px 6px rgba(182,242,58,.8); z-index: 2;
  opacity: calc(1 - var(--w) * var(--w));
}

.wipe { position: absolute; left: 60px; right: 60px; top: 360px; background: #151920; color: #fff; border-radius: 16px; padding: 18px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.wipe__top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 13px; color: #aab2bd; margin-bottom: 12px; }
.wipe__top strong { font-family: var(--sans); font-size: 30px; color: #fff; font-weight: 500; }
.wipe__bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.wipe__bar span { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--green); }
.wipe__meta { display: flex; justify-content: space-between; margin-top: 12px; font-family: var(--mono); font-size: 12px; color: #aab2bd; }
.wipe__ok { color: var(--green); opacity: 0; transition: opacity .3s; }
.scene--wipe.is-verified .wipe__ok { opacity: 1; }

/* ---------- Scene 4: shredder ---------- */
.scene--shred { --d: 0; --s: 0; }
.feed { position: absolute; left: 110px; top: 0; width: 300px; height: 262px; overflow: hidden; }
.hdd-view--shred { left: 150px; top: calc(110px + var(--d) * 250px); }
.hdd-view--shred .hdd { transform: rotateX(-14deg) rotateY(22deg) rotateZ(calc(var(--d) * 4deg)); }

.shredder { position: absolute; left: 90px; top: 248px; width: 340px; }
.shredder__mouth {
  position: relative; z-index: 2;
  height: 22px; margin: 0 10px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(#0e1116, #2a2f37);
  box-shadow: inset 0 6px 8px rgba(0,0,0,.6);
}
.shredder__body {
  height: 170px; border-radius: 0 0 22px 22px;
  background: linear-gradient(160deg, #ff6a4d, var(--red) 40%, var(--red-deep));
  box-shadow: 0 30px 60px rgba(180,20,10,.25), inset 0 -8px 0 rgba(0,0,0,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.shredder__window {
  width: 200px; height: 72px; border-radius: 12px; background: #151920;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.08);
  overflow: hidden;
}
.cog {
  width: 64px; height: 64px; border-radius: 50%;
  background:
    radial-gradient(circle, #151920 0 18%, transparent 19%),
    radial-gradient(circle, #8a929d 0 55%, transparent 56%),
    repeating-conic-gradient(#8a929d 0 12deg, transparent 12deg 30deg);
}
.cog--b { animation-direction: reverse !important; }
.scene--shred.is-active .cog { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shredder__brand { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.85); }

.shreds { position: absolute; left: 130px; top: 440px; width: 260px; height: 80px; overflow: hidden; }
.shreds span {
  position: absolute; top: 0; left: calc(var(--i) * 14px + 6px);
  width: 7px; height: 22px; border-radius: 2px;
  background: linear-gradient(#c9ced5, #6f7782);
  opacity: min(1, calc(var(--s) * 6));
  transform: translateY(calc(var(--s) * (52px + var(--j) * 3px) - 30px)) rotate(calc(var(--i) * 37deg));
}
.shreds span:nth-child(1)  { --i: 0;  --j: 2; }
.shreds span:nth-child(2)  { --i: 1;  --j: 5; }
.shreds span:nth-child(3)  { --i: 2;  --j: 1; }
.shreds span:nth-child(4)  { --i: 3;  --j: 6; }
.shreds span:nth-child(5)  { --i: 4;  --j: 3; }
.shreds span:nth-child(6)  { --i: 5;  --j: 7; }
.shreds span:nth-child(7)  { --i: 6;  --j: 2; }
.shreds span:nth-child(8)  { --i: 7;  --j: 5; }
.shreds span:nth-child(9)  { --i: 8;  --j: 0; }
.shreds span:nth-child(10) { --i: 9;  --j: 6; }
.shreds span:nth-child(11) { --i: 10; --j: 3; }
.shreds span:nth-child(12) { --i: 11; --j: 4; }
.shreds span:nth-child(13) { --i: 12; --j: 1; }
.shreds span:nth-child(14) { --i: 13; --j: 7; }
.shreds span:nth-child(15) { --i: 14; --j: 2; }
.shreds span:nth-child(16) { --i: 15; --j: 5; }
.shreds span:nth-child(17) { --i: 16; --j: 3; }
.shreds span:nth-child(18) { --i: 17; --j: 6; }

.destroyed {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, 10px);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 20px; font-size: 15px; white-space: nowrap;
  opacity: 0; transition: opacity .35s, transform .35s;
}
.destroyed.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scene 5: second life ---------- */
.scene--life { --r: 0; }
.laptop { position: absolute; left: 110px; top: 40px; width: 300px; opacity: var(--r); transform: translateY(calc((1 - var(--r)) * 40px)); }
.laptop__screen {
  height: 196px; border-radius: 14px 14px 4px 4px; padding: 10px;
  background: #1b1f26; box-shadow: 0 30px 60px rgba(0,0,0,.18);
}
.laptop__ui {
  height: 100%; border-radius: 6px;
  background: linear-gradient(135deg, #8e8cf5, #f3a8a0 70%, #ffd3b8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; text-align: center;
}
.laptop__grade { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; background: rgba(255,255,255,.25); padding: 4px 10px; border-radius: 999px; margin-bottom: 6px; }
.laptop__ui strong { font-family: var(--display); font-weight: 400; font-size: 30px; }
.laptop__ui small { font-size: 13px; opacity: .9; }
.laptop__base {
  height: 16px; margin: 0 -36px; border-radius: 2px 2px 14px 14px;
  background: linear-gradient(#d6dae0, #9aa2ad);
  position: relative;
}
.laptop__base::after { content: ""; position: absolute; left: 50%; top: 0; width: 70px; height: 6px; margin-left: -35px; border-radius: 0 0 6px 6px; background: rgba(0,0,0,.12); }

.checks { list-style: none; position: absolute; left: 30px; right: 30px; top: 300px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks li {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 500;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s;
}
.checks li span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--green); color: #1b3a00; font-size: 13px; font-weight: 700; }
.checks li.is-on, .leaf.is-on { opacity: 1; transform: none; }
.leaf {
  position: absolute; left: 50%; top: 440px; margin-left: -110px; width: 220px; text-align: center;
  background: #1f3d12; color: var(--green); border-radius: 999px; padding: 12px 16px; font-size: 15px; font-weight: 600;
  opacity: 0; transform: translateY(10px); transition: opacity .35s, transform .35s;
}

/* ---------- Closing CTA ---------- */
.how-cta { background: var(--ink); color: #fff; text-align: center; padding-block: 110px; }
.how-cta h2 { font-weight: 400; font-size: clamp(34px, 4vw, 58px); letter-spacing: -0.02em; margin-bottom: 20px; }
.how-cta p { font-size: clamp(17px, 1.4vw, 22px); color: #cfcfcf; margin: 0 auto 40px; max-width: 640px; line-height: 1.55; }

/* ---------- Responsive: stage pinned on top, text scrolls beneath ---------- */
@media (max-width: 900px) {
  .story__inner { grid-template-columns: 1fr; gap: 0; }
  .story__stage { order: -1; top: 80px; height: 46vh; min-height: 300px; z-index: 5; padding-bottom: 12px; background: #fff; }
  .stage { border-radius: 20px; }
  .story__steps { padding-block: 4vh 30vh; }
  .step { min-height: 64vh; justify-content: flex-start; padding-top: 6vh; }
  .stage__rail { left: 18px; right: 84px; top: 22px; }
  .stage__count { right: 18px; top: 13px; font-size: 12px; }
}

/* No-JS: hide the stage (the text still tells the story) */
html:not(.js) .story__stage { display: none; }
html:not(.js) .step { opacity: 1; min-height: 0; padding-block: 40px; }

@media (prefers-reduced-motion: reduce) {
  .hdd-view--book, .map__pulse, .cog, .how-hero__arrow svg { animation: none !important; }
  .scene, .step { transition: none; }
}
