/* 蝶 detail page, 2026-10-21. One sticky stage walks the 3D pad through
   正面 → 结构 → 表面 → 边缘 → 背面; the header, footer, cart and purchase box come from detail.css.
   Without JS (.bf-story lacks .bf-live) the chapters read as a plain stacked page. */
.bf,.bf-buy{--bg:#eff4f8;--paper:#f8fafc;--mute:#526779;--slate:#344c68;--cta:#151617;--rubber:#9eb0c2;--rule:rgba(52,76,104,.14)}
.bf{  --stage-h:calc(100vh - var(--header));--w:min(58vw,calc(100vw - 660px),calc((var(--stage-h) - 190px) * 900 / 771),900px);--t:9px;--spread:150px;
  --copy-left:calc(clamp(16px,3vw,44px) + 130px);font-size:15px;line-height:1.75}
@supports (height:100svh){.bf{--stage-h:calc(100svh - var(--header))}}
.bf img{max-width:100%;display:block}
.bf-num{font-variant-numeric:tabular-nums}
.bf h1,.bf h2,.bf h3{letter-spacing:0}

/* ---------- static fallback (no JS) ---------- */
.bf-story{position:relative}
.bf-stage{position:relative;padding:24px clamp(16px,5vw,72px) 48px}
.bf-word,.bf-gauge,.bf-tag,.bf-scan,.bf-rail,.bf-shadow,.bf-side,.bf-plane:not(.bf-art),.bf-frost,.bf-hint{display:none}
.bf-scene{position:relative}
.bf-pad{position:relative;width:min(100%,760px);aspect-ratio:900/771;margin:0 auto 32px}
.bf-plane{position:absolute;inset:0;border-radius:14px;overflow:hidden}
.bf-plane img{width:100%;height:100%;object-fit:cover}
.bf-copy{display:grid;gap:48px;margin-top:48px}
.bf-hero{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:24px}

/* ---------- animated stage ---------- */
.bf-live{height:760vh}
.bf-live .bf-stage{position:sticky;top:var(--header);height:var(--stage-h);overflow:hidden;padding:0;
  background:radial-gradient(70vmax 50vmax at 50% 45%,#fff,rgba(255,255,255,0) 70%),var(--bg)}
body.admin-bar .bf-live .bf-stage{top:calc(var(--header) + 32px);height:calc(var(--stage-h) - 32px)}
.bf-live .bf-word,.bf-live .bf-gauge,.bf-live .bf-tag,.bf-live .bf-scan,.bf-live .bf-shadow,.bf-live .bf-side,.bf-live .bf-plane,.bf-live .bf-frost{display:block}
.bf-live .bf-rail,.bf-live .bf-hint{display:flex}

.bf-word{position:absolute;left:50%;top:44%;z-index:0;pointer-events:none;user-select:none;white-space:nowrap;
  font-size:min(17vw,300px);letter-spacing:0;line-height:1;color:var(--slate);transform:translate(-50%,-50%)}

.bf-live .bf-scene{position:absolute;inset:0;perspective:1700px;perspective-origin:55% 40%;z-index:2}
.bf-live .bf-pad{position:absolute;left:50%;top:50%;width:var(--w);margin:calc(var(--w) * -771 / 1800) 0 0 calc(var(--w) / -2);
  transform-style:preserve-3d;will-change:transform;--ex:0}
.bf-plane{backface-visibility:hidden;-webkit-backface-visibility:hidden}
.bf-art{transform:translateZ(calc(var(--ex) * 8px));box-shadow:0 0 0 1px rgba(255,255,255,.6) inset}
.bf-art img{pointer-events:none}
.bf-frost{position:absolute;inset:0;width:100%;height:100%;cursor:crosshair;touch-action:pan-y}
.bf-coat{pointer-events:none;transform:translateZ(calc(2px + var(--ex) * var(--spread)));background:rgba(255,255,255,calc(var(--ex) * .45));
  box-shadow:0 0 0 1px rgba(52,76,104,calc(var(--ex) * .35)) inset}
.bf-coat .bf-grain{position:absolute;inset:0;opacity:calc(var(--ex) * .9);background-size:160px}
.bf-glare{position:absolute;inset:-20%;mix-blend-mode:screen;
  background:radial-gradient(circle at var(--gx,30%) var(--gy,25%),rgba(255,255,255,.5),rgba(255,255,255,0) 26%),linear-gradient(115deg,transparent 38%,rgba(255,255,255,.22) 47%,transparent 56%);
  background-size:100% 100%,260% 100%;background-position:0 0,var(--sheen,0%) 0}
.bf-base-top{transform:translateZ(calc(-1 * var(--t) - var(--ex) * var(--spread)));pointer-events:none;background:var(--rubber);box-shadow:0 0 0 1px rgba(255,255,255,.5) inset}
.bf-base-top .bf-grain{position:absolute;inset:0;opacity:.6;background-size:120px}
.bf-base{background:var(--rubber);transform:translateZ(calc(-1 * var(--t) - var(--ex) * var(--spread) - 1px)) rotateY(180deg)}
.bf-base img{transform:scale(1.34) translateY(-2%)}
.bf-side{position:absolute;top:10px;bottom:10px;width:var(--t);pointer-events:none;opacity:calc(1 - var(--ex));background:linear-gradient(90deg,#fff,#cfdeec 60%,var(--rubber) 61%,#7f93a8)}
.bf-l{left:0;transform-origin:left;transform:rotateY(90deg)}
.bf-r{left:calc(100% - var(--t));transform-origin:right;transform:rotateY(-90deg)}
.bf-anchor{position:absolute;right:0;top:50%;width:1px;height:1px}
.bf-shadow{position:absolute;left:50%;top:50%;width:var(--w);height:calc(var(--w) * .18);margin-left:calc(var(--w) / -2);border-radius:50%;
  background:radial-gradient(closest-side,rgba(52,76,104,.28),transparent);filter:blur(12px)}

/* exploded labels */
.bf-tag{position:absolute;left:0;top:0;z-index:5;pointer-events:none;opacity:0;padding-left:52px;white-space:nowrap}
.bf-tag::before{content:"";position:absolute;left:4px;top:.9em;width:40px;height:1px;background:var(--mute)}
.bf-tag::after{content:"";position:absolute;left:0;top:calc(.9em - 3px);width:7px;height:7px;border-radius:50%;background:var(--ink)}
.bf-tag b{display:block;font-size:15px;font-weight:600}
.bf-tag small{font-size:11px;color:var(--mute)}

/* depth gauge */
.bf-gauge{position:absolute;left:clamp(16px,3vw,44px);top:20%;bottom:22%;width:90px;z-index:6;font-size:10px;color:var(--mute);opacity:var(--go,0);transition:opacity .4s}
.bf-rule{position:absolute;left:28px;top:0;bottom:0;width:8px;background:repeating-linear-gradient(to bottom,var(--rule) 0 1px,transparent 1px calc(100% / 23));border-left:1px solid var(--rule)}
.bf-zone{position:absolute;left:0;width:22px;text-align:right}
.bf-needle{position:absolute;left:24px;width:20px;height:1px;background:var(--ink);top:var(--d,0%)}
.bf-read{position:absolute;left:50px;top:calc(var(--d,0%) - 10px);color:var(--ink);font-size:12px;font-weight:600;white-space:nowrap}
.bf-read em{font-style:normal;font-weight:400;color:var(--mute);display:block;font-size:10px;margin-top:-3px}

/* hero copy */
.bf-live .bf-hero{position:absolute;left:clamp(16px,4vw,48px);right:clamp(16px,4vw,48px);bottom:calc(32px + env(safe-area-inset-bottom,0px));z-index:6}
.bf-hero .bf-ch{position:static}
.bf-live .bf-hero .bf-ch{max-width:max(160px,calc(50vw - var(--w) / 2 - clamp(16px,4vw,48px) - 16px))}
.bf-hero h1{font-size:70px;line-height:1;font-weight:500;margin:0}
/* "Butterfly" is ~4.8em wide in Terminal Grotesque: keep it inside the gap left of the pad */
html[lang^="en"] .bf-live .bf-hero h1{font-size:clamp(40px,calc((50vw - var(--w) / 2 - clamp(16px,4vw,48px) - 24px) / 4.8),70px)}
.bf-kind{font-size:11px;color:var(--mute);margin:0 0 6px}
.bf-lead{font-size:13px;color:var(--mute);margin:8px 0 0}
.bf-hero-end{display:flex;align-items:center;gap:22px}
.bf-cta{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--cta);border-radius:12px;padding:0 30px;min-height:48px;font-size:15px;font-weight:600;background:var(--cta);color:#fff;white-space:nowrap}
.bf-hint{white-space:nowrap;align-items:center;gap:8px;font-size:11px;color:var(--mute)}
.bf-hint i{width:7px;height:7px;border-radius:50%;background:var(--ink);animation:bf-pulse 1.8s ease-in-out infinite}
@keyframes bf-pulse{50%{box-shadow:0 0 0 5px rgba(32,35,41,.08)}}

/* chapter copy */
.bf-eyebrow{font-size:11px;font-weight:600;color:var(--mute);margin:0}
.bf-ch h2{font-size:clamp(28px,2.9vw,42px);line-height:1.18;font-weight:500;margin:.35em 0 .55em;text-wrap:balance}
.bf-ch p{color:var(--mute);margin:0 0 1em;font-size:14px}
.bf-layers{list-style:none;margin:0;padding:0;display:grid;font-size:13px}
.bf-layers li{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;align-items:baseline;border-top:1px solid var(--rule);padding:10px 0}
.bf-layers li span{font-weight:600}
.bf-live .bf-copy{position:absolute;left:var(--copy-left);top:50%;margin:0;transform:translateY(-50%);
  width:clamp(220px,calc(65vw - var(--w) / 2 - var(--copy-left) - 32px),330px);z-index:6}
.bf-live .bf-copy .bf-ch{position:absolute;left:0;top:50%;width:100%;transform:translateY(calc(-50% + 22px));opacity:0;pointer-events:none;
  transition:opacity .55s ease,transform .8s cubic-bezier(.2,.7,.2,1)}
.bf-live .bf-copy .bf-ch.bf-on{opacity:1;transform:translateY(-50%);pointer-events:auto}
.bf-live .bf-hero .bf-ch{transform:translateY(16px);transition:opacity .55s ease,transform .8s cubic-bezier(.2,.7,.2,1);opacity:0}
.bf-live .bf-hero .bf-ch.bf-on{transform:none;opacity:1}

/* coating scan: lives on the pad itself, so it tilts with it. Left of the beam = coated (matte, fine grit,
   diffused reflection); right = bare glass (crisp reflections). Illustrative only. */
.bf-scan{pointer-events:none;opacity:0;transition:opacity .4s;--scan:50%;transform:translateZ(calc(var(--ex) * 8px + 1px))}
.bf-scan-gloss{position:absolute;inset:0;clip-path:inset(0 0 0 var(--scan));
  background:linear-gradient(112deg,transparent 24%,rgba(255,255,255,.5) 25.5%,rgba(255,255,255,.14) 29%,transparent 30.5%,
    transparent 63%,rgba(255,255,255,.62) 64.5%,rgba(255,255,255,.2) 68%,transparent 69.5%,transparent 73%,rgba(255,255,255,.35) 73.6%,transparent 75%)}
.bf-scan-coat{position:absolute;inset:0;clip-path:inset(0 calc(100% - var(--scan)) 0 0)}
.bf-scan-coat img{position:absolute;inset:0;filter:saturate(.93) contrast(.96) brightness(1.01) blur(.3px)}
.bf-scan-tooth{position:absolute;inset:0;background-size:96px;opacity:.75}
.bf-scan-haze{position:absolute;inset:0;
  background:linear-gradient(112deg,rgba(255,255,255,0) 12%,rgba(255,255,255,.14) 27%,rgba(255,255,255,0) 42%,
    rgba(255,255,255,0) 52%,rgba(255,255,255,.18) 67%,rgba(255,255,255,0) 82%),rgba(240,245,249,.04)}
.bf-scan-beam{position:absolute;top:0;bottom:0;left:var(--scan);width:1px;margin-left:-1px;background:rgba(255,255,255,.95);
  box-shadow:-1px 0 0 rgba(52,76,104,.45),0 0 10px 2px rgba(255,255,255,.55)}

.bf-shots{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:6px}
.bf-shots figure{margin:0;min-width:0}
.bf-ph{border-radius:12px;overflow:hidden;aspect-ratio:4/3;background:var(--paper)}
.bf-shots img{width:100%;height:100%;object-fit:cover;transform:scale(1.12);transition:transform 1.4s cubic-bezier(.2,.7,.2,1)}
.bf-ch.bf-on .bf-shots img,.bf-story:not(.bf-live) .bf-shots img{transform:scale(1)}
.bf-shots figcaption{font-size:10px;color:var(--mute);margin-top:4px}

/* chapter rail */
.bf-rail{position:absolute;left:50%;top:16px;transform:translateX(-50%);z-index:8;gap:26px}
.bf-rail button{white-space:nowrap;border:0;background:none;cursor:pointer;padding:0 0 4px;font-size:12px;color:var(--mute);border-bottom:1px solid transparent;min-height:32px}
.bf-rail button.bf-on{color:var(--ink);border-bottom-color:var(--ink)}
.bf-n{font-variant-numeric:tabular-nums;margin-right:4px;opacity:.5}

/* ---------- after the story ---------- */
.bf-wrap{padding-inline:clamp(16px,5vw,72px)}
.bf-desk{padding-block:12vh 6vh}
.bf-desk-frame{position:relative;border-radius:20px;overflow:hidden;aspect-ratio:16/9;max-height:86vh;width:100%;clip-path:inset(var(--ci,0%) round 20px)}
.bf-desk-frame img{width:100%;height:100%;object-fit:cover;transform:scale(var(--cs,1))}
.bf-desk-copy{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(24px,5vw,80px);margin-top:40px;align-items:start}
.bf-desk-copy h2{font-size:clamp(34px,4.6vw,60px);line-height:1.1;font-weight:500}
.bf-desk-copy p,.bf-box p{color:var(--mute);max-width:30em}
.bf-box{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,4fr);gap:clamp(24px,4vw,64px);align-items:center;padding-block:6vh}
.bf-box figure{border-radius:20px;overflow:hidden}
.bf-box h3{font-size:clamp(26px,3vw,40px);margin:.3em 0;font-weight:500}
.bf-specs{padding-block:8vh 12vh}
.bf-specs h3{font-size:clamp(28px,3vw,40px);font-weight:500;margin:0 0 24px}
.bf-specs dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));border-top:1px solid var(--rule)}
.bf-specs dl div{padding:20px 18px 20px 0;border-bottom:1px solid var(--rule)}
.bf-specs dt{font-size:11px;color:var(--mute)}
.bf-specs dd{margin:4px 0 0;font-size:18px;font-weight:600}
.bf-specs-foot{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:clamp(24px,5vw,80px);margin-top:48px;align-items:start}
.bf-care details{border-bottom:1px solid var(--rule)}
.bf-care summary{padding:18px 0;font-size:14px;cursor:pointer}
.bf-care p{font-size:13px;color:var(--mute);margin:0 0 12px}
.bf-footnote{margin-top:16px!important;font-size:11px!important}
.bf-purchase{display:grid;gap:16px;justify-items:start}
body.butterfly-page .site-footer{padding-bottom:110px}

/* buy bar */
.bf-buy{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));transform:translate(-50%,calc(var(--bh,1) * 140%));z-index:25;
  width:min(720px,calc(100% - 32px));display:flex;align-items:center;gap:16px;padding:8px 8px 8px 10px;border-radius:16px;
  background:rgba(248,250,252,.92);border:1px solid var(--rule);backdrop-filter:blur(16px);box-shadow:0 16px 40px rgba(52,76,104,.14);transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.bf-buy img{width:52px;height:44px;border-radius:8px;object-fit:cover}
.bf-buy-text{min-width:0;flex:1;line-height:1.4}
.bf-buy-text b{display:block;font-size:14px;font-weight:600}
.bf-buy-text small{display:block;color:var(--mute);font-size:11px}
.bf-buy-status{font-size:11px;color:var(--mute);white-space:nowrap}
.bf-buy .bf-cta{min-height:44px;padding:0 22px;font-size:14px}

/* ---------- stacked stage: phones, tablets and portrait screens ----------
   The copy keeps its own band at the bottom of the stage; JS measures the tallest chapter
   (--reserve) and the pad is sized to the space above it, so text never sits over the artwork. */
@media (max-width:1100px),(orientation:portrait) and (max-width:1200px){
  .bf{--t:6px;--spread:60px;--scene-top:52px;
    --scene-h:max(160px,calc(var(--stage-h) - var(--scene-top) - var(--reserve,320px) - 12px));
    --w:min(calc(100vw - 24px),calc(var(--scene-h) * 900 / 771 * .92),760px)}
  .bf-live .bf-scene{inset:auto 0;top:var(--scene-top);height:var(--scene-h)}
  .bf-live .bf-gauge,.bf-live .bf-tag{display:none}
  .bf-word{top:calc(var(--scene-top) + var(--scene-h) / 2);font-size:min(17vw,200px)}
  .bf-live .bf-hero{bottom:calc(20px + env(safe-area-inset-bottom,0px));flex-direction:column;align-items:stretch;gap:14px}
  .bf-hero h1,html[lang^="en"] .bf-live .bf-hero h1{font-size:56px}
  .bf-live .bf-hero .bf-ch{max-width:none}
  .bf-hero-end{justify-content:space-between}
  .bf-live .bf-copy{left:16px;right:16px;width:auto;top:auto;bottom:calc(88px + env(safe-area-inset-bottom,0px));transform:none;height:0}
  .bf-live .bf-copy .bf-ch{top:auto;bottom:0;transform:translateY(16px)}
  .bf-live .bf-copy .bf-ch.bf-on{transform:none}
  .bf-ch h2{font-size:28px}
  .bf-rail{top:12px;gap:18px}
  .bf-n{display:none}
}
@media (max-width:1100px) and (max-height:900px),(orientation:portrait) and (max-width:1200px) and (max-height:900px){.bf-shots{display:none}}
@media (max-width:760px){
  .bf{--scene-top:44px}
  .bf-shots,.bf-ch[data-bf-ch="2"] .bf-layers{display:none}
  .bf-ch h2{font-size:24px}
  .bf-ch p{font-size:13px;line-height:1.65}
  .bf-layers{font-size:12px}.bf-layers li{padding:7px 0;line-height:1.5}
  .bf-live .bf-copy{bottom:calc(74px + env(safe-area-inset-bottom,0px))}
  .bf-rail{top:8px}
  .bf-buy{padding:6px;gap:12px}.bf-buy img{width:44px;height:38px}.bf-buy .bf-cta{min-height:40px;padding:0 18px}
  .bf-desk-copy,.bf-box,.bf-specs-foot{grid-template-columns:1fr}
  .bf-desk-frame{aspect-ratio:4/5}
  .bf-buy-text small,.bf-buy-status{display:none}
}
@media (prefers-reduced-motion:reduce){.bf-ch,.bf-shots img,.bf-buy{transition:none!important}.bf-hint i{animation:none}}
