:root {
  --ink: #1f2240;
  --muted: #6b6f8e;
  --bg: #fbf7f2;
  --night: #120f24;
  --neon-pink: #ff4fa3;
  --neon-cyan: #39e1ff;
  --honey: #ffc83d;
  --miudoku: #ff9f2e;
  --destinana: #8b5cf6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: Fredoka, Inter, sans-serif; line-height: 1.1; margin: 0; }

/* ---------- Top bar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  color: #fff;
  background: linear-gradient(to bottom, rgba(10, 8, 25, .55), transparent);
}
.nav.solid { position: sticky; color: var(--ink); background: rgba(251, 247, 242, .9); backdrop-filter: blur(10px); border-bottom: 1px solid #eee3d6; }
.brand { font-family: Fredoka, sans-serif; font-weight: 700; font-size: 22px; text-decoration: none; letter-spacing: .3px; }
.brand span { color: var(--honey); }
.nav nav { display: flex; gap: 20px; }
.nav nav a { text-decoration: none; font-weight: 600; font-size: 15px; opacity: .9; }
.nav nav a:hover { opacity: 1; text-decoration: underline; }
.nav nav a.lang { border: 1.5px solid currentColor; border-radius: 999px; padding: 2px 10px; opacity: 1; }
.nav nav a.lang:hover { text-decoration: none; background: rgba(255, 255, 255, .15); }
:lang(zh-Hant) body { font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
:lang(zh-Hant) h1, :lang(zh-Hant) h2, :lang(zh-Hant) h3 { font-family: Fredoka, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; font-weight: 900; }

/* ---------- Scroll film ---------- */
#film { position: relative; height: 700vh; background: var(--night); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#frames { width: 100%; height: 100%; display: block; }

.caption {
  position: absolute; left: 50%; top: 22%;
  transform: translate(-50%, 16px);
  width: min(90vw, 760px);
  text-align: center; color: #fff;
  opacity: 0; transition: opacity .45s ease, transform .45s ease;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.caption.on { opacity: 1; transform: translate(-50%, 0); }
.caption h1 { font-size: clamp(36px, 6vw, 76px); }
.caption h2 { font-size: clamp(28px, 4.5vw, 56px); }
.caption p { font-size: clamp(16px, 2vw, 22px); margin: 14px 0 0; }
.caption.end { display: none; top: 14%; }
@media (orientation: portrait) { .caption.end { display: block; } }
.glow { color: var(--honey); text-shadow: 0 0 22px rgba(255, 200, 61, .8), 0 2px 18px rgba(0, 0, 0, .5); }

.machine {
  position: absolute; display: flex; align-items: flex-end; justify-content: center;
  border-radius: 18px; text-decoration: none;
  opacity: 0; pointer-events: none;
  transition: opacity .5s ease, box-shadow .3s ease, background .3s ease;
}
.machine.on { opacity: 1; pointer-events: auto; }
#hot-miudoku { box-shadow: 0 0 0 3px rgba(255, 159, 46, .0); }
.machine.on { animation: pulse 2.2s ease-in-out infinite; }
#hot-miudoku.on:hover { background: rgba(255, 159, 46, .12); box-shadow: 0 0 0 3px var(--miudoku), 0 0 40px var(--miudoku); }
#hot-destinana.on:hover { background: rgba(139, 92, 246, .14); box-shadow: 0 0 0 3px var(--destinana), 0 0 40px var(--destinana); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 0 14px rgba(57, 225, 255, .25); }
  50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .6), 0 0 34px rgba(255, 79, 163, .45); }
}
.machine .label {
  margin-bottom: 14%;
  padding: 10px 18px; border-radius: 999px;
  font-family: Fredoka, sans-serif; font-weight: 500; font-size: clamp(15px, 1.6vw, 20px);
  color: #fff; background: rgba(18, 15, 36, .78);
  border: 2px solid rgba(255, 255, 255, .7);
  white-space: nowrap;
}
#hot-miudoku .label b { color: var(--honey); }
#hot-destinana .label b { color: #c9b4ff; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: #fff; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: opacity .4s ease; text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.scroll-hint span { font-size: 26px; animation: bob 1.4s ease-in-out infinite; }
.scroll-hint.gone { opacity: 0; }
@keyframes bob { 50% { transform: translateY(6px); } }

.loader { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .12); transition: opacity .6s ease; }
.loader span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink)); transition: width .2s ease; }
.loader.done { opacity: 0; }

/* ---------- Pick a machine ---------- */
.choose { background: var(--night); color: #fff; padding: 80px 24px 96px; text-align: center; }
.choose h2 { font-size: clamp(30px, 4vw, 48px); margin-bottom: 36px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 980px; margin: 0 auto; }
.card {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: #1c1838; border-radius: 22px; padding: 16px 16px 22px; text-decoration: none;
  border: 2px solid transparent; transition: transform .2s ease, border-color .2s ease;
}
.card img { border-radius: 14px; aspect-ratio: 400 / 110; object-fit: cover; }
.card h3 { font-size: 28px; margin-top: 6px; }
.card p { color: #c8c5e0; margin: 0; line-height: 1.5; }
.card .cta { margin-top: auto; padding-top: 8px; font-weight: 600; }
.card.miudoku:hover { transform: translateY(-4px); border-color: var(--miudoku); }
.card.destinana:hover { transform: translateY(-4px); border-color: var(--destinana); }
.card.miudoku .cta { color: var(--honey); }
.card.destinana .cta { color: #c9b4ff; }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 28px 16px 40px; color: var(--muted); font-size: 14px; }
.home .foot { background: var(--night); color: #9a97b8; }
.foot p { margin: 6px 0; }

/* ---------- Sub pages ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 48px 24px 64px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero .badge { display: inline-block; font-weight: 600; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(40px, 6vw, 68px); margin: 10px 0 14px; }
.hero p.lead { font-size: 19px; line-height: 1.6; color: #44476a; margin: 0 0 24px; }
.hero .art { position: relative; }
.hero .art img { border-radius: 26px; box-shadow: 0 24px 60px rgba(31, 34, 64, .18); }
.stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 600;
}
.store small { display: block; font-size: 11px; font-weight: 400; opacity: .8; }
.store.soon { opacity: .55; pointer-events: none; }
.note { font-size: 14px; color: var(--muted); margin-top: 12px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 56px 0; }
.feature { background: #fff; border-radius: 20px; padding: 22px; box-shadow: 0 6px 24px rgba(31, 34, 64, .06); }
.feature h3 { font-size: 21px; margin-bottom: 6px; }
.feature p { margin: 0; color: #55587a; line-height: 1.55; }

.shots { display: flex; gap: 16px; overflow-x: auto; padding: 8px 2px 20px; scroll-snap-type: x mandatory; }
.shots img { width: 220px; flex: 0 0 auto; border-radius: 22px; scroll-snap-align: start; box-shadow: 0 10px 30px rgba(31, 34, 64, .12); }

.prose { max-width: 760px; margin: 0 auto; padding: 48px 24px 64px; line-height: 1.7; }
.prose h1 { font-size: 40px; margin-bottom: 4px; }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose .muted { color: var(--muted); }

.miudoku-page { --accent: var(--miudoku); background: linear-gradient(180deg, #fff3e4, var(--bg) 420px); }
.destinana-page { --accent: var(--destinana); background: linear-gradient(180deg, #efe8ff, var(--bg) 420px); }
.miudoku-page .hero h1 span, .destinana-page .hero h1 span { color: var(--accent); }

@media (max-width: 760px) {
  .nav { padding: 12px 16px; }
  .brand { font-size: 19px; }
  .nav nav { gap: 12px; }
  .nav nav a { font-size: 13px; }
  .nav nav a[href="/support/"], .nav nav a[href="/zh/support/"] { display: none; } /* still in the footer */
  .hero { grid-template-columns: 1fr; }
  .hero .art { order: -1; }
  .caption { top: 16%; }
  .machine .label { margin-bottom: 30%; font-size: 14px; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .machine.on, .scroll-hint span { animation: none; }
  .caption { transition: none; }
}
