/* Layout: a sticky chapter rail beside one reading column; screenshots sit in framed figures with numbered pins that match the list beside or below them. Prints as a clean A4 booklet. */
:root {
  --paper: #f4f6fa;
  --surface: #ffffff;
  --raised: #eef2f8;
  --ink: #0e1626;
  --muted: #4f5c73;
  --subtle: #7d889c;
  --line: #dde3ec;
  --accent: #1f6bff;
  --cyan: #0b8fb5;
  --profit: #0a8f60;
  --warn: #a8670d;
  --loss: #c8323f;
  --tint: rgba(31, 107, 255, 0.07);
  --shadow: 0 1px 2px rgba(14, 22, 38, 0.06), 0 12px 32px -16px rgba(14, 22, 38, 0.22);
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --rail: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #070b13; --surface: #0e1421; --raised: #141c2c; --ink: #e7ecf4; --muted: #a2adc1; --subtle: #6f7b93; --line: #1e2738;
    --accent: #4d8dff; --cyan: #3fc6e6; --profit: #3df08c; --warn: #f0b44c; --loss: #f45b69;
    --tint: rgba(77, 141, 255, 0.10); --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #070b13; --surface: #0e1421; --raised: #141c2c; --ink: #e7ecf4; --muted: #a2adc1; --subtle: #6f7b93; --line: #1e2738;
  --accent: #4d8dff; --cyan: #3fc6e6; --profit: #3df08c; --warn: #f0b44c; --loss: #f45b69;
  --tint: rgba(77, 141, 255, 0.10); --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16.5px/1.7 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; font-weight: 700; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.05rem); line-height: 1.2; font-weight: 600; }
h3 { font-size: 1.12rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; max-width: 66ch; }
strong { font-weight: 600; color: var(--ink); }
code, .key { font-family: var(--mono); font-size: 0.86em; }
.key { display: inline-block; min-width: 1.8em; padding: 0.05em 0.45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); text-align: center; color: var(--ink); white-space: nowrap; }
.eyebrow { font: 600 0.74rem/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.muted { color: var(--muted); }

.topbar { padding-inline: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding-block: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1rem/1 var(--display); color: var(--ink); text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { font: 500 0.78rem/1 var(--body); color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .meta { font-size: 0.85rem; color: var(--muted); }
.download { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #ffffff; font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.download:hover { filter: brightness(1.08); }
.page { padding-inline: 16px; }
.layout { max-width: 1240px; margin: 0 auto; display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .layout { grid-template-columns: var(--rail) minmax(0, 1fr); } }

.rail { display: none; }
@media (min-width: 1080px) {
  .rail { display: block; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 24px); align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; padding-block: 40px 24px; }
  .contents-mobile { display: none; }
}
.rail-title { font: 600 0.74rem/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); margin-bottom: 12px; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: grid; grid-template-columns: 1.8em minmax(0, 1fr); gap: 4px; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.9rem; line-height: 1.35; }
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font: 500 0.75rem/1.8 var(--mono); color: var(--subtle); }
.toc a:hover { background: var(--raised); color: var(--ink); }
.toc a.active { background: var(--tint); color: var(--accent); }
.toc a.active::before { color: var(--accent); }
.toc a.intro::before { counter-increment: none; content: "★"; }
.contents-mobile { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.contents-mobile summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.contents-mobile summary::after { content: "+"; color: var(--muted); font-weight: 500; }
.contents-mobile[open] summary::after { content: "–"; }
.contents-mobile .toc { padding: 0 8px 12px; }

.hero { padding-block: 56px 32px; display: grid; gap: 28px; }
.hero-copy { display: grid; gap: 18px; }
.hero-copy p { font-size: 1.12rem; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.quick a:hover { border-color: var(--accent); color: var(--accent); }
.loop { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.loop-step { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; gap: 6px; }
.loop-step b { font: 600 1rem/1.2 var(--display); }
.loop-step span { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }

main { min-width: 0; }
.chapter { padding-block: 56px; border-top: 1px solid var(--line); display: grid; gap: 22px; }
.chapter > header { display: grid; gap: 10px; }
.chapter > header p { font-size: 1.06rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font: 600 0.72rem/1.4 var(--body); letter-spacing: 0.04em; white-space: nowrap; }
.tag.premium { background: rgba(240, 180, 76, 0.16); color: var(--warn); }
.tag.free { background: rgba(10, 143, 96, 0.12); color: var(--profit); }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.block { display: grid; gap: 14px; min-width: 0; }
ul.points { margin: 0; padding-left: 1.2em; display: grid; gap: 7px; max-width: 70ch; }
ul.points li::marker { color: var(--cyan); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; max-width: 72ch; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 12px; align-items: start; }
.steps > li::before { content: counter(step); width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--accent); font: 600 0.9rem/1 var(--display); }
.steps > li > div { padding-top: 3px; display: grid; gap: 2px; }

figure { margin: 0; display: grid; gap: 10px; min-width: 0; }
.frame { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0b0f19; box-shadow: var(--shadow); }
.frame img { display: block; width: 100%; height: auto; }
.frame button.zoom { all: unset; display: block; width: 100%; cursor: zoom-in; }
.frame button.zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.frame.browser::before { content: ""; display: block; height: 26px; border-bottom: 1px solid #222a3a; background-color: #151b28;
  background-image: radial-gradient(circle at 16px 13px, #f45b69 0 4px, transparent 4.5px), radial-gradient(circle at 32px 13px, #f0b44c 0 4px, transparent 4.5px), radial-gradient(circle at 48px 13px, #3df08c 0 4px, transparent 4.5px); }
figcaption { font-size: 0.88rem; color: var(--muted); line-height: 1.55; max-width: 80ch; }
.crop { overflow: hidden; display: flex; flex-direction: column; }
.crop button.zoom { flex: 1 1 auto; min-height: 0; }
.crop img { height: 100%; object-fit: cover; object-position: top; }
.pins { position: relative; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #ffd23f; color: #111827; font: 700 0.8rem/1 var(--display); box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.85), 0 4px 10px rgba(0, 0, 0, 0.45); pointer-events: none; }
@media (max-width: 560px) { .pin { width: 20px; height: 20px; font-size: 0.68rem; box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.85); } }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: pin; }
.legend li { counter-increment: pin; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.97rem; }
.legend li::before { content: counter(pin); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #ffd23f; color: #111827; font: 700 0.8rem/1 var(--display); }
.legend li span { padding-top: 2px; }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .split.narrow-shot { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
}
.pair { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

.note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--raised); max-width: 78ch; font-size: 0.96rem; }
.note b.label { font: 700 0.72rem/1.9 var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); white-space: nowrap; }
.note.premium b.label { color: var(--warn); }

.tour { counter-reset: tour; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tour li { counter-increment: tour; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; gap: 6px; align-content: start; }
.tour li::before { content: "Step " counter(tour); font: 600 0.72rem/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.tour b { font: 600 1rem/1.3 var(--display); }
.tour span { font-size: 0.92rem; color: var(--muted); line-height: 1.5; }

.glossary { margin: 0; display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.glossary div { display: grid; gap: 4px 20px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.glossary div:last-child { border-bottom: 0; }
@media (min-width: 700px) { .glossary div { grid-template-columns: 190px minmax(0, 1fr); } }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 0.75rem/1.4 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); background: var(--raised); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yes { color: var(--profit); font-weight: 600; }
.no { color: var(--subtle); }

footer.end { padding-block: 40px 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; display: grid; gap: 8px; }

.viewer[hidden] { display: none; }
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(4, 7, 13, 0.9); display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); overflow: auto; }
.viewer img { max-width: min(1440px, 100%); height: auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.viewer button { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px; border: 0; border-radius: 999px; padding: 8px 14px; background: #ffffff; color: #0e1626; font: 600 0.88rem/1 var(--body); cursor: pointer; }

/* Printing and the PDF: a clean A4 booklet, one chapter per page. */
@page { size: A4; margin: 14mm 14mm 16mm; }
.video { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 22px; align-items: center; }
.video video { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--line); background: #0b0f19; box-shadow: var(--shadow); }
.video .print-only { display: none; }
@media (max-width: 560px) { .video { grid-template-columns: minmax(0, 1fr); } .video video { max-width: 280px; margin-inline: auto; } }
@media print {
  .video { display: block; }
  .video video { display: none; }
  .video .print-only { display: inline; }
  body { background: #ffffff; font-size: 10.5pt; line-height: 1.55; }
  .rail, .quick, .viewer, .download, .topbar .meta, .back { display: none !important; }
  .contents-mobile { display: block !important; break-before: page; border: 0; background: none; margin: 0; }
  .contents-mobile summary { padding: 0 0 6mm; font: 600 20pt/1.2 var(--display); }
  .contents-mobile summary::after, .contents-mobile[open] summary::after { content: none; }
  .contents-mobile .toc { columns: 2; column-gap: 10mm; padding: 0; display: block; }
  .contents-mobile .toc li { break-inside: avoid; }
  .contents-mobile .toc a { font-size: 11pt; padding: 5px 0; color: var(--ink); }
  .topbar { border: 0; padding: 0; }
  .page, .topbar { padding-inline: 0; }
  .layout { display: block; max-width: none; }
  .hero { padding-block: 10mm 0; break-after: page; }
  .chapter { padding-block: 0; border-top: 0; break-before: page; gap: 14px; }
  figure, .note, table, tr, .steps > li, .legend li, .tour li, .glossary div, .loop-step { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .frame { box-shadow: none; }
  .split, .split.narrow-shot { grid-template-columns: 44% minmax(0, 1fr); gap: 18px; }
  .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .split { align-items: start; }
  .tour { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glossary div { grid-template-columns: 42mm minmax(0, 1fr); }
  a { color: inherit; text-decoration: none; }
  footer.end { break-before: avoid; padding-block: 8mm 0; }
}

.back { font-size: 0.9rem; font-weight: 600; color: var(--ink); text-decoration: none; } .back:hover { color: var(--accent); }

.gs-1 { left:22.9% !important; top:3.1% !important; }

.gs-2 { left:1.7% !important; top:15.9% !important; }

.gs-3 { left:64% !important; top:16.7% !important; }

.gs-4 { left:75.4% !important; top:16.7% !important; }

.gs-5 { left:18.5% !important; top:21.4% !important; }

.gs-6 { left:18.5% !important; top:29.3% !important; }

.gs-7 { left:18.6% !important; top:43.9% !important; }

.gs-8 { aspect-ratio: 780 / 900 !important; }

.gs-9 { left:2.3% !important; top:6% !important; }

.gs-10 { left:2.3% !important; top:17.5% !important; }

.gs-11 { left:2.3% !important; top:25.9% !important; }

.gs-12 { left:2.3% !important; top:37.1% !important; }

.gs-13 { left:2.3% !important; top:48.7% !important; }

.gs-14 { left:2.3% !important; top:59.6% !important; }

.gs-15 { left:2.3% !important; top:70.1% !important; }

.gs-16 { left:2.3% !important; top:76% !important; }

.gs-17 { left:2.3% !important; top:79.1% !important; }

.gs-18 { left:87% !important; top:97.2% !important; }

.gs-19 { left:7.2% !important; top:15.2% !important; }

.gs-20 { left:7.2% !important; top:48.2% !important; }

.gs-21 { left:3.9% !important; top:52.6% !important; }

.gs-22 { left:30.7% !important; top:97.6% !important; }

.gs-23 { left:73.8% !important; top:97.6% !important; }

.gs-24 { aspect-ratio: 1440 / 520 !important; }

.gs-25 { left:2.5% !important; top:11.8% !important; }

.gs-26 { left:37% !important; top:20.2% !important; }

.gs-27 { left:67.4% !important; top:11.8% !important; }

.gs-28 { left:67.3% !important; top:49.6% !important; }

.gs-29 { left:67.3% !important; top:77.8% !important; }

.gs-30 { aspect-ratio: 1440 / 1100 !important; }

.gs-31 { aspect-ratio: 1440 / 1060 !important; }

.gs-32 { left:3.1% !important; top:6.8% !important; }

.gs-33 { left:3.1% !important; top:15.1% !important; }

.gs-34 { left:3.1% !important; top:27.3% !important; }

.gs-35 { left:3.1% !important; top:44.8% !important; }

.gs-36 { left:3.1% !important; top:61.3% !important; }

.gs-37 { left:3.1% !important; top:82% !important; }

.gs-38 { left:3.1% !important; top:93% !important; }

.gs-39 { max-width: 384px !important; }
