/* ==========================================================================
   S05 — Deep cleaning & sanitization: sticky layered-surface storytelling
   ========================================================================== */
.s05 {
  position: relative;
  padding-top: var(--section-y);
  background:
    linear-gradient(rgba(52, 127, 131, .06) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(52, 127, 131, .06) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(180deg, var(--white) 0%, var(--mint) 22%, var(--mint) 80%, var(--white) 100%);
}
.s05 .st-mint { stop-color: var(--mint); }
.s05 .st-white { stop-color: var(--white); }
.s05 .st-lime { stop-color: var(--lime); }

/* ---------- Head ---------- */
.s05__head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.s05__title { margin-top: 1.1rem; max-width: 15ch; }
.s05__compare { display: grid; gap: .9rem; }
.s05__cmp { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.1rem 1.3rem; border-radius: var(--r-md); background: rgba(255, 255, 255, .75); border: 1px solid var(--line); }
.s05__cmp--deep { background: var(--forest); color: #fff; border-color: transparent; }
.s05__cmp-ico { flex: none; width: 56px; height: 36px; margin-top: .2rem; }
.s05__cmp-ico path { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; }
.s05__cmp--deep .s05__cmp-ico path { stroke: var(--lime); }
.s05__cmp-title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.s05__cmp p { margin-top: .25rem; font-size: .94rem; color: var(--ink-soft); }
.s05__cmp--deep p { color: rgba(255, 255, 255, .75); }

/* ---------- Track + sticky stage ---------- */
.s05__track { position: relative; height: 520vh; margin-top: clamp(2rem, 4vw, 3rem); }
.s05__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; overflow: hidden; }
.s05__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-top: calc(var(--nav-h) * .6); }

/* rail */
.s05__rail { position: relative; display: grid; gap: .15rem; padding-left: 1.6rem; margin-bottom: clamp(1.5rem, 3.5vh, 2.6rem); counter-reset: none; }
.s05__rail::before { content: ""; position: absolute; left: 5px; top: .9rem; bottom: .9rem; width: 2px; background: var(--line); border-radius: 2px; }
.s05__rail::after { content: ""; position: absolute; left: 5px; top: .9rem; bottom: .9rem; width: 2px; background: linear-gradient(var(--teal), var(--lime)); border-radius: 2px; transform-origin: 50% 0; transform: scaleY(var(--rp, 0)); }
.s05__rail-btn { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 44px; width: 100%; text-align: left; color: var(--ink-soft); transition: color .4s; }
.s05__rail-btn::before { content: ""; position: absolute; left: calc(-1.6rem + 1px); top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--white); border: 2px solid var(--teal-300); transition: background .4s, border-color .4s, transform .5s var(--ease-spring); }
.s05__rail-n { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; }
.s05__rail-t { font-weight: 600; font-size: .95rem; transition: transform .5s var(--ease-out); }
.s05__rail-btn:hover { color: var(--forest); }
.s05__rail-btn.is-done::before { background: var(--teal); border-color: var(--teal); }
.s05__rail-btn.is-active { color: var(--forest); }
.s05__rail-btn.is-active::before { background: var(--lime); border-color: var(--forest); transform: scale(1.35); }
.s05__rail-btn.is-active .s05__rail-t { transform: translateX(6px); }
.s05__rail-btn.is-active .s05__rail-n { color: var(--teal-700); }

/* stage text: wipe-up mask transitions */
.s05__stages { display: grid; }
.s05__stage { grid-area: 1 / 1; visibility: hidden; clip-path: inset(0 0 100% 0); transform: translateY(18px); transition: clip-path .7s var(--ease-out), transform .7s var(--ease-out), visibility 0s .7s; }
.s05__stage.is-active { visibility: visible; clip-path: inset(0 0 -10% 0); transform: none; transition-delay: 0s; }
.s05__stage-k { color: var(--teal-700); }
.s05__stage h3 { margin: .6rem 0 .7rem; color: var(--forest); }
.s05__stage p:not(.s05__stage-k) { color: var(--ink-soft); max-width: 44ch; }
.s05__cta { margin-top: 1.2rem; }

/* ---------- Visualization ---------- */
.s05__viz { position: relative; width: 100%; max-width: 760px; justify-self: center; }
.s05__svg { width: 100%; height: auto; aspect-ratio: 650 / 670; overflow: visible; }
.s05__shadow ellipse { fill: var(--teal); opacity: .12; }
.s05__shadow { transform-origin: 300px 600px; }
.s05__layer, .s05__mist, .s05__done, .s05__shadow { will-change: transform; }
.s05__side--l { fill: var(--teal); opacity: .5; }
.s05__side--r { fill: var(--teal-700); opacity: .6; }
.s05__layer[data-l="0"] .s05__side--l { fill: var(--teal-700); opacity: .9; }
.s05__layer[data-l="0"] .s05__side--r { fill: var(--forest); opacity: .9; }
.s05__face { stroke: var(--teal); stroke-width: 1; vector-effect: non-scaling-stroke; }
.s05__face--base { stroke-opacity: .5; }
.s05__face--glass { fill: rgba(255, 255, 255, .16); stroke-opacity: .55; }
.s05__face--top { fill: rgba(255, 255, 255, .42); stroke-opacity: .7; transition: fill .6s; }
.s05.is-clean .s05__face--top { fill: rgba(255, 255, 255, .82); }
.s05__sheen { opacity: 0; }

.s05__touch .s05__tglow { fill: var(--lime); opacity: calc(var(--t, 0) * .55); }
.s05__touch .s05__tcore { fill: var(--teal); }
.s05__touch .s05__tping { fill: none; stroke: var(--lime-700); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.s05.is-touch .s05__tping { animation: s05-ping 1.6s var(--ease-out) infinite; }
.s05.is-touch .s05__touch g:nth-child(2) .s05__tping { animation-delay: .3s; }
.s05.is-touch .s05__touch g:nth-child(3) .s05__tping { animation-delay: .6s; }
.s05.is-touch .s05__touch g:nth-child(4) .s05__tping { animation-delay: .9s; }
.s05.is-touch .s05__touch g:nth-child(5) .s05__tping { animation-delay: 1.2s; }

.s05__zone-box { fill: none; stroke: var(--teal); stroke-opacity: .6; stroke-dasharray: 4 4; }
.s05__zone-hl { fill: var(--lime); opacity: 0; }
.s05__zone--k .s05__zone-hl { opacity: calc(var(--zk, 0) * .8); }
.s05__zone--b .s05__zone-hl { opacity: calc(var(--zb, 0) * .8); }
.s05__zone-art { fill: none; stroke: var(--teal-700); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .7; }
.s05__zone-t { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; fill: var(--teal-700); }

.s05__residue ellipse { fill: var(--charcoal); opacity: .26; }
.s05__dust circle { fill: var(--charcoal); opacity: .5; }
.s05__wipe { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: 26; stroke-linecap: round; opacity: .8; }

.s05__lbl path { fill: none; stroke: var(--teal); stroke-width: 1.2; stroke-dasharray: 2 3; }
.s05__lbl circle { fill: var(--teal); }
.s05__lbl text { font-family: var(--font-display); font-weight: 600; font-size: 19px; fill: var(--forest); letter-spacing: -.01em; }
.s05__lbl .s05__lbl-sub { font-family: var(--font-mono); font-weight: 400; font-size: 10.5px; letter-spacing: .14em; fill: var(--teal-700); }
.s05__lbl { opacity: var(--lo, 0); transition: opacity .3s; }
.s05__lbl.is-hot circle { fill: var(--lime-700); r: 6; }
.s05__lbl.is-hot path { stroke: var(--lime-700); stroke-dasharray: none; stroke-width: 2; }
.s05__lbl.is-hot text:not(.s05__lbl-sub) { fill: var(--teal-700); }

.s05__mist { opacity: 0; }
.s05__done { opacity: 0; transform: translate(300px, 260px); }
.s05__done rect { fill: var(--forest); }
.s05__done circle { fill: var(--lime); }
.s05__done path { fill: none; stroke: var(--forest); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.s05__done text { font-family: var(--font-display); font-weight: 600; font-size: 19px; fill: #fff; }

.s05__caption { position: absolute; left: 0; bottom: -.5rem; display: flex; align-items: center; gap: .7rem; color: var(--teal-700); }
.s05__caption-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime-700); animation: hh-pulse 2s var(--ease-in-out) infinite; }
.s05__meter { position: relative; width: 90px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.s05__meter i { position: absolute; inset: 0; background: var(--teal); transform-origin: 0 50%; transform: scaleX(var(--rp, 0)); }

@keyframes s05-ping { 0% { opacity: .9; transform: scale(.8); } 100% { opacity: 0; transform: scale(3); } }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .s05__head { grid-template-columns: 1fr; align-items: start; }
  .s05__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .s05__rail-t { font-size: .86rem; }
}

/* ---------- Mobile: viz on top, compact numbered rail + stage text below ---------- */
@media (max-width: 900px) {
  .s05__track { height: 560vh; }
  .s05__sticky { align-items: stretch; }
  .s05__grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; gap: .6rem; padding-top: calc(var(--nav-h) * .55); padding-bottom: 1rem; }
  .s05__viz { order: -1; max-width: 460px; width: 100%; }
  .s05__svg { max-height: 48svh; margin-inline: auto; }
  .s05__lbl text { font-size: 24px; }
  .s05__lbl .s05__lbl-sub { display: none; }
  .s05__caption { position: static; justify-content: center; margin-top: .2rem; }
  .s05__rail { display: flex; justify-content: space-between; padding-left: 0; margin: .4rem 0 1rem; gap: 0; }
  .s05__rail::before, .s05__rail::after { left: 22px; right: 22px; top: 50%; bottom: auto; width: auto; height: 2px; }
  .s05__rail::after { transform-origin: 0 50%; transform: scaleX(var(--rp, 0)); }
  .s05__rail li { position: relative; z-index: 1; }
  .s05__rail-btn { width: 44px; height: 44px; justify-content: center; border-radius: 50%; background: var(--white); border: 1.5px solid var(--teal-300); }
  .s05__rail-btn::before { display: none; }
  .s05__rail-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .s05__rail-btn.is-done { border-color: var(--teal); background: var(--mint); }
  .s05__rail-btn.is-active { background: var(--lime); border-color: var(--forest); }
  .s05__rail-btn.is-active .s05__rail-n { color: var(--forest); }
  .s05__stage h3 { font-size: 1.45rem; margin: .35rem 0 .4rem; }
  .s05__stage p:not(.s05__stage-k) { font-size: .95rem; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .s05__svg { max-height: 40svh; }
}

/* ---------- Static fallback (reduced motion) ---------- */
.s05.is-static .s05__track { height: auto; }
.s05.is-static .s05__sticky { position: relative; height: auto; display: block; padding: 2rem 0 var(--section-y); }
.s05.is-static .s05__grid { align-items: start; }
.s05.is-static .s05__rail { display: none; }
.s05.is-static .s05__stages { gap: 1.6rem; }
.s05.is-static .s05__stage { grid-area: auto; visibility: visible; clip-path: none; transform: none; padding-left: 1.2rem; border-left: 2px solid var(--lime); }
.s05.is-static .s05__stage[data-stage="0"] { display: none; }
.s05.is-static .s05__viz { position: sticky; top: calc(var(--nav-h) + 1rem); }
.s05.is-static .s05__svg { max-height: none; }
@media (max-width: 900px) { .s05.is-static .s05__viz { position: relative; top: 0; } }
