/* 熊好讀 home page — a product page for one idea: a wrong answer becomes next test's score.
   The journey section is tall and its stage sticks to the screen; home.js turns the scroll position into a time t
   (0 = the opening, 1…6 = the steps) and eases toward it, so everything glides. Things on the stage are sized in em and
   home.js sets the theatre's font size to fit the screen. Flat colours and 1px rules for the interface; the objects on
   the stage (paper, phone, cards) get soft shadows, like a product shot. */

.home { --sky: #070A12; --panel-bg: #0D1322; background: var(--sky); }
.home .top { background: transparent; transition: background .3s, box-shadow .3s; }
.home .top.solid { background: rgba(7, 10, 18, 0.72); }
.top .progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--brand); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.home em { font-style: normal; }
.goldword { color: var(--gold); }
.kicker { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--sub); letter-spacing: .08em; }
.kicker b { font: 400 14px var(--pixel); color: var(--brand-text); letter-spacing: .1em; padding: 3px 8px; box-shadow: inset 0 0 0 1px currentColor; }

/* headings come in character by character (home.js wraps each character in .ch) */
.split .ch { display: inline-block; white-space: pre; opacity: 0; transform: translateY(.45em) scale(.94); filter: blur(10px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform 1s cubic-bezier(.16, 1, .3, 1), filter .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i) * 26ms + var(--d0, 0ms)); }
.split.on .ch { opacity: 1; transform: none; filter: blur(0); }
.split:not(.on) .ch { transition-duration: .25s; transition-delay: 0s; }
html:not(.js) .split .ch { opacity: 1; transform: none; filter: none; }

/* ---------- the journey ---------- */
.journey { position: relative; height: 820vh; }
.journey .anchor { position: absolute; top: 0; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); column-gap: clamp(24px, 4vw, 64px);
  padding: 68px max(var(--pad), calc((100vw - 1320px) / 2)) 0;
}
.sky { position: absolute; inset: -60px 0; background: url("../img/stars.png") repeat 0 0 / 600px 600px; image-rendering: pixelated; opacity: .32; pointer-events: none; will-change: transform; }
.bignum { position: absolute; right: max(var(--pad), calc((100vw - 1320px) / 2)); bottom: -0.16em; height: 1em; overflow: hidden; font: 400 clamp(180px, 30vw, 460px)/1 var(--serif);
  color: transparent; -webkit-text-stroke: 1.5px rgba(241, 247, 251, 0.07); pointer-events: none; }
.bignum span { display: block; transition: transform .8s cubic-bezier(.16, 1, .3, 1), opacity .5s; }
.bignum.swap span { transform: translateY(45%); opacity: 0; transition: none; }

/* the opening line, centred over everything; home.js lifts it away as the journey starts */
.hero { position: absolute; z-index: 4; left: 0; right: 0; top: 0; padding: clamp(100px, 14vh, 160px) var(--pad) 0; display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; will-change: transform, opacity; }
.hero > * { pointer-events: auto; }
.hero h1 { margin: 16px 0 22px; font-family: var(--serif); font-size: clamp(48px, 7.6vw, 128px); line-height: 1.08; letter-spacing: .02em; white-space: nowrap; }
.hero br.m { display: none; }
.hero .lead { max-width: 30em; }
.hero .ctas { justify-content: center; margin-top: 30px; }
.hero .exam-strip { margin: 0 0 20px; }
.hero .eyebrow, .hero .lead, .hero .ctas, .hero .exam-strip { animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) both; }
.hero .exam-strip { animation-delay: .7s; }
.hero .lead { animation-delay: .55s; }
.hero .ctas { animation-delay: .7s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } }
.btn.play svg { width: 18px; height: 18px; }
.ctas .btn.ghost.play { min-height: 64px; }

/* the words for each step: stacked in one cell so the column keeps its height */
.copy { position: relative; z-index: 2; align-self: center; display: grid; padding-bottom: 72px; }
.step { grid-area: 1 / 1; align-self: center; opacity: 0; visibility: hidden; transform: translateY(26px); pointer-events: none;
  transition: opacity .3s, transform .5s cubic-bezier(.16, 1, .3, 1), visibility 0s .5s; }
.step.past { transform: translateY(-26px); }
.step.now { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .5s .1s, transform .9s .1s cubic-bezier(.16, 1, .3, 1), visibility 0s; }
.step h2 { margin: 18px 0 22px; font-family: var(--serif); font-size: clamp(36px, 4.4vw, 66px); line-height: 1.18; letter-spacing: .02em; }
.step > p:not(.kicker) { color: var(--sub); font-size: clamp(16.5px, 1.35vw, 19px); line-height: 1.9; max-width: 25em; }
.step .ctas { margin-top: 30px; }
.step .ctas .btn { min-height: 56px; }

/* six steps, each with a bar that fills while you are in it */
.rail { position: absolute; z-index: 3; left: max(var(--pad), calc((100vw - 1320px) / 2)); bottom: 30px; display: flex; gap: 8px; opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .4s; }
.rail.on { opacity: 1; transform: none; }
.rail a { --fill: 0; position: relative; display: flex; align-items: baseline; gap: 8px; padding: 10px 2px 12px; min-width: 44px; text-decoration: none; color: var(--faint); font-size: 14px; letter-spacing: .06em; transition: color .2s; }
.rail a b { font: 400 13px var(--pixel); letter-spacing: .08em; }
.rail a span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .5s cubic-bezier(.16, 1, .3, 1); }
.rail a::before, .rail a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.rail a::after { background: var(--brand); transform-origin: 0 50%; transform: scaleX(var(--fill)); }
.rail a.now { color: var(--text); }
.rail a.now span { max-width: 6em; }
.rail a:hover { color: var(--text); }

.hint { position: absolute; z-index: 5; left: 50%; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: translateX(-50%); color: var(--sub); font-size: 12px; letter-spacing: .3em; transition: opacity .3s; pointer-events: none; }
.hint i { width: 2px; height: 34px; background: var(--line); position: relative; overflow: hidden; }
.hint i::after { content: ""; position: absolute; left: 0; top: -14px; width: 2px; height: 14px; background: var(--brand); animation: hintDrop 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes hintDrop { to { transform: translateY(48px); } }
.hint.off { opacity: 0; }

/* ---------- the theatre ---------- */
.theatre { position: relative; z-index: 1; height: 100%; font-size: 10px; }
.tilt { position: absolute; inset: 0; will-change: transform; }
.obj { position: absolute; left: 50%; top: 50%; will-change: transform; }
.js .obj { opacity: 0; }

/* the test paper: a school sheet (校用卷) — boxed header with a score box, sans headings, serif questions, blue pen, red marks */
.paper, .exam { width: 46em; height: 60em; margin: -30em 0 0 -23em; padding: 2.4em 2.8em; background: #FBF7EE; color: #2B2B2B; border-radius: .5em;
  box-shadow: 0 3em 6em -1.5em rgba(0, 0, 0, .7), 0 .3em .6em rgba(0, 0, 0, .25); font-family: var(--serif); overflow: hidden; }
.p-head { display: grid; grid-template-columns: 1fr 1fr 8.6em; border: .12em solid #3A3A3A; margin-bottom: 1.4em; }
.p-head p { padding: .55em .9em; font-family: var(--body); font-size: 1.15em; line-height: 1.4; }
.p-title { grid-column: 1 / 3; position: relative; overflow: hidden; border-bottom: .1em solid #3A3A3A; font-size: 1.5em !important; font-weight: 700; letter-spacing: .06em; }
.p-title b { display: block; white-space: nowrap; }
.p-title .ex2 { position: absolute; left: .9em; top: .55em; }
.p-range { border-right: .1em solid #3A3A3A; white-space: nowrap; }
.p-range span { display: inline-block; margin-right: .6em; padding: 0 .4em; background: #3A3A3A; color: #FBF7EE; font-size: .85em; }
.p-name { color: #555; white-space: nowrap; }
.pen { font-family: var(--round); font-style: normal; color: #2850A8; display: inline-block; transform: rotate(-3deg); }
.p-score { grid-column: 3; grid-row: 1 / 3; position: relative; border-left: .1em solid #3A3A3A; display: grid; place-items: center; }
.p-score span { position: absolute; left: .5em; top: .3em; font-family: var(--body); font-size: .95em; color: #666; }
.p-score svg { position: absolute; left: 50%; top: 54%; width: 5.8em; height: 5.8em; margin: -2.9em 0 0 -2.9em; overflow: visible; }
.p-score .ring { fill: none; stroke: var(--red); stroke-width: 3.4; stroke-linecap: round; transition: stroke .6s; }
.p-score b { position: relative; margin-top: .5em; font: 400 3.1em/1 var(--round); color: var(--red); transform: rotate(-6deg); transition: color .6s; }
.exam .p-head { grid-template-columns: 1fr 1fr; }
.exam .p-title { grid-column: 1 / -1; }
.p-sec { font-family: var(--body); font-weight: 700; font-size: 1.2em; margin: 1.1em 0 .6em; }
.q { position: relative; display: flex; gap: .5em; font-size: 1.22em; line-height: 1.75; margin-bottom: .55em; }
.q .br { flex: none; width: 3em; color: #444; }
.q .n { flex: none; font-weight: 700; font-family: var(--body); }
.q .t { flex: 1; }
.q .ops { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 0 2.2em; font-size: .92em; }
.blank { position: relative; display: inline-block; min-width: 5.6em; text-align: center; border-bottom: .08em solid #2B2B2B; padding: 0 .3em; }
.blank .pen { font-size: 1.15em; }
.blank .a2 { position: absolute; left: 0; right: 0; opacity: 0; }
.tick { position: absolute; right: -.2em; top: .1em; width: 2em; height: 2em; fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.mark-x { position: absolute; left: 21.5em; top: -1.6em; width: 6em; height: 6em; fill: none; stroke: var(--red); stroke-width: 8; stroke-linecap: round; overflow: visible; }
.mark-x path { stroke-dasharray: 100; stroke-dashoffset: 100; }
.paper.drawn .mark-x path { animation: draw .3s cubic-bezier(.5, 0, .3, 1) 1.15s forwards; }
.paper.drawn .mark-x path + path { animation-delay: 1.42s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.mark-o { position: absolute; left: 19.2em; top: -.9em; width: 10.5em; height: 5em; fill: none; stroke: var(--red); stroke-width: 3.4; stroke-linecap: round; overflow: visible; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke .6s; }
.paper.gold .mark-o, .paper.gold .p-score .ring { stroke: var(--gold); }
.paper.gold .p-score b { color: #C99400; }
.work { display: grid; gap: 1.5em; margin: 1em 0 0 3.4em; }
.work i { height: .08em; background: rgba(0, 0, 0, .12); }
.p-foot { position: absolute; left: 0; right: 0; bottom: 1.2em; text-align: center; font-family: var(--body); font-size: 1em; color: #888; }

/* the phone, in the app's own light look */
.phone { width: 30em; height: 62em; margin: -31em 0 0 -15em; padding: .9em; border-radius: 4.6em; background: #0A0D10;
  box-shadow: inset 0 0 0 .2em #2C343B, 0 3em 6em -1.5em rgba(0, 0, 0, .75); }
.phone::after { content: ""; position: absolute; left: 50%; top: 1.9em; width: 1.6em; height: 1.6em; margin-left: -.8em; border-radius: 50%; background: #05070A; z-index: 3; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 3.8em; overflow: hidden; background: #F5F8FB; }
.scr { position: absolute; inset: 0; opacity: 0; }
.cam { background: #0B0D10; }
.cam-view { position: absolute; left: 50%; top: 46%; width: 44em; margin-left: -22em; padding: 2.4em 2em; background: #FBF7EE; color: #2B2B2B; font-family: var(--serif); transform: translateY(-50%) scale(.62); transform-origin: 50% 50%; }
.cam-view .q { font-size: 1.5em; }
.cam-view .mark-x path { stroke-dashoffset: 0; }
.brackets { position: absolute; left: 1.8em; right: 1.8em; top: 41%; height: 9em; margin-top: -1em; }
.brackets i { position: absolute; width: 3em; height: 3em; border: .32em solid #fff; }
.brackets i:nth-child(1) { left: 0; top: 0; border-width: .32em 0 0 .32em; border-radius: .8em 0 0 0; }
.brackets i:nth-child(2) { right: 0; top: 0; border-width: .32em .32em 0 0; border-radius: 0 .8em 0 0; }
.brackets i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 .32em .32em; border-radius: 0 0 0 .8em; }
.brackets i:nth-child(4) { right: 0; bottom: 0; border-width: 0 .32em .32em 0; border-radius: 0 0 .8em 0; }
.cam-hint { position: absolute; left: 0; right: 0; top: 6em; text-align: center; color: #fff; font-size: 1.4em; letter-spacing: .1em; }
.shutter { position: absolute; left: 50%; bottom: 4em; width: 6.4em; height: 6.4em; margin-left: -3.2em; border-radius: 50%; box-shadow: inset 0 0 0 .4em #fff; display: grid; place-items: center; }
.shutter i { width: 4.8em; height: 4.8em; border-radius: 50%; background: #fff; transition: transform .1s; }
.cam.click .shutter i { transform: scale(.82); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }

.chat { display: flex; flex-direction: column; color: #27313B; font-family: var(--round); }
.c-top { flex: none; display: flex; align-items: center; gap: .9em; padding: 4.4em 1.8em 1.2em; background: #fff; border-bottom: .1em solid #E4EAF0; font-size: 1.3em; }
.c-top img { width: 2.6em; height: auto; }
.c-top span { margin-left: auto; font-size: .82em; color: #1182B8; padding: .1em .7em; border-radius: 1em; background: #E3F4FD; }
.c-list { position: relative; flex: 1; overflow: hidden; }
.c-inner { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4em 1.4em 1.6em; display: flex; flex-direction: column; gap: .9em; will-change: transform; }
.b { max-width: 80%; padding: .75em 1.05em; font-size: 1.3em; line-height: 1.5; border-radius: 1.3em; will-change: transform, opacity; }
.b.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: .4em; }
.b.ai { align-self: flex-start; background: #fff; box-shadow: inset 0 0 0 .08em #DCE3EA; border-bottom-left-radius: .4em; }
.b.ai b { color: #E0343A; font-weight: 400; }
.b.img { padding: .35em; background: #DCEFFB; }
.snap { width: 15em; height: 7.4em; border-radius: .9em; overflow: hidden; background: #FBF7EE; position: relative; }
.snap .q { position: absolute; left: 1em; top: 1.6em; width: 40em; font-size: .62em; color: #2B2B2B; font-family: var(--serif); }
.snap .mark-x path { stroke-dashoffset: 0; }
.saved { display: block; width: fit-content; margin-top: .5em; padding: .05em .7em; font-size: .82em; border-radius: .5em; color: #9A6B00; box-shadow: inset 0 0 0 .1em var(--gold); }
.typing { position: absolute; left: 1.4em; bottom: 6.6em; display: flex; gap: .4em; padding: 1em 1.2em; border-radius: 1.3em; background: #fff; box-shadow: inset 0 0 0 .1em #DCE3EA; opacity: 0; }
.typing i { width: .7em; height: .7em; border-radius: 50%; background: #9AA8B5; animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-.4em); } }
.c-input { flex: none; display: flex; align-items: center; gap: 1em; margin: 0 1.2em 2.2em; padding: .8em .8em .8em 1.3em; border-radius: 2em; background: #fff; box-shadow: inset 0 0 0 .1em #DCE3EA; color: #9AA8B5; font-size: 1.3em; }
.c-input i { margin-left: auto; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--brand); }

.study { background: #0E1528; color: #fff; font-family: var(--round); text-align: center; }
.strata { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: url("../img/ground-rock.png") repeat 0 0 / 8em 8em; image-rendering: pixelated; }
.strata::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: .8em; background: #0E1528; }
.s-sub { position: relative; margin-top: 6.2em; font-size: 1.3em; color: var(--sub); letter-spacing: .1em; }
.s-time { position: relative; margin-top: .3em; font: 400 6.4em/1.1 var(--pixel); letter-spacing: .04em; }
.digger { position: absolute; left: 50%; bottom: 40%; width: 22.2em; height: 19.8em; margin: 0 0 -1.8em -11.1em; background: url("../img/dig-strip.png") no-repeat 0 0 / 266.4em 19.8em; image-rendering: pixelated; animation: dig 1s steps(12) infinite; }
@keyframes dig { to { background-position-x: -266.4em; } }
.s-depth { position: absolute; left: 0; right: 0; bottom: 18%; font-size: 1.5em; color: #F7D99A; }
.s-depth b { font: 400 2em var(--pixel); color: var(--gold); margin-right: .15em; }
.s-guard { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); display: flex; align-items: center; gap: .6em; white-space: nowrap; padding: .5em 1em; border-radius: 2em; background: rgba(10, 14, 24, .78); font-size: 1.15em; color: #DCE6EE; }
.s-guard i { width: 2.4em; height: 1.4em; border-radius: 1em; background: var(--green); position: relative; }
.s-guard i::after { content: ""; position: absolute; right: .2em; top: .2em; width: 1em; height: 1em; border-radius: 50%; background: #fff; }

/* the 錯題本 cards; the first one flips into a 測驗卡 */
.card { width: 30em; height: 17.6em; margin: -8.8em 0 0 -15em; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; padding: 1.6em 1.8em; border-radius: 1.4em; background: #fff; color: #27313B; font-family: var(--round);
  box-shadow: inset 0 0 0 .1em #DCE3EA, 0 2em 4em -1em rgba(0, 0, 0, .6); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; background: #FFF6D6; box-shadow: inset 0 0 0 .14em var(--gold), 0 2em 4em -1em rgba(0, 0, 0, .6); text-align: center; }
.face.back img { width: 4.6em; height: auto; }
.face.back p { font-size: 1.5em; }
.face.back p b { color: #B07A00; margin-right: .3em; font-weight: 400; }
.face.back .c-sub { font-size: 1.05em; color: #8A7A55; }
.c-tag { display: flex; align-items: center; gap: .55em; font-size: 1.05em; color: #6A7782; }
.c-tag i { width: .8em; height: .8em; background: var(--c); }
.c-q { margin: .5em 0 .7em; font-size: 1.42em; line-height: 1.45; font-family: var(--serif); }
.c-why { font-size: 1.12em; color: #3B4650; }
.c-why b { font-weight: 400; color: #E0343A; margin-right: .6em; padding: .05em .5em; border-radius: .4em; box-shadow: inset 0 0 0 .1em currentColor; font-size: .9em; }
.c-bar { position: absolute; left: 1.8em; right: 1.8em; bottom: 1.5em; height: .55em; border-radius: 1em; background: #EDF1F5; overflow: hidden; }
.c-bar i { display: block; height: 100%; background: var(--brand); border-radius: 1em; }
.book { margin: -1.6em 0 0 -9em; width: 18em; text-align: center; font-size: 1.6em; color: var(--text); letter-spacing: .1em; padding: .5em 0; box-shadow: inset 0 0 0 .07em var(--line); background: rgba(7, 10, 18, .6); }
.book b { font: 400 1.3em var(--pixel); color: var(--gold); }

/* the apps that try to get in while you study */
.toast { width: 27em; margin: -3.2em 0 0 -13.5em; display: flex; align-items: center; gap: 1em; padding: 1.1em 1.3em; border-radius: 1.4em; background: #fff; color: #27313B; font-family: var(--round); box-shadow: 0 2em 4em -1em rgba(0, 0, 0, .6); }
.toast .ic { flex: none; width: 3.6em; height: 3.6em; border-radius: .9em; background: var(--c); display: grid; place-items: center; }
.toast .ic svg { width: 2.6em; height: 2.6em; }
.toast span { display: flex; flex-direction: column; font-size: 1.2em; line-height: 1.35; color: #6A7782; transition: opacity .25s; }
.toast span b { font-weight: 400; color: #27313B; }
.toast em { position: absolute; right: 1em; top: 50%; padding: .1em .6em; font-size: 1.3em; color: var(--red); box-shadow: inset 0 0 0 .14em var(--red); border-radius: .3em; background: #fff; transform: translateY(-50%) rotate(-8deg) scale(1.6); opacity: 0; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), opacity .15s; }
.toast.blocked span { opacity: .35; }
.toast.blocked em { opacity: 1; transform: translateY(-50%) rotate(-8deg); }

/* the paper made from the mistakes */
.rows { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rows li { counter-increment: r; position: relative; display: flex; align-items: baseline; gap: .4em; padding: .95em 0; font-size: 1.32em; line-height: 1.6; border-bottom: .08em dashed rgba(0, 0, 0, .14); }
.rows li .br { flex: none; width: 2.6em; color: #666; }
.rows li::before { content: counter(r) "."; order: 1; flex: none; font-family: var(--body); font-weight: 700; }
.rows li > span:not(.br) { order: 2; }
.rows li > mark { order: 3; }
.rows mark { margin-left: auto; flex: none; padding: 0 .55em; font-size: .78em; font-family: var(--round); background: none; color: #C9302C; box-shadow: inset 0 0 0 .1em currentColor; border-radius: .35em; }
.pdf { position: absolute; right: 2.4em; bottom: 3.6em; display: flex; align-items: center; gap: .5em; padding: .6em 1.2em; border-radius: 1em; background: var(--brand); color: #fff; font-family: var(--round); font-size: 1.3em; box-shadow: 0 .3em 0 var(--brand-deep); opacity: 0; transform: translateY(1em) scale(.8); transition: opacity .25s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.pdf svg { width: 1.3em; height: 1.3em; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.exam.done .pdf { opacity: 1; transform: none; }

/* the score going up */
.chart { width: 30em; margin: -9em 0 0 -15em; padding: 1.6em 1.8em 1.4em; border-radius: 1.4em; background: #111A30; box-shadow: inset 0 0 0 .1em var(--line), 0 2em 4em -1em rgba(0, 0, 0, .7); font-family: var(--round); }
.ch-h { display: flex; align-items: center; justify-content: space-between; font-size: 1.3em; color: var(--text); }
.ch-h span { font-size: .78em; color: var(--faint); }
.chart svg { display: block; width: 100%; height: auto; margin: .6em 0 .2em; overflow: visible; }
.chart .grid { stroke: rgba(241, 247, 251, .08); stroke-width: 1; fill: none; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.chart circle { fill: #111A30; stroke: var(--gold); stroke-width: 3; }
.chart circle.last { fill: var(--gold); }
.ch-x { display: flex; justify-content: space-between; font-size: 1.05em; color: var(--sub); }
.ch-x span { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.ch-x b { font: 400 1.5em var(--pixel); color: var(--text); }
.ch-x span:last-child b { color: var(--gold); }
.happy { margin: -6em 0 0 -6em; width: 12em; }
.happy img { width: 100%; height: auto; }
.sparks { width: 0; height: 0; }
.sparks i { position: absolute; width: 1.2em; height: 1.2em; margin: -.6em; background: var(--gold); opacity: 0; }
.sparks i:nth-child(even) { width: .8em; height: .8em; margin: -.4em; background: #FFF1B8; }
.sparks.go i { animation: spark 1.2s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(1em) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(.3); } }
.sparks i:nth-child(1) { --a: 8deg; --d: 11em; } .sparks i:nth-child(2) { --a: 44deg; --d: 8em; } .sparks i:nth-child(3) { --a: 80deg; --d: 10em; } .sparks i:nth-child(4) { --a: 118deg; --d: 8em; }
.sparks i:nth-child(5) { --a: 152deg; --d: 12em; } .sparks i:nth-child(6) { --a: 190deg; --d: 8em; } .sparks i:nth-child(7) { --a: 226deg; --d: 11em; } .sparks i:nth-child(8) { --a: 262deg; --d: 8em; }
.sparks i:nth-child(9) { --a: 298deg; --d: 12em; } .sparks i:nth-child(10) { --a: 334deg; --d: 8em; }

/* ---------- the sentence that lights up ---------- */
.statement { position: relative; height: 280vh; }
.st-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; place-items: center; padding: 0 var(--pad); }
.st-text { font: 400 clamp(28px, 4.4vw, 70px)/1.4 var(--serif); letter-spacing: .02em; }
.st-text .ch { color: rgba(241, 247, 251, .13); transition: color .35s; }
.st-text .ch.lit { color: var(--text); }
.st-text em .ch.lit { color: var(--gold); }

/* ---------- free stuff, sliding sideways ---------- */
.hgal { position: relative; height: 300vh; }
.hg-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: clamp(26px, 4vh, 48px); }
.hg-head { width: 100%; max-width: 1320px; padding: 0 max(var(--pad), calc((100vw - 1320px) / 2)); }
.hg-head h2 { margin-top: 16px; font-family: var(--serif); font-size: clamp(34px, 4.4vw, 62px); line-height: 1.2; letter-spacing: .02em; }
.hg-row { display: flex; gap: 20px; width: max-content; padding: 0 max(var(--pad), calc((100vw - 1320px) / 2)); will-change: transform; }
.hcard { flex: none; width: clamp(270px, 31vw, 450px); display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--panel-bg); color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .25s; }
.hcard img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #0B1120; transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.hcard:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.hcard:hover img { transform: scale(1.05); }
.hcard .tag { margin: 18px 22px 0; font-size: 13px; color: var(--gold); letter-spacing: .08em; }
.hcard b { margin: 6px 22px 22px; font-weight: 400; font-size: 17px; line-height: 1.55; }
.hg-label { flex: none; width: clamp(250px, 24vw, 340px); display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 28px; border-radius: 22px; background: var(--brand); color: #fff; text-decoration: none; transition: transform .3s; }.hg-label:hover { transform: translateY(-4px); }
.hg-label .n { font-size: 18px; letter-spacing: .06em; }
.hg-label .n b { font: 400 64px/1 var(--pixel); margin-right: 6px; }
.hg-label strong { font: 400 clamp(26px, 2.4vw, 34px)/1.25 var(--serif); }
.hg-label span:not(.n) { font-size: 15px; line-height: 1.7; opacity: .9; }
.hg-label i { margin-top: 6px; font-style: normal; font-size: 15px; letter-spacing: .06em; }
.hg-label.lab { background: var(--gold); color: #241A00; }
.hg-label.lab .n, .hg-label.lab i { color: rgba(36, 26, 0, .75); }
/* the 地科實驗室 tile sits beside the videos tile; a second blue tile would read as more of the same, so it is
   the gold one */
.hg-end { flex: none; width: 1px; }
.hg-bar { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 max(var(--pad), calc((100vw - 1320px) / 2)); }
.hg-bar::before { content: ""; display: block; height: 2px; background: var(--line); }
.hg-bar i { display: block; height: 2px; margin-top: -2px; background: var(--text); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- the sections after the journey ---------- */
.block { position: relative; padding: clamp(100px, 12vw, 160px) 0; }
.block .head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.block .head h2 { margin: 18px 0 16px; font-family: var(--serif); font-size: clamp(34px, 4.4vw, 62px); line-height: 1.2; letter-spacing: .02em; }
.block .head > p:not(.kicker) { color: var(--sub); font-size: clamp(16.5px, 1.35vw, 18.5px); }
.reveal { opacity: 0; transform: translateY(46px); transition: opacity 1s cubic-bezier(.16, 1, .3, 1), transform 1.1s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* bento: one tile per thing, each with its own small loop (paused until the tile is on screen) */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(270px, auto); gap: 18px;
  grid-template-areas: "mine mine guard guard" "mine mine cal candle" "streak ypt web web"; }
.tile { position: relative; display: flex; flex-direction: column; padding: 28px 28px 30px; border-radius: 26px; background: var(--panel-bg); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; }
.tile:not(.in) *, .tile:not(.in) *::before, .tile:not(.in) *::after { animation-play-state: paused !important; }
.tile h3 { font-size: 20px; letter-spacing: .04em; }
.tile p { margin-top: 6px; color: var(--sub); font-size: 15px; line-height: 1.75; }
.tile-art { position: relative; flex: 1; min-height: 120px; margin-bottom: 22px; }
.t-mine { grid-area: mine; } .t-guard { grid-area: guard; } .t-cal { grid-area: cal; } .t-candle { grid-area: candle; }
.t-streak { grid-area: streak; } .t-ypt { grid-area: ypt; } .t-web { grid-area: web; }
/* 小白 digging, trying each pickaxe in turn */
.t-mine .tile-art { min-height: 320px; margin: -28px -28px 26px; }
.mine-wall { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: url("../img/ground-rock.png") repeat 0 0 / 72px 72px; image-rendering: pixelated; animation: wallUp 1.5s steps(6) infinite; }
.mine-wall::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: #6B4F3A; }
@keyframes wallUp { to { background-position-y: -72px; } }
.mine-bear { position: absolute; z-index: 1; left: 50%; bottom: calc(30% - 24px); width: 222px; height: 198px; margin-left: -111px; background: url("../img/dig-strip.png") no-repeat 0 0 / 2664px 198px; image-rendering: pixelated; animation: digBig 1s steps(12) infinite; }
@keyframes digBig { to { background-position-x: -2664px; } }
.mine-bear.gold { background-image: url("../img/gold-strip.png"); }
.mine-bear.diamond { background-image: url("../img/diamond-strip.png"); }
.mine-bear.star { background-image: url("../img/star-strip.png"); }
.mine-depth { position: absolute; left: 28px; top: 26px; font-size: 16px; color: #F7D99A; }
.mine-depth b { font: 400 44px/1 var(--pixel); color: var(--gold); margin-right: 4px; }
.mine-pick { position: absolute; right: 28px; top: 30px; padding: 4px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
/* apps bouncing off the phone */
.t-guard .tile-art { display: grid; place-items: center; }
.g-phone { width: 74px; height: 140px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--sub); display: grid; place-items: center; }
.g-lock { width: 26px; height: 22px; border-radius: 5px; background: var(--brand); position: relative; margin-top: 10px; }
.g-lock::before { content: ""; position: absolute; left: 5px; top: -13px; width: 12px; height: 14px; border: 3px solid var(--brand); border-bottom: 0; border-radius: 9px 9px 0 0; }
.g-app { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border-radius: 8px; animation: bounceOff 2.4s cubic-bezier(.5, 0, .5, 1) infinite; }
.g-app.a1 { background: #FF6B9D; --sx: -170px; --sy: -40px; }
.g-app.a2 { background: #58CC02; --sx: 170px; --sy: -20px; animation-delay: .8s; }
.g-app.a3 { background: #A98BF0; --sx: -150px; --sy: 50px; animation-delay: 1.6s; }
@keyframes bounceOff {
  0% { transform: translate(var(--sx), var(--sy)) scale(.9); opacity: 0; }
  15% { opacity: 1; }
  45% { transform: translate(calc(var(--sx) * .32), calc(var(--sy) * .32)) scale(1); }
  70% { transform: translate(calc(var(--sx) * .8), calc(var(--sy) * .8 + 40px)) rotate(40deg) scale(.8); opacity: 1; }
  85%, 100% { transform: translate(calc(var(--sx) * .9), calc(var(--sy) * .9 + 60px)) rotate(60deg) scale(.7); opacity: 0; }
}
.g-switch { position: absolute; right: 0; top: 0; width: 52px; height: 30px; border-radius: 99px; background: var(--green); }
.g-switch::after { content: ""; position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
/* the calendar with the exam days lit */
.t-cal .tile-art { display: flex; align-items: flex-end; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; max-width: 230px; }
.cal i { aspect-ratio: 1; border-radius: 5px; background: rgba(241, 247, 251, .07); }
.cal i.x { background: var(--brand); animation: examDay 2.8s steps(1) infinite; }
.cal i.x.g { animation-delay: 1.4s; }
@keyframes examDay { 50% { background: var(--gold); } }
/* the candle burning down */
.t-candle .tile-art { display: flex; align-items: flex-end; justify-content: flex-start; }
.candle { position: relative; width: 40px; height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.candle .wax { width: 30px; height: 80px; background: #F1EADB; box-shadow: inset -7px 0 0 #D9CFBA; transform-origin: 50% 100%; animation: melt 7s linear infinite; }
.candle .flame { position: absolute; left: 50%; bottom: 80px; width: 26px; height: 26px; margin-left: -13px; animation: flameDown 7s linear infinite; }
@keyframes melt { 0% { transform: scaleY(1); } 92% { transform: scaleY(.18); } 100% { transform: scaleY(1); } }
@keyframes flameDown { 0% { transform: translateY(0); opacity: 1; } 92% { transform: translateY(66px); opacity: 1; } 93%, 99% { opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
/* the streak */
.t-streak .tile-art { display: flex; align-items: flex-end; }
.streak { display: flex; align-items: baseline; gap: 8px; }
.streak b { font: 400 92px/1 var(--pixel); color: var(--gold); }
.streak span { font-size: 18px; color: var(--sub); }
/* YPT bars moving over */
.t-ypt .tile-art { display: flex; align-items: flex-end; }
.bars { display: flex; align-items: flex-end; gap: 7px; height: 100px; }
.bars i { width: 16px; border-radius: 4px 4px 0 0; background: var(--brand); transform-origin: 50% 100%; animation: bar 3s cubic-bezier(.3, 1.4, .5, 1) infinite; }
.bars i:nth-child(1) { height: 40%; } .bars i:nth-child(2) { height: 66%; animation-delay: .1s; } .bars i:nth-child(3) { height: 48%; animation-delay: .2s; }
.bars i:nth-child(4) { height: 86%; animation-delay: .3s; } .bars i:nth-child(5) { height: 58%; animation-delay: .4s; } .bars i:nth-child(6) { height: 74%; animation-delay: .5s; }
.bars i:nth-child(7) { height: 100%; animation-delay: .6s; background: var(--gold); }
@keyframes bar { 0%, 8% { transform: scaleY(0); } 35%, 100% { transform: scaleY(1); } }
/* phone and laptop */
.t-web .tile-art { display: flex; align-items: flex-end; justify-content: center; gap: 22px; }
.dev { position: relative; box-shadow: inset 0 0 0 2px var(--sub); border-radius: 10px; overflow: hidden; }
.dev.laptop { width: 220px; height: 136px; border-radius: 10px 10px 4px 4px; }
.dev.mobile { width: 62px; height: 120px; border-radius: 14px; }
.dev i { position: absolute; left: 12%; right: 12%; top: 18%; height: 10px; border-radius: 3px; background: var(--brand); box-shadow: 0 20px 0 rgba(241, 247, 251, .14), 0 40px 0 rgba(241, 247, 251, .14), 0 60px 0 rgba(241, 247, 251, .1); animation: sync 3s ease-in-out infinite; }
.dev.mobile i { animation-delay: .4s; }
@keyframes sync { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* plans and questions */
.home .plans { max-width: none; }
.home .plan { background: var(--panel-bg); }
.home .plan .price b { font-weight: 400; }
.home .faq { max-width: 900px; }
.home .faq details { background: var(--panel-bg); }
.faq details .a { overflow: hidden; }

/* the end: the app icon floating in the night, 小白's sky */
.get { text-align: center; overflow: hidden; padding-top: clamp(120px, 13vw, 180px); }
.get .night { position: absolute; inset: 0; background: url("../img/stars.png") repeat 0 0 / 600px 600px; image-rendering: pixelated; opacity: .4; pointer-events: none; }
.get .wrap { position: relative; }
.app-icon { --rx: 0deg; --ry: 0deg; position: relative; width: clamp(150px, 16vw, 210px); aspect-ratio: 1; margin: 0 auto 46px; border-radius: 23%; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.app-icon.in { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: opacity 1s, transform .5s cubic-bezier(.16, 1, .3, 1); animation: float 5s ease-in-out infinite; }
.app-icon img { width: 100%; height: 100%; display: block; }
.app-icon .sheen { position: absolute; inset: -50%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .28) 50%, transparent 58%); transform: translateX(-60%); animation: sheen 5s 1.2s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes sheen { 0% { transform: translateX(-60%); } 30%, 100% { transform: translateX(60%); } }
@keyframes float { 50% { translate: 0 -10px; } }
.get h2 { font-family: var(--serif); font-size: clamp(42px, 6.4vw, 92px); line-height: 1.12; margin-bottom: 22px; }
.get .lead { margin: 0 auto; }
.home footer { background: #05070D; }
.home footer .brand { font-size: 17px; color: var(--text); }
.home footer .brand img { width: 32px; height: 32px; border-radius: 9px; }

/* the film */
.film { padding: 0; border: 0; background: transparent; width: min(380px, 86vw); max-height: 92vh; overflow: visible; }
.film::backdrop { background: rgba(3, 5, 10, .9); }
.film video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 88vh; border-radius: 22px; background: #000; }
.film-close { position: absolute; top: -8px; right: -60px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.film[open] { animation: pop .4s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* ---------- phones and small windows ---------- */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "mine mine" "guard guard" "cal candle" "streak ypt" "web web"; }
}
@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 62px var(--pad) 0; }
  .theatre { grid-row: 1; margin: 22px calc(-1 * var(--pad)) 0; }
  .copy { grid-row: 2; align-self: end; padding-bottom: 28px; }
  .step { align-self: end; }
  .step h2 { font-size: clamp(30px, 8vw, 44px); margin: 12px 0 12px; }
  .step > p:not(.kicker) { font-size: 15.5px; line-height: 1.8; }
  .step .ctas { margin-top: 18px; gap: 10px; }
  .step .ctas .btn { flex: 1 1 0; min-height: 52px; padding: 0 14px; }
  .kicker, .kicker b { font-size: 13px; }
  .hero { padding-top: 92px; }
  .hero h1 { font-size: clamp(44px, 13vw, 76px); white-space: normal; margin: 10px 0 14px; }
  .hero br.m { display: inline; }
  .hero .lead { font-size: 15.5px; line-height: 1.8; max-width: 22em; }
  .hero .ctas { margin-top: 18px; gap: 10px; width: 100%; max-width: 440px; }
  .hero .ctas .btn.store { flex: 1 1 0; min-width: 0; min-height: 54px; padding: 0 12px; gap: 8px; }
  .hero .ctas .btn.store svg { width: 20px; height: 20px; }
  .hero .ctas .btn.play { flex: 1 1 100%; min-height: 36px; padding: 0; box-shadow: none; font-size: 15px; color: var(--sub); }
  .hero .exam-strip { margin-bottom: 10px; }
  /* the rail becomes six bars under the header */
  .rail { left: var(--pad); right: var(--pad); top: 66px; bottom: auto; gap: 5px; }
  .rail a { flex: 1; min-width: 0; padding: 0; height: 12px; }
  .rail a b, .rail a span { display: none; }
  .hint { display: none; }
  .bignum { font-size: 52vw; right: var(--pad); bottom: auto; top: 76px; }
  .hcard { width: 74vw; }
  .st-text { font-size: clamp(22px, 6vw, 40px); }
  .hg-label { width: 66vw; }
  .film-close { right: 0; top: -58px; }
}
@media (max-width: 960px) and (max-height: 720px) {
  .hero .exam-strip, .hero .eyebrow { display: none; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; grid-auto-rows: minmax(220px, auto); }
  .tile { padding: 22px 20px 24px; border-radius: 22px; }
  .t-mine .tile-art { min-height: 260px; margin: -22px -20px 20px; }
  .mine-depth { left: 20px; top: 20px; } .mine-pick { right: 20px; top: 22px; }
  .mine-bear { transform: scale(.8); transform-origin: 50% 100%; }
  .tile h3 { font-size: 17px; }
  .tile p { font-size: 14px; }
  .streak b { font-size: 70px; }
  .dev.laptop { width: 160px; height: 100px; }
  .dev.mobile { width: 48px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .split .ch { opacity: 1; transform: none; filter: none; }
  .paper .mark-x path { stroke-dashoffset: 0; }
}

/* without scripts: no pinning, everything one after another */
html:not(.js) .journey, html:not(.js) .statement, html:not(.js) .hgal { height: auto; }
html:not(.js) .stage { position: relative; height: auto; display: block; padding-top: 110px; }
html:not(.js) .hero { position: relative; padding-top: 0; }
html:not(.js) .step { position: relative; opacity: 1; visibility: visible; transform: none; margin: 60px 0; }
html:not(.js) .copy { display: block; }
html:not(.js) .theatre, html:not(.js) .rail, html:not(.js) .hint, html:not(.js) .bignum { display: none; }
html:not(.js) .st-pin, html:not(.js) .hg-pin { position: relative; height: auto; padding: 100px var(--pad); }
html:not(.js) .st-text .ch { color: var(--text); }
html:not(.js) .hg-row { flex-wrap: wrap; width: auto; }
