:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --accent: #1a73e8;
  --rule: #e5e5e5;
  --code-bg: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --fg: #eaeaea;
    --muted: #a0a0a0;
    --accent: #6aa6f0;
    --rule: #2a2a2a;
    --code-bg: #1e1e1e;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 1.25rem;
}

header.site .inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

header.site h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

header.site nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

header.site nav a:hover { color: var(--fg); }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

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

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: 600;
  background: var(--code-bg);
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

.subtle { color: var(--muted); font-size: 0.9rem; }

footer.site {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site .inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--fg); }

.hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.hero p.tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.install-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.install-btn {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
}

.install-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Help page extras --- */

.help-hero {
  display: grid;
  grid-template-columns: 1fr 160px;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.help-hero h1 { margin-top: 0; }
.help-hero .tagline { color: var(--muted); font-size: 1.05rem; margin: 0; }

.help-hero svg { width: 100%; height: auto; }

@media (max-width: 560px) {
  .help-hero { grid-template-columns: 1fr; }
  .help-hero svg { max-width: 140px; justify-self: center; }
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 1rem 0 2.5rem;
  list-style: none;
}

.toc-grid li { margin: 0; }

.toc-grid a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s, transform 0.15s;
}

.toc-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.toc-grid svg {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
}

.section-heading svg {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.section-heading h2 {
  margin: 0;
}

.tip {
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
  padding: 0.85rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 1.25rem 0;
  font-size: 0.97rem;
}

.tip strong { color: var(--accent); }

.steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding: 0.2rem 0 1rem 2.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.steps > li:last-child { padding-bottom: 0; }

.screenshot-slot {
  display: grid;
  place-items: center;
  margin: 1rem auto;
  max-width: 280px;
  aspect-ratio: 9 / 19;
  border: 2px dashed var(--rule);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.screenshot {
  display: block;
  margin: 1.25rem auto;
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  .screenshot { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
}

figure.screenshot-figure {
  margin: 1.25rem 0;
  text-align: center;
}

figure.screenshot-figure figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.invite-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}

.invite-cards .card {
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg);
}

.invite-cards .card h4 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--accent);
}

.invite-cards .card p {
  margin: 0;
  font-size: 0.92rem;
}

/* ===========================================================================
 * Landing page (body.landing)
 *
 * Wider main container than the other static pages — index.html needs room
 * for two-column layouts (hero text + screenshot, mode grid + screenshot)
 * that don't fit comfortably in the 720px reading column used for prose.
 *
 * All landing-specific selectors are scoped under body.landing so the other
 * pages (privacy / terms / help / age-suitability) are unaffected.
 * =========================================================================== */

body.landing main {
  max-width: 1100px;
}

/* Hero — text left, primary screenshot right. Stacks on narrow viewports. */
.landing .hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3rem;
}

.landing .hero-text h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.landing .hero-text .tagline {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.landing .hero-shot-wrap {
  display: flex;
  justify-content: center;
}

.landing .hero-shot {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 36px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  .landing .hero-shot {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  }
}

/* Store buttons — Apple + Google badges side by side, equal height.
 * Apple ≥ Google height rule is satisfied trivially by setting both to
 * the same height. */
.landing .store-buttons {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.landing .store-badge {
  height: 48px;
  width: auto;
  display: block;
}

/* Google's badge image ships with built-in clear-space padding around the
 * artwork; Apple's SVG does not. Nudging the visual baselines so the two
 * sit on the same line at the same effective size. */
.landing .store-badge--google {
  height: 70px;
  margin: -11px 0;
}

/* Four-feature grid — 2x2 on desktop, 1col on mobile. */
.landing .features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1rem 0 2rem;
}

.landing .feature {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg);
}

.landing .feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.landing .feature p {
  margin: 0;
  font-size: 0.95rem;
}

.landing .section-lede {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0.25rem 0 1.5rem;
}

/* Two-column layout: text/grid on one side, screenshot on the other.
 * --reverse variant swaps the columns. */
.landing .features-side-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
  margin: 1rem 0 2.5rem;
}

.landing .features-side-grid--reverse {
  grid-template-columns: 1fr 1.5fr;
}

.landing .features-side-grid--reverse > div:first-child {
  order: 2;
}

.landing .features-side-shot-wrap {
  display: flex;
  justify-content: center;
}

.landing .features-side-shot {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 32px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .landing .features-side-shot {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  }
}

/* Visibility-mode grid — 2x2 on desktop, 1col on mobile. */
.landing .modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.landing .mode {
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg);
}

.landing .mode h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.landing .mode p {
  margin: 0;
  font-size: 0.92rem;
}

.landing .feature-list {
  margin: 0;
  padding-left: 1.2rem;
}

.landing .feature-list li {
  margin: 0.5rem 0;
  line-height: 1.5;
}

/* Responsive: stack two-column layouts on narrow viewports. */
@media (max-width: 760px) {
  .landing .hero,
  .landing .features-side-grid,
  .landing .features-side-grid--reverse {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .landing .features-side-grid--reverse > div:first-child {
    order: 0;
  }
  .landing .features-grid,
  .landing .modes-grid {
    grid-template-columns: 1fr;
  }
  .landing .hero-text h1 {
    font-size: 1.9rem;
  }
}
