/* Shared product page (食決, 拾行). Each page sets --brand / --brand-2. */
.product { --brand: #0071e3; --brand-2: #5e5ce6; --g1: var(--brand); --g2: var(--brand-2); }

.p-hero { padding: clamp(56px,8vw,96px) 0 0; overflow: hidden; text-align: center; }
.p-hero-icon { width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 22%; box-shadow: 0 10px 28px rgba(0,0,0,.16); animation: p-pop 1s var(--ease-apple) both; }
.p-hero .eyebrow { color: var(--brand); animation: p-rise 1s .05s var(--ease-apple) both; }
.p-hero h1 { animation: p-rise 1s .1s var(--ease-apple) both; }
.p-hero .lead { max-width: 640px; margin: 18px auto 0; color: var(--text-muted); animation: p-rise 1s .18s var(--ease-apple) both; }
.p-hero .cta-row { margin-top: 30px; animation: p-rise 1s .26s var(--ease-apple) both; }
.p-hero-meta { margin-top: 16px; color: var(--text-muted); font-size: .82rem; animation: p-rise 1s .3s var(--ease-apple) both; }
.p-hero-stage { position: relative; margin-top: clamp(40px,6vw,64px); height: clamp(420px,56vw,600px); display: flex; justify-content: center; }
.p-hero-stage .phone { --phone-w: clamp(230px,24vw,290px); transform: translateY(calc(var(--p,0) * -50px)) scale(calc(1 + var(--p,0) * .04)); animation: p-phone 1.2s .35s var(--ease-apple) both; }
.p-hero-glow { position: absolute; left: 50%; top: 18%; width: min(760px,90vw); height: 60%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 32%, transparent), transparent); filter: blur(30px); opacity: calc(.55 + var(--p,0) * .45); pointer-events: none; }
.p-hero.on-dark { background: #000; color: #f5f5f7; }
.p-hero.on-dark .lead, .p-hero.on-dark .p-hero-meta { color: #a1a1a6; }

@keyframes p-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes p-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes p-phone { from { opacity: 0; translate: 0 120px; } to { opacity: 1; translate: 0 0; } }

/* Story steps colour */
.p-story { background: #000; color: #f5f5f7; }
.p-story .story-step h3 { color: #f5f5f7; }
.p-story .story-step p { color: #a1a1a6; }
.p-story .story-step .role { display: block; margin-bottom: 14px; color: var(--brand); font-size: 1.05rem; font-weight: 600; }
.p-story .phone { --phone-w: clamp(230px,24vw,300px); box-shadow: inset 0 0 0 1.5px #3a3a3c, 0 40px 120px color-mix(in srgb, var(--brand) 30%, transparent); }
.p-story-intro { padding: clamp(100px,12vw,160px) 0 0; text-align: center; }
.p-story-intro p { max-width: 640px; margin: 20px auto 0; color: #a1a1a6; font-size: clamp(1.05rem,1.6vw,1.3rem); }

/* Feature tiles accents */
.tile-accent { background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 12%, #fff), #fff) !important; }
.tile-accent h3 { color: inherit; }
.tile-dark { background: #000 !important; color: #f5f5f7; }
.tile-dark p { color: #a1a1a6 !important; }
.tile-emoji { margin-bottom: 20px; font-size: 2.2rem; line-height: 1; }
.tile .tile-stat.brand { background: linear-gradient(90deg,var(--brand),var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.check-list { margin-top: 18px; list-style: none; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; color: var(--text-secondary); }
.tile-dark .check-list li { color: #d2d2d7; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }

/* Final CTA */
.p-final { padding: clamp(100px,12vw,160px) 0; text-align: center; }
.p-final img { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 22%; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.p-final p { max-width: 520px; margin: 16px auto 32px; color: var(--text-muted); font-size: 1.15rem; }
.p-final .cta-row { gap: 18px 24px; }

/* Notes and callouts */
.p-note { max-width: 860px; margin: 32px auto 0; padding: 22px 26px; background: var(--bg-secondary); border-radius: var(--radius-md); color: var(--text-secondary); font-size: .92rem; line-height: 1.7; }
.section-alt .p-note { background: #fff; }

@media (max-width: 734px) {
  .p-hero-stage { height: 128vw; }
  .p-hero-stage .phone { --phone-w: 58vw; }
}
@media (prefers-reduced-motion: reduce) {
  .p-hero-stage .phone { transform: none; }
}

/* "Decide for me" reel (食決) */
.decide { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: clamp(32px,6vw,80px); padding: clamp(32px,5vw,64px); background: #fff; border-radius: 32px; }
.decide h3 { font-size: clamp(2rem,4vw,3rem); line-height: 1.08; letter-spacing: -.03em; }
.decide-copy p { margin: 14px 0 26px; color: var(--text-muted); font-size: 1.1rem; }
.decide-machine { position: relative; padding: 18px; background: #000; border-radius: 28px; box-shadow: 0 30px 70px rgba(255,106,43,.22); }
.decide-window { position: relative; height: 240px; overflow: hidden; border-radius: 16px; background: #161617; }
.decide-window::before, .decide-window::after { content: ""; position: absolute; left: 0; right: 0; z-index: 2; height: 80px; pointer-events: none; }
.decide-window::before { top: 0; background: linear-gradient(#161617, rgba(22,22,23,0)); }
.decide-window::after { bottom: 0; background: linear-gradient(rgba(22,22,23,0), #161617); }
.decide-focus { position: absolute; left: 10px; right: 10px; top: 50%; z-index: 1; height: 80px; translate: 0 -50%; border-radius: 14px; background: rgba(255,106,43,.16); box-shadow: inset 0 0 0 1.5px rgba(255,106,43,.6); }
.decide-reel { position: relative; z-index: 1; list-style: none; will-change: transform; }
.decide-reel li { height: 80px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #f5f5f7; font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.decide-reel li span { font-size: 2rem; }
.decide-result { min-height: 1.6em; margin-top: 16px; color: #f5f5f7; text-align: center; font-size: 1rem; }
.decide-result strong { color: var(--brand); }
@media (max-width: 900px) { .decide { grid-template-columns: 1fr; text-align: center; } }

/* Step → distance calculator (拾行) */
.calc { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); overflow: hidden; background: #fff; border-radius: 32px; }
.calc-controls { padding: clamp(28px,4vw,52px); display: grid; gap: 28px; align-content: start; }
.calc-field label, .calc-field .calc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; font-weight: 600; }
.calc-field output { color: var(--brand); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.calc-field small { display: block; margin-top: 8px; color: var(--text-muted); font-size: .8rem; }
.calc input[type=range], .route-panel input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) var(--fill, 50%), #e8e8ed var(--fill, 50%)); cursor: pointer; }
.calc input[type=range]::-webkit-slider-thumb, .route-panel input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.06); transition: transform .2s var(--ease-apple); }
.calc input[type=range]::-moz-range-thumb, .route-panel input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.calc input[type=range]:active::-webkit-slider-thumb, .route-panel input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.calc .segmented { width: 100%; }
.calc-result { position: relative; padding: clamp(28px,4vw,52px); display: flex; flex-direction: column; justify-content: center; gap: 18px; background: linear-gradient(160deg, var(--brand-2), #0b1f2a); color: #fff; overflow: hidden; }
.calc-result small { opacity: .75; font-size: .95rem; }
.calc-km { display: flex; align-items: baseline; gap: 12px; font-size: clamp(4.4rem,10vw,7.6rem); font-weight: 700; line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.calc-km span { font-size: clamp(1.4rem,2.6vw,2rem); font-weight: 600; letter-spacing: -.01em; }
.calc-formula { padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.1); font-size: .95rem; font-variant-numeric: tabular-nums; }
.calc-walker { position: absolute; right: -20px; bottom: -20px; width: 180px; opacity: .14; }
.calc-note { margin-top: 18px; color: var(--text-muted); font-size: .78rem; text-align: center; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }

.p-hero-stats { display: flex; justify-content: center; gap: clamp(32px,8vw,96px); margin-top: clamp(44px,6vw,64px); animation: p-rise 1s .35s var(--ease-apple) both; }
.p-hero-stats strong { display: block; font-size: clamp(3rem,8vw,5.6rem); font-weight: 700; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--text-primary), color-mix(in srgb, var(--text-primary) 55%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.p-hero-stats span { display: block; margin-top: 8px; color: var(--text-muted); font-size: .95rem; }
.p-hero-big-icon { width: clamp(120px,14vw,168px); height: clamp(120px,14vw,168px); margin: 0 auto 26px; border-radius: 23%; box-shadow: 0 24px 60px rgba(7,16,87,.28); animation: p-pop 1.1s var(--ease-apple) both; }

/* Route speed demo (座標實驗室) */
.route-demo { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); overflow: hidden; background: #fff; border-radius: 32px; }
.route-map { position: relative; min-height: 380px; background: radial-gradient(circle at 30% 30%, #eef4ff, #dfe9f8 70%); }
.route-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route-map .road { fill: none; stroke: #fff; stroke-width: 26; stroke-linecap: round; }
.route-map .path { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; }
.route-map .done { fill: none; stroke: color-mix(in srgb, var(--brand) 35%, #fff); stroke-width: 8; stroke-linecap: round; }
.route-map .pin-start { fill: #30b85a; }
.route-map .pin-end { fill: #ff3b30; }
.route-map .pin-label { font: 600 15px var(--font-sans); fill: var(--text-primary); }
.route-dot { fill: var(--brand); stroke: #fff; stroke-width: 5; filter: drop-shadow(0 4px 10px rgba(47,123,255,.5)); }
.route-pulse { fill: var(--brand); opacity: .18; transform-box: fill-box; transform-origin: center; animation: route-pulse 1.8s ease-out infinite; }
@keyframes route-pulse { from { transform: scale(.6); opacity: .35; } to { transform: scale(2.2); opacity: 0; } }
.route-panel { padding: clamp(28px,4vw,48px); display: grid; gap: 22px; align-content: center; }
.route-trip { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.route-trip span { flex: 1; padding: 12px 14px; background: var(--bg-secondary); border-radius: 14px; }
.route-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.route-stats div { padding: 16px; background: var(--bg-secondary); border-radius: 16px; }
.route-stats small { display: block; color: var(--text-muted); font-size: .8rem; }
.route-stats strong { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.route-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; }
.switch { position: relative; width: 51px; height: 31px; flex: none; border-radius: 16px; background: #e9e9eb; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15); transition: transform .25s var(--ease-apple); }
.switch[aria-checked="true"] { background: #34c759; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.route-actions { display: flex; gap: 12px; }
.route-actions .btn-primary, .route-actions .btn-secondary { flex: 1; }
@media (max-width: 900px) { .route-demo { grid-template-columns: 1fr; } .route-map { min-height: 300px; } }

.req-list { display: grid; gap: 14px; margin-top: 24px; list-style: none; counter-reset: req; }
.req-list li { position: relative; padding: 18px 20px 18px 62px; background: #161617; border-radius: 18px; color: #d2d2d7; }
.req-list li::before { counter-increment: req; content: counter(req); position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem; }
.req-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: clamp(32px,7vw,100px); }
@media (max-width: 900px) { .req-grid { grid-template-columns: 1fr; justify-items: center; } }

/* Mini quiz (單字速刷) */
.quiz-demo { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: clamp(32px,6vw,80px); padding: clamp(32px,5vw,64px); background: #fff; border-radius: 32px; }
.quiz-demo h3 { font-size: clamp(2rem,4vw,3rem); line-height: 1.08; letter-spacing: -.03em; }
.quiz-copy p { margin-top: 14px; color: var(--text-muted); font-size: 1.1rem; }
.quiz-card { position: relative; padding: clamp(24px,3vw,36px); overflow: hidden; background: #f4f2ed; border-radius: 28px; box-shadow: 0 30px 70px color-mix(in srgb, var(--brand) 18%, transparent); }
.quiz-timer { position: absolute; inset: 0 0 auto; height: 5px; background: #dedad0; }
.quiz-timer span { display: block; width: 100%; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease-apple); }
.quiz-kind { color: var(--brand); font-size: .82rem; font-weight: 600; }
.quiz-word { margin-top: 10px; font-family: "New York", "Iowan Old Style", Georgia, serif; font-size: clamp(2.4rem,5vw,3.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.quiz-phon { margin-top: 4px; color: var(--text-muted); font-size: 1rem; }
.quiz-options { display: grid; gap: 10px; margin-top: 24px; }
.quiz-options button { min-height: 52px; padding: 12px 18px; background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px #dedad0; color: var(--text-primary); text-align: left; font-size: 1.05rem; font-weight: 500; transition: box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast); }
.quiz-options button:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.quiz-options button:not(:disabled):active { transform: scale(.985); }
.quiz-options button:disabled { cursor: default; }
.quiz-options button.is-correct { background: #e4f1e9; box-shadow: inset 0 0 0 1.5px #2e7a4c; color: #1f5a37; }
.quiz-options button.is-wrong { background: #f7e6e2; box-shadow: inset 0 0 0 1.5px #b4432e; color: #8a2f1e; }
.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-top: 18px; }
.quiz-feedback { color: var(--text-secondary); font-size: .95rem; }
.quiz-foot .btn-primary { background: var(--brand); }
.quiz-done { min-height: 380px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; }
.quiz-done[hidden], .quiz-play[hidden] { display: none; }
.quiz-result { font-size: clamp(2rem,4vw,2.8rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
.quiz-result strong { color: var(--brand); font-weight: 700; }
.quiz-done p:not(.quiz-kind):not(.quiz-result) { color: var(--text-secondary); font-size: 1.05rem; }
.quiz-done .btn-primary { margin-top: 8px; }
@media (max-width: 900px) { .quiz-demo { grid-template-columns: 1fr; } .quiz-copy { text-align: center; } .quiz-card { width: 100%; max-width: 440px; margin-inline: auto; } }
.p-final-links { margin-top: 22px; }
/* Text-only tiles: let short copy set the height instead of the 300px bento minimum. */
.tile-grid-compact .tile { min-height: 0; }
.tile-grid-compact .tile-emoji { margin-bottom: 16px; }
/* Hero stage that shows the whole phone instead of cropping it at the section edge. */
.p-hero-stage-full { height: auto; padding-bottom: clamp(56px,8vw,100px); }
.p-hero-stage-full .p-hero-glow { top: 10%; height: 70%; }
@media (max-width: 734px) { .p-hero-stage-full { height: auto; } }
