:root {
  --page: #f5f8f6;
  --surface: #fff;
  --surface-soft: #edf3ef;
  --ink: #14221e;
  --muted: #53665e;
  --line: #dce6df;
  --accent: #075d4d;
  --accent-hover: #0b493e;
  --accent-ink: #fff;
  --hero-art: #e2f1e9;
  --hero-glow: #f5fffa;
  --staff-past: #126c59;
  --staff-future: #9ebdb0;
  --play-bg: #f6fffb;
  --play-ink: #12483d;
  --play-ring: #236b5d;
  --play-hover: #d9f7ed;
  --radius: 24px;
  --gutter: clamp(16px, 5vw, 72px);
  --section-gap: clamp(48px, 7vw, 94px);
  --content: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101614;
    --surface: #171f1c;
    --surface-soft: #202c27;
    --ink: #eef7f1;
    --muted: #a7bbb0;
    --line: #304139;
    --accent: #8de9ce;
    --accent-hover: #b3f7e3;
    --accent-ink: #102b22;
    --hero-art: #182c25;
    --hero-glow: #29483c;
    --staff-past: #8de9ce;
    --staff-future: #648a7b;
    --play-bg: #183c32;
    --play-ink: #ecfff7;
    --play-ring: #a0ebd6;
    --play-hover: #24614f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(82px + env(safe-area-inset-top));
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  color: var(--ink);
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) max(var(--gutter), calc((100% - var(--content)) / 2)) 10px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
}

.brand, .top nav, .top nav a {
  display: flex;
  align-items: center;
}

.brand, .top nav a { min-height: 44px; text-decoration: none; }

.brand {
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.brand img { width: 32px; height: 32px; border-radius: 9px; }

.top nav {
  gap: clamp(2px, 1.3vw, 16px);
  font-size: 14px;
  font-weight: 600;
}

.top nav a {
  justify-content: center;
  min-width: 44px;
  padding-inline: clamp(6px, 1.2vw, 13px);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.top nav .nav-download { background: var(--surface-soft); color: var(--accent); }

main, footer {
  width: min(var(--content), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

main > section + section { margin-top: var(--section-gap); }

h1, h2, h3 { margin: 0; line-height: 1.16; }
h2 { font-size: clamp(29px, 4vw, 48px); font-weight: 730; letter-spacing: -0.025em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 74px);
  align-items: center;
  padding-top: clamp(36px, 6vw, 82px);
}

.hero h1 {
  font-size: clamp(41px, 6vw, 82px);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -0.065em;
}

.hero h1 span { color: var(--accent); }

.hero-copy p {
  max-width: 29em;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
}

.hero-actions, .stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-actions { margin-top: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 4vw, 37px);
  min-height: clamp(265px, 33vw, 410px);
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 24%, var(--hero-glow), transparent 72%), var(--hero-art);
}

.hero-art img {
  width: min(34%, 153px);
  height: auto;
}

.hero-art img:first-child { transform: translateY(-8px); }
.hero-art img:last-child { transform: translateY(8px); }
.ios-image { mask: url("media/screenshots/ios-mask.png") center / 100% 100% no-repeat; }

.section-heading { margin-bottom: 22px; }
.section-heading p, .apps p { margin: 8px 0 0; color: var(--muted); }

.film, .phone-set, .guide li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.film {
  --film-padding: clamp(12px, 2vw, 24px);
  padding: var(--film-padding);
}

.film + .film { margin-top: 22px; }

.film-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0 0 16px;
}

.film-head h3 { font-size: clamp(22px, 2.5vw, 32px); font-weight: 700; letter-spacing: -0.035em; }

.meta, .file-size {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.meta { margin: 5px 0 0; }
.file-size { font-weight: 500; }

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #090e0c;
}

.stage video {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  object-fit: contain;
}

.stage-hit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.stage-hit:focus-visible {
  outline: 2px solid var(--play-ring);
  outline-offset: -4px;
}

.stage-glyph {
  display: grid;
  place-items: center;
  width: clamp(50px, 6vw, 68px);
  aspect-ratio: 1;
  border: 1px solid var(--play-ring);
  border-radius: 50%;
  background: var(--play-bg);
  color: var(--play-ink);
  box-shadow: 0 2px 18px #0005;
  transition: opacity 180ms ease, background-color 180ms ease;
}

.stage-glyph svg { width: 41%; height: auto; fill: currentColor; }
.stage-glyph .pause { display: none; }
.film.is-playing .stage-glyph { opacity: 0; }
.film.is-playing .stage-glyph .play { display: none; }
.film.is-playing .stage-glyph .pause { display: block; }
.film.is-playing .stage-hit:focus-visible .stage-glyph { opacity: 1; }

.staff-block {
  margin-top: 8px;
  padding: 9px 12px 7px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.staff-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.staff-label .now { color: var(--ink); font-weight: 650; }
.staff-hint { margin-inline-start: 11px; }

.staff {
  width: 100%;
  height: clamp(48px, 6vw, 68px);
  cursor: pointer;
  touch-action: none;
}

.staff:focus-visible { border-radius: 4px; outline-offset: 1px; }

.film-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.film-details p { flex: 1 1 30em; margin: 0; }

.file-row { display: flex; flex-wrap: wrap; gap: 0 12px; }

.file-row a {
  display: inline-flex;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  color: var(--accent);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.guide ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.guide li { padding: 20px; counter-increment: step; }
.guide h3 { font-size: 17px; }
.guide h3::before {
  content: counter(step) ". ";
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.guide li p { margin: 9px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.phones > h2 { margin-bottom: 22px; }

.phone-set {
  padding: clamp(16px, 3vw, 32px);
}

.phone-set + .phone-set { margin-top: 14px; }
.phone-set h3 { margin-bottom: 16px; font-size: 19px; }

.phone-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 28px);
  max-width: 808px;
  margin-inline: auto;
}

.phone { margin: 0; }
.phone-image { width: 100%; height: auto; }

.phone figcaption {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.apps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 30px;
  padding: clamp(20px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--hero-art);
}

.apps p { max-width: 30em; }
.badge { display: block; }
.badge img { height: 48px; width: auto; }

footer {
  margin-top: 36px;
  padding: 18px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer p { margin: 0 0 4px; }
footer p:first-child { color: var(--ink); font-weight: 650; }
.legal a { color: var(--accent); text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .top nav a:hover { background: var(--surface-soft); color: var(--accent); }
  .btn:hover { background: var(--accent-hover); }
  .btn-secondary:hover { border-color: var(--accent); background: var(--surface-soft); }
  .file-row a:hover { text-decoration-color: currentColor; }
  .stage-hit:hover .stage-glyph { background: var(--play-hover); opacity: 1; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; }
  .hero-art img { width: min(32%, 135px); }
  .hero-copy p { margin-top: 16px; }
  .hero-actions { margin-top: 20px; }
  .guide ol { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .phone-row {
    grid-auto-columns: 74%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }
  .phone { scroll-snap-align: start; }
  .phone:last-child { scroll-snap-align: end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-glyph, .btn { transition: none; }
}
