/* Wish Genie site. One stylesheet for all pages. No third-party resources. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --clay: #AE4419;
  --clay-deep: #8C3410;
  --sky: #8DCFF0;
  --gold: #F2C57C;
  --ink: #2B1A12;
  --soft: #5A4638;
  --sand: #F7EFE6;
  --paper: #FFFAF4;
  --line: rgba(43, 26, 18, .13);
  --link: #AE4419;
  --chip-clay-bg: #F5D9C7;
  --chip-clay-fg: #8C3410;
  --chip-sky-bg: #C6E7F8;
  --chip-sky-fg: #114761;
  --glass: rgba(255, 252, 247, .58);
  --glass-strong: rgba(255, 250, 244, .82);
  --glass-edge: rgba(255, 255, 255, .7);
  --haze: rgba(250, 242, 232, .62);
  --shadow: 0 24px 60px -28px rgba(60, 28, 10, .45);
  --img-filter: none;
  --fill-1: #8DCFF0;
  --fill-2: #F0B595;
  --fill-3: #F1DFC8;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5EADF;
    --soft: #CDBBAA;
    --sand: #17100C;
    --paper: #221812;
    --line: rgba(245, 234, 223, .16);
    --link: #F29A70;
    --chip-clay-bg: #4A2416;
    --chip-clay-fg: #FFC9AD;
    --chip-sky-bg: #173B4D;
    --chip-sky-fg: #BFE6FA;
    --glass: rgba(28, 19, 14, .62);
    --glass-strong: rgba(28, 19, 14, .84);
    --glass-edge: rgba(255, 240, 225, .14);
    --haze: rgba(18, 11, 8, .5);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
    --img-filter: brightness(.4) saturate(1.15);
    --fill-1: #1F5C7A;
    --fill-2: #8C3410;
    --fill-3: #5A4638;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 17px/1.65 var(--body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .07em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--round); line-height: 1.15; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
:lang(zh-Hant) h1, :lang(zh-Hant) h2, :lang(zh-Hant) h3 { letter-spacing: 0; line-height: 1.3; }
p { margin: 0 0 1em; }
[id] { scroll-margin-top: 104px; }
::selection { background: var(--sky); color: #1B120D; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Plain pages without the site shell (the app's sign-in relay page). */
body > main:not([class]) { max-width: 680px; margin: 0 auto; padding: 18vh 24px 64px; }
body > main:not([class]) h1 { font-size: 2rem; margin-bottom: .6em; }

/* ---------- Navigation ---------- */
.nav { position: fixed; z-index: 50; top: 14px; left: 0; right: 0; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.skip { position: absolute; left: 12px; top: -80px; background: var(--ink); color: var(--sand); padding: 10px 16px; border-radius: 12px; pointer-events: auto; }
.skip:focus { top: 0; }
.nav-pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 10px 34px -18px rgba(60, 28, 10, .5);
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.scrolled .nav-pill { background: var(--glass-strong); box-shadow: 0 14px 40px -18px rgba(60, 28, 10, .65); }
.nav-pill a { color: var(--ink); text-decoration: none; white-space: nowrap; border-radius: 999px; font-size: 15px; font-weight: 550; line-height: 1; }
.nav-pill .nav-brand { display: flex; align-items: center; gap: 9px; padding: 3px 12px 3px 3px; font-family: var(--round); font-weight: 750; font-size: 16px; }
.nav-brand img { width: 32px; height: 32px; display: block; }
.nav-links { display: flex; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a, .nav-lang { padding: 11px 13px; transition: background .25s; }
.nav-links a:hover, .nav-lang:hover { background: rgba(174, 68, 25, .12); }
.nav-pill .nav-links a[aria-current] { background: var(--ink); color: var(--sand); }
.nav-pill .nav-cta { padding: 11px 18px; font-family: var(--round); font-weight: 700; transition: transform .3s var(--ease), box-shadow .35s var(--ease); }
.nav-pill .nav-cta:hover { transform: translateY(-1px); }
@media (max-width: 760px) {
  .nav-pill .nav-cta { display: none; }
  .nav-pill a { font-size: 14px; }
  .nav-links a, .nav-lang { padding: 10px 9px; }
}
/* When the links don't fit, they scroll inside the pill; the fade says there is more. */
.nav-links.less, .nav-links.more { -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--l, 0px), #000 calc(100% - var(--r, 0px)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--l, 0px), #000 calc(100% - var(--r, 0px)), transparent); }
.nav-links.less { --l: 22px; }
.nav-links.more { --r: 26px; }
@media (max-width: 560px) {
  .nav-links a, .nav-lang { padding: 10px 7px; }
  .nav-brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav-pill .nav-brand { padding-right: 3px; }
}
/* Phones: Privacy lives in the footer only (Frank 2026-11-26); still shown on the privacy page itself. */
@media (max-width: 430px) {
  .nav-links a[href$="privacy/"]:not([aria-current="page"]) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: 1em 1.55em;
  border-radius: 999px;
  font-family: var(--round); font-weight: 700; font-size: 1.02rem; line-height: 1;
  text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
/* Metal finish: a polished gradient with a break at the horizon, a bright top edge, a dark bottom edge.
   On hover the button glows and a band of light crosses it once. */
.btn-clay, .btn-pearl, .nav-pill .nav-cta { position: relative; isolation: isolate; overflow: hidden; }
.btn-clay, .nav-pill .nav-cta {
  color: #fff; text-shadow: 0 1px 0 rgba(84, 26, 4, .55);
  background: linear-gradient(180deg, #BF5420 0%, #B34A1B 46%, #9A3A12 54%, #7C2C0D 100%);
  border: 1px solid #6B2408;
  box-shadow: inset 0 1px 0 rgba(255, 214, 176, .8), inset 0 -2px 0 rgba(60, 18, 2, .45), 0 14px 30px -14px rgba(124, 44, 13, .9);
}
.btn-clay:hover, .btn-clay:focus-visible, .nav-pill .nav-cta:hover, .nav-pill .nav-cta:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 214, 176, .8), inset 0 -2px 0 rgba(60, 18, 2, .45), 0 0 0 4px rgba(240, 150, 90, .24), 0 0 34px 4px rgba(240, 140, 70, .6);
}
.btn-pearl {
  color: #2B1A12; text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  background: linear-gradient(180deg, #FFFFFF 0%, #F4EFE9 46%, #E4DDD5 54%, #CFC7BE 100%);
  border: 1px solid #A99E93;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(90, 70, 56, .28), 0 14px 30px -16px rgba(60, 28, 10, .6);
}
.btn-pearl:hover, .btn-pearl:focus-visible {
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(90, 70, 56, .28), 0 0 0 4px rgba(255, 244, 228, .4), 0 0 34px 4px rgba(255, 230, 200, .8);
}
.btn-clay::after, .btn-pearl::after, .nav-pill .nav-cta::after {
  content: ""; position: absolute; z-index: -1; inset: -1px; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 214, .42) 50%, transparent 62%);
  transform: translateX(-110%);
}
.btn-pearl::after { background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%); }
.btn-clay:hover::after, .btn-clay:focus-visible::after, .btn-pearl:hover::after, .btn-pearl:focus-visible::after,
.nav-pill .nav-cta:hover::after, .nav-pill .nav-cta:focus-visible::after { animation: sheen 1.7s var(--ease); }
@keyframes sheen { to { transform: translateX(110%); } }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0; }

.eyebrow { display: inline-flex; align-items: center; gap: .6em; margin: 0 0 1.1em; font-family: var(--round); font-weight: 700; font-size: .95rem; letter-spacing: .02em; color: var(--ink); }
.eyebrow::before { content: ""; width: .95em; height: .95em; background: var(--clay); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }

/* ---------- Phone ---------- */
.phone {
  --w: min(300px, 66vw);
  width: var(--w); flex: none;
  padding: calc(var(--w) * .032);
  border-radius: calc(var(--w) * .165);
  background: linear-gradient(160deg, #3A2A22, #17100C 55%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 50px 80px -30px rgba(50, 22, 6, .6), 0 18px 36px -18px rgba(50, 22, 6, .5);
}
.phone img { display: block; width: 100%; height: auto; border-radius: calc(var(--w) * .135); }

/* ---------- Home: hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100vh, 1080px); min-height: min(100svh, 1080px);
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(104px, 15vh, 160px) 20px 0;
  text-align: center;
}
.hero-bg { position: absolute; z-index: -3; inset: 0 0 -8% 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; display: block; filter: var(--img-filter); animation: drift 36s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.hero::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 0; width: min(1100px, 150vw); height: 72%; transform: translateX(-50%); background: radial-gradient(closest-side, var(--haze), transparent); pointer-events: none; }
.hero-copy { max-width: 980px; will-change: transform; }
.hero h1 { font-size: clamp(2.45rem, min(7.4vw, 10.6vh), 5.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.03; }
:lang(zh-Hant) .hero h1 span { display: inline-block; }
:lang(zh-Hant) .hero h1 { font-size: clamp(2.1rem, min(8.4vw, 10vh), 5rem); letter-spacing: .01em; line-height: 1.2; }
.h1-icon { width: .8em; height: .8em; margin: 0 .1em; vertical-align: -.07em; transform: rotate(-7deg); filter: drop-shadow(0 .08em .14em rgba(80, 36, 10, .35)); }
.lede { max-width: 39em; margin: 1.5em auto 1.8em; font-size: clamp(1.02rem, 1.25vw, 1.16rem); line-height: 1.6; color: var(--ink); }
.hero-phone { flex: 1 0 auto; height: 0; min-height: clamp(210px, 36vh, 420px); margin-top: clamp(30px, 6vh, 64px); display: flex; justify-content: center; align-items: flex-start; }
.hero-phone .phone { --w: min(310px, 64vw); will-change: transform; }

.sparks { position: absolute; z-index: -2; inset: 0; pointer-events: none; filter: drop-shadow(0 0 6px rgba(255, 220, 160, .95)); }
.sparks i { position: absolute; bottom: 20%; width: 12px; height: 12px; background: #FFE9BF; opacity: 0; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: spark 11s linear infinite; }
.sparks i:nth-child(1) { left: 31%; --dx: -6vw; animation-delay: -1s; }
.sparks i:nth-child(2) { left: 38%; --dx: 5vw; width: 8px; height: 8px; animation-duration: 14s; animation-delay: -6s; }
.sparks i:nth-child(3) { left: 46%; --dx: -3vw; width: 16px; height: 16px; animation-duration: 16s; animation-delay: -3s; }
.sparks i:nth-child(4) { left: 57%; --dx: 7vw; width: 9px; height: 9px; animation-duration: 12s; animation-delay: -9s; }
.sparks i:nth-child(5) { left: 66%; --dx: -4vw; animation-duration: 15s; animation-delay: -12s; }
.sparks i:nth-child(6) { left: 24%; --dx: 3vw; width: 7px; height: 7px; animation-duration: 13s; animation-delay: -4s; }


/* Entrance. Runs from CSS alone, so the final state shows even without JavaScript. */
.hero-copy > * { animation: rise 1.1s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .12s; }
.hero-copy > :nth-child(3) { animation-delay: .22s; }
.hero-phone .phone { animation: phone-rise 1.6s .3s var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes phone-rise { from { opacity: 0; transform: translateY(42%); } }
@keyframes drift { to { transform: scale(1.07); } }
@keyframes spark { 0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 0; } 12% { opacity: .95; } 70% { opacity: .7; } 100% { transform: translate(var(--dx, 0), -52vh) scale(1) rotate(160deg); opacity: 0; } }

/* ---------- Home: the wish sentence ---------- */
.wish { position: relative; z-index: 2; margin-top: -40px; padding: clamp(72px, 11vw, 136px) 0 clamp(64px, 10vw, 128px); background: var(--sand); border-radius: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 48px) 0 0; box-shadow: 0 -30px 60px -40px rgba(60, 28, 10, .5); }
.wish-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 88px); align-items: center; }
.sentence { font-size: clamp(1.42rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.5; letter-spacing: -.01em; text-wrap: pretty; }
:lang(zh-Hant) .sentence { line-height: 1.6; }
.chip { display: inline-block; white-space: nowrap; font-weight: inherit; line-height: 1.3; padding: .06em .42em; margin: .14em 0; border-radius: .42em; background: var(--chip-clay-bg); color: var(--chip-clay-fg); }
.chip.data { background: var(--chip-sky-bg); color: var(--chip-sky-fg); }
.nb { white-space: nowrap; }
.fine { margin: 1.8em 0 0; max-width: 34em; color: var(--soft); font-size: 1rem; }
.wish .phone { transform: rotate(3deg); }
@media (max-width: 860px) {
  .wish-grid { grid-template-columns: 1fr; }
  .wish .phone { margin: 8px auto 0; --w: min(270px, 68vw); }
}

/* ---------- Home: cloud sea ---------- */
.sky { position: relative; isolation: isolate; overflow: hidden; margin: 0 clamp(8px, 1.4vw, 20px); border-radius: clamp(26px, 3.4vw, 48px); padding: clamp(72px, 10vw, 136px) 0; }
.sky-bg { position: absolute; z-index: -1; inset: -14% 0; }
.sky-bg img { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--img-filter); }
/* A light veil keeps dark ink at 4.5:1 or better over the darkest part of the clouds. */
.sky-bg::after, .doc-hero-bg::after { content: ""; position: absolute; inset: 0; background: rgba(247, 239, 230, .12); }
@media (max-aspect-ratio: 4/5) { .sky-bg::after, .doc-hero-bg::after { background: rgba(247, 239, 230, .3); } }
.sky-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px); align-items: center; }
.sky h2 { font-size: clamp(2rem, 4.6vw, 3.7rem); font-weight: 800; max-width: 12em; margin-bottom: clamp(28px, 4vw, 48px); }
/* Stacked rows: a thick outline with a hard offset shadow, like two sheets of paper.
   Each row ticks itself as it scrolls in, and its colour spreads from the tick box in a circle. */
.stack { list-style: none; margin: 0; padding: 0 6px 6px 0; display: grid; gap: 18px; max-width: 600px; }
.row { position: relative; isolation: isolate; overflow: hidden; margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px 22px; border: 2px solid var(--ink); border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.row::before { content: ""; position: absolute; z-index: -1; left: 36px; top: 34px; width: 230%; aspect-ratio: 1; border-radius: 50%; background: var(--fill-1); transform: translate(-50%, -50%); }
.row:nth-child(2)::before { background: var(--fill-2); }
.row:nth-child(3)::before { background: var(--fill-3); }
.tick { position: relative; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 8px; background: var(--ink); }
.tick::after { content: ""; position: absolute; left: 8px; top: 3px; width: 8px; height: 14px; border: solid var(--paper); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.row h3 { font-size: 1.22rem; font-weight: 750; margin: .08em 0 .35em; }
.row p { margin: 0; line-height: 1.55; }
.sky .phone { transform: rotate(-3deg); }
@media (max-width: 960px) {
  .sky-grid { grid-template-columns: 1fr; }
  .sky .phone { margin: 12px auto 0; --w: min(270px, 68vw); }
  .stack { max-width: none; }
}

/* ---------- Home: promise ---------- */
.promise { padding: clamp(80px, 12vw, 168px) 0 clamp(56px, 8vw, 104px); }
.promise h2 { font-size: clamp(2.5rem, 8.4vw, 6.6rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
:lang(zh-Hant) .promise h2 { letter-spacing: 0; line-height: 1.2; font-size: clamp(2.2rem, 7.4vw, 5.6rem); }
.promise h2 em { font-style: normal; color: var(--link); }
.facts { list-style: none; margin: clamp(36px, 6vw, 72px) 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 44px); }
.facts li { margin: 0; padding-top: 18px; border-top: 2px solid var(--ink); font-size: 1.12rem; line-height: 1.5; }
.promise .cta-row { justify-content: flex-start; }
.doors { list-style: none; margin: clamp(48px, 7vw, 88px) 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.doors li { margin: 0; border-top: 1px solid var(--line); }
.doors a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 4px; font-family: var(--round); font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 1.75rem); color: var(--ink); text-decoration: none; transition: padding .4s var(--ease), color .25s; }
.doors a::after { content: ""; flex: none; width: .62em; height: .62em; margin-right: 6px; border-top: .13em solid currentColor; border-right: .13em solid currentColor; transform: rotate(45deg); transition: transform .4s var(--ease); }
.doors a:hover { padding-left: 16px; color: var(--link); }
.doors a:hover::after { transform: translateX(6px) rotate(45deg); }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- Footer ---------- */
.foot { position: relative; isolation: isolate; overflow: hidden; padding: clamp(110px, 16vw, 210px) 12px 14px; }
.foot-bg { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; filter: var(--img-filter); -webkit-mask-image: linear-gradient(transparent, #000 55%); mask-image: linear-gradient(transparent, #000 55%); }
.foot-bar { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 22px; padding: 12px 12px 12px 22px; border-radius: 28px; background: var(--glass-strong); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-size: 14.5px; color: var(--ink); }
.foot-bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.foot-bar a { color: var(--ink); }
.foot-bar .btn { font-size: .92rem; padding: .85em 1.25em; }

/* ---------- Document pages (guide, support, privacy) ---------- */
.doc-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(132px, 19vw, 216px) 0 clamp(44px, 7vw, 84px); }
.doc-hero-bg { position: absolute; z-index: -1; inset: 0; }
.doc-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: var(--img-filter); -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); }
.doc-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 800; letter-spacing: -.03em; animation: rise 1s var(--ease) both; }
:lang(zh-Hant) .doc-hero h1 { letter-spacing: .01em; }
.doc-hero .meta { margin: 1.1em 0 0; color: var(--ink); font-size: .98rem; animation: rise 1s .1s var(--ease) both; }

.doc-grid { display: grid; grid-template-columns: 256px minmax(0, auto); justify-content: start; gap: clamp(32px, 6vw, 88px); align-items: start; padding-top: 8px; padding-bottom: clamp(48px, 8vw, 96px); }

.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; font-size: 14.5px; line-height: 1.4; }
.toc summary { list-style: none; font-family: var(--round); font-weight: 750; font-size: 13.5px; letter-spacing: .04em; color: var(--soft); padding: 0 0 12px 15px; }
.toc summary::-webkit-details-marker { display: none; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--soft); text-decoration: none; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); font-weight: 650; border-left-color: var(--clay); }

.prose { max-width: 33.5em; font-size: 1.0625rem; line-height: 1.72; overflow-wrap: break-word; }
:lang(zh-Hant) .prose { max-width: 38em; line-height: 1.86; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 780; margin: 2.3em 0 .75em; padding-top: 1.5em; border-top: 1px solid var(--line); }
.prose h2 + .meta { margin: -.35em 0 1em; font-size: .95rem; }
.prose h3 { font-size: 1.24rem; font-weight: 720; line-height: 1.35; margin: 2em 0 .6em; padding-top: 1.7em; border-top: 1px solid var(--line); text-wrap: pretty; }
.prose h2 + h3 { border-top: 0; padding-top: 0; margin-top: 1.2em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.35em; }
.prose li { margin: .5em 0; padding-left: .2em; }
.prose li::marker { color: var(--clay); font-weight: 700; }
.prose strong { font-weight: 680; }
.prose code { font: .88em var(--mono); padding: .12em .4em; border-radius: 7px; background: var(--chip-clay-bg); color: var(--chip-clay-fg); overflow-wrap: anywhere; }
pre.note { margin: 1.4em 0 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; padding: 20px 22px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); font: 14px/1.6 var(--mono); color: var(--ink); }
p.meta { color: var(--soft); }

/* An anchor the app or another page linked to: mark where the reader landed. */
.prose :target { background: linear-gradient(var(--chip-sky-bg), var(--chip-sky-bg)) no-repeat 0 100% / 100% 0; animation: landed 2.6s ease-out; }
.prose h2:target, .prose h3:target { box-shadow: -14px 0 0 -10px var(--clay); }
@keyframes landed { 0%, 35% { background-size: 100% 100%; } }

.progress { position: fixed; z-index: 60; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--clay), var(--gold)); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

@media (max-width: 959px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { position: static; max-height: none; overflow: visible; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
  .toc summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: var(--ink); font-size: 15px; letter-spacing: 0; }
  .toc summary::after { content: ""; width: .5em; height: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-25%) rotate(45deg); transition: transform .3s var(--ease); }
  .toc details[open] summary::after { transform: translateY(15%) rotate(225deg); }
  .toc ul { margin: 0 18px 14px; }
  .prose, :lang(zh-Hant) .prose { margin: 0 auto; width: 100%; }
}
@media (min-width: 960px) {
  .toc summary { pointer-events: none; }
}

/* ---------- Scroll reveals (only when the script is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .phone[data-reveal] { transform: translateY(60px); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js .wish .phone[data-reveal].in { transform: rotate(3deg); }
.js .sky .phone[data-reveal].in { transform: rotate(-3deg); }
.js .sentence .chip { background-color: transparent; color: inherit; transition: background-color .7s var(--ease), color .7s var(--ease); transition-delay: calc(var(--i, 0) * 110ms + 150ms); }
.js .sentence.in .chip { background-color: var(--chip-clay-bg); color: var(--chip-clay-fg); }
.js .sentence.in .chip.data { background-color: var(--chip-sky-bg); color: var(--chip-sky-fg); }
.js .row::before { transform: translate(-50%, -50%) scale(0); transition: transform 1.1s cubic-bezier(.3, .7, .2, 1); }
.js .tick { background-color: var(--paper); transition: background-color .3s; }
.js .tick::after { transform: rotate(45deg) scale(0); transition: transform .4s var(--ease); }
.js .row::before, .js .tick, .js .tick::after { transition-delay: calc(var(--d, 0) * 320ms + 250ms); }
.js .row.in::before { transform: translate(-50%, -50%) scale(1); }
.js .row.in .tick { background-color: var(--ink); }
.js .row.in .tick::after { transform: rotate(45deg) scale(1); }

/* ---------- Reduced motion: show the final state, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sparks { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .wish .phone[data-reveal] { transform: rotate(3deg); }
  .js .sky .phone[data-reveal] { transform: rotate(-3deg); }
  .js .sentence .chip { background-color: var(--chip-clay-bg); color: var(--chip-clay-fg); }
  .js .sentence .chip.data { background-color: var(--chip-sky-bg); color: var(--chip-sky-fg); }
  .progress { display: none; }
}

/* ---------- Dark ---------- */
@media (prefers-color-scheme: dark) {
  .phone img { filter: brightness(.9); }
  .sky-bg::after, .doc-hero-bg::after { background: none; }
  .sparks i { background: #FFD58F; }
  .btn-pearl { background: linear-gradient(180deg, #F1EBE4 0%, #DDD5CC 46%, #C9C0B6 54%, #ADA398 100%); border-color: #8E847A; }
  .nav-links a:hover, .nav-lang:hover { background: rgba(255, 255, 255, .1); }
}

@media print {
  .nav, .toc, .foot-bg, .progress, .doc-hero-bg { display: none; }
  .doc-grid { display: block; }
}
