/* CantoPass: shared styles for every page. Colours follow the app (Theme.swift). */

:root {
  --bg: #f6f2eb;
  --bg-alt: #efe8dc;
  --card: #ffffff;
  --text: #1d1b19;
  --muted: #6b655e;
  --line: #e4ddd1;
  --red: #d62839;
  --red-deep: #b31d2d;
  --orange: #fa7819;
  --teal: #12807a;
  --navy: #1b2a4a;
  --gold: #e3a92b;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 28px rgba(40, 30, 20, .08);
  --radius: 22px;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --bg-alt: #151518;
    --card: #1c1c1f;
    --text: #ecebe8;
    --muted: #a3a1a8;
    --line: #2e2e34;
    --red: #f0505e;
    --red-deep: #d83a49;
    --teal: #3fb8ae;
    --navy: #9fb4e0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang HK", "Noto Sans HK", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 560px) { .nav .hide-sm { display: none; } .nav { gap: 16px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-deep), 0 10px 24px rgba(214, 40, 57, .25); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { color: var(--text); background: var(--card); border: 1px solid var(--line); }
.btn svg { width: 20px; height: 20px; flex: none; }
/* Until launch: a plain "coming soon" label. On launch day, swap in Apple's official
   "Download on the App Store" badge artwork, unmodified (Apple's marketing guidelines). */
.soon-badge { display: inline-flex; flex-direction: column; align-items: flex-start; background: var(--red); color: #fff; border-radius: 12px; padding: 9px 18px; line-height: 1.15; cursor: default; }
.soon-badge small { font-size: 11px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.soon-badge span { font-size: 18px; font-weight: 700; }

/* Hero */
.hero { padding: 56px 0 72px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 62px); font-weight: 850; margin-bottom: 22px; }
.hero h1 .zh { color: var(--red); white-space: nowrap; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 33em; margin-bottom: 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cta-note { font-size: 14px; color: var(--muted); margin-top: 16px; }

.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art::before {
  content: ""; position: absolute; inset: 6% 2% 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--orange) 30%, transparent), transparent);
  filter: blur(10px);
}
.hero-art .phone { width: min(320px, 74vw); transform: rotate(3deg); }
.hero-art .mascot { position: absolute; left: -6%; bottom: -4%; width: clamp(130px, 17vw, 190px); }
.bubble {
  position: absolute; left: 3%; bottom: 41%;
  background: var(--card); color: var(--text); font-weight: 800; font-size: 20px;
  padding: 8px 16px; border-radius: 18px; box-shadow: var(--shadow);
  animation: bubble 4s ease-in-out infinite;
}
.bubble::after { content: ""; position: absolute; left: 38px; bottom: -8px; border: 9px solid transparent; border-bottom: 0; border-top-color: var(--card); }
.bubble small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
@keyframes bubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 860px) {
  .hero { padding-top: 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { margin: 0 auto; width: 100%; max-width: 420px; }
}

/* Phone frame around a screenshot */
.phone {
  position: relative; border-radius: 44px; padding: 10px;
  background: linear-gradient(145deg, #2a2a2e, #0b0b0d);
  box-shadow: 0 30px 60px -20px rgba(30, 20, 10, .45), inset 0 0 0 1.5px rgba(255,255,255,.12);
}
.phone img { border-radius: 35px; width: 100%; height: auto; aspect-ratio: 603 / 1311; background: var(--bg); }

/* Sections */
section { padding: 84px 0; scroll-margin-top: 64px; }
section.alt { background: var(--bg-alt); }
.section-head { max-width: 40em; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 19px; margin: 0; }
.kicker { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }

/* Tones */
.tones { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .tones { grid-template-columns: 1fr; } }
.tone-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 16px; }
.tone-chart { width: 100%; height: auto; display: block; }
.tone-chart .grid { stroke: var(--line); }
.tone-chart .lvl { fill: var(--muted); font-size: 11px; }
.tone-chart .band { fill: var(--bg); }
.tone-buttons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.tone-btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; color: var(--text);
  background: var(--bg); border-radius: 14px; padding: 8px 2px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  transition: transform .12s ease, background .2s;
}
.tone-btn:hover { background: color-mix(in srgb, var(--c) 16%, var(--bg)); }
.tone-btn:active { transform: scale(.95); }
.tone-btn.playing { background: color-mix(in srgb, var(--c) 26%, var(--bg)); }
.tone-btn b { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; }
.tone-btn span { font-size: 13px; font-weight: 700; color: var(--c); }
.tone-btn em { font-style: normal; font-size: 12px; color: var(--muted); }
.tone-hint { text-align: center; font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.tone-path { transition: stroke-width .2s, opacity .2s; }
.tone-chart.has-active .tone-path { opacity: .3; }
.tone-chart.has-active .tone-path.active { opacity: 1; stroke-width: 15; }
.tones-copy h3 { font-size: 22px; margin: 26px 0 8px; }
.tones-copy p { color: var(--muted); }
.tones-copy .note { font-size: 15px; border-left: 3px solid var(--gold); padding-left: 14px; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--card); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); }
.feature .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 16px; font-size: 22px; font-weight: 800; }
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }

/* Screenshot strip */
.shots {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 10px 20px 30px; margin: 0 auto; max-width: calc(var(--max) + 40px);
  scrollbar-width: thin;
}
.shots figure { margin: 0; flex: 0 0 auto; width: 240px; scroll-snap-align: center; }
.shots .phone { border-radius: 38px; padding: 8px; }
.shots .phone img { border-radius: 31px; }
.shots figcaption { text-align: center; font-weight: 700; margin-top: 14px; font-size: 15px; }
.shots figcaption span { display: block; font-weight: 500; color: var(--muted); font-size: 14px; }
@media (min-width: 1100px) {
  .shots { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .shots figure { width: auto; }
}

/* Promise */
.promise { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .promise { grid-template-columns: 1fr; } }
.promise div { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.promise h3 { font-size: 19px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.promise h3 svg { width: 22px; height: 22px; color: var(--teal); flex: none; }
.promise p { margin: 0; color: var(--muted); font-size: 16px; }

/* Mascot section */
.meet { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }
@media (max-width: 760px) { .meet { grid-template-columns: 1fr; text-align: center; gap: 24px; } .meet .mascot { margin: 0 auto; } }
.meet .mascot { width: 260px; cursor: pointer; }
.meet h2 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 14px; }
.meet p { color: var(--muted); font-size: 18px; }

/* Final call to action */
.final { text-align: center; }
.final .icon { width: 110px; height: 110px; border-radius: 25px; margin: 0 auto 24px; box-shadow: var(--shadow); }
.final h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.final p { color: var(--muted); font-size: 19px; margin-bottom: 28px; }
.final .cta { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 15px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Text pages: privacy, support */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 20px 80px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 8px; }
.doc h2 { font-size: 22px; margin: 40px 0 10px; }
.doc .muted { color: var(--muted); }
.summary { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 14px; padding: 18px 22px; margin: 28px 0; }
.summary ul { margin: 8px 0 0; padding-left: 20px; }
.summary p:last-child { margin-bottom: 0; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; margin-bottom: 10px; }
details summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); }

/* Tung Jai, the mascot (an SVG drawn to match Mascot.swift) */
.mascot svg { width: 100%; height: auto; overflow: visible; display: block; }
.mascot .tj-body { animation: tj-bob 2.4s ease-in-out infinite; }
.mascot .tj-shadow { animation: tj-shadow 2.4s ease-in-out infinite; transform-origin: 0 46px; }
.mascot .tj-eye { animation: tj-blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }
.mascot .tj-eye:nth-child(2) { animation-delay: .02s; }
.mascot .tj-happy-eye { opacity: 0; }
.mascot .tj-open-eye, .mascot .tj-happy-eye { transition: opacity .1s; }
.mascot .tj-rim, .mascot .tj-mouth { transform-box: fill-box; transform-origin: center; transition: transform .18s cubic-bezier(.3, 1.5, .5, 1); }
.mascot .tj-rim { transform: scaleY(.76); }
.mascot .tj-mouth { transform: scaleY(.7); }
/* Arms hang from the shoulders and swing up to wave, as in Mascot.swift. */
.mascot .tj-arm { transform-origin: 0 0; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.mascot .tj-arm-l { transform: translate(-26.5px, -.5px) rotate(38deg); }
.mascot .tj-arm-r { transform: translate(26.5px, -.5px) rotate(-38deg); }
.mascot.talking .tj-rim { animation: tj-talk-rim .3s ease-in-out infinite alternate; }
.mascot.talking .tj-mouth { animation: tj-talk .3s ease-in-out infinite alternate; }
.mascot.happy .tj-open-eye { opacity: 0; }
.mascot.happy .tj-happy-eye { opacity: 1; }
.mascot.happy .tj-rim, .mascot.happy .tj-mouth { transform: scaleY(1); }
.mascot.happy .tj-arm-l { transform: translate(-26.5px, -.5px) rotate(150deg); }
.mascot.happy .tj-arm-r { transform: translate(26.5px, -.5px) rotate(-150deg); }
.mascot.happy svg { animation: tj-hop .55s ease-out; }
/* A tap sends the ashtray up off his head, flipping over twice, and back down with a bounce. */
.mascot .tj-tray { transform-box: fill-box; transform-origin: center; }
.mascot.happy .tj-tray { animation: tj-flip 1s cubic-bezier(.25, .8, .35, 1); }
@keyframes tj-flip {
  0% { transform: translateY(0) scaleY(1) rotate(0); }
  12% { transform: translateY(-3px) scaleY(1) rotate(0); }
  30% { transform: translateY(-26px) scaleY(-1) rotate(-12deg); }
  48% { transform: translateY(-34px) scaleY(1) rotate(8deg); }
  66% { transform: translateY(-20px) scaleY(-1) rotate(-6deg); }
  82% { transform: translateY(0) scaleY(1) rotate(0); }
  90% { transform: translateY(-3px) scaleY(1); }
  100% { transform: translateY(0) scaleY(1); }
}
@keyframes tj-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes tj-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.94); } }
@keyframes tj-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.1); } }
@keyframes tj-talk { from { transform: scaleY(.57); } to { transform: scaleY(.93); } }
@keyframes tj-talk-rim { from { transform: scaleY(.66); } to { transform: scaleY(.95); } }
@keyframes tj-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-18%); } 70% { transform: translateY(0); } 85% { transform: translateY(-3%); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .mascot *, .mascot svg, .bubble { animation: none !important; }
}
