:root {
  --bg: #f4f0e8;
  --bar: rgba(244, 240, 232, 0.82);
  --text: #1d1d1f;
  --muted: #56565a;
  --accent: #0f6e6b;
  --on-accent: #ffffff;
  --line: rgba(48, 40, 32, 0.14);
  --cinnabar: #a34337;
  --bezel: #1c1917;
  --shadow: rgba(48, 36, 24, 0.14);
  --ink: rgba(48, 40, 32, 0.16);
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.75rem;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: 0;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: none;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.05;
  font-optical-sizing: auto;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding-inline: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -0.5px 0 var(--line);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img {
  width: 22px;
  height: 22px;
  flex: none;
}

.brand span {
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  touch-action: manipulation;
}

.topbar .button {
  justify-self: end;
  position: relative;
  z-index: 0;
  min-height: 44px;
  padding-inline: 16px;
  background: transparent;
  font-size: 0.875rem;
}

.topbar .button::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 50%;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateY(-50%);
}

.button:active,
.brand:active {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.hero {
  padding: 48px 0 72px;
}

.hero-grid,
.beat-grid {
  display: grid;
  align-items: center;
  gap: 40px;
}

.hero h1 {
  font-size: clamp(2.5rem, 4.6vw, 3.6rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.seal {
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 20px;
  border-radius: 1px;
  background: var(--cinnabar);
}

.lede {
  max-width: 28em;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 24px;
}

.phone {
  position: relative;
  width: min(280px, 100%);
  margin: 0;
  justify-self: center;
  padding: 10px;
  border-radius: 36px;
  background: var(--bezel);
  box-shadow: 0 22px 50px var(--shadow);
}

.phone img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 26px;
}

.ink {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 240%;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.beat {
  padding: 64px 0;
}

.beat h2 {
  max-width: 12em;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.kicker {
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.chapter {
  padding-top: 48px;
}

.chapter-title {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.chapter-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.chapter + .hero {
  padding-top: 32px;
}

.beat:has(+ .chapter) {
  padding-bottom: 16px;
}

.chapter + .scene {
  padding-top: 36px;
}

.scene:has(+ .chapter) {
  padding-bottom: 16px;
}

.chapter + .download {
  padding-top: 32px;
}

.scene {
  padding: 96px 0;
}

.scene h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.shot {
  margin: 48px 0 0;
}

.shot img,
.shot video {
  width: 100%;
  height: auto;
  border-radius: 18px;
  display: block;
}

.caption {
  max-width: 40em;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.aside {
  margin-top: 28px;
  color: var(--muted);
}

.download {
  padding: 28px 0 8px;
}

.download h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.download .lede {
  font-size: 1.0625rem;
}

.packs {
  margin-top: 36px;
}

fieldset {
  margin: 0;
  padding: 0;
  min-width: 0;
  border: 0;
}

.download legend {
  margin: 0 0 8px;
  padding: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.choices {
  border-top: 1px solid var(--line);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.choice input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.choice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.choice-name {
  font-weight: 600;
}

.choice:has(input:checked) .choice-name {
  color: var(--accent);
}

.choice-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.choice-file {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.release {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  justify-items: start;
}

#apk-hint {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.95rem;
}

.repos {
  display: flex;
  align-items: center;
  justify-content: center;
}

.repo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}

.repo:active {
  opacity: 0.55;
}

.repo-mark {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer {
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (min-width: 720px) {
  .topbar-inner {
    min-height: 4rem;
  }

  .hero {
    padding: 88px 0 104px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
  }

  .beat {
    padding: 88px 0;
  }

  .beat-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 72px;
  }

  .phone-first .beat-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .phone-first .beat-copy {
    order: 2;
  }

  .phone-first .phone {
    order: 1;
  }

  .chapter {
    padding-top: 72px;
  }

  .chapter + .hero {
    padding-top: 44px;
  }

  .chapter + .scene {
    padding-top: 48px;
  }

  .chapter + .download {
    padding-top: 44px;
  }

  .scene {
    padding: 112px 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --bar: rgba(20, 18, 16, 0.82);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --accent: #8fd9cf;
    --on-accent: #1d1d1f;
    --line: rgba(255, 255, 255, 0.16);
    --cinnabar: #a34337;
    --bezel: #1c1917;
    --shadow: rgba(0, 0, 0, 0.45);
    --ink: rgba(244, 240, 232, 0.22);
    color-scheme: dark;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button:active,
  .brand:active {
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .topbar,
  .phone,
  .shot img,
  .shot video {
    box-shadow: inset 0 0 0 1px var(--text);
  }
}
