/* Tokel Genesis: a quiet, Mac-like page. Light and dark follow the device; everything scales from phone to desktop. */
:root {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #4a4a50;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.6);
  --accent: #ff7a1a;
  --accent-2: #7a5cff;
  --accent-ink: #ffffff;
  --accent-text: #b8470a;
  --btn-a: #c2410c;
  --btn-b: #c92a3e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(20, 20, 40, 0.08);
  --radius: 22px;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f1d;
    --bg-2: #121829;
    --ink: #f5f5f7;
    --ink-2: #c9cbd6;
    --muted: #9599a8;
    --line: rgba(255, 255, 255, 0.08);
    --glass: rgba(24, 30, 50, 0.62);
    --glass-line: rgba(255, 255, 255, 0.08);
    --accent: #ff8f3d;
    --accent-2: #9b86ff;
    --accent-text: #ffa45c;
    --btn-a: #c2410c;
    --btn-b: #c92a3e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 50px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; -webkit-user-drag: none; user-select: none; }
body { -webkit-touch-callout: none; } /* no iOS long-press menu on links and images */
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", "Noto Sans TC", sans-serif; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; line-break: strict; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* navigation: frosted bar */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.brand b { color: var(--accent-text); font-weight: 700; }
.links { display: flex; gap: 0.25rem; margin: 0 auto; }
.links a { text-decoration: none; color: var(--ink-2); font-size: 0.92rem; padding: 0.45rem 0.8rem; border-radius: 999px; transition: background .2s, color .2s; }
.links a:hover { background: var(--line); color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.pill { display: inline-flex; align-items: center; height: 40px; padding: 0 0.95rem; border-radius: 999px; font: 600 0.88rem/1 inherit; font-family: inherit; text-decoration: none; background: var(--ink); color: var(--bg); border: 0; cursor: pointer; }
.pill.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, top .25s; }
.menu-btn span:first-child { top: 15px; } .menu-btn span:last-child { top: 23px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 max(1.25rem, env(safe-area-inset-left)); }
.section { padding: 4.5rem 0 0; scroll-margin-top: 70px; }
.head { text-align: center; margin-bottom: 2rem; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; color: var(--accent-text); margin-bottom: 0.6rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.muted { color: var(--muted); }
.tiny { font-size: 0.85rem; }

/* hero */
.hero { position: relative; text-align: center; padding: 6rem 0 3rem; isolation: isolate; }

/* hero background: "dawn of the universe", drawn in index.html (SVG), animated here */
.cosmos { position: absolute; z-index: -1; top: -80px; bottom: -60px; left: 50%; width: 100vw; transform: translateX(-50%); pointer-events: none; overflow: hidden; }
.cosmos svg { width: 100%; height: 100%; display: block; }
.cosmos::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; background: linear-gradient(to bottom, transparent, var(--bg)); }
.cosmos .sky-l { opacity: 1; } .cosmos .sky-d { opacity: 0; }
.cosmos .star { fill: #fff; opacity: 0; }
.cosmos .nebula { opacity: .55; }
.cosmos .sun { opacity: .8; }
.cosmos .moon { opacity: .7; }
.tw { animation: twinkle 4.5s ease-in-out infinite; }
.tw2 { animation-delay: 1.1s; } .tw3 { animation-delay: 2.3s; animation-duration: 6s; } .tw4 { animation-delay: 3.4s; animation-duration: 5.2s; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.nebula { animation: drift 28s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(40px, 18px); } }
.planet { animation: bob 12s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotate(-16deg) translateY(-10px); } }
.planet { transform-origin: 1220px 600px; transform: rotate(-16deg); }
@media (prefers-color-scheme: dark) {
  .cosmos .sky-l { opacity: 0; } .cosmos .sky-d { opacity: 1; }
  .cosmos .star { opacity: .8; }
  .cosmos .tw { opacity: .4; }
  .cosmos .nebula { opacity: .9; }
  .cosmos .sun { opacity: .65; }
}
/* hero text stays readable over the planet on narrow screens */
.hero h1, .hero .lead, .hero .eyebrow { position: relative; text-shadow: 0 1px 24px var(--bg); }
.hero h1 { font-size: clamp(3rem, 10vw, 6.2rem); line-height: 1.02; font-weight: 700; }
.hero .dot { color: var(--muted); font-weight: 400; }
.grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 640px; margin: 1.4rem auto 0; font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--ink-2); }
.cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.facts { list-style: none; padding: 0; margin: 3rem auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; max-width: 760px; }
.facts li { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 18px; padding: 0.9rem 0.6rem; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.facts b { display: block; font-size: 1.35rem; }
.facts span { font-size: 0.82rem; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.4rem; border-radius: 999px; font: 600 1rem/1 inherit; font-family: inherit; text-decoration: none; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(120deg, var(--btn-a), var(--btn-b)); color: var(--accent-ink); border: 0; }
.btn.small { min-height: 40px; padding: 0 1.1rem; font-size: 0.92rem; }

/* surfaces */
.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: var(--shadow); -webkit-backdrop-filter: saturate(160%) blur(22px); backdrop-filter: saturate(160%) blur(22px); }
.statement { padding: clamp(1.6rem, 4vw, 3rem); text-align: center; }
.statement h2 { margin-bottom: 1.2rem; }
.statement p { max-width: 760px; margin: 0 auto 0.9rem; font-size: 1.08rem; }
.grid { display: grid; gap: 1rem; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.2rem; }
.card p { color: var(--ink-2); font-size: 0.97rem; }
.card .ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 0.8rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.card.link { text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.card.link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card .go { margin-top: auto; padding-top: 0.9rem; font-weight: 600; color: var(--accent-text); font-size: 0.95rem; }
.note { margin-top: 1rem; padding: 1rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.legacy { padding: clamp(1.6rem, 4vw, 2.6rem); text-align: center; }
.legacy h2 { margin-bottom: 0.8rem; overflow-wrap: anywhere; }
.legacy p { max-width: 620px; margin: 0 auto 1.2rem; color: var(--ink-2); }

/* FAQ: native details, smooth enough and accessible */
.faq { display: grid; gap: 0.7rem; max-width: 820px; margin: 0 auto; }
.faq details { padding: 0 1.3rem; }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 2rem 1.1rem 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 1.2rem; color: var(--ink-2); }

.contact { padding: clamp(1.4rem, 4vw, 2.4rem); display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: center; }
.contact h2 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.contact-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.contact .tiny { grid-column: 1 / -1; }
.contact .tiny a { color: var(--accent-text); }
.foot { text-align: center; padding: 4rem 1rem calc(2.5rem + env(safe-area-inset-bottom)); font-size: 0.9rem; }
.foot p + p { margin-top: 0.3rem; }

/* English mode hides the Chinese-only copy of the statement (the English line is always shown) */
html[lang="en"] .zh-only { display: none; }

/* tablet */
@media (max-width: 960px) {
  .grid.three { grid-template-columns: repeat(2, 1fr); }
}
/* phone */
/* menu button wherever the seven section links don't fit in one row (tablets, phones in landscape) */
@media (max-width: 1080px) {
  .menu-btn { display: block; }
  .links { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 0.75rem; right: 0.75rem; flex-direction: column; gap: 0; padding: 0.5rem; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: 1px solid var(--glass-line); border-radius: 20px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .2s, transform .2s; }
  .links.open { opacity: 1; transform: none; pointer-events: auto; }
  .links a { padding: 0.85rem 1rem; font-size: 1.02rem; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-actions .pill:not(.ghost) { display: none; }
  .hero { padding-top: 3.5rem; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .section { padding-top: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* safety notice */
.safety { margin-top: 1rem; padding: 1.1rem 1.3rem; border-left: 4px solid var(--accent); display: grid; gap: 0.3rem; }
.safety strong { font-size: 1rem; }
.safety p { color: var(--ink-2); font-size: 0.95rem; }

/* the subtitle sits on frosted glass where the planet can pass behind it (tablet/phone widths) */
@media (max-width: 1200px) {
  .hero .lead { display: inline-block; padding: 0.7rem 1.1rem; border-radius: 18px; background: color-mix(in srgb, var(--bg) 62%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-shadow: none; }
}
@media (max-width: 760px) {
  .cosmos .moon { display: none; }
}

/* ---------- effects ---------- */
/* starfield canvas behind the planet; with it running, the SVG's static stars and sky give way to it */
.cosmos { background: linear-gradient(180deg, #eef3ff 0%, #f7eefb 60%, #ffe9d8 100%); }
@media (prefers-color-scheme: dark) { .cosmos { background: linear-gradient(180deg, #060914 0%, #0d1330 55%, #1c1a3f 100%); } }
.cosmos .starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.cosmos svg { position: relative; will-change: transform; }
.cosmos.live-stars .sky, .cosmos.live-stars .stars { display: none; }

/* title: letters rise in, then "新篇章" carries a slow light sweep */
.reveal-title.go .ch { display: inline-block; opacity: 0; transform: translateY(0.45em) scale(.96); filter: blur(6px); animation: rise-in .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes rise-in { to { opacity: 1; transform: none; filter: none; } }
.shimmer { background-image: linear-gradient(110deg, var(--accent) 0%, #ff5f6d 30%, #ffd29a 45%, var(--accent-2) 60%, var(--accent) 100%); background-size: 250% 100%; animation: shimmer 6s ease-in-out infinite; }
.shimmer .ch { background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 250% 100%; animation: rise-in .9s cubic-bezier(.2, .8, .2, 1) forwards, shimmer 6s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* sections rise into view */
.rise { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.rise.in { opacity: 1; transform: none; }

/* cards tilt toward the pointer, with a light sheen following it */
.card.tilt { transition: transform .25s ease, box-shadow .25s ease, border-color .2s; transform-style: preserve-3d; overflow: hidden; }
.card.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 45%); }
.card.tilt:hover::after { opacity: 1; }
.card.tilt:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 24px 60px rgba(30, 20, 80, .16); }

/* live chain data */
.live { max-width: 760px; margin: 1rem auto 0; padding: 1rem 1.2rem 1.1rem; text-align: center; }
.live-head { display: flex; align-items: center; justify-content: center; gap: 0.55rem; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.8rem; }
.live-head .tiny { font-weight: 400; }
.live-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.live-grid b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.live-grid span { font-size: 0.8rem; color: var(--muted); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); position: relative; }
.pulse.ok { background: #30d158; } .pulse.slow { background: #ffd60a; } .pulse.idle { background: #ff9f0a; }
.pulse.ok::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #30d158; animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@media (max-width: 760px) { .live-grid { grid-template-columns: repeat(2, 1fr); row-gap: 0.9rem; } }
@media (prefers-reduced-motion: reduce) { .reveal-title .ch { opacity: 1 !important; transform: none !important; filter: none !important; } .rise { opacity: 1 !important; transform: none !important; } }

/* the second half of the title ("A new chapter" / "新篇章") always stays together on one line */
.reveal-title .grad { display: inline-block; white-space: nowrap; }
html[lang="en"] .hero h1 { font-size: clamp(2.1rem, 10.5vw, 6.2rem); }
/* English: two deliberate lines, "Genesis" / "A new chapter" (no dangling dot) */
html[lang="en"] .reveal-title .dot { display: none; }
html[lang="en"] .reveal-title .grad { display: block; }

/* ---------- OniU and support ---------- */
[hidden] { display: none !important; } /* a component's own display rule must never show a hidden element */
.app-feature { padding: clamp(1.6rem, 4vw, 2.6rem); display: grid; grid-template-columns: 1fr auto; gap: 1.2rem 2rem; align-items: center; }
.app-feature h2 { margin-bottom: 0.8rem; }
.app-feature p { color: var(--ink-2); max-width: 680px; }
.app-points { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; color: var(--ink-2); font-size: 0.97rem; }
.app-points li::before { content: "✓"; color: var(--accent-text); font-weight: 700; margin-right: 0.55rem; }
.support .card { gap: 0.6rem; }
.allow-copy, .allow-copy *, input { -webkit-touch-callout: default; user-select: text; -webkit-user-select: text; }
.copy-row, .kv { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.7rem 0.8rem; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.copy-row code, .kv code { font: 600 0.95rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; flex: 1 1 14rem; min-width: 0; }
.kv { display: grid; grid-template-columns: 1fr auto; }
.kv .k { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
.kv code[data-unit]::after { content: " " attr(data-unit); color: var(--muted); font-weight: 400; }
.buy-form { display: grid; gap: 0.45rem; margin-top: 0.4rem; }
.buy-form label { font-size: 0.88rem; font-weight: 600; margin-top: 0.3rem; }
.buy-form input { font: 1rem/1.4 inherit; font-family: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.85rem; min-height: 48px; width: 100%; }
.buy-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.buy-form .btn { margin-top: 0.5rem; }
.buy-form .btn:disabled { opacity: .6; cursor: progress; }
.form-msg:empty { display: none; }
.form-msg.bad, .order .warn { color: #c0262d; }
@media (prefers-color-scheme: dark) { .form-msg.bad, .order .warn { color: #ff8a8a; } }
.order { display: grid; gap: 0.55rem; margin-top: 0.4rem; }
.order-status { font-weight: 700; }
.order-status.st-sent { color: #1f8a3c; }
@media (prefers-color-scheme: dark) { .order-status.st-sent { color: #4ade80; } }
.order-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 760px) { .app-feature { grid-template-columns: 1fr; } .app-feature .btn { justify-self: start; } }
