/* /booth-guide/ (lib/booth-guide-page.mjs).
 *
 * Styled after the restream booth rather than the rest of the site: it is the
 * booth's own manual, and a newcomer should recognise what they read here when
 * they open the booth. Urbanist at the booth's weights (600, 700, 800; 500 for
 * running text, which the booth has little of), the booth's panel and control
 * tokens for the dark theme, and a light counterpart of the same palette. The
 * amber number badges match the callouts drawn on the screenshots. */

@font-face {
  font-family: "Urbanist";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/urbanist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-head: #e4eaf4;
  --line: #cdd6e5;
  --dialog-line: #93a4c4;
  --control: #e7edf7;
  --control-line: #a7b6d2;
  --text: #0f172a;
  --muted: #475569;
  --heading: #0b1220;
  --pressed: #1d4ed8;
  --pressed-text: #ffffff;
  --link: #1d4ed8;
  --pill: #f1f4fa;
  --amber: #9a5b00;
  --badge: #ffb627;
  --badge-ink: #1a1305;
  --onair: #b91c1c;
  --ok: #047857;
  --note-bg: #fff6dc;
  --note-line: #e2b54d;
  --shot-frame: #070b14;
  --code-bg: #e4eaf4;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14;
    --panel: #131d31;
    --panel-head: #1b2742;
    --line: #2c3a58;
    --dialog-line: #4b5f8a;
    --control: #1f2c48;
    --control-line: #42557d;
    --text: #f1f5f9;
    --muted: #9aa8bf;
    --heading: #ffffff;
    --pressed: #1d4ed8;
    --pressed-text: #ffffff;
    --link: #93c5fd;
    --pill: #0f1a2b;
    --amber: #fbbf24;
    --badge: #ffb627;
    --badge-ink: #1a1305;
    --onair: #f87171;
    --ok: #34d399;
    --note-bg: #231b0b;
    --note-line: #8a6a1d;
    --shot-frame: #070b14;
    --code-bg: #0b111d;
    --shadow: 0 8px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b14;
  --panel: #131d31;
  --panel-head: #1b2742;
  --line: #2c3a58;
  --dialog-line: #4b5f8a;
  --control: #1f2c48;
  --control-line: #42557d;
  --text: #f1f5f9;
  --muted: #9aa8bf;
  --heading: #ffffff;
  --pressed: #1d4ed8;
  --pressed-text: #ffffff;
  --link: #93c5fd;
  --pill: #0f1a2b;
  --amber: #fbbf24;
  --badge: #ffb627;
  --badge-ink: #1a1305;
  --onair: #f87171;
  --ok: #34d399;
  --note-bg: #231b0b;
  --note-line: #8a6a1d;
  --shot-frame: #070b14;
  --code-bg: #0b111d;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Urbanist", system-ui, sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
}
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 64px;
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { font-family: "Urbanist", system-ui, sans-serif; color: var(--heading); line-height: 1.15; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 6vw, 2.9rem); font-weight: 800; margin: .1em 0 .2em; }
h2 { font-size: clamp(1.55rem, 4.4vw, 2.1rem); font-weight: 800; margin: 0 0 .5em; }
h2:focus { outline: none; }
h2:focus-visible { outline: 3px solid var(--badge); outline-offset: 4px; border-radius: 4px; }
h3 { font-size: 1.22rem; font-weight: 800; margin: 1.6em 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; font-weight: 600; }
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--badge); outline-offset: 2px; border-radius: 6px; }
strong, b { color: var(--heading); font-weight: 800; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: .3em 0; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; background: var(--code-bg); border: 1px solid var(--line); padding: .05em .35em; border-radius: 6px; }
kbd {
  font: 700 .82em "Urbanist", system-ui, sans-serif; color: var(--heading);
  background: var(--control); border: 1px solid var(--control-line); border-bottom-width: 2px;
  border-radius: 6px; padding: .05em .45em; white-space: nowrap;
}

/* Hero */
.hero { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.home-link { display: inline-block; font-size: .92rem; font-weight: 700; text-decoration: none; color: var(--muted); margin-bottom: 10px; }
.home-link:hover { color: var(--link); }
.kicker { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin: 0; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 44em; margin: 0; }

/* Index: a booth panel. */
.layout { display: block; }
.index-mobile {
  display: none; margin: 0 0 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.index-mobile > summary {
  cursor: pointer; list-style: none; padding: 10px 14px; font-weight: 800; color: var(--heading);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--control); border-bottom: 1px solid transparent; border-radius: 11px;
}
.index-mobile[open] > summary { border-bottom-color: var(--line); border-radius: 11px 11px 0 0; }
.index-mobile > summary::-webkit-details-marker { display: none; }
.index-mobile > summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); font-weight: 700; }
.index-mobile[open] > summary::after { content: "\2212"; }
.index-mobile .now { font-weight: 600; color: var(--muted); font-size: .92rem; margin-left: auto; text-align: right; }
.index-mobile .index-list { padding: 8px 10px 12px; }

.index-side { margin-bottom: 24px; }
.js .index-side { display: none; }
.js .index-mobile { display: block; }

.index-list h2 {
  font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 14px 0 4px; padding-left: 10px;
}
.index-list h2:first-child { margin-top: 4px; }
.index-list ol { list-style: none; padding: 0; margin: 0; }
.index-list li { margin: 1px 0; }
.index-list a {
  display: block; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--text);
  border: 1px solid transparent; font-size: .95rem; font-weight: 600; line-height: 1.35;
}
.index-list a:hover { background: var(--control); border-color: var(--control-line); }
.index-list a[aria-current="true"] { background: var(--pressed); border-color: var(--pressed); color: var(--pressed-text); font-weight: 800; }

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: start; }
  .js .index-side, .index-side {
    display: block; position: sticky; top: env(safe-area-inset-top, 0px);
    max-height: 100vh; overflow-y: auto; margin: 0;
    padding: 10px 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  }
  .js .index-mobile { display: none; }
}

main { min-width: 0; }
main > section { padding-top: 4px; padding-bottom: 8px; scroll-margin-top: 16px; }
.no-js main > section + section { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 32px; }
.part { font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin: 0 0 8px; }

.start-here { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; }
.start-here p:last-child { margin-bottom: 0; }

/* Previous / Next: booth controls. */
.pager { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager-where { color: var(--muted); font-size: .9rem; font-weight: 600; margin: 0 0 10px; }
.pager-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager-links a {
  display: block; padding: 9px 14px; background: var(--control); border: 1px solid var(--control-line); border-radius: 8px;
  text-decoration: none; color: var(--heading); font-weight: 800; line-height: 1.3;
}
.pager-links a span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.pager-links a:hover { border-color: var(--dialog-line); }
.pager-links .next { text-align: right; grid-column: 2; }

/* Figures */
figure { margin: 18px 0 24px; }
figure img {
  display: block; max-width: 100%; height: auto; border-radius: 12px;
  background: var(--shot-frame); border: 1px solid var(--line); box-shadow: var(--shadow);
}
figure.narrow img { max-width: min(100%, 460px); }
figure.tiny img { max-width: min(100%, 320px); }
figcaption { font-size: .92rem; color: var(--muted); margin-top: 8px; }
figcaption b { color: var(--text); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.pair figure { margin: 0; }

/* Lower-thirds walkthrough: readable labels, including on a narrow phone. */
.lower-thirds-location { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; font-size: .9rem; }
.lower-thirds-location > span { color: var(--muted); }
.lower-thirds-location > div { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 10px; background: var(--panel-head); border: 1px solid var(--line); }
.lower-thirds-location > div > * { padding: 5px 12px; }
.lower-thirds-location strong { background: var(--pressed); color: #fff; border-radius: 6px; }
.lower-thirds-closeup { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: center; }
.lower-thirds-closeup img { width: 100%; }
.lower-thirds-callouts { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.lower-thirds-callouts li { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: .94rem; }
.lower-thirds-callouts .n { flex: none; }
.lower-thirds-timing-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lower-thirds-timing-head > span { color: var(--muted); font-size: .9rem; }
.lower-thirds-timeline { display: grid; grid-template-columns: 2.5fr repeat(5, 1fr); gap: 4px; padding: 0; margin: 0; list-style: none; }
.lower-thirds-timeline li { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; margin: 0; padding: 12px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: .8rem; line-height: 1.3; }
.lower-thirds-timeline strong { font-size: .94rem; color: inherit; }
.lower-thirds-timeline .lt-time { font-weight: 800; white-space: nowrap; }
.lower-thirds-timeline .lt-intro { background: var(--panel-head); }
.lower-thirds-timeline .lt-gap { background: var(--panel); border-style: dashed; color: var(--muted); }
.lower-thirds-timeline .lt-twitch { background: #5832a0; color: #fff; border-color: #7954be; }
.lower-thirds-timeline .lt-youtube { background: #a42132; color: #fff; border-color: #c14757; }
.lower-thirds-timeline .lt-web { background: #14664b; color: #fff; border-color: #2d8b6c; }
.lower-thirds-settings-flow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0; }
.lower-thirds-settings-flow li { position: relative; display: grid; justify-items: start; align-content: start; gap: 8px; margin: 0; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.lower-thirds-settings-flow li > span:last-child { color: var(--muted); font-size: .9rem; }
.lower-thirds-settings-flow li + li::before { content: "→"; position: absolute; left: -18px; top: 50%; color: var(--muted); transform: translateY(-50%); }
@media (max-width: 1100px) {
  .lower-thirds-closeup { grid-template-columns: 1fr; }
  .lower-thirds-closeup img { max-width: 380px; }
  .lower-thirds-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .lower-thirds-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lower-thirds-timeline li { padding: 12px; }
  .lower-thirds-settings-flow ol { grid-template-columns: 1fr; }
  .lower-thirds-settings-flow li + li::before { content: "↓"; left: 24px; top: -12px; }
}

/* The amber number badges, as drawn on the screenshots. */
.n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.55em; height: 1.55em; padding: 0 .3em;
  border-radius: 1em; background: var(--badge); color: var(--badge-ink); font-weight: 800; font-size: .8em;
  vertical-align: .12em; line-height: 1; box-shadow: 0 0 0 1.5px var(--badge-ink) inset;
}

.note { border: 1px solid var(--note-line); background: var(--note-bg); border-radius: 12px; padding: 12px 16px; margin: 16px 0 20px; }
.note p:last-child { margin-bottom: 0; }
.note > strong:first-child { display: block; margin-bottom: 2px; }

/* Tables: booth panels, with the panel head for their header row. */
.table-wrap { overflow-x: auto; margin: 14px 0 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
thead th { background: var(--panel-head); font-weight: 800; color: var(--heading); font-size: .92rem; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
td.what { min-width: 150px; }
.dash { color: var(--muted); }

/* Cards: booth panels; the tags are booth pills. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 0 14px; box-shadow: var(--shadow); overflow: hidden; }
.card h3 {
  margin: 0 0 10px; padding: 10px 14px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel-head); border-bottom: 1px solid var(--line);
}
.card > :not(h3) { margin-left: 14px; margin-right: 14px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.tag { font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--pill); }
.tag.skip { color: var(--ok); border-color: currentColor; background: transparent; }
.tag.careful { color: var(--onair); border-color: currentColor; background: transparent; }

.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; padding: 0; list-style: none; margin: 10px 0 18px; }
.legend li { margin: 0; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.legend svg {
  flex: none; width: 34px; height: 30px; padding: 4px 6px; border-radius: 8px;
  background: var(--pressed); border: 1px solid var(--pressed);
  stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Questions: booth panels too. */
details.q { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; box-shadow: var(--shadow); }
details.q summary { cursor: pointer; padding: 12px 16px; font-weight: 800; color: var(--heading); list-style: none; position: relative; padding-right: 40px; border-radius: 11px; }
details.q[open] summary { background: var(--panel-head); border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; margin-bottom: 10px; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; position: absolute; right: 16px; top: 9px; font-size: 1.3rem; color: var(--muted); font-weight: 700; }
details.q[open] summary::after { content: "\2212"; }
details.q > div { padding: 0 16px 10px; }

footer.end { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .pager-links { grid-template-columns: 1fr; }
  .pager-links .next { grid-column: auto; }
}
