:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #16150f;
  --ink-soft: #55524a;
  --ink-faint: #63605a;
  --rule: #e5e1d8;
  --accent: #8a1c1c;
  --accent-soft: #f5ece9;
  --gold: #846921;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210;
    --surface: #1a1917;
    --ink: #ece8e0;
    --ink-soft: #a8a49b;
    --ink-faint: #96928b;
    --rule: #2e2c28;
    --accent: #d96a6a;
    --accent-soft: #241a1a;
    --gold: #c9a23f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* --- layered background: two soft brand glows + film grain --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -8%,  color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(52rem 38rem at 92% 8%,   color-mix(in srgb, var(--gold) 10%, transparent),   transparent 62%),
    radial-gradient(60rem 50rem at 50% 108%, color-mix(in srgb, var(--accent) 8%, transparent),  transparent 65%);
}
/* fine grain keeps the large flat areas from banding and reads as paper */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  body::after { opacity: 0.055; }
}

/* --- reading progress --- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  z-index: 50;
  transition: width .1s linear;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 2.75rem 1.5rem 8rem; position: relative; }

/* --- masthead: full-bleed sticky bar, content aligned to the reading column --- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
}
.masthead-in {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead .brand {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: none;
  transition: color .15s;
}
.masthead .brand:hover { color: var(--ink-soft); }

/* --- module menu --- */
.mod-nav { position: relative; }
.mod-btn {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.34rem 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mod-btn:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); border-color: var(--ink-faint); }
.mod-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mod-chev { transition: transform .2s ease; color: var(--ink-faint); }
.mod-btn[aria-expanded="true"] .mod-chev { transform: rotate(180deg); }

.mod-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(23rem, calc(100vw - 2rem));
  max-height: min(30rem, calc(100vh - 6rem));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0,0,0,.24), 0 2px 6px rgba(0,0,0,.1);
  padding: 0.7rem;
  z-index: 40;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}
.mod-menu.open { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Fail-safe: visibility keys off the [hidden] attribute, not only the .open
   class. If the class never lands (throttled rAF, JS timing), an open menu is
   still visible rather than a transparent, clickable ghost. */
.mod-menu:not([hidden]) { opacity: 1; }
.mod-menu[hidden] { display: none; }
.mod-menu-h {
  font-family: var(--sans); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  padding: 0.5rem 0.6rem 0.45rem;
}
.mod-list { list-style: none; margin: 0 0 0.2rem; padding: 0; }
.mod-list li { margin: 0; padding: 0; }
.mod-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border: none;
  border-radius: 5px;
  color: var(--ink);
  font-family: var(--sans);
  transition: background .12s;
}
a.mod-item:hover { background: var(--accent-soft); }
.mod-item.current { background: var(--accent-soft); }
.mod-item.current .mod-t { color: var(--accent); }
.mod-num {
  font-family: var(--mono); font-size: 0.64rem; color: var(--ink-faint);
  padding-top: 0.15rem; min-width: 1.2rem;
}
.mod-item.current .mod-num { color: var(--accent); }
.mod-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.mod-t { font-size: 0.78rem; font-weight: 600; line-height: 1.3; }
.mod-teaser { font-size: 0.68rem; color: var(--ink-faint); line-height: 1.35; }
.mod-item.pending { opacity: 0.5; cursor: default; }
.mod-badge {
  margin-left: auto; align-self: center;
  font-family: var(--sans); font-size: 0.55rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); border: 1px solid var(--rule);
  border-radius: 2px; padding: 0.08rem 0.32rem; white-space: nowrap;
}

/* --- prev / next --- */
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.pn {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--sans);
  color: var(--ink);
  transition: border-color .15s, transform .15s, background .15s;
}
a.pn:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--accent-soft); }
.pn-next { text-align: right; }
.pn-k { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.pn-t { font-size: 0.86rem; font-weight: 600; line-height: 1.35; }
.pn-note { font-size: 0.64rem; color: var(--ink-faint); }
.pn-soon { opacity: 0.55; }
.pn-empty { border: none; background: none; }
@media (max-width: 620px) {
  .prevnext { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .pn-empty { display: none; }
}
.masthead .status {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--gold);
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.05em;
}

/* --- headings --- */
h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 2.5rem;
  font-weight: 600;
  background: linear-gradient(170deg, var(--ink) 55%, color-mix(in srgb, var(--ink) 62%, var(--gold)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  line-height: 1.3;
  scroll-margin-top: 2rem;
  position: relative;
}
/* small brand tick above each section heading */
h2::before {
  content: "";
  position: absolute; top: -1px; left: 0;
  width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
h3 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin: 2.5rem 0 1rem;
}
p { margin: 0 0 1.35rem; }

/* lede */
h1 + p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
a:hover { border-bottom-color: var(--accent); }

strong { font-weight: 650; }

/* --- the money quote --- */
blockquote {
  margin: 2.5rem 0;
  padding: 1.6rem 1.85rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 1.08rem;
  position: relative;
  overflow: hidden;
}
blockquote::after {           /* faint gold wash to lift it off the page */
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(24rem 12rem at 100% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote strong { color: var(--accent); }

/* --- sticky TOC (wide screens only) --- */
/* Anchored to the reading column (right edge sits 1.5rem left of the 46rem
   wrap), never to the viewport edge, so it can't clip or collide. */
.toc {
  position: fixed;
  top: 50%;
  right: calc(50% + 24.5rem);
  transform: translateY(-50%);
  width: 11.5rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  z-index: 20;
  opacity: 0;
  transition: opacity .4s ease;
}
.toc.ready { opacity: 1; }
.toc-h {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 0.7rem; padding-left: 0.75rem;
}
.toc a {
  /* line-clamp needs -webkit-box; it ellipsises at the real line end rather
     than chopping mid-word the way a character-count truncation does. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0.34rem 0.4rem 0.34rem 0.75rem;
  border: none;
  border-left: 2px solid var(--rule);
  color: var(--ink-faint);
  line-height: 1.35;
  transition: color .15s, border-color .15s, padding-left .15s;
}
.toc a:hover { color: var(--ink-soft); border-left-color: var(--ink-faint); }
.toc a.active {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 600;
  padding-left: 0.95rem;
}
@media (max-width: 1400px) { .toc { display: none; } }

/* --- section reveal --- */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}

/* --- tables: these carry the argument --- */
.table-scroll { overflow-x: auto; margin: 2rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.86rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
th {
  text-align: left;
  font-weight: 650;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
/* numeric columns read better right-aligned + tabular */
td:not(:first-child), th:not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
td:first-child { color: var(--ink-soft); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3%, transparent); }

/* --- lists --- */
ul, ol { margin: 0 0 1.35rem; padding-left: 1.3rem; }
li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
li::marker { color: var(--ink-faint); }

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: 0.12em 0.38em;
  border-radius: 3px;
}
pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: inherit; }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* --- appendix --- */
h3#appendix-where-these-numbers-come-from ~ ul,
h3#appendix-where-these-numbers-come-from + p {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* --- index page --- */
.index-list { list-style: none; padding: 0; }
.index-list li {
  border-bottom: 1px solid var(--rule);
  padding: 0;
  margin: 0;
}
.index-list a, .index-list .ix-pending {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.05rem 0.6rem;
  border: none;
  color: var(--ink);
  transition: background 0.12s, padding-left 0.12s;
}
.index-list a:hover { background: var(--accent-soft); padding-left: 1rem; }
.index-list .ix-pending { opacity: 0.45; }
.ix-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ix-teaser { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-faint); line-height: 1.4; }
.index-lede { font-size: 1.12rem; color: var(--ink-soft); }
.index-meter {
  height: 3px; background: var(--rule); border-radius: 999px;
  overflow: hidden; margin: 2rem 0 0.6rem;
}
.index-meter-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 999px;
}
.index-meta {
  font-family: var(--sans); font-size: 0.7rem; color: var(--ink-faint);
  margin-bottom: 2.5rem;
}
.index-list .num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  min-width: 2rem;
  padding-top: 0.2rem;
}
.index-list .title { font-weight: 600; }
.index-list .pending { color: var(--ink-faint); font-weight: 400; }
.index-list .badge {
  margin-left: auto;
  align-self: center;
  font-family: var(--sans);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
}
.index-list .badge.done { color: var(--gold); border-color: currentColor; }

/* ============================================================
   DATA VISUALIZATION
   Palette validated via dataviz skill validate_palette.js:
   #c73e2f + #b08d2e -> lightness PASS / chroma PASS /
   CVD deutan dE 13.4 PASS (>=12) / contrast PASS, light AND dark.
   ============================================================ */
:root {
  --series-1: #c73e2f;   /* paid sales */
  --series-2: #b08d2e;   /* kindle unlimited */
  --grid: #e8e4db;
  --axis: #706c65;
}
@media (prefers-color-scheme: dark) {
  :root { --grid: #2b2926; --axis: #88847c; }
}

/* --- stat tiles --- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 5px;
  overflow: hidden;
  margin: 2.5rem 0 3rem;
}
.tile {
  background: var(--surface);
  padding: 1.15rem 1.15rem 1.25rem;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1);
  transition-delay: calc(var(--i) * 70ms);
}
.js .tile { opacity: 0; }
.tiles.in .tile { opacity: 1; transform: none; }
.tile-k {
  font-family: var(--sans); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
.tile-v {
  font-family: var(--sans); font-size: 1.6rem; font-weight: 640;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1.05;
}
.tile-s {
  font-family: var(--sans); font-size: 0.68rem; color: var(--ink-faint);
  margin-top: 0.4rem; line-height: 1.35;
}

/* --- figure --- */
.fig {
  margin: 2.75rem 0 3rem;
  padding: 1.35rem 1.35rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.3,1);
}
.js .fig { opacity: 0; }
.fig.in { opacity: 1; transform: none; }
.fig-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.fig-title {
  font-family: var(--sans); font-size: 0.94rem; font-weight: 650;
  margin: 0 0 0.2rem; letter-spacing: -0.01em; color: var(--ink);
}
.fig-sub {
  font-family: var(--sans); font-size: 0.74rem; color: var(--ink-faint);
  margin: 0; line-height: 1.4;
}
.fig-note {
  font-family: var(--sans); font-size: 0.74rem; color: var(--ink-soft);
  line-height: 1.55; margin-top: 1rem; padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

/* --- legend (always present for >=2 series) --- */
.lg { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.lg-item {
  font-family: var(--sans); font-size: 0.7rem; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
}
.lg-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* --- svg --- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.grid { stroke: var(--grid); stroke-width: 1; }
.ax { fill: var(--axis); font-family: var(--sans); font-size: 10px; font-variant-numeric: tabular-nums; }
.ax-t { fill: var(--ink-faint); font-family: var(--sans); font-size: 10px; }
.hit { fill: transparent; cursor: pointer; }

.bar .s1 { fill: var(--series-1); }
.bar .s2 { fill: var(--series-2); }
.bar rect.s1, .bar rect.s2 { transition: opacity .12s; }
.chart:hover .bar:not(.on) rect.s1,
.chart:hover .bar:not(.on) rect.s2 { opacity: 0.42; }
.bar:focus { outline: none; }
.bar:focus rect.s2 { stroke: var(--ink); stroke-width: 2; }
.peak {
  fill: var(--ink); font-family: var(--sans); font-size: 10.5px;
  font-weight: 650; font-variant-numeric: tabular-nums;
}

.line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area { fill: var(--series-1); opacity: 0.1; }
.dot circle { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; transition: r .12s; }
.dot.on circle, .dot:focus circle { r: 6.5; }
.dot:focus { outline: none; }
.mean { stroke: var(--ink-faint); stroke-width: 1.5; stroke-dasharray: 5 4; }
.mean-lbl { fill: var(--ink-soft); font-family: var(--sans); font-size: 10px; font-weight: 600; }
.mk { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.mk-lbl { fill: var(--ink-soft); font-family: var(--sans); font-size: 10px; font-weight: 600; }
.drop { stroke: var(--series-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }

/* --- tooltip --- */
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--bg);
  border-radius: 4px; padding: 0.55rem 0.7rem;
  font-family: var(--sans); font-size: 0.72rem; min-width: 132px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.tip-t { font-weight: 650; margin-bottom: 0.35rem; opacity: .95; }
.tip-r { display: flex; justify-content: space-between; gap: 1rem; line-height: 1.55; opacity: .85; }
.tip-r b { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .fig, .tile { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 2.5rem 1.1rem 5rem; }
  .tile-v { font-size: 1.3rem; }
  .fig { padding: 1rem 0.8rem; }
}

/* --- module 1: breach map (matrix) --- */
.bm { overflow: visible; }
.bm-col { fill: var(--ink); font-family: var(--sans); font-size: 11px; font-weight: 700; }
.bm-head-rule { stroke: var(--rule); stroke-width: 1; }
.bm-key { fill: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.bm-what { fill: var(--ink-faint); font-family: var(--sans); font-size: 10.5px; }
.bm-thread { stroke: var(--rule); stroke-width: 1.5; }
.bm-dot { fill: var(--ink-faint); stroke: var(--surface); stroke-width: 2; }
.bm-row .hit { fill: transparent; cursor: pointer; }
.bm-row { transition: opacity .12s; }
.chart.bm:hover .bm-row:not(.on):not(:focus) { opacity: 0.4; }
.bm-row:focus { outline: none; }
.bm-row.on .hit, .bm-row:focus .hit { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.bm-row.on .bm-dot, .bm-row:focus .bm-dot { fill: var(--series-2); }
.bm-row.on .bm-thread, .bm-row:focus .bm-thread { stroke: var(--series-2); stroke-width: 2; }
/* the favicon row: the worst one, always loud */
.bm-row.worst .bm-key { fill: var(--series-1); }
.bm-row.worst .bm-dot { fill: var(--series-1); }
.bm-row.worst .bm-thread { stroke: var(--series-1); stroke-width: 2.5; }
.bm-row.worst .bm-what { fill: var(--ink-soft); }
/* --- expand all / collapse all --- */
.deep-all { margin: 1.5rem 0 2.25rem; }
.deep-all-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  color: var(--ink-soft);
  background: none; border: 1px dashed var(--rule); border-radius: 999px;
  padding: 0.35rem 0.85rem; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.deep-all-btn:hover { color: var(--ink); border-color: var(--ink-faint); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.deep-all-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.deep-all-btn .deep-ico { width: 13px; height: 13px; flex: 0 0 13px; }
.deep-all-btn .deep-ico::before { top: 5px; left: 2.5px; width: 6px; }
.deep-all-btn .deep-ico::after { left: 5px; top: 2.5px; height: 6px; }
.deep-all-btn.all-open .deep-ico::after { transform: rotate(90deg); opacity: 0; }
.deep-all-btn.all-open { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, var(--rule)); }

/* --- the closing offer (end of Module 8) --- */
.offer {
  margin: 4rem 0 1rem;
  padding: 2rem 2rem 2.25rem;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--rule));
  border-radius: 8px;
  background:
    radial-gradient(30rem 16rem at 100% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%),
    var(--surface);
  position: relative;
}
.offer::before {
  content: "";
  position: absolute; top: -1px; left: 2rem; right: 2rem; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.offer > h2 {
  border-top: none; padding-top: 0; margin-top: 0;
  font-size: 1.15rem; letter-spacing: -0.02em;
}
.offer > h2::before { display: none; }
.offer strong { color: var(--ink); }
.offer > p:last-child { margin-bottom: 0; }
@media (max-width: 640px) { .offer { padding: 1.4rem 1.1rem; } }

/* ============================================================
   TOOL BANNER
   Owner brief: the tool is the product, the module is the receipts.
   Every module opens by naming the one tool it exists to justify.
   ============================================================ */
.toolbanner {
  margin: 1.75rem 0 2.5rem;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--rule));
  border-radius: 8px;
  background:
    radial-gradient(24rem 12rem at 100% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%),
    var(--surface);
  padding: 1.1rem 1.25rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.toolbanner::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}
.tb-tag {
  font-family: var(--sans); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 0.55rem;
}
.tb-body { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.tb-name {
  font-family: var(--mono); font-size: 0.94rem; font-weight: 600;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 0.15rem 0.5rem; border-radius: 4px; white-space: nowrap;
}
.tb-does { font-family: var(--sans); font-size: 0.86rem; color: var(--ink); margin: 0; line-height: 1.45; flex: 1; min-width: 14rem; }
.tb-note {
  font-family: var(--sans); font-size: 0.7rem; color: var(--ink-faint);
  margin-top: 0.75rem; padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
@media (max-width: 560px) { .tb-body { flex-direction: column; gap: 0.4rem; } }

/* sales: the tool a scar produced, inline */
.scar-tool {
  /* always its own line: inline-block left it stranded mid-sentence on the
     shorter entries and on its own line for the longer ones */
  display: block; margin-top: 0.45rem;
  font-family: var(--sans); font-size: 0.7rem; color: var(--ink-faint);
}
.scar-tool code { font-size: 0.72rem; color: var(--gold); background: none; padding: 0; }
.scars .scar-n { font-family: var(--mono); }
.tier-lack { color: var(--ink-faint); }
.tier-lack::before { background: var(--ink-faint) !important; opacity: .5; }

/* --- handoff review-copy bar --- */
.hoff-bar {
  margin: 1.75rem 0 2.5rem;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--rule));
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 6%, var(--surface));
  padding: 1.15rem 1.35rem 1.3rem;
}
.hoff-tag {
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 0.5rem;
}
.hoff-note { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; margin: 0 0 1rem; }
.hoff-dl {
  display: inline-block; font-family: var(--sans); font-size: 0.8rem; font-weight: 650;
  color: var(--bg); background: var(--accent); border: 1px solid var(--accent);
  padding: 0.55rem 1.1rem; border-radius: 5px; text-decoration: none;
  transition: transform .12s, background .15s;
}
.hoff-dl:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 85%, black); }

/* ============================================================
   COURSE HOME  (course.html)  — the premium landing
   ============================================================ */
.is-index .chero {
  position: relative;
  width: 100%;
  min-height: min(60vh, 540px);
  display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, var(--rule));
}
.chero-media { position: absolute; inset: 0; z-index: -2; }
.chero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 30% center; animation: heroIn 1.5s cubic-bezier(.2,.7,.3,1) both; }
.chero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 26%, color-mix(in srgb, var(--bg) 30%, transparent) 62%, transparent 100%),
    linear-gradient(to right, color-mix(in srgb, var(--bg) 45%, transparent), transparent 62%);
}
/* let the image itself be a touch richer under the text */
.chero-media img { filter: saturate(1.05) contrast(1.03); }
.chero-inner { max-width: 46rem; margin: 0 auto; width: 100%; padding: 3rem 1.5rem 2.25rem; }
.chero-kick {
  font-family: var(--sans); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
  animation: rise .6s ease .1s both;
}
.chero-h {
  font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02;
  letter-spacing: -0.03em; font-weight: 600; margin: 0 0 1rem; color: var(--ink);
  text-shadow: 0 2px 50px color-mix(in srgb, var(--bg) 70%, transparent);
  animation: rise .7s cubic-bezier(.2,.7,.3,1) .2s both;
}
.chero-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 30rem; margin: 0 0 1.5rem; animation: rise .7s ease .35s both; }
.chero-meter { height: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 999px; overflow: hidden; max-width: 22rem; margin-bottom: 0.6rem; }
.chero-meter-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; }
.chero-meta { font-family: var(--sans); font-size: 0.74rem; color: var(--ink-faint); margin: 0; }
.chero-meta strong { color: var(--ink); }

.wrap-course { padding-top: 3rem; }

/* --- module cards --- */
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 3.5rem; }
@media (max-width: 680px) { .mod-grid { grid-template-columns: 1fr; } }
.mc {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 0 1rem;
  padding: 1.35rem 1.35rem;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
  text-decoration: none; color: var(--ink); position: relative; overflow: hidden;
  transition: transform .16s cubic-bezier(.2,.7,.3,1), border-color .16s, box-shadow .16s;
}
a.mc:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
a.mc:hover .mc-arrow { transform: translateX(3px); color: var(--accent); }
.mc-feat { grid-column: 1 / -1; background: radial-gradient(28rem 14rem at 100% 0%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 70%), var(--surface); border-color: color-mix(in srgb, var(--gold) 40%, var(--rule)); }
.mc-num {
  font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1;
  color: color-mix(in srgb, var(--ink) 30%, var(--gold)); font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.mc-feat .mc-num { font-size: 2.8rem; }
.mc-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.mc-title { font-family: var(--sans); font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.5rem; }
.mc-free { font-size: 0.56rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bg); background: var(--gold); padding: 0.12rem 0.4rem; border-radius: 2px; }
.mc-teaser { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft); line-height: 1.45; }
.mc-foot { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.5rem; flex-wrap: wrap; }
.mc-tool { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); }
.mc-min { font-family: var(--sans); font-size: 0.66rem; color: var(--ink-faint); }
.mc-arrow { font-family: var(--sans); font-size: 1rem; color: var(--ink-faint); transition: transform .16s, color .16s; align-self: center; }
.mc-pending { opacity: 0.5; }
.mc-soon { align-self: center; font-family: var(--sans); font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); border: 1px solid var(--rule); border-radius: 2px; padding: 0.1rem 0.4rem; }

.course-sec { margin: 0 0 1.25rem; }
.course-sec-h { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.course-sec-p { font-family: var(--sans); font-size: 0.86rem; color: var(--ink-soft); margin: 0; }
.kit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0 0 3rem; }
@media (max-width: 680px) { .kit-grid { grid-template-columns: 1fr; } }
.kc {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 1.35rem 1.3rem 1.4rem;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--rule)); border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 4%, var(--surface)); text-decoration: none; color: var(--ink);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), border-color .16s, box-shadow .16s;
}
.kc:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 60%, var(--rule)); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.kc-star { color: var(--gold); font-size: 1rem; }
.kc-t { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; }
.kc-d { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); line-height: 1.45; flex: 1; }
/* The modules tier cannot open these. Saying so on the card is cheaper than a
   buyer clicking through to a lock page and writing in to ask what broke. */
.kc-tier {
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); border: 1px solid currentColor;
  border-radius: 3px; padding: 0.1rem 0.3rem; margin-left: 0.45rem; vertical-align: 0.12em;
}
.kc-star + .kc-tier { margin-left: 0.5rem; }
.course-sec-a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.kc-go { font-family: var(--sans); font-size: 0.72rem; font-weight: 650; color: var(--accent); margin-top: 0.3rem; }
/* The whole kit as one archive. It sits under the four document cards because a
   buyer who wants the tools should not have to know a URL to reach them: the zip
   is the only place the ten tools ship, and it was unlinked for its first week. */
.kit-bundle {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  margin: -2rem 0 3rem; padding: 1.35rem 1.4rem;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
}
.kb-body { flex: 1 1 18rem; }
.kb-t { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.kb-d { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft); line-height: 1.45; }
.kb-go {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 650; white-space: nowrap;
  padding: 0.7rem 1.25rem; border-radius: 5px; text-decoration: none;
  background: var(--accent); color: var(--surface);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s;
}
.kb-go:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.course-foot { display: flex; gap: 1.5rem; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.course-foot-link { font-family: var(--sans); font-size: 0.76rem; color: var(--ink-faint); text-decoration: none; }
.course-foot-link:hover { color: var(--accent); }

/* ============================================================
   MODULE PAGE editorial polish (does not touch the sales page)
   ============================================================ */
/* drop cap on the opening paragraph. Targets the first <p> child of the reading
   column regardless of the banner/expand-all elements that precede it. */
body:not(.is-sales):not(.is-index) .wrap > p:first-of-type::first-letter {
  font-family: var(--serif); font-weight: 600;
  float: left; font-size: 3.4rem; line-height: 0.66;
  padding: 0.42rem 0.62rem 0 0; color: var(--accent);
}
/* dramatic pull-quotes in modules */
body:not(.is-sales) blockquote {
  border-left: none;
  padding: 1.75rem 1.9rem 1.75rem 3.2rem;
  position: relative;
  font-family: var(--serif);
  font-size: 1.2rem; line-height: 1.5;
}
body:not(.is-sales) blockquote::before {
  content: "\201C";
  position: absolute; left: 0.9rem; top: 0.4rem;
  font-family: var(--serif); font-size: 3.4rem; line-height: 1;
  color: color-mix(in srgb, var(--gold) 55%, transparent);
}
body:not(.is-sales) blockquote::after { display: none; }

/* ── masthead nav (all pages) ─────────────────────────────────────────── */
.mn { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; }
.mn-link { font-family: var(--sans); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; transition: color .15s; }
.mn-link:hover { color: var(--ink); }
.mn-buy { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bg); background: var(--accent); padding: 0.45rem 0.95rem; border-radius: 4px; text-decoration: none; transition: transform .12s; }
.mn-buy:hover { transform: translateY(-1px); }
@media (max-width: 560px) { .mn { gap: 0.9rem; } .mn-link { display: none; } }

/* Checkout: the refund and the no-income-guarantee line sit at the point of payment,
   not three clicks away. */
.co-legal { font-family: var(--sans); font-size: 0.75rem; line-height: 1.6; color: var(--ink-faint); margin: 1.75rem 0 0; }
.co-legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Which release this download is, stated on the card rather than only inside the zip. */
.kb-ver { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.55rem; }
.kb-ver a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
