/* =========================================================
   Branding guide — shared styles (blog/branding/*)
   Dark is the default. Light only via :root[data-theme="light"].
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --paper: #161615;
  --raise: #1d1c1b;
  --ink: #efede8;
  --muted: #a5a29b;
  --line: #34322f;
  --soft: #1f1e1d;
  --fill: #2a2927;
  --accent: #f5b800;
  --accent-ink: #f5b800;          /* accent used AS text: must stay readable */
  --accent-soft: #33290b;
  --on-accent: #141414;
  --warn: #ff6b6f;
  --warn-soft: #3a1c1e;
  --ok: #4fd18b;
  --ok-soft: #13301f;
  --mark: #f5b800;
  --on-mark: #141414;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --r: 14px;
  --r-sm: 8px;
  --nav-w: 272px;
  --read: 760px;
  --display: "Karantina", "IBM Plex Sans Hebrew", sans-serif;
  --text: "IBM Plex Sans Hebrew", "Assistant", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9e6df;
  --paper: #fbfaf7;
  --raise: #ffffff;
  --ink: #161616;
  --muted: #5d5b57;
  --line: #d6d2c8;
  --soft: #f2efe8;
  --fill: #e6e2d9;
  --accent: #f5b800;
  --accent-ink: #8a6400;
  --accent-soft: #fbefc8;
  --on-accent: #141414;
  --warn: #c4262d;
  --warn-soft: #fbe6e7;
  --ok: #12804a;
  --ok-soft: #dff3e8;
  --mark: #ffd84d;
  --on-mark: #141414;
  --shadow: 0 20px 50px rgba(40,30,10,.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 18px/1.75 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--mono); font-size: .9em; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.g-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.g-top a { color: var(--ink); text-decoration: none; }
.g-back { font-weight: 500; white-space: nowrap; color: var(--muted) !important; }
.g-back:hover { color: var(--ink) !important; }
.g-title { font: 700 30px/1.05 var(--display); white-space: nowrap; letter-spacing: normal; padding-top: 4px; }
.g-title b { color: var(--accent-ink); font-weight: 700; }
.g-top .spacer { flex: 1; }
.g-iconbtn {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 17px; line-height: 1;
}
.g-iconbtn:hover { border-color: var(--muted); }
.g-iconbtn svg { width: 18px; height: 18px; }
.g-menu-btn { display: none; }
.g-progress { position: fixed; top: 63px; inset-inline: 0; height: 2px; z-index: 41; pointer-events: none; }
.g-progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: right center; transform: scaleX(0); }

/* ---------- search ---------- */
.g-search { position: relative; width: min(420px, 42vw); }
.g-search input {
  width: 100%; height: 40px; padding: 0 40px 0 64px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: 400 15px var(--text);
}
.g-search input::placeholder { color: var(--muted); }
.g-search input:focus { outline: none; border-color: var(--accent); }
.g-search .ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.g-search kbd { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; direction: ltr; }
.g-results {
  position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 60;
  max-height: min(70vh, 560px); overflow: auto;
  background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 6px; display: none;
}
.g-results.open { display: block; }
.g-results .hint { padding: 12px 14px; color: var(--muted); font-size: 14px; }
.g-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.g-results a:hover, .g-results a.on { background: var(--soft); }
.g-results .r-ch { font: 500 12px var(--text); color: var(--muted); display: block; }
.g-results .r-t { font-weight: 600; display: block; line-height: 1.4; }
.g-results .r-s { font-size: 14px; color: var(--muted); display: block; line-height: 1.55; margin-top: 2px; }
.g-results mark, .hit { background: var(--mark); color: var(--on-mark); border-radius: 3px; padding: 0 2px; }
.hit.now { outline: 2px solid var(--ink); }

.g-findbar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: none; align-items: center; gap: 8px;
  background: var(--raise); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  padding: 6px 8px 6px 14px; font-size: 14px; white-space: nowrap;
}
.g-findbar.open { display: flex; }
.g-findbar b { color: var(--accent-ink); }
.g-findbar button { border: 0; background: var(--soft); color: var(--ink); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.g-findbar button:hover { background: var(--fill); }

/* ---------- shell ---------- */
.g-shell {
  display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px);
}
.g-nav { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow: auto; padding: 28px 0 40px; scrollbar-width: thin; }
.g-nav h2 { font: 500 12px var(--text); letter-spacing: .02em; color: var(--muted); margin: 0 0 10px; }
.g-nav ol { list-style: none; margin: 0; padding: 0; }
.g-nav > ol > li { margin: 1px 0; }
.g-nav a { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.4; }
.g-nav a:hover { color: var(--ink); background: var(--soft); }
.g-nav a .n { font: 500 12px var(--mono); color: var(--muted); min-width: 20px; }
.g-nav li.cur > a { color: var(--ink); background: var(--soft); font-weight: 600; }
.g-nav li.cur > a .n { color: var(--accent-ink); }
.g-nav .subs { margin: 2px 0 8px; padding-inline-start: 30px; border-inline-start: 1px solid var(--line); margin-inline-start: 19px; }
.g-nav .subs a { font-size: 14px; padding: 5px 10px; }
.g-nav .subs a { transition: color .25s; }
/* the section in view: its name in the chapter colour, and the line beside the topics fills in that colour
   down to where the reader is (guide.js sets --fill in px as they scroll) */
.g-nav .subs { position: relative; }
.g-nav .subs::before { content: ""; position: absolute; inset-inline-start: -2px; top: 0; width: 3px; height: var(--fill, 0px); border-radius: 3px; background: var(--c, var(--accent)); transition: height .12s linear; }
.g-nav .subs a.on { color: var(--c, var(--accent)); font-weight: 600; }
:root[data-theme="light"] .g-nav .subs::before { background: var(--ci, var(--accent)); }
:root[data-theme="light"] .g-nav .subs a.on { color: var(--ci, var(--accent)); }
.g-nav .home a { margin-bottom: 10px; }

.g-main { min-width: 0; padding: 40px 0 80px; }
.g-main > * { max-width: var(--read); }
.g-main > .full, .g-main > .wide { max-width: none; }

/* ---------- chapter head ---------- */
.ch-head { padding: 24px 0 36px; border-bottom: 1px solid var(--line); margin-bottom: 40px; max-width: none !important; }
.ch-num { font: 500 14px var(--mono); color: var(--accent-ink); letter-spacing: .08em; direction: ltr; text-align: right; }
.ch-head h1 { font: 700 clamp(64px, 10vw, 128px)/1.05 var(--display); margin: 6px 0 14px; letter-spacing: normal; }
.ch-head .lede { font-size: clamp(19px, 2vw, 22px); line-height: 1.6; color: var(--ink); max-width: var(--read); margin: 0; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- text ---------- */
.sec { padding-top: 8px; margin-bottom: 64px; }
h2 { font: 700 clamp(40px, 5vw, 56px)/1.05 var(--display); margin: 0 0 18px; letter-spacing: normal; scroll-margin-top: 84px; }
h3 { font: 600 22px/1.35 var(--text); margin: 36px 0 10px; scroll-margin-top: 84px; }
h4 { font: 600 18px/1.4 var(--text); margin: 24px 0 6px; color: var(--ink); }
p { margin: 0 0 16px; }
strong, b { font-weight: 600; color: var(--ink); }
.muted { color: var(--muted); }
.lead { font-size: 20px; line-height: 1.65; }
.hl { background: var(--accent); color: var(--on-accent); padding: 0 4px; border-radius: 3px; }
ul, ol { margin: 0 0 18px; padding-inline-start: 22px; }
li { margin: 4px 0; }
ul.dots { list-style: none; padding: 0; }
ul.dots > li { position: relative; padding-inline-start: 22px; }
ul.dots > li::before { content: ""; position: absolute; right: 2px; top: .72em; width: 7px; height: 7px; background: var(--accent); border-radius: 2px; }
ol.steps { list-style: none; padding: 0; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding-inline-start: 48px; margin: 14px 0; }
ol.steps > li::before { content: counter(s); position: absolute; right: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font: 500 14px var(--mono); color: var(--accent-ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
blockquote, .quote { margin: 24px 0; padding: 4px 22px 4px 0; border-inline-start: 3px solid var(--accent); font-size: 21px; line-height: 1.6; }

/* boxes */
.note, .warn, .tip, .ok-box { padding: 16px 20px; border-radius: var(--r-sm); margin: 22px 0; }
.note { background: var(--soft); border: 1px solid var(--line); }
.tip { background: var(--accent-soft); border-inline-start: 4px solid var(--accent); }
.warn { background: var(--warn-soft); border-inline-start: 4px solid var(--warn); }
.ok-box { background: var(--ok-soft); border-inline-start: 4px solid var(--ok); }
.tip > :last-child, .warn > :last-child, .note > :last-child, .ok-box > :last-child { margin-bottom: 0; }
.box-label { display: block; font: 600 13px var(--text); letter-spacing: .02em; margin-bottom: 4px; }
.tip .box-label { color: var(--accent-ink); }
.warn .box-label { color: var(--warn); }
.ok-box .box-label { color: var(--ok); }

/* cross reference */
.xref {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 500; text-decoration: none;
  padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  white-space: nowrap;
}
.xref::before { content: "←"; color: var(--accent-ink); order: 2; }
.xref:hover { border-color: var(--accent); }

/* cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); margin: 22px 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; }
.card h4 { margin-top: 0; }
.card p { font-size: 16px; line-height: 1.6; margin-bottom: 0; color: var(--muted); }
.card .k { font: 500 12px var(--mono); color: var(--accent-ink); display: block; margin-bottom: 6px; direction: ltr; text-align: right; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.55; }
.tbl th, .tbl td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 600; background: var(--soft); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 600; }

/* figures & galleries */
figure { margin: 28px 0; }
.fig img { display: block; width: 100%; border-radius: var(--r); background: var(--soft); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); margin: 24px 0 8px; }
.gallery.g2 { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.gallery a { display: block; border-radius: var(--r-sm); overflow: hidden; background: var(--soft); aspect-ratio: 4/5; }
.gallery.natural a { aspect-ratio: auto; }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gallery.natural img { height: auto; }
.gallery a:hover img { transform: scale(1.04); }
.gallery + figcaption { margin-top: 0; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.88); display: none; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1400px, 100%); max-height: 88vh; border-radius: 10px; }
.lightbox p { color: #ddd; text-align: center; font-size: 14px; margin: 12px 0 0; }

/* ---------- animation figures ---------- */
.anim {
  position: relative; margin: 32px 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(16px, 3vw, 28px);
}
.anim__stage { position: relative; min-height: 120px; }
.anim figcaption { margin-top: 16px; }
.anim__label { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--text); color: var(--muted); margin-bottom: 14px; }
.anim__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.anim__replay {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--raise); color: var(--ink);
  font: 500 13px var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.anim.is-done .anim__replay, .anim.is-static .anim__replay { opacity: 1; pointer-events: auto; }
.anim__replay:hover { border-color: var(--accent); }
/* Animations are written as: .anim.is-playing .thing { animation: name 1s ease forwards; }
   Before playing, elements show their START state; with reduced motion the page adds .is-static and
   page CSS should show the END state under .anim.is-static. */

/* steppers: click-through infographics (guide.js builds the bar) */
.anim.is-stepper:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.stepper { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.stepper__list { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.stepper__btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--soft); color: var(--muted);
  font: 500 14px var(--text); padding: 6px 12px 6px 8px; border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s;
}
.stepper__btn .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--mono); background: var(--fill); color: var(--ink); }
.stepper__btn:hover { border-color: var(--muted); color: var(--ink); }
.stepper__btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepper__btn.on .n { background: var(--on-accent); color: var(--accent); }
.stepper__nav { flex: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; border: 1px solid var(--line); background: var(--raise); color: var(--ink); font-size: 16px; }
.stepper__nav:hover:not(:disabled) { border-color: var(--accent); }
.stepper__nav:disabled { opacity: .35; cursor: default; }
[data-goto] { cursor: pointer; }
@media (max-width: 560px) { .stepper__btn .t { display: none; } .stepper__btn { padding: 4px; } }

/* widgets */
.widget { margin: 28px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 3vw, 28px); }
.widget label { font-size: 15px; color: var(--muted); }
input[type="range"] { accent-color: var(--accent); width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: 500 14px var(--text); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; padding: 0; list-style: none; }
.chips li, .chip { margin: 0; font-size: 15px; padding: 5px 14px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.chips.yes li { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.chips.no li { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); text-decoration: line-through; text-decoration-color: var(--warn); }

/* swatches */
.swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); margin: 20px 0; }
.sw { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.sw i { display: block; height: 84px; }
.sw div { padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.sw b { display: block; }
.sw code { font: 500 12px var(--mono); color: var(--muted); direction: ltr; unicode-bidi: isolate; display: block; text-align: right; }

/* links list */
.links { list-style: none; padding: 0; display: grid; gap: 10px; }
.links a { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); text-decoration: none; color: var(--ink); }
.links a:hover { border-color: var(--accent); }
.links small { display: block; color: var(--muted); font-size: 14px; }
.links .u { font: 400 12px var(--mono); color: var(--muted); direction: ltr; unicode-bidi: isolate; }

/* pager */
.ch-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); max-width: none !important; }
.ch-pager a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); text-decoration: none; color: var(--ink); }
.ch-pager a:hover { border-color: var(--accent); }
.ch-pager small { display: block; color: var(--muted); font-size: 13px; }
.ch-pager b { font: 700 32px/1.1 var(--display); display: block; margin-top: 4px; }
.ch-pager .next { text-align: left; }
.ch-pager .empty { visibility: hidden; }

.g-foot { border-top: 1px solid var(--line); padding: 28px 16px 48px; text-align: center; color: var(--muted); font-size: 14px; }
.g-foot a { color: var(--muted); }

/* review mode: ?review=1 outlines everything Claude added */
.review [data-added] { outline: 2px dashed #3fa9ff; outline-offset: 6px; border-radius: 6px; position: relative; }
.review [data-added]::after { content: "הרחבה"; position: absolute; top: -12px; left: 8px; background: #3fa9ff; color: #001; font: 600 11px var(--text); padding: 1px 8px; border-radius: 999px; }

/* ---------- hub ---------- */
.hub-hero { padding: 48px 0 28px; max-width: none !important; }
.hub-hero .kicker { font: 500 14px var(--text); color: var(--accent-ink); }
.hub-hero h1 { font: 700 clamp(84px, 15vw, 200px)/1.05 var(--display); margin: 4px 0 18px; letter-spacing: normal; }
.hub-hero h1 span { color: var(--accent-ink); }
.hub-hero p { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.6; max-width: 720px; }
.hub-search { max-width: 640px !important; margin: 26px 0 8px; }
.hub-search .g-search { width: 100%; }
.hub-search .g-search input { height: 56px; font-size: 17px; padding-right: 48px; }
.hub-search .g-search .ico { right: 18px; width: 18px; height: 18px; }
.hub-chapters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); margin: 40px 0; max-width: none !important; }
.hub-chapters a { position: relative; display: flex; flex-direction: column; min-height: 168px; padding: 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; overflow: hidden; transition: border-color .2s, transform .35s cubic-bezier(.2,.7,.2,1); }
.hub-chapters a:hover { border-color: var(--accent); transform: translateY(-3px); }
.hub-chapters .n { font: 500 13px var(--mono); color: var(--accent-ink); direction: ltr; text-align: right; }
.hub-chapters b { font: 700 40px/1.05 var(--display); margin: 8px 0 8px; }
.hub-chapters span.d { font-size: 15px; line-height: 1.55; color: var(--muted); margin-top: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .g-shell { grid-template-columns: minmax(0, 1fr); }
  .g-menu-btn { display: grid; }
  .g-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; height: 100vh;
    width: min(330px, 88vw); background: var(--raise); border-inline-start: 1px solid var(--line);
    padding: 20px 16px 40px; transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.7,.2,1);
    box-shadow: var(--shadow);
  }
  .g-nav.open { transform: none; }
  .g-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.5); display: none; }
  .g-scrim.open { display: block; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .g-top { gap: 8px; padding: 0 12px; }
  .g-back .lbl, .g-title { display: none; }
  .g-search { width: auto; flex: 1; }
  .g-search kbd { display: none; }
  .g-search input { padding-left: 14px; }
  .g-main { padding-top: 24px; }
  .ch-pager { grid-template-columns: 1fr; }
  .ch-pager b { font-size: 28px; }
  .anim__replay { top: 8px; left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
@media print {
  .g-top, .g-nav, .g-progress, .ch-pager, .g-findbar, .anim__replay { display: none !important; }
  .g-shell { display: block; }
  body { background: #fff; color: #111; }
}

/* =========================================================
   Chapter colours: every chapter has its own main + supporting colour.
   body[data-ch="NN"] swaps --accent (and friends) for the whole page.
   ========================================================= */
:root {
  --c-what: #FF6B57; --c-brands: #FF4D4D; --c-strategy: #9B7BFF; --c-color: #FF4FA3; --c-type: #33C6E8; --c-logo: #F5B800; --c-logodesign: #38B6FF; --c-visual: #A6E22E; --c-grid: #4C8DFF; --c-mockups: #FF8A2B; --c-digital: #2FD6A3; --c-rules: #FF5470; --c-presenting: #7C83FF; --c-checklist: #5BD16C; --c-resources: #FFA372;
  /* the same colours, dark enough to read as text on a light page */
  --i-what: #C2412E; --i-brands: #C21B1B; --i-strategy: #6A4BD6; --i-color: #C21F72; --i-type: #0E7FA0; --i-logo: #8A6400; --i-logodesign: #0B6FA8; --i-visual: #557A0B; --i-grid: #2259C9; --i-mockups: #B65310; --i-digital: #0F8A66; --i-rules: #C21F3E; --i-presenting: #4B52D6; --i-checklist: #23863A; --i-resources: #B85A26;
  --accent2: #9B7BFF; --accent2-ink: #9B7BFF;
}
body[data-ch="what"] { --accent: var(--c-what); --accent2: var(--c-strategy); --ai: var(--i-what); --a2i: var(--i-strategy); }
body[data-ch="brands"] { --accent: var(--c-brands); --accent2: var(--c-rules); --ai: var(--i-brands); --a2i: var(--i-rules); }
body[data-ch="strategy"] { --accent: var(--c-strategy); --accent2: var(--c-what); --ai: var(--i-strategy); --a2i: var(--i-what); }
body[data-ch="color"] { --accent: var(--c-color); --accent2: var(--c-type); --ai: var(--i-color); --a2i: var(--i-type); }
body[data-ch="type"] { --accent: var(--c-type); --accent2: var(--c-color); --ai: var(--i-type); --a2i: var(--i-color); }
body[data-ch="logo"] { --accent: var(--c-logo); --accent2: var(--c-what); --ai: var(--i-logo); --a2i: var(--i-what); }
body[data-ch="logodesign"] { --accent: var(--c-logodesign); --accent2: var(--c-logo); --ai: var(--i-logodesign); --a2i: var(--i-logo); }
body[data-ch="visual"] { --accent: var(--c-visual); --accent2: var(--c-type); --ai: var(--i-visual); --a2i: var(--i-type); }
body[data-ch="grid"] { --accent: var(--c-grid); --accent2: var(--c-logo); --ai: var(--i-grid); --a2i: var(--i-logo); }
body[data-ch="mockups"] { --accent: var(--c-mockups); --accent2: var(--c-digital); --ai: var(--i-mockups); --a2i: var(--i-digital); }
body[data-ch="digital"] { --accent: var(--c-digital); --accent2: var(--c-strategy); --ai: var(--i-digital); --a2i: var(--i-strategy); }
body[data-ch="rules"] { --accent: var(--c-rules); --accent2: var(--c-logo); --ai: var(--i-rules); --a2i: var(--i-logo); }
body[data-ch="presenting"] { --accent: var(--c-presenting); --accent2: var(--c-logo); --ai: var(--i-presenting); --a2i: var(--i-logo); }
body[data-ch="checklist"] { --accent: var(--c-checklist); --accent2: var(--c-strategy); --ai: var(--i-checklist); --a2i: var(--i-strategy); }
body[data-ch="resources"] { --accent: var(--c-resources); --accent2: var(--c-digital); --ai: var(--i-resources); --a2i: var(--i-digital); }
body[data-ch] {
  --accent-ink: var(--accent); --accent2-ink: var(--accent2);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--paper));
  --mark: var(--accent);
}
:root[data-theme="light"] body[data-ch] {
  --accent-ink: var(--ai); --accent2-ink: var(--a2i);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #ffffff);
}

/* more colour, everywhere */
body[data-ch] .ch-head { position: relative; isolation: isolate; }
body[data-ch] .ch-head::before {
  content: ""; position: absolute; z-index: -1; inset: -40px -30% auto auto; width: 70%; height: 340px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 60%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 70%);
  filter: blur(10px);
}
body[data-ch] .ch-head h1 { background: linear-gradient(90deg, var(--ink) 40%, var(--accent-ink)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
h2[id]::after { content: ""; display: block; width: 56px; height: 5px; border-radius: 3px; margin-top: 10px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
ul.dots > li:nth-child(even)::before { background: var(--accent2); }
ol.steps > li::before { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-ink); }
blockquote, .quote { border-inline-start-color: var(--accent2); }
.card { border-top: 3px solid color-mix(in srgb, var(--accent) 70%, var(--line)); }
.card:nth-child(even) { border-top-color: color-mix(in srgb, var(--accent2) 70%, var(--line)); }
.card:nth-child(even) .k { color: var(--accent2-ink); }
.anim__label::before { background: var(--accent2); }
.anim, .widget { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.note { border-color: color-mix(in srgb, var(--accent2) 35%, var(--line)); background: color-mix(in srgb, var(--accent2) 7%, var(--soft)); }
.xref { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* side nav, hub and pager: every chapter in its own colour */
.g-nav li[style] > a .n { color: var(--c); font-weight: 600; }
:root[data-theme="light"] .g-nav li[style] > a .n { color: var(--ci); }
.g-nav li.cur[style] > a { background: color-mix(in srgb, var(--c) 16%, var(--soft)); }
.hub-chapters a[style] { border-top: 4px solid var(--c); }
.hub-chapters a[style] .n, .hub-chapters a[style] .ic { color: var(--c); }
:root[data-theme="light"] .hub-chapters a[style] .n, :root[data-theme="light"] .hub-chapters a[style] .ic { color: var(--ci); }
.hub-chapters a[style]:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--paper)); }
.ch-pager a[style] small { color: var(--c); }
:root[data-theme="light"] .ch-pager a[style] small { color: var(--ci); }
.ch-pager a[style]:hover { border-color: var(--c); }

/* generated illustrations */
.illus { margin: 22px 0 30px; }
.illus img { display: block; width: 100%; height: auto; border-radius: var(--r); background: #151513; }
.illus.hero { margin: 0 0 8px; max-width: none !important; }
.illus.hero img { aspect-ratio: 21 / 9; object-fit: cover; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.illus figcaption { margin-top: 8px; }

/* =========================================================
   Step rail: vertical axis beside a step-by-step section (guide.js "rails")
   ========================================================= */
.g-main > section.sec.has-rail { max-width: calc(var(--read) + 236px); }
.rail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 204px; gap: 32px; align-items: start; }
.rail-body { min-width: 0; }
.rail { position: sticky; top: 88px; align-self: start; padding: 4px 0; }
.rail ol { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 2px; }
.rail__track { position: absolute; top: 18px; bottom: 18px; right: 17px; width: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.rail ol { z-index: 1; }
.rail__track i { display: block; width: 100%; height: 100%; background: linear-gradient(var(--accent), var(--accent2)); transform-origin: top center; transform: scaleY(0); }
.rail li { margin: 0; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.rail a .n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--mono); background: var(--paper); border: 2px solid var(--line); color: var(--muted); transition: background .25s, border-color .25s, color .25s, transform .25s; }
.rail a:hover { color: var(--ink); }
.rail a:hover .n { border-color: var(--accent); }
.rail a.past .n { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent-ink); }
.rail a.on { color: var(--ink); font-weight: 600; }
.rail a.on .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.08); }
@media (max-width: 1060px) {
  .rail-grid { display: flex; flex-direction: column-reverse; gap: 0; }
  .rail {
    position: sticky; top: 64px; z-index: 6; width: 100%;
    margin: 0 0 18px; padding: 8px 0; overflow-x: auto; scrollbar-width: none;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .rail::-webkit-scrollbar { display: none; }
  .rail ol { display: flex; gap: 6px; width: max-content; }
  .rail__track { display: none; }
  .rail a { padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); white-space: nowrap; font-size: 13px; }
  .rail a .n { width: 26px; height: 26px; font-size: 12px; border-width: 1px; }
  .rail a:not(.on) .t { display: none; }
  .rail a.on { border-color: var(--accent); }
  .g-main > section.sec.has-rail { max-width: var(--read); }
}
@media print { .rail { display: none; } .rail-grid { display: block; } }
/* rail: safety + long rails (many steps) */
section.has-rail .rail-body { width: 100%; }
.rail { max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
.rail.is-long ol { gap: 0; }
.rail.is-long a { padding: 2px 0; font-size: 13px; }
.rail.is-long a .n { width: 28px; height: 28px; font-size: 12px; }
.rail.is-long .rail__track { right: 13px; top: 14px; bottom: 14px; }
@media (max-width: 1060px) { .rail { max-height: none; overflow-y: visible; } }
/* readers who ask the system for less motion: step changes happen at once */
@media (prefers-reduced-motion: reduce) { .anim *, .anim *::before, .anim *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* search reveal: switch an infographic's step without its slide transition */
.anim.no-trans, .anim.no-trans * { transition: none !important; }
/* phone: a step's heading lands below the sticky step strip, not under it */
@media (max-width: 1060px) { section.has-rail [data-rail-step][id], section.has-rail .rail-body h3[id] { scroll-margin-top: 136px; } }

/* ---------- 07.11.2026: one top bar only ----------
   The guide's own bar (title, chapters button, search) is gone; the site's bar (assets/css/blog-nav.css)
   is the only one. The chapters button and the search now sit in its second row, so nothing is pinned
   above the page any more and everything that made room for the old 64px bar moves up. */
.g-progress { top: 0; }
.g-nav { top: 0; height: 100vh; }
[id], h2, h3 { scroll-margin-top: 20px; }
.rail { top: 24px; }
@media (max-width: 1060px) {
  .rail { top: 0; }
  section.has-rail [data-rail-step][id], section.has-rail .rail-body h3[id] { scroll-margin-top: 72px; }
}
/* inside the site bar, which is dark in both themes */
.bn .g-iconbtn { background: transparent; color: #f2efe9; border-color: rgba(242, 239, 233, 0.14); }
.bn .g-iconbtn:hover { border-color: #f2efe9; }
.bn .g-search input { background: rgba(242, 239, 233, 0.06); color: #f2efe9; border-color: rgba(242, 239, 233, 0.14); }
.bn .g-search input::placeholder, .bn .g-search .ico, .bn .g-search kbd { color: #a19d95; }
.bn .g-search kbd { border-color: rgba(242, 239, 233, 0.14); }
.bn .g-results { text-align: right; }
@media (max-width: 760px) {
  .bn .bn__sub:has(.g-search) { flex-wrap: wrap; }
  .bn .bn__sub:has(.g-search) .bn__acts { width: 100%; flex-wrap: nowrap; }
  .bn .g-search { flex: 1; width: auto; min-width: 0; }
}
