/* Purrbox 官網：跟 App 一樣的貼紙風（docs/design/style.md）：木地板、3px 黑邊、平塗、硬邊黑影、Huninn 標題。 */
@font-face {
  font-family: "Huninn";
  src: url(fonts/huninn-site.woff2) format("woff2");
  font-display: swap;
}
:root {
  --floor: #ebddc4; --plank: #dccbae; --paper: #fbf7f0; --paper-sunk: #f3ead9;
  --ink: #2c2c2a; --ink-soft: #5f5e5a; --primary: #534ab7; --primary-wash: #e7e4f8;
  --go: #16d9c0; --go-wash: #d6f3ec; --line: 3px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); line-height: 1.7;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--floor) repeating-linear-gradient(90deg, transparent 0 148px, var(--plank) 148px 150px);
}
.h { font-family: "Huninn", "Noto Sans TC", system-ui, sans-serif; font-weight: 400; }
a { color: var(--primary); }

/* one language at a time (site.js sets data-lang; without JS both show) */
html[data-lang="en"] [lang="zh-Hant"] { display: none !important; }
html[data-lang="zh"] [lang="en"] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px); background: var(--paper); border-bottom: var(--line) solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 24px; }
.brand img { border-radius: 10px; border: 2px solid var(--ink); }
.top nav { display: flex; gap: clamp(10px, 2vw, 24px); margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.top nav a:hover { color: var(--primary); }
.lang {
  font: 700 15px/1 system-ui, sans-serif; color: var(--ink); background: var(--paper); cursor: pointer;
  border: var(--line) solid var(--ink); border-radius: 999px; padding: 8px 14px; box-shadow: 3px 3px 0 var(--ink);
}
.lang:active { transform: translate(3px, 3px); box-shadow: none; }
@media (max-width: 640px) { .top nav { display: none; } .lang { margin-left: auto; } }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; height: min(86vh, 860px); min-height: 560px; border-bottom: var(--line) solid var(--ink); overflow: hidden; }
.scene { position: absolute; inset: 0; background: var(--paper-sunk) url(img/cover.jpg) center / cover no-repeat; cursor: pointer; }
.scene.webgl-ready { background: var(--paper-sunk); }
.scene canvas { display: block; width: 100%; height: 100%; }
/* the real cat's clip plays over the 3D scene first (hero.js), then a white flash cuts to the paper cat */
.scene .intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% 50%; z-index: 1; background: var(--paper-sunk); }
.scene .flash { position: absolute; inset: 0; z-index: 2; background: #fff; opacity: 0; pointer-events: none; }
.scene .flash.on { animation: flash 0.5s ease-out; }
@keyframes flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.hero .hero-card, .hero .hint { transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s; }
@media (min-width: 721px) {
  /* wide screens: the card would cover the real cat, so it comes in when the clip ends */
  .js .hero.intro .hero-card { opacity: 0; transform: translateY(18px); }
}
.hero-card {
  position: absolute; z-index: 5; left: clamp(16px, 4vw, 56px); bottom: clamp(16px, 5vh, 56px); width: min(520px, calc(100% - 32px));
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: 24px; padding: 22px 26px 24px;
  box-shadow: 8px 8px 0 var(--ink);
}
.wordmark { margin: 0; line-height: 0; }
.wordmark svg { width: min(340px, 78%); height: auto; overflow: visible; font-family: "Huninn", system-ui, sans-serif; }
.tag { margin: 6px 0 8px; font-size: 26px; color: var(--primary); }
.hero-card p { margin: 6px 0; font-size: 16px; color: var(--ink-soft); }
.hero-card p.tag { margin: 6px 0 8px; font-size: 26px; color: var(--primary); }
.cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.btn {
  display: inline-block; font: 400 20px/1 "Huninn", system-ui, sans-serif; color: var(--ink); text-decoration: none;
  background: var(--go); border: var(--line) solid var(--ink); border-radius: 16px; padding: 12px 20px; box-shadow: 4px 4px 0 var(--ink);
}
.btn:active { transform: translate(4px, 4px); box-shadow: none; }
.store { font-size: 14px; font-weight: 700; color: var(--ink); background: var(--primary-wash); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; }
.hero-card p.store-hint { margin: 10px 0 0; font-size: 14px; }
.hero-tools { position: absolute; right: clamp(16px, 4vw, 40px); top: 16px; z-index: 4; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; pointer-events: none; }
.hint { margin: 0; font-size: 14px; font-weight: 700; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; }
.replay {
  pointer-events: auto; cursor: pointer; font: 700 14px/1.2 system-ui, sans-serif; color: #fff; background: var(--primary);
  border: 2px solid var(--ink); border-radius: 999px; padding: 5px 12px; box-shadow: 2px 2px 0 var(--ink);
}
.replay:active { transform: translate(2px, 2px); box-shadow: none; }
.hero .replay { transition: opacity 0.3s; }
.hero.intro .replay, .hero.intro .hint { opacity: 0; pointer-events: none; }
@media (max-width: 720px) {
  /* phones: a wider stage (about 4:3) so the real cat's clip keeps both the cat and the robot vacuum,
     and the title card comes up into the first screen */
  .scene .intro-video { object-position: 25% 50%; }
  .hero { height: auto; min-height: 0; }
  .scene { position: relative; height: clamp(260px, 82vw, 58vh); min-height: 0; overflow: hidden; }
  .hero-card { position: relative; left: auto; bottom: auto; width: auto; margin: -36px 16px 24px; }
  .hero-tools { top: 12px; right: 12px; left: 12px; }
}

/* ---------------------------------------------------------------- sections */
.band { padding: clamp(40px, 7vw, 80px) clamp(16px, 4vw, 40px); border-bottom: var(--line) solid var(--ink); }
.band > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.band.paper { background: var(--paper-sunk); }
.band h2 { font-size: clamp(34px, 5vw, 48px); margin: 0 auto 8px; }
.lead { font-size: 18px; color: var(--ink-soft); margin-top: 0; }
.video { margin: 28px auto 36px; }
.video video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 20px; box-shadow: 8px 8px 0 var(--ink);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.card {
  background: var(--paper); border: var(--line) solid var(--ink); border-radius: 22px; padding: 16px 18px 20px;
  box-shadow: 6px 6px 0 var(--ink);
}
.card { cursor: pointer; }
/* the 3D stage of each card (cards.js); the App's illustration stays as the fallback without WebGL */
.stage { position: relative; aspect-ratio: 16 / 10; border: var(--line) solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--paper-sunk); }
.stage > img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--floor); }
.stage.live > img { display: none !important; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.flashing::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.8); }
.stage-hint {
  position: absolute; left: 8px; top: 8px; font: 700 12px/1.2 system-ui, sans-serif; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 9px; transition: opacity 0.2s;
}
.card.playing .stage-hint { opacity: 0; }
.ov { position: absolute; inset: 0; pointer-events: none; font-family: "Huninn", system-ui, sans-serif; color: var(--ink); }
.card .step-line {
  margin: 10px 0 0; min-height: 2.9em; font: 700 15px/1.45 system-ui, "Noto Sans TC", sans-serif; color: var(--ink);
  background: var(--primary-wash); border: 2px solid var(--ink); border-radius: 12px; padding: 5px 10px;
}
.ov .joy { position: absolute; left: 12px; bottom: 12px; width: 64px; height: 64px; border-radius: 50%; background: rgba(251, 247, 240, 0.75); border: 2px solid var(--ink); display: grid; place-items: center; }
.ov .knob { width: 30px; height: 30px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.ov .hb {
  position: absolute; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-size: 20px;
}
.ov .hb.swat { background: #e2552d; }
.ov .hb.down { transform: translate(3px, 3px); box-shadow: none; filter: brightness(1.12); }
.ov .hb svg { position: absolute; left: -11px; top: -11px; width: 72px; height: 72px; transform: rotate(-90deg); }
.ov .hb .track { fill: none; stroke: rgba(44, 44, 42, 0.18); stroke-width: 7; }
.ov .hb .fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.ov .hb .lbl { position: relative; }
.ov .hb .under {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 13px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px;
}
.ov .hb .under.hot { background: #d8432c; color: #fff; }
.ov .ib { position: absolute; right: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: grid; place-items: center; }
.ov .ib img { width: 36px; height: auto; }
.ov .ib.down { transform: translate(3px, 3px); box-shadow: none; }
.ov .pop {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -100%) scale(0.6); opacity: 0; white-space: nowrap;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 16px;
  box-shadow: 2px 2px 0 var(--ink); transition: opacity 0.15s, transform 0.2s;
}
.ov .pop.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.ov .pop.hot { color: #d8432c; }
.ov .pop.primary { background: var(--primary); color: #fff; }
.ov .pop.chip { font-size: 13px; }
.ov .pop.big { font-size: 24px; padding: 4px 16px; transform: translate(-50%, -50%) scale(0.6); }
.ov .pop.big.on { transform: translate(-50%, -50%) scale(1); }
.ov .clock {
  position: absolute; right: 8px; top: 8px; display: grid; justify-items: center; gap: 2px; background: var(--paper);
  border: 2px solid var(--ink); border-radius: 12px; padding: 3px 10px 5px; box-shadow: 2px 2px 0 var(--ink);
}
.ov .clock .time { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov .clock .badge { display: none; font: 700 11px/1.3 system-ui, sans-serif; color: #fff; background: #b3261e; border-radius: 999px; padding: 0 7px; }
.ov .clock .target { font: 700 11px/1.3 system-ui, sans-serif; color: var(--ink-soft); }
.ov .clock.sudden .time { color: #d8432c; }
.ov .clock.sudden .badge { display: inline-block; }
.ov .clock.sudden .target { color: #b3261e; }
.ov .bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; }
.ov .bar .who { font-size: 13px; color: var(--primary); }
.ov .bar .track { position: relative; flex: 1; height: 10px; border-radius: 999px; background: var(--paper-sunk); border: 2px solid var(--ink); }
.ov .bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: #f4b740; }
.ov .bar .mark { position: absolute; top: -6px; bottom: -6px; width: 4px; margin-left: -2px; background: #d8432c; border-radius: 2px; }
.ov .bar.won .fill { background: var(--go); }
.ov .bar .sec { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
.card h3 { margin: 14px 0 4px; font-size: 26px; color: var(--primary); }
.card p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 20px; margin-top: 24px; }
.fact { background: var(--paper); border: var(--line) solid var(--ink); border-radius: 20px; padding: 18px 20px; box-shadow: 5px 5px 0 var(--ink); }
.fact .big { margin: 0 0 6px; font-size: 28px; line-height: 1.2; color: var(--ink); }
.fact p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* privacy policy: a quiet reading column */
.legal { background: var(--paper); }
.legal > * { max-width: 760px; }
.legal h3 { font-size: 22px; margin: 28px auto 6px; }
.legal p, .legal li { font-size: 16px; }
.legal ul { padding-left: 1.3em; }
.legal li { margin: 6px 0; }
.legal .note { color: var(--ink-soft); font-size: 14px; }
code { font-size: 0.9em; background: var(--paper-sunk); padding: 1px 5px; border-radius: 6px; word-break: break-all; }

footer { text-align: center; padding: 28px 16px 40px; font-size: 14px; color: var(--ink-soft); }
footer a { color: var(--ink-soft); }
