/* 玛嗒玛嗒官网：全站共用样式。Tokens follow DESIGN.md of the app. */
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("/assets/fonts/zen-kaku-gothic-new-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --blue: #0088ff;
  --blue-ink: #0066dd;
  --blue-deep: #0057c2;
  --blue-wash: #eaf4ff;
  --blue-glow: #bfe0ff;
  --surface: #f4f6fa;
  --ink: #0a1426;
  --ink-2: #5b6577;
  --ink-3: #8e97a6;
  --line: rgba(10, 20, 38, .09);
  --line-2: rgba(10, 20, 38, .055);
  --shadow: 0, 42, 102;
  --bg: #fff;
  --head: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  /* SwiftUI spring(response .32, damping .86) and (.45, .72), sampled. */
  --snappy: linear(0, .0192, .0682, .1363, .2152, .2989, .3828, .4639, .54, .6099, .6729, .7288, .7778, .82, .8561, .8866, .912, .9329, .95, .9637, .9747, .9832, .9898, .9948, .9985, 1.0011, 1.0029, 1.004, 1.0047, 1.005, 1.005, 1.0048, 1.0045, 1.0042, 1.0038, 1.0033, 1.0029, 1.0025, 1.0022, 1.0018, 1);
  --bouncy: linear(0, .0164, .0597, .1221, .1972, .2795, .3647, .4494, .5312, .6082, .679, .743, .7998, .8492, .8916, .9273, .9567, .9805, .9991, 1.0134, 1.0238, 1.031, 1.0355, 1.0378, 1.0384, 1.0376, 1.0359, 1.0334, 1.0305, 1.0273, 1.024, 1.0208, 1.0177, 1.0147, 1.012, 1.0096, 1.0075, 1.0056, 1.004, 1.0026, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --ja: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --brand-ja: "Zen Kaku Gothic New", var(--ja);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:lang(ja) { word-break: auto-phrase; }
:lang(zh-Hant) { --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", sans-serif; }
:lang(ja) { --sans: var(--ja); }
[lang="ja"] { font-family: var(--ja); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--head) + 20px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.75 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip; padding-top: var(--head); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, figure, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--blue-glow); }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: .85em; height: .85em; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; }
.skip:focus { top: 12px; }

/* Masthead: clear over the page, frosted once the page moves under it. */
.masthead { position: fixed; inset: 0 0 auto; z-index: 50; padding-top: env(safe-area-inset-top); transition: background-color .3s, box-shadow .3s, backdrop-filter .3s, color .3s; }
.masthead.is-scrolled { background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 1px 0 var(--line-2); }
/* Over the blue first screen the masthead turns white and drops its glass. */
.masthead.is-dark { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: #fff; }
.masthead.is-dark .masthead-nav a, .masthead.is-dark .masthead-nav a[aria-current] { color: #fff; }
.masthead.is-dark .masthead-nav a:hover, .masthead.is-dark .lang-picker summary:hover, .masthead.is-dark .lang-picker[open] summary { background: rgba(255, 255, 255, .14); }
.masthead.is-dark .masthead-download { background: #fff; color: var(--blue-ink); }
.masthead-bar { height: var(--head); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand-icon { width: 32px; height: 32px; border-radius: 23%; box-shadow: 0 0 0 .5px rgba(10, 20, 38, .14), 0 2px 6px rgba(var(--shadow), .12); transition: transform .5s var(--bouncy); }
.brand:hover .brand-icon { transform: rotate(-8deg) scale(1.06); }
.masthead-nav { display: flex; gap: 2px; margin-left: auto; font-size: 15px; font-weight: 550; }
.masthead-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink); transition: background-color .2s, color .2s; }
.masthead-nav a:hover { background: rgba(10, 20, 38, .05); }
.masthead-nav a[aria-current] { color: var(--blue-ink); }
.masthead-actions { display: flex; align-items: center; gap: 8px; }
.masthead-download { padding: 8px 18px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 650; white-space: nowrap; transition: opacity .3s, transform .4s var(--snappy), background-color .2s, visibility .3s; }
.masthead-download:hover { background: var(--blue-ink); }
.masthead-download.is-hidden { opacity: 0; transform: scale(.9); visibility: hidden; }
.lang-picker { position: relative; font-size: 14px; }
.lang-picker summary { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; cursor: pointer; list-style: none; font-weight: 550; transition: background-color .2s; user-select: none; }
.lang-picker summary::-webkit-details-marker { display: none; }
.lang-picker summary:hover, .lang-picker[open] summary { background: rgba(10, 20, 38, .05); }
.lang-picker summary .i { width: 18px; height: 18px; stroke-width: 1.6; }
.lang-picker summary .i-sm { width: 13px; height: 13px; transition: transform .25s var(--ease); }
.lang-picker[open] summary .i-sm { transform: rotate(180deg); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; padding: 6px; border-radius: 18px; background: rgba(255, 255, 255, .92); color: var(--ink); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: 0 0 0 .5px rgba(10, 20, 38, .1), 0 18px 40px -12px rgba(var(--shadow), .28); transform-origin: top right; animation: pop .26s var(--snappy); }
.lang-menu a { display: block; padding: 9px 14px; border-radius: 12px; font-size: 15px; }
.lang-menu a:hover { background: var(--surface); }
.lang-menu a[aria-current] { background: var(--blue-wash); color: var(--blue-ink); font-weight: 650; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } }

/* Type */
.display { font-size: clamp(46px, 5.4vw, 80px); line-height: 1.16; font-weight: 700; letter-spacing: 0; }
.display > span, .h2 > span, .closing-title > span { display: block; }
.h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.25; font-weight: 700; text-wrap: balance; }
.h2 { font-size: clamp(34px, 4vw, 58px); line-height: 1.2; font-weight: 700; text-wrap: balance; }
:lang(ja) .display { font-size: clamp(40px, 4.7vw, 70px); line-height: 1.22; }
:lang(ja) .h2 { font-size: clamp(30px, 3.6vw, 52px); line-height: 1.28; }
:lang(ja) .h1 { font-size: clamp(30px, 3.5vw, 48px); line-height: 1.35; }
.lead { font-size: 19px; line-height: 1.85; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }

.scene-card-tag { align-self: flex-start; display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--blue-wash); color: var(--blue-ink); font-size: 12.5px; font-weight: 650; line-height: 1.4; }
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 4px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item h3 { font-size: 18.5px; font-weight: 650; line-height: 1.5; }
.faq-item summary .i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; color: var(--blue-ink); background: var(--blue-wash); transition: transform .4s var(--snappy); }
.faq-item[open] summary .i { transform: rotate(45deg); }
.faq-a { padding: 0 4px 24px; color: var(--ink-2); font-size: 16px; line-height: 1.85; max-width: 46em; }

/* App Store: one flat capsule, the only solid blue on the screen. */
.store-btn { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 28px 0 24px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 650; white-space: nowrap; transition: background-color .2s, transform .3s var(--snappy); }
.store-btn:hover { background: var(--blue-ink); }
.store-btn:active { transform: scale(.97); transition-duration: .12s; }
.store-btn-icon { width: 21px; height: 21px; margin-top: -3px; }
.more-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--blue-ink); transition: gap .3s var(--snappy); }
.more-link:hover { gap: 12px; }
.more-link .i { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 650; transition: background-color .2s; }
.btn:hover { background: var(--blue-ink); }

/* Keycap duo: the icon composition as a page element. */
.keycaps { position: relative; width: 176px; height: 176px; flex: none; }
.keycap { position: absolute; display: grid; place-items: center; font: 700 56px/1 var(--brand-ja); border-radius: 26.4%; user-select: none; -webkit-user-select: none; }
.keycap--solid { left: 0; top: 0; width: 110px; height: 110px; background: var(--blue); color: #fff; box-shadow: 0 8px 10px -4px rgba(var(--shadow), .2), 0 22px 40px -12px rgba(var(--shadow), .3); }
.keycap--glass { left: 66px; top: 66px; width: 106px; height: 106px; color: var(--blue-ink); background: linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .55)); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), inset 1px 1px 0 rgba(255, 255, 255, .9), 0 10px 26px -10px rgba(var(--shadow), .35); }

/* Reveal on scroll */
.motion .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms); }
.motion .reveal.in { opacity: 1; transform: none; }

/* Footer */
.footer { position: relative; background: #fff; border-top: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-block: 56px 40px; }
.footer-brand .brand { font-size: 17px; color: var(--ink); }
.footer-brand .brand-icon { width: 28px; height: 28px; }
.footer-brand p { margin-top: 12px; max-width: 18em; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 { margin-bottom: 4px; font-size: 13px; font-weight: 650; letter-spacing: .06em; color: var(--ink); }
.footer a { transition: color .2s; }
.footer-col a:hover, .footer-col a[aria-current], .footer-base a:hover { color: var(--blue-ink); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 20px 32px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }

/* Language suggestion (never a redirect) */
.lang-suggest { position: fixed; z-index: 60; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 20px; border-radius: 999px; background: rgba(10, 20, 38, .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; font-size: 14px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); animation: rise .6s var(--bouncy); max-width: calc(100% - 32px); }
.lang-suggest span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-suggest a { padding: 7px 14px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 650; white-space: nowrap; }
.lang-suggest button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; opacity: .7; }
.lang-suggest button:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 18px); } }

/* WeChat: App Store links need the system browser. */
.wechat-tip { inset: calc(env(safe-area-inset-top) + 74px) 16px auto; width: auto; max-width: none; max-height: none; margin: 0; padding: 22px 22px 18px; border: 0; border-radius: 24px; background: #fff; color: var(--ink); overflow: visible; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); }
.wechat-tip::backdrop { background: rgba(10, 20, 38, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wechat-tip[open], .wechat-tip[open]::backdrop { animation: fade .3s ease; }
.wechat-tip h2 { font-size: 19px; }
.wechat-tip p { margin-top: 8px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.wechat-tip button { margin-top: 14px; height: 44px; width: 100%; border: 0; border-radius: 999px; background: var(--blue-wash); color: var(--blue-ink); font-weight: 650; cursor: pointer; }
.wechat-arrow { position: absolute; right: 8px; top: -66px; width: 60px; height: 60px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 1100px) {
  .wrap { width: calc(100% - 64px); }
}
@media (max-width: 860px) {
  .masthead-nav { display: none; }
  .masthead-actions { margin-left: auto; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  :root { --head: 56px; }
  body { font-size: 16px; }
  .wrap { width: calc(100% - 40px); }
  .brand { font-size: 17px; }
  .brand-icon { width: 30px; height: 30px; }
  .masthead-bar { gap: 12px; }
  .masthead-actions { gap: 2px; }
  .masthead-download { padding: 7px 15px; font-size: 13.5px; }
  .lang-picker summary { padding: 8px; }
  .lang-picker summary span, .lang-picker summary .i-sm { display: none; }
  .lead { font-size: 17px; }
  .store-btn { height: 54px; padding: 0 24px 0 20px; font-size: 16.5px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; padding-block: 44px 28px; }
  .footer-col:last-child { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
  .footer-col:last-child h2 { width: 100%; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
}
body.page-hidden *, body.page-hidden *::before, body.page-hidden *::after { animation-play-state: paused !important; }

/* Increase Contrast: brand blue deepens under white text, as in the app (DESIGN.md). */
@media (prefers-contrast: more) {
  :root { --blue: var(--blue-ink); }
  .store-btn:hover, .masthead-download:hover, .btn:hover { background: var(--blue-deep); }
}
