/* PlayGuard's website (site/README.md): the branding's navy, teal and amber
   (branding/), in a light and a dark theme (data-theme, set before the first
   paint by each page: the choice kept, else the system's). */
/* Sora (SIL Open Font License, fonts/OFL.txt), served with the site rather
   than by Google Fonts, which would see every visitor: its Latin letters,
   cut out of google/fonts' ofl/sora/Sora[wght].ttf, every weight. */
@font-face {
  font-family: "Sora";
  src: url("fonts/sora.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #121b2c;
  --muted: #536079;
  --line: #dbe2ec;
  --accent: #0a705f;
  --accent-soft: #e2f4f0;
  --accent-text: #ffffff;
  --amber: #b26a00;
  --amber-soft: #fff4e2;
  --hero: #0b1424;
  --hero-text: #e8eef7;
  --hero-muted: #a9b6cc;
  --shadow: 0 10px 30px rgb(11 20 36 / 0.10);
  --radius: 14px;
  --display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* The page's sides: 16px, more beside an iPhone's notch in landscape
     (viewport-fit=cover lets the page under it). */
  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1424;
  --surface: #111d31;
  --surface-2: #17253d;
  --text: #e8eef7;
  --muted: #a9b6cc;
  --line: #22324f;
  --accent: #2ec4a6;
  --accent-soft: #0f2f2e;
  --accent-text: #05140f;
  --amber: #ffb547;
  --amber-soft: #2c2412;
  --hero: #08101d;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* iOS enlarges the text when the phone turns to landscape, unless told not to. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: var(--accent); }
img, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; letter-spacing: -0.01em; }
code { overflow-wrap: break-word; font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 5px; }
pre { background: var(--surface-2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
pre code { background: none; padding: 0; }

/* For a screen reader only. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px max(var(--gutter-r), calc((100% - 1180px) / 2)) 10px max(var(--gutter-l), calc((100% - 1180px) / 2));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.2s ease;
}
/* On a phone, out of the way while reading down, back as soon as one
   scrolls up (site.js). */
.top.away { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 700 20px var(--display); }
.brand b { color: inherit; font-weight: 700; }
.nav { display: flex; gap: 18px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a[aria-current] { color: var(--text); }
.nav .nav-try { color: var(--accent); }
.settings { display: flex; gap: 8px; }
.picker { position: relative; display: inline-flex; }
.picker-face { display: none; }
.settings select {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
}

/* Buttons and callouts */
.button {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
/* Hover only where there is a pointer: a finger's tap would leave it on. */
@media (hover: hover) {
  .nav a:hover { color: var(--text); }
  .button:hover { filter: brightness(1.06); }
  .doc-group li a:hover, .doc-results a:hover { background: var(--surface-2); }
  .toc a:hover { color: var(--text); }
  .hero .source a:hover { color: var(--hero-text); }
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 18px 0; }
.callout p { margin: 0.3em 0; }
.callout.warning, .callout.caution, .callout.important { border-color: var(--amber); background: var(--amber-soft); }
.callout.wide { max-width: 1180px; margin: 24px var(--gutter-r) 0 var(--gutter-l); }
@media (min-width: 1212px) { .callout.wide { margin: 24px auto 0; } }

/* Home */
/* Aurore's sky: the night, an aurora rising from the left (branding/). */
.hero { background: radial-gradient(120% 90% at 0% 100%, rgb(0 255 204 / 0.10), transparent 60%),
  radial-gradient(90% 80% at 100% 0%, rgb(138 92 255 / 0.12), transparent 60%), var(--hero); color: var(--hero-text); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: center;
  padding: 56px max(var(--gutter-r), calc((100% - 1180px) / 2)) 56px max(var(--gutter-l), calc((100% - 1180px) / 2));
}
.hero h1 { font-size: clamp(30px, 4vw, 46px); margin: 6px 0 10px; }
.hero .sub { color: #2ec4a6; font-weight: 600; font-size: 19px; margin: 0 0 12px; }
.hero p { color: var(--hero-muted); }
.wordmark { font: 700 22px var(--display); color: var(--hero-text); margin: 0; letter-spacing: -0.02em; }
.wordmark span { color: inherit; }
.wordmark::after { content: ""; display: block; width: 52px; height: 4px; border-radius: 2px; margin-top: 6px;
  background: linear-gradient(90deg, #00ffcc, #33bbff 55%, #8a5cff); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero .button { background: transparent; color: var(--hero-text); border-color: #2a3854; }
.hero .button.primary { background: #2ec4a6; border-color: #2ec4a6; color: #05140f; }
.hero .source { margin: 14px 0 0; font-size: 15px; }
.hero .source a { color: var(--hero-muted); }
.hero-video { position: relative; }
.hero-video video { width: 100%; border-radius: 16px; box-shadow: 0 30px 80px rgb(0 0 0 / 0.5), 0 0 0 1px #2a3854; display: block; }
/* The tour's play / pause (site.js): it plays by itself only where motion
   and data are welcome (not on a phone, nor with reduced motion). Paused, a
   large play in the middle; playing, a pause in the corner. */
.video-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2a3854;
  background: rgb(8 16 29 / 0.8);
  color: #e8eef7;
  cursor: pointer;
}
.video-toggle::before { content: ""; display: block; margin: auto; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; transform: translateX(2px); }
.video-toggle:not(.playing) { right: calc(50% - 32px); bottom: calc(50% - 32px); width: 64px; height: 64px; }
.video-toggle:not(.playing)::before { border-width: 12px 0 12px 19px; transform: translateX(3px); }
.video-toggle.playing::before { width: 12px; height: 16px; border: solid currentColor; border-width: 0 4px; transform: none; }
/* Its sound (site.js): off at first, as a video that plays by itself must
   be; a speaker in the other corner while it plays, struck through while muted. */
.video-sound {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2a3854;
  background: rgb(8 16 29 / 0.8);
  color: #e8eef7;
  cursor: pointer;
  padding: 0;
}
.video-sound svg { display: block; margin: auto; width: 22px; height: 22px; }
.video-sound .on { display: none; }
.video-sound[aria-pressed="true"] .on { display: inline; }
.video-sound[aria-pressed="true"] .off { display: none; }

.section { max-width: 1180px; margin: 0 auto; padding: 56px var(--gutter-r) 0 var(--gutter-l); }
.section > h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 22px; }
.section.narrow { max-width: 720px; padding-bottom: 80px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 { margin: 8px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .icon { display: block; width: 42px; height: 42px; padding: 9px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
/* The other features: smaller, flatter. */
.more-title { margin: 28px 0 12px; font-size: 18px; color: var(--muted); }
.cards-small { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cards-small .card { box-shadow: none; padding: 14px 16px; }
.cards-small .card h3 { font-size: 16px; }
.cards-small .card .icon { width: 34px; height: 34px; padding: 7px; border-radius: 9px; }

/* PlayGuard and Nintendo's app. */
.compare table { border-collapse: collapse; width: 100%; max-width: 720px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { position: relative; padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.compare thead th { font-family: var(--display); }
.compare thead th, .compare td.yes, .compare td.no { text-align: center; width: 30%; }
.compare tbody th { font-weight: 500; }
.compare tr:last-child > * { border-bottom: 0; }
.compare td.yes { color: var(--accent); font-weight: 700; font-size: 18px; }
.compare td.no { color: var(--muted); font-size: 18px; }

/* Every screen at once on a large screen; one after the other on a phone,
   the next one showing at the edge. */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery a { display: block; position: relative; }
.gallery img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); display: block; }
/* A screenshot's dark one under the dark theme (build_site.py's gallery_image()). */
.shot-dark { display: none !important; }
:root[data-theme="dark"] .shot-dark { display: block !important; }
:root[data-theme="dark"] .shot-light { display: none !important; }
.gallery figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary, .release summary { cursor: pointer; padding: 14px 28px 14px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker, .release summary::-webkit-details-marker { display: none; }
.faq summary::after, .release summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: calc(50% - 6px);
  width: 8px;
  height: 8px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after, .release[open] summary::after { transform: translateY(4px) rotate(-135deg); }
.faq details { scroll-margin-top: 100px; }
.faq details[open] summary { color: var(--accent); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

.band {
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--accent-soft);
  border-radius: 18px;
  padding: 28px 32px;
  max-width: 1148px;
}
.band h2 { margin: 0 0 6px; font-size: 24px; }
.band p { margin: 0; color: var(--muted); }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.steps { padding-left: 1.3em; }
/* Tabs (site.js): one way to do something, then another. */
.tab-list { display: flex; gap: 4px; padding: 4px; margin: 0 0 4px; border-radius: 12px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.tab-list button { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 15px system-ui, sans-serif; cursor: pointer; }
.tab-list button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(11 20 36 / 0.12); }
.tab-title { font-size: 16px; margin: 18px 0 0; }
.size { font-weight: 400; opacity: 0.8; white-space: nowrap; }
/* On the accent, faded text falls under 4.5:1 (WCAG AA): its weight alone sets it apart. */
.button.primary .size { opacity: 1; }
.steps li { margin: 6px 0; }

.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.doc-group h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 8px; }
.doc-group ul { list-style: none; padding: 0; margin: 0; }
.doc-group li a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.doc-group li a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Documentation */
/* The documentation's versions: the latest release's, main's. */
.doc-versions { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.doc-versions a { flex: 1; text-align: center; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.doc-versions a[aria-current] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.doc-search { margin-bottom: 14px; }
.doc-search input { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
                    background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.doc-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.doc-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.doc-results[hidden] { display: none; }
.doc-results a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.doc-results a:focus { background: var(--surface-2); }
.doc-results strong { display: block; }
.doc-results span { color: var(--muted); font-size: 13px; }
.doc-results .none { color: var(--muted); font-size: 14px; padding: 6px 10px; }
.doc-search { position: relative; }
.doc-results mark { background: var(--amber-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.doc {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px var(--gutter-r) 0 var(--gutter-l);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 220px;
  gap: 36px;
  align-items: start;
}
.doc-nav, .toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow: auto; }
.doc-nav .doc-list { grid-template-columns: 1fr; }
.toc ul { list-style: none; padding: 0 0 0 12px; margin: 0; border-left: 1px solid var(--line); font-size: 14px; }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.prose { min-width: 0; }
.prose h1 { font-size: clamp(28px, 3.5vw, 38px); margin-top: 0; }
.prose h2 { margin-top: 2em; padding-top: 0.4em; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.prose h3 { margin-top: 1.6em; scroll-margin-top: 80px; }
/* A heading's link, to share its section: on hovering it, always on a touch screen. */
.anchor { margin-left: 0.3em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.anchor::before { content: "#"; }
h2:hover > .anchor, h3:hover > .anchor, .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .anchor { opacity: 0.45; } }
/* Screenshots with their names (build_site.py's screenshot_table()): two
   columns, one on a phone; a touch shows one larger (site.js). */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; margin: 20px 0; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
/* The pages before and after. */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 600; background: var(--surface); }
.pager span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.pager .prev span::before { content: "← "; }
.pager .next { grid-column: 2; text-align: right; }
.pager .next span::after { content: " →"; }
/* A copy button on a block of code (site.js). */
pre.has-copy { position: relative; padding-right: 76px; }
.copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; min-height: 32px; border-radius: 8px; border: 1px solid var(--line);
        background: var(--surface); color: var(--text); font: 600 13px system-ui, sans-serif; cursor: pointer; }
/* The compatibility page's check (site.js). */
.compat-check, .since { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.compat-check p { margin: 0 0 8px; }
.compat-check label, .since label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.since-result:empty { display: none; }
.since-result { margin: 10px 0 0 !important; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); }
/* A section main has and the latest release had not. */
.new-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
             background: var(--accent-soft); color: var(--accent); font: 600 12px/1.6 system-ui, sans-serif; letter-spacing: 0.02em; }
.compat-check input, .since input { width: 12em; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
                      background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.compat-result:empty { display: none; }
.compat-result { margin: 10px 0 0 !important; padding: 8px 12px; border-radius: 8px; }
.compat-result.ok { background: var(--accent-soft); }
.compat-result.warn { background: var(--amber-soft); }
/* The changelog's older releases. */
.release { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin: 10px 0; background: var(--surface); scroll-margin-top: 100px; }
.release summary { font: 600 18px var(--display); }
.release small, .prose h2 small { color: var(--muted); font: 400 14px system-ui, sans-serif; margin-left: 6px; }
.prose img { border-radius: 10px; border: 1px solid var(--line); }
.prose li { margin: 4px 0; }
.table { overflow-x: auto; margin: 16px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.edit { margin-top: 40px; font-size: 14px; }
.toc-mobile { display: none; }

/* A screenshot larger (site.js): swipe or the arrows for the others, down or
   Esc to close. */
.lightbox { padding: 0; border: 0; background: rgb(5 10 20 / 0.94); width: 100%; height: 100%; max-width: none; max-height: none; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgb(5 10 20 / 0.92); }
:root:has(.lightbox[open]) { overflow: hidden; }
.lightbox figure { margin: 0; padding: 56px max(16px, env(safe-area-inset-right)) 72px max(16px, env(safe-area-inset-left)); text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); border-radius: 10px; }
.lightbox figcaption { color: #e8eef7; margin-top: 10px; font-size: 15px; }
.lightbox button { position: fixed; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #2a3854; background: rgb(8 16 29 / 0.8); color: #e8eef7; cursor: pointer; }
.lightbox-prev::before, .lightbox-next::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border: solid currentColor; border-width: 2px 2px 0 0; }
.lightbox-close { top: calc(12px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.lightbox-close::before, .lightbox-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.lightbox-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.lightbox-prev, .lightbox-next { top: calc(50% - 22px); }
.lightbox-prev { left: max(12px, env(safe-area-inset-left)); }
.lightbox-next { right: max(12px, env(safe-area-inset-right)); }
.lightbox-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.lightbox-next::before { transform: translate(-70%, -50%) rotate(45deg); }

/* Back to the top (site.js shows it far down a page). */
.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.to-top::before { content: ""; position: absolute; left: 16px; top: 18px; width: 10px; height: 10px; border: solid var(--text); border-width: 2px 0 0 2px; transform: rotate(45deg); }

/* Footer */
.footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px var(--gutter-r) calc(24px + env(safe-area-inset-bottom)) var(--gutter-l); color: var(--muted); font-size: 14px; }
.footer img { vertical-align: -4px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; margin-bottom: 16px; }
.footer-cols p { margin: 0 0 8px; }
.footer h2 { font: 600 13px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); margin: 0 0 8px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 4px 0; }
.fine { font-size: 13px; }

@media (max-width: 1100px) {
  .doc { grid-template-columns: 210px minmax(0, 1fr); }
  .toc { display: none; }
  /* The page's sections, folded before the first. */
  .toc-mobile { display: block; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .toc-mobile summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
  .toc-mobile ul { margin: 0; padding: 0 16px 10px 32px; }
  .toc-mobile li { margin: 0; }
  .toc-mobile a { display: block; padding: 8px 0; text-decoration: none; }
}
/* The header on two rows until its links, menus and name fit on one: up to
   1080px, for the longer languages (a phone in landscape, a small tablet). */
@media (max-width: 1080px) {
  .top { flex-wrap: wrap; gap: 10px 16px; }
  /* The links on a row of their own, Try first; GitHub is in the footer. */
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 14px; scrollbar-width: none; font-size: 15px;
         margin: -6px 0 -10px; }
  /* The edge fades only while there is more to scroll to (site.js). */
  .nav.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
              mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
  /* Fingers, not a pointer: 44px to touch. */
  .nav a { padding: 10px 0; }
  .nav .nav-try { order: -1; font-weight: 600; }
  .nav .nav-gh { display: none; }
  .settings { margin-left: auto; gap: 6px; }
  /* The menus a short face (the language's code, the theme's icon), the
     select over it, unseen, opening the system's list. 16px: iOS zooms
     into a smaller field when it is touched. */
  .picker-face { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; height: 40px; padding: 0 10px;
                 border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 600 14px system-ui, sans-serif; }
  .picker-face::before { content: ""; width: 18px; height: 18px; background: currentColor;
                         -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
  .picker-lang .picker-face { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18'/%3E%3C/svg%3E"); }
  .picker-theme .picker-face { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M12 3a9 9 0 0 1 0 18z'/%3E%3C/svg%3E"); }
  :root[data-theme-choice="light"] .picker-theme .picker-face { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E"); }
  :root[data-theme-choice="dark"] .picker-theme .picker-face { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E"); }
  .picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
  .picker:focus-within .picker-face { outline: 3px solid var(--accent); outline-offset: 2px; }
  .doc-search input { font-size: 16px; padding: 10px 12px; }
  .doc-nav { top: 104px; max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); }
}
@media (max-width: 860px) {
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  /* A screen's text is small here: a magnifier says it opens larger. */
  .gallery a::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgb(8 16 29 / 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8eef7' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 18px no-repeat;
  }
  /* Where one is in the screens (site.js). */
  .gallery-dots[hidden] { display: none; }
  .gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
  .gallery-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
  .gallery-dots span.on { background: var(--accent); transform: scale(1.25); }
  .columns { grid-template-columns: 1fr; }
  /* The hero: the title, then the tour, then the rest, the buttons a
     finger's width. */
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding-top: 32px; padding-bottom: 40px; }
  .hero-text { display: contents; }
  .hero-video { order: 1; margin: 6px 0 22px; }
  .hero-text > p:not(.wordmark, .sub), .actions, .hero .source { order: 2; }
  .hero .sub { margin-bottom: 0; }
  .hero-text > p:not(.wordmark, .sub) { margin-top: 0; }
  .actions { margin-top: 6px; }
  .actions .button { flex: 1 1 100%; text-align: center; }
  .hero .source a, .footer a { display: inline-block; padding: 10px 0; }
  .footer-inner p { margin: 6px 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .footer-cols > :first-child { grid-column: 1 / -1; }
  .footer li { margin: 0; }
  .wordmark { display: none; }
  /* The search's results over the page, not pushing it down. */
  .doc-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 6; background: var(--surface); border: 1px solid var(--line);
                 border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow: auto; }
  .doc-results a { padding: 10px; }
  .compare th, .compare td { padding: 12px 10px; }
  .compare thead th, .compare td.yes, .compare td.no { width: 24%; }
  .compare thead th { font-size: 14px; }
  /* The lightbox's arrows under the screenshot, beside its name. */
  .lightbox-prev, .lightbox-next { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); }
  /* The features: each one's icon beside its title. */
  .cards { gap: 12px; }
  .card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; padding: 16px; }
  .card .icon { grid-row: span 2; }
  .card h3 { margin: 0 0 4px; }
  .band { flex-direction: column; align-items: flex-start; margin: 56px var(--gutter-r) 0 var(--gutter-l); padding: 24px 20px; }
  .band .button { align-self: stretch; text-align: center; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  /* The documentation's pages at the top, in a row to scroll. */
  .doc { gap: 20px; padding-top: 16px; }
  .doc-nav { position: static; max-height: none; overflow: visible; }
  .doc-nav .doc-list { position: relative; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .doc-nav .doc-group, .doc-nav .doc-group ul { display: contents; }
  .doc-nav .doc-group h3 { display: none; }
  .doc-nav .doc-group li a { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .top, .gallery-dots span, .faq summary::after, .release summary::after { transition: none; }
}
@media (max-width: 600px) {
  .shots { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
/* Printed (the troubleshooting's steps, a page to keep): the text alone,
   every folded part open, the links' addresses after them. */
@media print {
  .top, .footer, .doc-nav, .toc, .toc-mobile, .pager, .edit, .to-top, .lightbox, .copy, .anchor, .video-toggle, .video-sound,
  .gallery-dots, .doc-search, .skip, .compat-check { display: none !important; }
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .doc { display: block; padding: 0; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #333; word-break: break-all; }
  .prose h2, .prose h3 { break-after: avoid; }
  .prose pre, .prose table, .shots figure, .callout { break-inside: avoid; }
  .card, .compare table { box-shadow: none; }
}
