/*
 * Shared landing-page stylesheet for USelf Labs game/app sub-sites.
 *
 * This file is IDENTICAL in every landing page folder — it is the template's
 * shared layer. Per-game look is set entirely by overriding the custom
 * properties in the `:root` block of that site's index.html, so nothing here
 * needs editing when cloning a new site.
 *
 * Update flow: edit _template/styles.css, then re-copy it into each site
 * folder (./new-site.sh --sync).
 *
 * No build step, no framework, no external requests — one file, ships as-is.
 */

/* ── Theme contract ───────────────────────────────────────────────────────
 * Defaults below are USelf Labs house colours (matching uselflabs.com).
 * Each site's index.html overrides the ones it cares about.
 * ------------------------------------------------------------------------ */
:root {
  --bg: #06060f;
  --bg-raised: #0d0e1a;
  --bg-sunken: #04040a;
  --text: #f2f3f7;
  --muted: #9aa0b4;
  --faint: #7d8299;
  --accent: #0074fe;
  --accent-ink: #ffffff; /* text colour that sits on --accent */
  --accent-soft: rgba(0, 116, 254, 0.14);
  --border: rgba(242, 243, 247, 0.09);
  --border-strong: rgba(242, 243, 247, 0.18);
  --glow: radial-gradient(closest-side, rgba(0, 116, 254, 0.35), transparent);

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --shell: 1140px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

* {
  margin: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  /* Kills the 300ms double-tap zoom delay on touch. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  selection-background-color: var(--accent);
  selection-color: var(--accent-ink);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

ul,
ol {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
  font-weight: 700;
  color: var(--text);
}

p {
  text-wrap: pretty;
}

/* One global focus treatment, so nothing interactive ships without one. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Anchored sections clear the sticky header. */
:target {
  scroll-margin-top: 5.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout primitives ─────────────────────────────────────────────────── */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 24px;
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 18px;
  }
}

.section {
  position: relative;
  padding-block: 80px;
}

@media (max-width: 768px) {
  .section {
    padding-block: 60px;
  }
}

.section--sunken {
  background: var(--bg-sunken);
  border-block: 1px solid var(--border);
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.section__title {
  margin-top: 8px;
  font-size: clamp(1.6rem, 4.2vw, 2.3rem);
  letter-spacing: -0.03em;
}

.section__lede {
  margin-top: 14px;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: -0.015em;
  margin-right: auto;
  transition: opacity 0.18s ease;
}

.header__brand:hover {
  opacity: 0.9;
}

.header__icon {
  width: 34px;
  height: 34px;
  border-radius: 26%;
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.header__nav {
  display: none;
  gap: 28px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}

.header__nav a {
  position: relative;
  padding-block: 4px;
  transition: color 0.18s ease;
}

.header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.22s var(--ease-out);
}

.header__nav a:hover {
  color: var(--text);
}

.header__nav a:hover::after {
  width: 100%;
}

@media (min-width: 800px) {
  .header__nav {
    display: flex;
  }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-raised) 70%, transparent);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.14s var(--ease-out);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised));
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 18px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
  color: var(--accent-ink);
  background: var(--accent);
  filter: brightness(1.08);
  box-shadow: 0 6px 24px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0) scale(0.97);
  filter: brightness(1);
}

/* Official Google Play badge. Google's brand rules ask for the supplied
   artwork, so it is an <img> rather than a re-drawn button. */
.play-badge {
  display: inline-block;
  border-radius: 8px;
  transition: transform 0.18s var(--ease-out), filter 0.18s ease, opacity 0.18s ease;
}

.play-badge img {
  height: 56px;
  width: auto;
  border-radius: 6px;
}

.play-badge:hover {
  opacity: 0.94;
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.play-badge:active {
  transform: translateY(0) scale(0.98);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 60px 80px;
}

/* The feature graphic, bled behind the copy as atmosphere rather than content
   — masked and dimmed so text contrast never depends on the artwork. */
.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center right;
  opacity: 0.36;
  filter: saturate(1.15);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 82%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.95),
    transparent 82%
  );
}

/* Opaque-to-transparent wash over the copy column. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to right,
    var(--bg) 0%,
    var(--bg) 26%,
    color-mix(in srgb, var(--bg) 80%, transparent) 48%,
    transparent 78%
  );
}

@media (max-width: 939px) {
  /* Single column: the copy sits over the whole width, so wash the art evenly
     from the bottom instead of from the left. */
  .hero__scrim {
    background: linear-gradient(
      to bottom,
      transparent 0%,
      color-mix(in srgb, var(--bg) 85%, transparent) 50%,
      var(--bg) 85%,
      var(--bg) 100%
    );
  }
}

.hero__glow {
  position: absolute;
  z-index: 0;
  width: 680px;
  height: 680px;
  top: -260px;
  right: -180px;
  background: var(--glow);
  opacity: 0.75;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 48px;
}

@media (min-width: 940px) {
  .hero {
    padding-block: 84px 104px;
  }

  .hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 56px;
  }
}

.hero__icon {
  width: 80px;
  height: 80px;
  border-radius: 22%;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-soft);
  transition: transform 0.25s var(--ease-out);
}

.hero__icon:hover {
  transform: scale(1.03);
}

.hero__category {
  margin-top: 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin-top: 10px;
  font-size: clamp(2.2rem, 6.4vw, 3.5rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.hero__tagline {
  margin-top: 18px;
  max-width: 36ch;
  font-size: clamp(1.08rem, 2.4vw, 1.32rem);
  line-height: 1.5;
  color: var(--text);
}

.hero__body {
  margin-top: 14px;
  max-width: 52ch;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

/* Fact chips: category / price / offline etc. */
.chips {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-raised));
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s var(--ease-out);
}

.chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-raised));
  transform: translateY(-1px);
}

/* Hero art: phone-style presentation with rim lighting */
.hero__art {
  position: relative;
  justify-self: center;
  max-width: 310px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow:
    0 32px 80px -12px rgba(0, 0, 0, 0.8),
    0 0 40px -10px var(--accent-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  background: var(--bg-raised);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.hero__art:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 40px 90px -12px rgba(0, 0, 0, 0.85),
    0 0 50px -6px var(--accent-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hero__art img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--shot-aspect, 9 / 16);
  object-fit: cover;
}

/* ── Screenshot strip ──────────────────────────────────────────────────── */
.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}

@media (min-width: 700px) {
  .shots {
    gap: 22px;
  }
}

.shots li {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  overflow: hidden;
  /* Set per site — screenshot aspect differs per game, so none get squashed. */
  aspect-ratio: var(--shot-aspect, 9 / 16);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.28s var(--ease-out), border-color 0.28s ease, box-shadow 0.28s ease;
}

.shots li:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.65), 0 0 30px -10px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.shots img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-out);
}

.shots li:hover img {
  transform: scale(1.02);
}

/* Mobile screenshot carousel snap */
@media (max-width: 640px) {
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    margin-inline: -18px;
    padding-inline: 18px;
    padding-bottom: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }

  .shots::-webkit-scrollbar {
    height: 4px;
  }

  .shots::-webkit-scrollbar-track {
    background: transparent;
  }

  .shots::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
  }

  .shots li {
    flex: 0 0 76%;
    scroll-snap-align: center;
  }
}

/* ── Feature cards (Bento style) ───────────────────────────────────────── */
.cards {
  margin-top: 36px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.25s ease,
    transform 0.25s var(--ease-out),
    box-shadow 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow:
    0 16px 36px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 6px;
  box-shadow: 0 4px 14px var(--accent-soft);
}

.card__title {
  margin-top: 12px;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card__body {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Numbered stat row ─────────────────────────────────────────────────── */
.stats {
  margin-top: 36px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 760px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  position: relative;
  padding: 22px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.22s var(--ease-out), border-color 0.22s ease;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.stat__value {
  font-size: clamp(1.6rem, 4.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.stat__label {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

/* ── Checklist ─────────────────────────────────────────────────────────── */
.checklist {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

@media (min-width: 760px) {
  .checklist {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 36px;
  }
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.96rem;
  color: var(--muted);
  line-height: 1.55;
}

.checklist li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px 10px;
  box-shadow: 0 0 10px var(--accent-soft);
}

/* ── FAQ ───────────────────────────────────────────────────────────────── */
.faq {
  margin-top: 32px;
  max-width: 82ch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq details {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.faq details:hover {
  border-color: var(--border-strong);
}

.faq details[open] {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--bg-raised) 92%, var(--accent) 8%);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  flex: none;
  transition: transform 0.25s var(--ease-out), background-color 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

.faq p {
  padding: 0 22px 20px;
  max-width: 72ch;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ── Closing CTA ───────────────────────────────────────────────────────── */
.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-block: 84px;
  border-top: 1px solid var(--border);
}

.cta__glow {
  position: absolute;
  z-index: 0;
  width: 760px;
  height: 760px;
  left: 50%;
  bottom: -440px;
  transform: translateX(-50%);
  background: var(--glow);
  opacity: 0.65;
  pointer-events: none;
}

.cta__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta__title {
  font-size: clamp(1.75rem, 5.2vw, 2.6rem);
  letter-spacing: -0.03em;
}

.cta__body {
  margin-top: 14px;
  max-width: 48ch;
  font-size: 1.04rem;
  line-height: 1.6;
  color: var(--muted);
}

.cta .play-badge {
  margin-top: 32px;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding-block: 36px;
  font-size: 0.86rem;
  color: var(--faint);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--muted);
  font-weight: 500;
}

.footer__brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer__links a {
  transition: color 0.18s ease;
}

.footer__links a:hover {
  color: var(--text);
}

/* ── Scroll reveal ─────────────────────────────────────────────────────────
 * Gated on `scripting: enabled` so with JS off (or for a crawler that does not
 * run it) content renders plainly visible instead of stuck at opacity 0.
 * ------------------------------------------------------------------------ */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.65s var(--ease-out),
      transform 0.65s var(--ease-out);
  }

  [data-reveal][data-revealed] {
    opacity: 1;
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Document / Prose (for Privacy Policy, etc) ────────────────────────── */
.document {
  max-width: 820px;
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left, 20px));
  padding-right: max(20px, env(safe-area-inset-right, 20px));
  padding-block: 44px 88px;
  word-break: break-word;
}

.document h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 8px;
}

.document .eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.document .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.document .meta .tag {
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-raised) 50%, transparent);
}

.document h2 {
  font-size: 1.5rem;
  margin-top: 40px;
  margin-bottom: 16px;
}

.document h3 {
  font-size: 1.2rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.document p {
  margin-bottom: 16px;
}

.document .lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.document a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.18s ease;
  word-break: break-word;
}

.document a:hover {
  color: var(--text);
}

.document ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.document li {
  margin-bottom: 8px;
}

.document .table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-block: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
}

.document table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 600px;
}

.document th,
.document td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.document th {
  font-weight: 600;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.document .contact {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Clean WebView Mode (In-App Privacy / Terms) ────────────────────────── */
html.is-webview,
body.is-webview {
  background: var(--bg);
  color: var(--text);
}

.is-webview .header,
.is-webview .footer {
  display: none !important;
}

.is-webview .document {
  max-width: 760px;
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  padding-bottom: max(36px, env(safe-area-inset-bottom, 36px));
  padding-left: max(16px, env(safe-area-inset-left, 16px));
  padding-right: max(16px, env(safe-area-inset-right, 16px));
}

.is-webview .document h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 6px;
}

.is-webview .document .eyebrow {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.is-webview .document .lede {
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.is-webview .document .meta {
  margin-bottom: 24px;
  padding-bottom: 16px;
  font-size: 0.82rem;
}

.is-webview .document h2 {
  font-size: 1.25rem;
  margin-top: 28px;
  margin-bottom: 10px;
}

.is-webview .document h3 {
  font-size: 1.05rem;
  margin-top: 22px;
  margin-bottom: 8px;
}

.is-webview .document p,
.is-webview .document li {
  font-size: 0.92rem;
  line-height: 1.6;
}

.is-webview .document .contact {
  padding: 14px 16px;
  font-size: 0.88rem;
}

/* ── WebView Adaptive Light / Dark Theme ────────────────────────────────── */
@media (prefers-color-scheme: light) {
  html.is-webview {
    color-scheme: light;
    --bg: #ffffff;
    --bg-raised: #f3f4f6;
    --bg-sunken: #f9fafb;
    --text: #111827;
    --muted: #4b5563;
    --faint: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --accent-soft: rgba(37, 99, 235, 0.08);
  }
}

@media (prefers-color-scheme: dark) {
  html.is-webview {
    color-scheme: dark;
    --bg: #0c0d10;
    --bg-raised: #16181d;
    --bg-sunken: #060709;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --faint: #6b7280;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
  }
}

/* Explicit overrides via ?theme=light or ?theme=dark */
html.is-webview.theme-light {
  color-scheme: light;
  --bg: #ffffff;
  --bg-raised: #f3f4f6;
  --bg-sunken: #f9fafb;
  --text: #111827;
  --muted: #4b5563;
  --faint: #6b7280;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.08);
}

html.is-webview.theme-dark {
  color-scheme: dark;
  --bg: #0c0d10;
  --bg-raised: #16181d;
  --bg-sunken: #060709;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --faint: #6b7280;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
}
