:root {
  color-scheme: light;
  --ink: #241914;
  --muted: #6b5b52;
  --paper: #fff7ed;
  --card: #ffffff;
  --accent: #ff4d2e;
  --link: #9f1f0f;
  --line: #ead8ca;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--link);
  font-weight: 700;
}

.page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  min-height: calc(100vh - 96px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 8px 8px 0 #241914;
}

.eyebrow {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 32px 0 8px;
  font-size: 1.15rem;
  letter-spacing: 0;
}

p {
  margin: 0 0 14px;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.15rem, 3vw, 1.7rem);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.download-note {
  max-width: 560px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.doc {
  max-width: 760px;
  padding: 34px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.doc h1 {
  margin: 18px 0 20px;
  font-size: clamp(2.4rem, 9vw, 4.8rem);
}

.back {
  display: inline-block;
  margin-bottom: 6px;
}

.updated {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 24px, 920px);
    padding: 24px 0;
  }

  .doc {
    padding: 22px;
  }
}

/* Tutorial */
.tutorial-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.tutorial-nav,
.tutorial-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.tutorial-nav {
  margin-bottom: 42px;
}

.localized-content {
  display: none;
}

.default-locale,
.localized-content:target {
  display: block;
}

body:has(#zh-Han:target) #en,
body:has(#zh-Hans:target) #en,
body:has(#zh-walkthrough:target) #en,
body:has(#zh-troubleshooting:target) #en {
  display: none;
}

body:has(#zh-Han:target) #zh-Hans,
body:has(#zh-Hans:target) #zh-Hans,
body:has(#zh-walkthrough:target) #zh-Hans,
body:has(#zh-troubleshooting:target) #zh-Hans {
  display: block;
}

.locale-anchor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tutorial-nav-spacer {
  flex: 1 1 auto;
}

.language-switcher {
  display: inline-flex;
  min-height: 36px;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.language-switcher a + a {
  border-left: 2px solid var(--ink);
}

.language-switcher a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

.tutorial-footer {
  justify-content: center;
  padding: 28px 0 6px;
}

.tutorial-hero {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
}

.tutorial-hero-grid,
.step-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: center;
}

.tutorial-hero-copy h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  max-width: 780px;
}

.tutorial-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.tutorial-hero-actions a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
}

.tutorial-hero-actions a + a {
  background: var(--card);
  color: var(--ink);
}

.tutorial-section {
  padding: 44px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading h2,
.story-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.95;
}

.section-heading p {
  color: var(--muted);
  font-size: 1.08rem;
}

.story-card,
.info-card,
.step-card,
.story-panel,
.device-frame {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
}

.story-card,
.step-card {
  box-shadow: 8px 8px 0 var(--ink);
}

.story-card,
.info-card,
.story-panel {
  padding: 22px;
}

.hero-story {
  transform: rotate(1deg);
  background: #fffdf8;
}

.label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.demo-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}

.demo-facts div {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.demo-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-facts dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.setup-grid,
.trouble-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trouble-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.info-card h3,
.story-panel h4,
.step-copy h3 {
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.05;
}

.info-card h3 {
  font-size: 1.2rem;
}

.info-card p,
.story-panel p,
.step-copy p {
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-step {
  margin: 0;
}

.step-card {
  padding: 24px;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.step-meta span:first-child,
.role-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.step-meta span:first-child {
  background: #ffd43b;
}

.role-chip {
  background: var(--card);
}

.role-chip.organizer {
  background: var(--accent);
  color: var(--ink);
}

.role-chip.guest {
  background: #4dabf7;
  color: var(--ink);
}

.step-copy h3 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.platform-notes {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.platform-notes p {
  margin: 0;
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: #fffaf4;
}

.device-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.device-frame {
  margin: 0;
  padding: 12px;
  background: #1f1713;
  box-shadow: 6px 6px 0 var(--accent);
}

.android-frame {
  box-shadow-color: #4dabf7;
}

.device-screen {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 77, 46, 0.08), rgba(77, 171, 247, 0.08)),
    #fffaf4;
  color: var(--ink);
  text-align: center;
}

.device-screen span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.device-screen strong {
  font-size: 1.55rem;
}

.device-frame figcaption {
  margin-top: 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.story-panel {
  background: #fffaf4;
}

.story-panel.accent-plan {
  background: #e8f4ff;
}

.story-panel.accent-vote {
  background: #fff5bf;
}

.story-panel.accent-primary {
  background: #ffe0d6;
}

.story-panel.accent-settled {
  background: #e3f8e8;
}

.demo-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.demo-list li + li {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .tutorial-hero-grid,
  .step-card {
    grid-template-columns: 1fr;
  }

  .setup-grid,
  .trouble-grid {
    grid-template-columns: 1fr;
  }

  .hero-story {
    transform: none;
  }
}

@media (max-width: 620px) {
  .tutorial-page {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }

  .tutorial-hero {
    min-height: auto;
    padding: 18px 0 34px;
  }

  .tutorial-nav {
    margin-bottom: 28px;
  }

  .tutorial-hero-actions a {
    width: 100%;
    justify-content: center;
  }

  .story-card,
  .info-card,
  .story-panel,
  .step-card {
    padding: 18px;
  }

  .demo-facts,
  .device-pair {
    grid-template-columns: 1fr;
  }

  .device-screen {
    min-height: 220px;
  }
}
