:root {
  --bg: #FFFFFF;
  --bg-soft: #F6F8FC;
  --surface: #FFFFFF;
  --text: #1F2430;
  --text-2: #556070;
  --line: #E4E8F0;
  --blue: #5BCEFA;
  --pink: #F5A9B8;
  --lilac: #E6E0FA;
  --tone-blue: #E3F4FD;
  --tone-pink: #FDE8EE;
  --tone-lilac: #EEEAFB;
  --blue-ink: #1C6FB5;
  --pink-ink: #B23A64;
  --lilac-ink: #5B4BA8;
  --on-accent: #FFFFFF;
  --topbar: rgba(255, 255, 255, 0.84);
  --phone-frame: #1F2430;
  --chat-a: #CDEFFD;
  --chat-b: #FFFFFF;
  --chat-c: #FBD9E1;
  --bubble-in: #FFFFFF;
  --bubble-out: #FDE8EE;
  --shadow: 0 24px 60px rgba(28, 111, 181, 0.2);
  --radius-card: 28px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141826;
    --bg-soft: #191E2E;
    --surface: #1E2336;
    --text: #EEF1F8;
    --text-2: #AAB3C5;
    --line: #2C3350;
    --blue: #8FD8FB;
    --pink: #F7BCC9;
    --lilac: #3A3460;
    --tone-blue: #1B2D44;
    --tone-pink: #3A2232;
    --tone-lilac: #2A2646;
    --blue-ink: #8FD8FB;
    --pink-ink: #F7BCC9;
    --lilac-ink: #C9BFFF;
    --on-accent: #10233A;
    --topbar: rgba(20, 24, 38, 0.84);
    --phone-frame: #0B0E18;
    --chat-a: #1D3550;
    --chat-b: #1E2336;
    --chat-c: #45283A;
    --bubble-in: #262C44;
    --bubble-out: #4A2A3D;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141826;
  --bg-soft: #191E2E;
  --surface: #1E2336;
  --text: #EEF1F8;
  --text-2: #AAB3C5;
  --line: #2C3350;
  --blue: #8FD8FB;
  --pink: #F7BCC9;
  --lilac: #3A3460;
  --tone-blue: #1B2D44;
  --tone-pink: #3A2232;
  --tone-lilac: #2A2646;
  --blue-ink: #8FD8FB;
  --pink-ink: #F7BCC9;
  --lilac-ink: #C9BFFF;
  --on-accent: #10233A;
  --topbar: rgba(20, 24, 38, 0.84);
  --phone-frame: #0B0E18;
  --chat-a: #1D3550;
  --chat-b: #1E2336;
  --chat-c: #45283A;
  --bubble-in: #262C44;
  --bubble-out: #4A2A3D;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--blue-ink); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg); }

main:focus { outline: none; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--blue-ink);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topnav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.topnav a:hover { background: var(--bg-soft); color: var(--text); }
.topnav .nav-download { background: var(--tone-blue); color: var(--blue-ink); font-weight: 600; }
.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
}
.lang-switch[hidden] { visibility: hidden; } /* keeps its space so the top bar does not jump when main.js shows it */
.lang-switch button {
  min-width: 40px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--blue-ink);
  color: var(--on-accent);
  box-shadow: none;
}

/* hero */
.hero {
  position: relative;
  overflow: clip;
  padding: 72px 0 56px;
  background:
    radial-gradient(60% 60% at 85% 20%, color-mix(in srgb, var(--blue) 26%, transparent), transparent 70%),
    radial-gradient(50% 50% at 70% 90%, color-mix(in srgb, var(--pink) 28%, transparent), transparent 70%),
    var(--bg);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tone-pink);
  color: var(--pink-ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  background: linear-gradient(100deg, var(--blue-ink) 10%, var(--pink-ink) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  max-width: 30em;
  margin: 18px 0 28px;
  color: var(--text-2);
  font-size: clamp(1.1875rem, 2.2vw, 1.4375rem);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s var(--spring), box-shadow 0.25s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary {
  background: var(--blue-ink);
  color: var(--on-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--blue-ink) 30%, transparent);
}
.btn-ghost { border: 1.5px solid var(--line); background: var(--surface); color: var(--blue-ink); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.hero-meta { margin: 16px 0 0; color: var(--text-2); font-size: 0.875rem; }

.hero-art { position: relative; display: flex; justify-content: center; padding: 32px 0; }
.phone {
  position: relative;
  z-index: 1;
  width: 280px;
  aspect-ratio: 9 / 18.5;
  padding: 12px;
  border-radius: 40px;
  background: var(--phone-frame);
  box-shadow: var(--shadow);
}
.phone-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(160deg, var(--chat-a) 0%, var(--chat-b) 50%, var(--chat-c) 100%);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; background: var(--topbar); }
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5BCEFA, #F5A9B8);
  color: #1F2430;
  font-size: 0.9375rem;
  font-weight: 700;
}
.chat-name { display: block; color: var(--text); font-size: 0.875rem; font-weight: 700; line-height: 1.2; }
.chat-status { display: block; color: var(--blue-ink); font-size: 0.75rem; line-height: 1.3; }
.chat-body { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
.bubble {
  max-width: 84%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--bubble-in);
  color: var(--text);
  font-size: 0.84375rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.bubble p { margin: 0; }
.bubble.in { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 6px; }
.bubble .translation {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed color-mix(in srgb, var(--blue-ink) 40%, transparent);
  color: var(--blue-ink);
}
.chat-input {
  margin: 4px 12px 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.8125rem;
}
.plane {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 2%;
  width: 120px;
  filter: drop-shadow(0 8px 12px rgba(28, 111, 181, 0.25));
  animation: glide 2.5s ease-in-out 2 alternate both;
}
.trail { position: absolute; z-index: 2; top: 56px; right: calc(2% + 96px); width: 150px; color: var(--pink); }
.sparkle {
  position: absolute;
  z-index: 2;
  color: var(--pink);
  font-size: 1.375rem;
  line-height: 1;
  animation: twinkle 2s ease-in-out 2 both;
}
.sparkle.s1 { top: 6%; left: 8%; }
.sparkle.s2 { right: 4%; bottom: 12%; color: var(--blue); animation-delay: 0.4s; }
.sparkle.s3 { top: 48%; left: 2%; font-size: 1rem; animation-delay: 0.8s; }

@keyframes glide {
  from { transform: translate(-10px, 10px) rotate(-6deg); }
  to { transform: translate(12px, -12px) rotate(4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* notice */
.notice { border-block: 1px solid var(--line); background: var(--bg-soft); }
.notice p { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 0; color: var(--text-2); font-size: 0.9375rem; }
.notice svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--blue-ink); }

/* sections */
.section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); }
.kicker { margin: 0 0 8px; color: var(--pink-ink); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.04em; }
.section h2 {
  max-width: 18em;
  margin: 0;
  font-size: clamp(2.125rem, 5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.section h2, .card h3, .a11y-card h3 { text-wrap: balance; }
.section-lead { max-width: 36em; margin: 16px 0 48px; color: var(--text-2); font-size: 1.1875rem; }

/* feature cards */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 32px 32px 128px;
  border-radius: var(--radius-card);
  background: var(--tone-blue);
}
.card-wide { grid-column: 1 / -1; min-height: 240px; padding: 36px 40% 40px 40px; }
.tone-blue { background: var(--tone-blue); --ink: var(--blue-ink); }
.tone-pink { background: var(--tone-pink); --ink: var(--pink-ink); }
.tone-lilac { background: var(--tone-lilac); --ink: var(--lilac-ink); }
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
}
.card h3 { margin: 16px 0 10px; font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.25; letter-spacing: -0.015em; }
.card p { max-width: 32em; margin: 0; color: var(--text-2); }
.card-art {
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: 96px;
  height: 96px;
  color: var(--ink);
  transition: transform 0.4s var(--spring);
}
.card-wide .card-art { right: 48px; bottom: 50%; width: 150px; height: 150px; transform: translateY(50%); }
.card:hover .card-art { transform: rotate(-6deg) scale(1.05); }
.card-wide:hover .card-art { transform: translateY(50%) rotate(-6deg) scale(1.05); }

/* accessibility */
.a11y-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.a11y-card { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.a11y-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: var(--tone-blue);
  color: var(--blue-ink);
}
.a11y-card:nth-child(2) .a11y-icon { background: var(--tone-pink); color: var(--pink-ink); }
.a11y-card:nth-child(3) .a11y-icon { background: var(--tone-lilac); color: var(--lilac-ink); }
.a11y-icon svg { width: 28px; height: 28px; }
.a11y-card h3 { margin: 0 0 10px; font-size: 1.375rem; line-height: 1.3; }
.a11y-card p { margin: 0; color: var(--text-2); }


/* footer */
.footer { padding: 48px 0 40px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { display: grid; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 40px; height: 40px; border-radius: 12px; }
.footer-brand b { font-size: 1.125rem; }
.footer-brand p { margin: 0; color: var(--text-2); font-size: 0.9375rem; }
.footer-links ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--text); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--blue-ink); text-decoration: underline; }
.footer-note, .footer-copy { max-width: 52em; margin: 0; color: var(--text-2); font-size: 0.875rem; }

/* narrow screens */
@media (max-width: 53.6875em) { /* 859px at the default 16px text size; em follows the browser text size setting */
  .nav-hide-sm { display: none; }
  .hero { padding: 40px 0 32px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .phone { width: 240px; }
  .hero h1 { font-size: clamp(2.25rem, 13vw, 4rem); }
  .plane { width: 96px; top: 0; }
  .trail { display: none; } /* on narrow screens the dots would cross the mockup's chat header */
  .section { padding: 64px 0; }
  .section-lead { margin-bottom: 32px; }
  .card-grid, .a11y-grid { grid-template-columns: minmax(0, 1fr); }
  .card, .card-wide { min-height: 0; padding: 28px 24px 116px; }
  .card-wide .card-art { right: 24px; bottom: 20px; width: 96px; height: 96px; transform: none; }
  .card-wide:hover .card-art { transform: rotate(-6deg) scale(1.05); }
  .a11y-card { padding: 28px 24px; }
}

@media (max-width: 25em) { /* 400px */
  /* 360px wide in English: icon + name + "Download" + 中/EN must still fit on one line */
  .topbar-inner { gap: 10px; }
  .brand { font-size: 1.0625rem; }
  .topnav a { padding: 8px 10px; font-size: 0.875rem; }
  .lang-switch button { min-width: 36px; }
}

@media (max-width: 22.4375em) { /* 359px */
  /* 320px (WCAG reflow): keep the name for screen readers, show only the icon */
  .topbar-inner { gap: 8px; }
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
