/* 熊好讀 — official site. The page is a mine: scrolling down digs through the app's strata.
   Flat colours only (no gradients); pixel art for 小白, the ground and the layer edges; serif for the big lines,
   Bear Round (jf open 粉圓, the app's font) for everything else, Cubic 11 for the depth digits. */
@font-face { font-family: "Bear Round"; src: url("../fonts/BearRound-site.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Study Serif"; src: url("../fonts/StudySerif-site.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cubic 11"; src: url("../fonts/Cubic_11-latin.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: dark;
  --sky: #0E1528;
  --text: #F1F7FB;
  --sub: #AEBDC7;
  --faint: #73868F;
  --line: rgba(241, 247, 251, 0.12);
  --surface: rgba(10, 14, 18, 0.55);
  --brand: #1CB0F6;
  --brand-deep: #1182B8;
  --brand-text: #49C0F8;
  --gold: #FFC800;
  --gold-deep: #C99400;
  --pink: #FF6B9D;
  --green: #58CC02;
  --red: #E0343A;
  --round: "Bear Round", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --serif: "Study Serif", "Noto Serif TC", "Songti TC", serif;
  --pixel: "Cubic 11", "Bear Round", monospace;
  --body: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --wrap: 1120px;
  --pad: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--sky); color: var(--text); font-family: var(--round); font-size: 17px; line-height: 1.75; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.25; text-wrap: balance; }
.px { image-rendering: pixelated; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--text); color: #000; padding: 8px 14px; border-radius: 10px; }

/* ---------- buttons: the app's chunky ones ---------- */
.btn {
  --c: var(--brand); --d: var(--brand-deep);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 18px; border: 0;
  background: var(--c); color: #fff; font: inherit; font-size: 18px; letter-spacing: 0.04em; text-decoration: none; white-space: nowrap;
  box-shadow: 0 5px 0 var(--d); cursor: pointer; transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--d); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 3px; }
.btn.ghost { --c: transparent; --d: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--line); }
.btn.sm { min-height: 42px; padding: 0 18px; font-size: 15px; border-radius: 14px; box-shadow: 0 4px 0 var(--d); }
.btn svg { width: 22px; height: 22px; flex: none; }
/* Android and the web version get the same button: same colour and size, a small line says which device */
.btn.store { flex: 0 0 240px; padding: 0 22px; gap: 12px; text-align: left; }
.btn.store span { display: flex; flex-direction: column; line-height: 1.3; }
.btn.store small { font-size: 12.5px; letter-spacing: 0.08em; opacity: 0.85; }
.ctas .btn { min-height: 64px; }
.note { color: var(--sub); font-size: 14px; }
/* before launch the site recruits testers; flip <html data-stage> to "live" when the app is on Google Play */
[data-stage="beta"] .live-only, [data-stage="live"] .beta-only { display: none !important; }
/* the web version (PWA): its buttons stay hidden until site.js knows where it lives */
html:not([data-web="on"]) .web-only, [data-web="on"] .web-off { display: none !important; }

/* ---------- header with the depth meter ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; transition: background .25s, box-shadow .25s; }
.top.solid { background: rgba(10, 14, 20, 0.86); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 68px; max-width: 1240px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 21px; letter-spacing: 0.1em; flex: none; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.depth { margin-left: auto; display: none; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 999px; background: rgba(15, 19, 28, 0.82); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--sub); white-space: nowrap; }
.depth.on { display: flex; }
.depth img { width: 29px; height: 22px; }
.depth b { flex: none; font: 400 18px var(--pixel); color: #F7D99A; letter-spacing: 0.06em; min-width: 3.5ch; text-align: right; }
.top nav { display: flex; align-items: center; gap: 26px; margin-left: auto; font-size: 15px; }
.top nav a:not(.btn) { text-decoration: none; color: var(--sub); }
.top nav a:not(.btn):hover { color: var(--text); }
.depth.on + nav { margin-left: 22px; }
@media (max-width: 860px) {
  .top nav a:not(.btn) { display: none; }
  .depth { padding: 5px 12px 5px 8px; }
}
@media (max-width: 520px) {
  .top .wrap { gap: 12px; }
  .depth img { display: none; }
  .depth.on + nav { margin-left: 12px; }
}
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------- hero: the night above the mine ---------- */
.hero { position: relative; padding: 132px 0 0; background: var(--sky); overflow: hidden; }
.stars { position: absolute; inset: 0 0 160px 0; background: url("../img/stars.png") repeat; background-size: 720px 720px; image-rendering: pixelated; opacity: 0.9; pointer-events: none; }
.moon { position: absolute; top: 96px; right: 7%; width: 72px; height: 72px; image-rendering: pixelated; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 56px; align-items: end; }
.hero-copy { padding-bottom: 200px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--brand-text); letter-spacing: 0.08em; }
.eyebrow::before { content: ""; width: 10px; height: 10px; background: var(--brand); }
.hero h1 { margin: 22px 0 26px; font-family: var(--serif); font-size: clamp(46px, 7.4vw, 96px); letter-spacing: 0.02em; line-height: 1.12; }
.goldword { color: var(--gold); position: relative; white-space: nowrap; }
.shine { background: linear-gradient(105deg, var(--gold) 40%, #FFF3C4 50%, var(--gold) 60%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s 1.2s infinite; }
@keyframes shine { 0% { background-position: 100% 0; } 18%, 100% { background-position: 0 0; } }
.lead { max-width: 33em; font-size: clamp(17px, 1.6vw, 20px); color: var(--sub); line-height: 1.85; }
.lead b { color: var(--text); font-weight: 400; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 34px; }
.ctas .note { width: 100%; margin-top: 4px; }
.hero-phone { position: relative; justify-self: center; padding-bottom: 176px; }
.hero-phone .phone { width: min(300px, 76vw); }
.ground { position: relative; height: 180px; margin-top: -150px; background: url("../img/ground.png") repeat-x 0 0 / 960px 180px; image-rendering: pixelated; }
.ground::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; background: url("../img/grass-top.png") repeat-x 0 0 / 960px 12px; image-rendering: pixelated; }
.fall { position: absolute; top: -40px; width: 42px; height: 42px; z-index: 1; animation: fall 7s linear infinite; }
.fall svg { width: 100%; height: 100%; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  4% { opacity: 1; }
  32% { transform: translateY(var(--drop)) rotate(30deg); opacity: 1; }
  33%, 100% { transform: translateY(var(--drop)) rotate(30deg); opacity: 0; }
}

/* ---------- phones ---------- */
.phone { position: relative; width: min(330px, 76vw); aspect-ratio: 9 / 19.5; padding: 10px; border-radius: 50px; background: #0A0D10; box-shadow: inset 0 0 0 2px #2C343B, inset 0 0 0 5px #05070A; }
.phone > img, .phone > video { width: 100%; height: 100%; object-fit: cover; border-radius: 41px; background: #000; }
.phone::after { content: ""; position: absolute; left: 50%; top: 22px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #05070A; box-shadow: inset 0 0 0 3px #11161B; }
.sound { position: absolute; right: -64px; bottom: 190px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(10, 14, 20, 0.78); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.sound svg { width: 24px; height: 24px; }
.sound .on { display: none; }
.sound[aria-pressed="true"] .on { display: block; }
.sound[aria-pressed="true"] .off { display: none; }

/* ---------- the strata ---------- */
.layer { position: relative; --bg: #1B140F; --speck: #2A1F17; background: var(--bg); padding: clamp(96px, 12vw, 150px) 0; }
.edge { position: absolute; left: 0; right: 0; top: -35px; height: 36px; width: 100%; pointer-events: none; }
.edge path { fill: var(--bg); }
.stratum { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; font-size: 14px; color: var(--sub); letter-spacing: 0.06em; }
.stratum b { font: 400 16px var(--pixel); color: #F7D99A; letter-spacing: 0.08em; }
.stratum::before { content: ""; width: 26px; height: 2px; background: currentColor; opacity: 0.6; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); align-items: center; }
.feature.flip .shot { order: -1; }
.feature h2 { font-family: var(--serif); font-size: clamp(34px, 4.6vw, 58px); letter-spacing: 0.02em; margin-bottom: 26px; }
.feature p { color: var(--sub); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.9; max-width: 30em; }
.feature p + p { margin-top: 14px; }
.points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 14px; }
.points li { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; font-size: 17px; }
.points li::before { content: ""; width: 12px; height: 12px; margin-top: 9px; background: var(--brand); }
.points li span { color: var(--sub); display: block; font-size: 15px; }
.shot { position: relative; justify-self: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chips span { padding: 6px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 15px; color: var(--text); }
.chips span.locked { color: var(--faint); }

/* a red ✗ lodged in each layer, turning gold as you pass it */
.ore { position: absolute; width: 56px; height: 56px; pointer-events: none; }
.ore rect { transition: fill .5s; }
.ore .ink { fill: var(--red); }
.ore .ink-d { fill: #A9232A; }
.ore.gold .ink { fill: #E8B64A; }
.ore.gold .ink-d { fill: #A8741E; }
.ore.gold .hi { fill: #FFE7A8; }
.ore .hi { fill: var(--red); transition: fill .5s; }
.ore::after { content: ""; position: absolute; inset: -10px; opacity: 0; background: url("../img/sparkle.svg") center / contain no-repeat; }
.ore.gold::after { animation: sparkle 1.1s .2s 1; }
@keyframes sparkle { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }

/* reveal on scroll */
.rise { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1); }
.rise.in { opacity: 1; transform: none; }
.rise.d1 { transition-delay: .08s; } .rise.d2 { transition-delay: .16s; } .rise.d3 { transition-delay: .24s; }

/* ---------- plans ---------- */
.section-head { max-width: 760px; margin-bottom: 54px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(34px, 4.6vw, 56px); margin-bottom: 16px; }
.section-head p { color: var(--sub); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 900px; }
.plan { position: relative; padding: 34px 32px 36px; border-radius: 28px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.plan.plus { box-shadow: inset 0 0 0 2px var(--brand); }
.plan h3 { font-size: 22px; letter-spacing: 0.06em; display: flex; align-items: center; gap: 12px; }
.plan h3 img { width: 34px; height: 34px; }
.price { margin: 18px 0 6px; font-size: 46px; line-height: 1; letter-spacing: 0.02em; }
.price small { font-size: 17px; color: var(--sub); margin-left: 4px; }
.plan .note { min-height: 1.75em; }
.plan ul { list-style: none; margin: 26px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: 16px; }
.plan li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.plan li svg { width: 20px; height: 20px; margin-top: 5px; color: var(--green); }
.plan li b { font-weight: 400; color: var(--brand-text); }
.badge { position: absolute; top: -14px; right: 24px; padding: 4px 14px; border-radius: 999px; background: var(--gold); color: #2A2213; font-size: 14px; letter-spacing: 0.04em; }

/* ---------- questions ---------- */
.faq { max-width: 860px; display: grid; gap: 12px; }
.faq details { border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 64px 22px 28px; position: relative; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 28px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background:
  linear-gradient(currentColor, currentColor) center / 16px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 16px no-repeat; color: var(--brand-text); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 28px 24px; color: var(--sub); }
.faq .a p + p { margin-top: 10px; }

/* ---------- the bottom of the mine ---------- */
.get { text-align: center; padding-bottom: clamp(110px, 14vw, 170px); }
.get .icon { width: min(220px, 52vw); height: auto; margin: 0 auto 38px; border-radius: 22%; }
.get h2 { font-family: var(--serif); font-size: clamp(38px, 5.6vw, 72px); margin-bottom: 22px; }
.get p.lead { margin: 0 auto; }
.get .ctas { justify-content: center; }
/* the bottom: the sign-up form, and under it the web version's button */
.get .ctas:has(.join) { flex-direction: column; align-items: center; }
.get .ctas:has(.join) .join { width: 100%; }
.get .ctas:has(.join) .btn.store { flex: none; width: min(440px, 100%); }
/* the closed test's sign-up: a Gmail, then grade and phone */
.join { flex: 1 1 100%; max-width: 440px; margin: 0 auto 6px; display: grid; gap: 12px; text-align: left; }
.join-title { font-size: 18px; letter-spacing: .04em; }
.join input, .join select { width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); font: inherit; font-size: 16px; }
.join select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.join select option { background: #0F1520; color: var(--text); }
.join input:focus-visible, .join select:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 2px; }
.join-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.join .btn { width: 100%; }
.join-note { margin-top: -2px; }
.join-note.ok { color: var(--green); }
.join-note.err { color: var(--red); }
.join.done input, .join.done select, .join.done .btn { display: none; }
.get { overflow: hidden; }
.city { position: absolute; left: 0; bottom: 0; width: 100%; height: 120px; pointer-events: none; }

footer { background: #0A0E13; color: var(--faint); font-size: 14px; padding: 46px 0 56px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
footer a { color: var(--sub); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .made { margin-left: auto; }

/* ---------- the shaft on wide screens: 小白 digs down as you scroll ---------- */
.shaft { position: fixed; left: 28px; top: 0; bottom: 0; width: 148px; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .4s; display: none; }
.shaft.on { opacity: 1; }
.shaft .wall { position: absolute; inset: 0; background: url("../img/ground-rock.png") repeat 0 0 / 240px 240px; image-rendering: pixelated; }
.shaft .dug { position: absolute; left: 6px; right: 6px; top: 0; height: var(--floor, 58%); background: #0C1018; }
.shaft .timber { position: absolute; top: 0; bottom: 0; width: 6px; background: #6B4F3A; }
.shaft .timber.l { left: 0; } .shaft .timber.r { right: 0; }
.shaft .bear { position: absolute; left: 50%; top: var(--floor, 58%); width: 116px; height: 90px; transform: translate(-50%, -100%); }
.shaft .lamp { position: absolute; left: 6px; right: 6px; top: calc(var(--floor, 58%) - 132px); height: 132px; background: rgba(255, 210, 140, 0.06); box-shadow: 0 -40px 0 rgba(255, 210, 140, 0.03); }
@media (min-width: 1360px) {
  .shaft { display: block; }
  main .wrap { padding-left: max(var(--pad), 200px); max-width: calc(var(--wrap) + 160px); }
}

@media (max-width: 960px) {
  .hero { padding-top: 112px; }
  .hero-grid { grid-template-columns: 1fr; gap: 10px; }
  .hero-copy { padding-bottom: 20px; }
  .hero-phone { padding-bottom: 172px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 54px; }
  .feature.flip .shot { order: 0; }
  /* one column leaves no margin, so the ✗ sits in the layer's top padding instead of on the text */
  .ore { top: 30px !important; width: 42px; height: 42px; }
  .plans { grid-template-columns: 1fr; }
  .sound { bottom: 186px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .btn { min-height: 54px; padding: 0 22px; font-size: 17px; }
  .ctas .btn { flex: 1 1 100%; }
  .moon { width: 52px; height: 52px; top: 86px; }
  .phone { width: min(300px, 80vw); border-radius: 46px; }
  .phone > img, .phone > video { border-radius: 37px; }
  .sound { right: 12px; bottom: 186px; }
  .plan { padding: 30px 24px 32px; }
  .faq summary { padding: 20px 56px 20px 22px; font-size: 17px; }
  .faq .a { padding: 0 22px 22px; }
  footer .made { margin-left: 0; width: 100%; }
}

/* ---------- 404: a layer nobody has dug ---------- */
.lost { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 48px var(--pad); background: #1C1510; text-align: center; }
.lost img { width: 174px; height: auto; }
.lost .stratum { margin: 6px 0 0; }
.lost h1 { font-family: var(--serif); font-size: clamp(34px, 6vw, 56px); }
.lost p:not(.stratum) { color: var(--sub); max-width: 26em; }
.lost .btn { margin-top: 14px; }

/* ---------- reading pages (privacy, terms, account deletion) ---------- */
.doc { background: #111A21; padding: 130px 0 110px; }
.doc .wrap { max-width: 820px; }
.doc h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 54px); margin-bottom: 14px; }
.doc .meta { color: var(--faint); font-size: 15px; margin-bottom: 44px; }
.doc h2 { font-size: 22px; margin: 46px 0 14px; letter-spacing: 0.04em; }
.doc h3 { font-size: 18px; margin: 28px 0 10px; }
.doc p, .doc li { font-family: var(--body); color: #D5DEE4; font-size: 16.5px; line-height: 1.95; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 1.4em; margin: 10px 0; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--brand-text); }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-family: var(--body); font-size: 15.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); color: #D5DEE4; }
.doc th { color: var(--text); font-weight: 600; white-space: nowrap; }
.doc .card { margin: 26px 0; padding: 26px 28px; border-radius: 22px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1.5px var(--line); }
.doc .card p { color: var(--text); }
.doc .steps { counter-reset: s; list-style: none; padding: 0; }
.doc .steps li { counter-increment: s; position: relative; padding-left: 46px; margin-top: 14px; }
.doc .steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; font: 400 16px/30px var(--pixel); text-align: center; }
@media (max-width: 520px) { .doc th { white-space: normal; } }
