/* 傳家寶 For My Family — shared styles.
   Layout: one centred column on warm paper; real objects carry the imagery; lilac is the only accent. */
:root{
  --paper:#F8F3EB; --paper-2:#EFE7DB; --ink:#24221E; --ink-2:#56504A; --rule:#E2DBCF;
  --lilac:#6F5BA3; --lilac-soft:#EEEAF6; --ok:#2F6B3F; --err:#9B2C2C;
  --serif:"Noto Serif TC","Songti TC","PMingLiU",serif;
  --sans:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
  --wrap:1080px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:18px;line-height:1.8;-webkit-text-size-adjust:100%}
img{max-width:100%;height:auto;display:block}
a{color:var(--lilac)}
:focus-visible{outline:3px solid var(--lilac);outline-offset:3px}
.wrap{max-width:var(--wrap);margin:0 auto;padding-left:max(20px,env(safe-area-inset-left,0px));padding-right:max(20px,env(safe-area-inset-right,0px))}
.narrow{max-width:720px}
[data-lang="zh"] [lang="en"]{display:none!important}
[data-lang="en"] [lang="zh-Hant"]{display:none!important}
h1,h2,h3{font-family:var(--serif);font-weight:600;line-height:1.35;margin:0;text-wrap:balance}
h1{font-size:clamp(34px,5.6vw,56px);letter-spacing:.02em}
h2{font-size:clamp(26px,3.6vw,36px);margin-bottom:14px}
h3{font-size:22px}
p{margin:0}
.eyebrow{font-size:15px;font-weight:500;letter-spacing:.16em;color:var(--lilac);margin-bottom:10px}
section{padding-block:60px}
@media (min-width:821px){section{padding-block:76px}}
section+section{border-top:1px solid var(--rule)}
.lead{font-size:20px;color:var(--ink-2);max-width:34em}
.muted{color:var(--ink-2)}

/* header */
header{position:sticky;top:0;z-index:20;background:rgba(248,243,235,.94);backdrop-filter:saturate(1.2) blur(8px);border-bottom:1px solid var(--rule);padding-top:env(safe-area-inset-top,0px)}
.bar{display:flex;align-items:center;gap:14px;min-height:64px}
.brand{display:flex;align-items:baseline;gap:10px;text-decoration:none;color:var(--ink);margin-right:auto}
.brand b{font-family:var(--serif);font-weight:600;font-size:24px;letter-spacing:.12em}
.brand span{font-size:13px;letter-spacing:.2em;color:var(--lilac);font-weight:500}
.navlink{color:var(--ink);text-decoration:none;font-size:16px;padding:8px 4px}
.navlink:hover{color:var(--lilac)}
.langbtn{font:inherit;font-size:15px;background:none;border:1px solid var(--rule);border-radius:999px;padding:6px 14px;color:var(--ink);cursor:pointer;min-height:40px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;font:inherit;font-weight:500;font-size:18px;text-decoration:none;border-radius:10px;padding:14px 24px;min-height:54px;cursor:pointer;border:2px solid var(--ink);transition:background .15s,color .15s}
.btn.primary{background:var(--ink);color:#fff}
.btn.primary:hover{background:#000}
.btn.ghost{background:transparent;color:var(--ink)}
.btn.ghost:hover{background:var(--paper-2)}
.btn svg{width:22px;height:22px;flex:none}
.bar .btn{font-size:16px;padding:8px 16px;min-height:44px}
.brand b,.navlink,.langbtn{white-space:nowrap}
@media (max-width:640px){.bar .btn .long{display:none}.brand span{display:none}.navlink{font-size:15px}}
@media (max-width:460px){.bar{gap:10px}.brand b{font-size:21px;letter-spacing:.08em}.bar .btn{padding:8px 11px}.bar .btn>span{display:none}.langbtn{padding:6px 10px}}

/* hero — mobile first: title in the empty space above the glasses, actions below them */
.hero{position:relative;overflow:hidden;min-height:calc(100svh - 64px);display:flex;padding:0}
.heroimg{position:absolute;inset:0;margin:0}
.heroimg picture{display:contents}
.heroimg img{width:100%;height:100%;object-fit:cover;object-position:center 45%}
.hero::before{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,rgba(248,243,235,.94) 0%,rgba(248,243,235,.75) 22%,rgba(248,243,235,0) 34%,rgba(248,243,235,0) 62%,rgba(248,243,235,.85) 74%,rgba(248,243,235,.97) 100%)}
.hero .wrap{position:relative;z-index:2;width:100%;display:flex}
.hero .copy{display:flex;flex-direction:column;justify-content:space-between;width:100%;max-width:520px;padding-block:28px 32px}
.hero h1{font-size:clamp(30px,8vw,58px)}
.hero .lead{margin-top:10px;font-size:18px;color:#4A443C}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px}
.textlink{color:var(--ink);font-size:17px;text-decoration:none;border-bottom:1px solid currentColor;padding-bottom:2px}
.note{font-size:15px;color:var(--ink-2);margin-top:12px}
@media (min-width:821px){
  .hero{min-height:620px;align-items:center}
  .heroimg img{object-position:right center}
  .hero::before{background:linear-gradient(90deg,rgba(248,243,235,.97) 0%,rgba(248,243,235,.9) 38%,rgba(248,243,235,.3) 62%,rgba(248,243,235,0) 82%)}
  .hero .copy{justify-content:center;gap:30px;padding-block:96px;max-width:680px}
  .hero h1{white-space:nowrap}
  .hero .lead{margin-top:18px;font-size:20px}
}

/* faint grey genealogy texture between sections */
.tex{position:relative;isolation:isolate}
.tex::before{content:"";position:absolute;inset:0;z-index:-1;background:url("img/bg/zupu-tex3.jpg") center/cover no-repeat}
section.tex+section,section+section.tex{border-top:0}

/* step reveal on scroll */
.fire.reveal li{opacity:0;transform:translateY(26px);transition:opacity .7s ease var(--d,0ms),transform .7s ease var(--d,0ms)}
.fire.reveal li.in{opacity:1;transform:none}
@media (max-width:820px){.fire.reveal li{transition-delay:0ms}}

/* 薪火相傳 — a vertical path on phones, a horizontal one on desktop */
.fire{list-style:none;margin:36px 0 0;padding:0;display:grid;gap:0;position:relative}
.fire li{display:grid;grid-template-columns:56px 1fr;gap:18px;align-content:start;position:relative;padding-bottom:34px}
.fire li:last-child{padding-bottom:0}
.fire li::before{content:"";position:absolute;left:27px;top:56px;bottom:0;width:2px;background:var(--rule)}
.fire li:last-child::before{display:none}
.fire .mark{width:56px;height:56px;border-radius:50%;display:grid;place-items:center;background:#fff;border:2px solid var(--lilac);font-family:var(--serif);font-size:26px;color:var(--ink);position:relative;z-index:1}
.fire .mark.rel{background:var(--lilac);color:#fff}
.fire h3{margin-top:12px}
.fire p.muted{margin-top:8px}
@media (min-width:821px){
  .fire{grid-template-columns:repeat(4,1fr);gap:28px}
  .fire li{grid-template-columns:1fr;gap:16px;padding-bottom:0}
  .fire li::before{left:64px;right:-28px;top:27px;bottom:auto;width:auto;height:2px}
  .fire h3{margin-top:0}
}

/* why now — abacus band, words over the photo */
.band{position:relative;padding-block:calc(100vw * 1.02) 56px;background:var(--paper) url("img/bg/abacus3-m.jpg") center top/100% auto no-repeat;border-top:0}
.band::before{content:"";position:absolute;left:0;right:0;top:calc(100vw * 0.86);height:calc(100vw * 0.95);background:linear-gradient(180deg,rgba(248,243,235,0) 0%,rgba(248,243,235,.9) 35%,var(--paper) 100%)}
.band .wrap{position:relative}
.band .copy{max-width:560px}
.band .copy p{margin-top:14px;color:#3E3A34}
@media (min-width:821px){
  .band{padding-block:96px;background:#E9E1D3 url("img/bg/abacus3.jpg") right center/cover no-repeat}
  .band::before{top:0;height:auto;bottom:0;background:linear-gradient(90deg,rgba(248,243,235,.97) 0%,rgba(248,243,235,.9) 45%,rgba(248,243,235,.25) 75%,rgba(248,243,235,0) 100%)}
}

/* beyond family */
.beyond p{max-width:40em;color:var(--ink-2)}

/* works — one gently moving shelf per series; covers keep their true shape */
.series{margin-top:44px}
.series h3{margin-bottom:2px}
.series .muted{font-size:16px}
.track{display:flex;gap:18px;overflow-x:auto;padding:18px max(20px,env(safe-area-inset-left,0px)) 10px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.track::-webkit-scrollbar{display:none}
.book{flex:none;display:flex;flex-direction:column;gap:10px;align-items:flex-start;background:none;border:0;padding:0;cursor:pointer;font:inherit;color:inherit;text-align:left}
.book img{height:230px;width:auto;max-width:none;border-radius:3px;box-shadow:0 8px 22px rgba(36,34,30,.18);transition:transform .2s}
.book:hover img,.book:focus-visible img{transform:translateY(-4px)}
.book>span{font-family:var(--serif);font-size:16px;max-width:200px;line-height:1.4}
@media (min-width:821px){.book img{height:280px}.track{padding-left:max(20px,calc((100vw - var(--wrap))/2 + 20px))}}
.sheet{position:fixed;inset:0;z-index:40;background:rgba(36,34,30,.55);display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.sheet-card{position:relative;background:var(--paper);width:100%;max-width:560px;max-height:92svh;overflow:auto;border-radius:18px 18px 0 0;padding:28px 22px calc(28px + env(safe-area-inset-bottom,0px))}
.sheet-card img{max-height:52svh;width:auto;max-width:100%;margin:0 auto;border-radius:3px;box-shadow:0 10px 30px rgba(36,34,30,.22)}
.sheet-body{margin-top:22px}
.sheet-body .eyebrow{margin-bottom:4px}
.sheet-body h3{font-size:24px}
.sheet-body .muted{margin-top:10px}
.sheet-body .btn{margin-top:20px}
.sheet-close{position:absolute;top:12px;right:12px;width:44px;height:44px;border-radius:50%;border:0;background:var(--paper-2);font-size:18px;cursor:pointer;z-index:2}
@media (min-width:821px){.sheet{align-items:center}.sheet-card{border-radius:18px}}

/* real event photo: title first, photo below on phones; photo beside the title on desktop */
.scene{position:relative;padding:0;border-top:0;display:flex;flex-direction:column-reverse}
.scene .heroimg{position:relative;inset:auto;margin:0}
.scene .heroimg img{width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
.scene .wrap{position:relative;width:100%}
.scene .copy{padding-block:48px 24px;max-width:520px}
@media (min-width:821px){
  .scene{display:flex;flex-direction:row;align-items:center;min-height:620px}
  .scene .heroimg{position:absolute;top:0;bottom:0;right:0;left:34%;-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 18%);mask-image:linear-gradient(90deg,transparent 0,#000 18%)}
  .scene .heroimg img{height:100%;aspect-ratio:auto;object-position:center}
  .scene .copy{max-width:380px;padding-block:96px}
}
.photo{margin:24px 0 0}
.photo img{width:100%;border-radius:12px;aspect-ratio:3/2;object-fit:cover}
@media (min-width:821px){.photo img{aspect-ratio:21/9;object-position:center 40%}}
#voices{padding-top:44px}

/* voices — six cards, same shape */
.tcards{display:grid;gap:16px;margin-top:28px}
.tcard{margin:0;background:#fff;border:1px solid var(--rule);border-radius:14px;padding:22px 22px 18px;display:flex;flex-direction:column;justify-content:space-between;gap:18px}
.tcard blockquote{margin:0;font-family:var(--serif);font-size:17px;line-height:1.85;color:#2F2B26}
.tcard blockquote::before{content:"「";color:var(--lilac)}
.tcard blockquote::after{content:"」";color:var(--lilac)}
[data-lang="en"] .tcard blockquote::before{content:"“"}
[data-lang="en"] .tcard blockquote::after{content:"”"}
.tcard figcaption{display:flex;align-items:center;gap:12px;border-top:1px solid var(--rule);padding-top:14px}
.tcard svg{width:46px;height:46px;flex:none}
.tcard b{display:block;font-size:16px}
.tcard small{display:block;font-size:13px;color:var(--ink-2)}
.source{font-size:14px;color:var(--ink-2);margin-top:12px}
.storyhead{margin-top:44px}
.stories{display:grid;gap:14px;margin-top:16px}
.stories p{padding-left:16px;border-left:2px solid var(--lilac);color:#3E3A34}
@media (min-width:640px){.tcards{grid-template-columns:1fr 1fr}}
@media (min-width:1000px){.tcards{grid-template-columns:repeat(3,1fr)}}

/* boxes (offer) */
.offer{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin-top:36px}
.card{background:#fff;border:1px solid var(--rule);border-radius:14px;padding:28px}
.price{font-family:var(--serif);font-size:34px;margin:14px 0 4px}
.price small{font-family:var(--sans);font-size:16px;color:var(--ink-2);font-weight:400}
.card p.muted{margin-top:4px}
.card ul{margin:14px 0 0;padding-left:1.2em;color:var(--ink-2)}
.card li{margin-bottom:6px}
.first{margin-top:24px;padding:18px 20px;background:var(--lilac-soft);border-radius:12px}
.first b{color:var(--lilac)}
@media (max-width:820px){.offer{grid-template-columns:1fr}}

/* start steps */
.steps{list-style:none;margin:36px 0 0;padding:0;display:grid;gap:18px;counter-reset:s}
.steps li{display:grid;grid-template-columns:56px 1fr;gap:18px;align-items:start;background:#fff;border:1px solid var(--rule);border-radius:14px;padding:22px}
.steps li::before{counter-increment:s;content:counter(s);width:48px;height:48px;border-radius:50%;background:var(--ink);color:#fff;font-family:var(--serif);font-size:22px;display:grid;place-items:center}
.steps p{color:var(--ink-2);margin-top:4px}

/* form */
.formgrid{display:grid;grid-template-columns:1.3fr .7fr;gap:40px;margin-top:36px;align-items:start}
form{display:grid;gap:18px}
label{display:block;font-weight:500;margin-bottom:6px}
label small{font-weight:400;color:var(--ink-2)}
input,select,textarea{width:100%;font:inherit;font-size:18px;padding:13px 14px;border:1.5px solid #CFC8BB;border-radius:10px;background:#fff;color:var(--ink);min-height:54px}
input:focus,select:focus,textarea:focus{border-color:var(--lilac);outline:none;box-shadow:0 0 0 3px var(--lilac-soft)}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.status{font-size:17px;min-height:1.5em}
.status.ok{color:var(--ok);font-weight:500}
.status.err{color:var(--err)}
.wa{background:#fff;border:1px solid var(--rule);border-radius:14px;padding:24px;text-align:center}
.wa img{width:180px;margin:14px auto;background:#fff;padding:12px;border:1px solid var(--rule);border-radius:8px}
.wa p{color:var(--ink-2);font-size:16px}
@media (max-width:820px){.formgrid{grid-template-columns:1fr}.wa .qr{display:none}}

/* faint genealogy texture (about page only) */
.faint{position:relative}
.faint::before{content:"";position:absolute;inset:0;background:url("img/bg/zupu-tex3.jpg") center top/cover no-repeat;pointer-events:none}
.faint>*{position:relative}

/* about page */
.story{padding-block:0 80px}
.story .head{padding-block:72px 64px;margin-bottom:40px;border-bottom:1px solid var(--rule)}
.story .top{margin-bottom:40px}
.story figure{margin:0 0 40px}
.story figure img{width:100%;border-radius:6px}
.story .body p{margin-bottom:22px;font-family:var(--serif);font-size:19px;line-height:2}
.chain{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:8px 0 30px;padding:22px 24px;background:var(--lilac-soft);border-radius:12px;font-family:var(--serif);font-size:22px;color:var(--lilac)}
.chain i{font-style:normal;color:#A79BC9;font-size:18px}
.sign{margin-top:36px;font-family:var(--serif);line-height:1.7}
.sign b{display:block;font-size:22px;font-weight:600}
.sign span{color:var(--ink-2);font-size:16px}
.pull{font-family:var(--serif);font-size:24px;line-height:1.6;color:var(--ink);border-left:3px solid var(--lilac);padding-left:20px;margin:6px 0 30px}

footer{padding-block:36px calc(36px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--rule);font-size:15px;color:var(--ink-2)}
footer .wrap{display:flex;flex-wrap:wrap;gap:8px 24px;justify-content:space-between}
footer a{color:var(--ink-2)}

/* reader */
.reader{position:fixed;inset:0;z-index:50;background:rgba(20,18,16,.94);display:flex;flex-direction:column;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.reader[hidden]{display:none}
.rtop{display:flex;align-items:center;gap:12px;color:#fff;padding:12px 16px}
.rtop b{font-family:var(--serif);font-weight:500;margin-right:auto;font-size:18px}
.rtop button,.rnav button{font:inherit;color:#fff;background:rgba(255,255,255,.12);border:0;border-radius:999px;min-width:48px;min-height:48px;padding:0 16px;cursor:pointer;font-size:17px}
.rstage{flex:1;display:flex;align-items:center;justify-content:center;padding:8px 16px;min-height:0}
.rstage .pg{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:2px;box-shadow:0 10px 40px rgba(0,0,0,.4);background:#FBF8F1}
.page{position:relative;height:100%;max-height:min(100%,92vw);aspect-ratio:1/1;max-width:100%;background:#FBF8F1;overflow:hidden;border-radius:2px;box-shadow:0 10px 40px rgba(0,0,0,.4)}
.page img{width:100%;height:100%;object-fit:cover}
.rnav{display:flex;align-items:center;justify-content:center;gap:16px;color:#fff;padding:12px 16px 18px;font-variant-numeric:tabular-nums}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}.btn{transition:none}}
