/* ============================================================
   Bitcoin P2P Mastery — design system
   Dark, technical, built for long-form reading + diagrams + code.
   ============================================================ */

:root {
  /* palette */
  --bg:          #0d1117;
  --bg-elev:     #161b22;
  --bg-elev-2:   #1c2230;
  --bg-code:     #11161f;
  --border:      #2a3240;
  --border-soft: #212936;

  --text:        #d7dde5;
  --text-dim:    #98a2b3;
  --text-faint:  #6b7480;
  --heading:     #f0f4f8;

  --accent:      #f7931a;   /* bitcoin orange */
  --accent-soft: #ffb454;
  --accent-dim:  #a8641050;

  --c-core:      #58a6ff;   /* [C] */
  --c-research:  #f778ba;   /* [R] */
  --c-obs:       #3fb950;   /* [O] */
  --c-hist:      #d29922;   /* [H] */

  --ok:          #3fb950;
  --warn:        #d29922;
  --danger:      #f85149;
  --info:        #58a6ff;

  /* type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 860px;
  --sidebar-w: 300px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 0;
  transition: width .2s ease, flex-basis .2s ease, padding .2s ease, border-width .2s ease;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar .brand {
  display: block;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: .5rem;
  text-decoration: none;
}
.sidebar .brand b { color: var(--heading); font-size: 1.05rem; letter-spacing: -.01em; }
.sidebar .brand span { display: block; color: var(--accent); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; margin-top: .2rem; }

.nav-group-label {
  padding: .9rem 1.25rem .3rem;
  color: var(--text-faint);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}
.nav-link {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .4rem 1.25rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .92rem;
  border-left: 2px solid transparent;
}
.nav-link:hover { background: var(--bg-elev-2); color: var(--text); }
.nav-link.active { border-left-color: var(--accent); color: var(--heading); background: var(--bg-elev-2); }
.nav-link .wk { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: .78rem; min-width: 1.6em; }
.nav-link .done { color: var(--ok); margin-left: auto; font-size: .8rem; }

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2.5rem 3rem 6rem;
  display: flex;
  justify-content: center;
}
.content > article { width: 100%; max-width: var(--maxw); min-width: 0; }

/* right-hand in-page TOC */
.toc {
  position: sticky; top: 2.5rem;
  align-self: flex-start;
  width: 210px; flex: 0 0 210px;
  margin-left: 2rem;
  font-size: .84rem;
  border-left: 1px solid var(--border-soft);
  padding-left: 1rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}
.toc-title { color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; margin-bottom: .5rem; }
.toc a { display: block; color: var(--text-dim); text-decoration: none; padding: .18rem 0; line-height: 1.4; }
.toc a:hover { color: var(--accent-soft); }
.toc a.h3 { padding-left: .8rem; font-size: .8rem; }
.toc a.active { color: var(--accent); }

@media (max-width: 1180px) { .toc { display: none; } }
@media (min-width: 821px) {
  html[data-nav="collapsed"] .sidebar {
    width: 0;
    flex: 0 0 0;
    padding: 0;
    border-right-width: 0;
    pointer-events: none;
  }
  html:not([data-nav="collapsed"]) .menu-btn {
    left: calc(var(--sidebar-w) - 2.75rem);
  }
}
@media (max-width: 820px) {
  .sidebar,
  html[data-nav="collapsed"] .sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    padding: 1.25rem 0;
    border-right: 1px solid var(--border);
    position: fixed;
    left: -100%;
    z-index: 50;
    transition: left .2s;
    box-shadow: 0 0 40px #000a;
    pointer-events: auto;
  }
  .sidebar.open,
  html[data-nav="collapsed"] .sidebar.open { left: 0; }
  .content { padding: 1.5rem 1.25rem 4rem; }
  article h1 { font-size: 1.55rem; }
}

.menu-btn {
  display: inline-flex;
  position: fixed; top: 1rem; left: 1rem; z-index: 60;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: .45rem .6rem; cursor: pointer; font-size: 1.1rem;
}

/* ---------- typography ---------- */
article h1, article h2, article h3, article h4 { color: var(--heading); line-height: 1.25; letter-spacing: -.015em; }
article h1 { font-size: 2.1rem; margin: 0 0 .4rem; }
article h2 { font-size: 1.5rem; margin: 2.6rem 0 1rem; padding-top: .6rem; border-top: 1px solid var(--border-soft); }
article h3 { font-size: 1.18rem; margin: 1.8rem 0 .7rem; color: var(--accent-soft); }
article h4 { font-size: 1rem; margin: 1.3rem 0 .5rem; color: var(--text); text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; }
article p { margin: 0 0 1.1rem; }
article a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
article a:hover { border-bottom-color: var(--accent); }
article strong { color: var(--heading); font-weight: 600; }
article ul, article ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
article li { margin: .35rem 0; overflow-wrap: anywhere; }
.study-plan { min-width: 0; max-width: 100%; }
article hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.lede { font-size: 1.18rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 1.8rem; }

/* inline code + code blocks */
code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: .1em .35em;
  color: var(--accent-soft);
  overflow-wrap: anywhere;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  max-width: 100%;
  font-size: .82rem;
  line-height: 1.6;
  margin: 0 0 .4rem;
}
pre code { background: none; border: none; padding: 0; color: #c9d1d9; font-size: inherit; overflow-wrap: normal; white-space: inherit; }

/* code figure: filename bar + permalink */
figure.code { margin: 1.4rem 0; max-width: 100%; }
figure.code figcaption {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: .4rem .8rem;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-dim);
  min-width: 0;
}
figure.code figcaption .file { color: var(--accent-soft); min-width: 0; overflow-wrap: anywhere; }
figure.code figcaption a { margin-left: auto; color: var(--info); font-size: .72rem; border: none; }
figure.code figcaption a:hover { text-decoration: underline; }
figure.code pre { border-radius: 0 0 var(--radius) var(--radius); }
figure.code .cap-note { color: var(--text-faint); font-size: .78rem; margin-top: .35rem; font-family: var(--font-body); }

/* ---------- callouts ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: .9rem 1.1rem;
  margin: 1.4rem 0;
  font-size: .95rem;
}
.callout .callout-head {
  font-weight: 600; color: var(--heading);
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .4rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
}
.callout p:last-child { margin-bottom: 0; }
.callout.research { border-left-color: var(--c-research); }
.callout.research .callout-head { color: var(--c-research); }
.callout.attack   { border-left-color: var(--danger); }
.callout.attack .callout-head { color: var(--danger); }
.callout.lab      { border-left-color: var(--c-obs); }
.callout.lab .callout-head { color: var(--c-obs); }
.callout.history  { border-left-color: var(--c-hist); }
.callout.history .callout-head { color: var(--c-hist); }
.callout.note     { border-left-color: var(--info); }
.callout.note .callout-head { color: var(--info); }
.callout.warn     { border-left-color: var(--warn); }
.callout.warn .callout-head { color: var(--warn); }

/* ---------- figures / diagrams ---------- */
figure.diagram {
  margin: 1.8rem 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  overflow-x: auto;
  max-width: 100%;
}
figure.diagram .mermaid { display: flex; justify-content: center; overflow-x: auto; max-width: 100%; }
.mermaid { max-width: 100%; overflow-x: auto; }
figure.diagram svg, .mermaid svg { max-width: 100%; height: auto; }
figure.diagram img { max-width: 100%; height: auto; }
figure.diagram figcaption { color: var(--text-dim); font-size: .84rem; margin-top: .9rem; text-align: center; }
figure.diagram figcaption b { color: var(--text); }

/* ---------- Mermaid palette overrides ----------
   Force the site palette onto Mermaid output regardless of which theme it
   renders with (its theme-variable timing is unreliable). Covers the sequence,
   flowchart, and state elements actually used across the weeks. */
.mermaid svg { background: transparent; }
/* sequence: participant boxes + lifelines */
.mermaid .actor { fill: var(--bg-elev-2) !important; stroke: var(--accent) !important; }
.mermaid text.actor, .mermaid text.actor > tspan, .mermaid .actor > tspan { fill: var(--heading) !important; stroke: none !important; font-weight: 600; }
.mermaid .actor-line { stroke: var(--text-faint) !important; }
/* sequence: messages */
.mermaid .messageText, .mermaid .labelText, .mermaid .loopText, .mermaid .loopText > tspan { fill: var(--text) !important; stroke: none !important; }
.mermaid .messageLine0 { stroke: var(--text-dim) !important; }
.mermaid .messageLine1 { stroke: var(--text-dim) !important; stroke-dasharray: 3, 3; }
.mermaid #arrowhead path, .mermaid marker path { fill: var(--text-dim) !important; stroke: none !important; }
/* sequence: alt/opt/loop frames + labels */
.mermaid .labelBox { fill: var(--bg-elev-2) !important; stroke: var(--border) !important; }
.mermaid .loopLine { stroke: var(--c-core) !important; }
.mermaid .sequenceNumber { fill: var(--heading) !important; }
.mermaid line.loopLine, .mermaid path.loopLine { stroke: var(--border) !important; }
/* sequence: activations */
.mermaid .activation0, .mermaid .activation1, .mermaid .activation2 { fill: var(--bg-elev-2) !important; stroke: var(--c-core) !important; }
/* notes */
.mermaid .note { fill: #3a2d0a !important; stroke: var(--warn) !important; }
.mermaid .noteText, .mermaid .noteText > tspan { fill: #ffe0a3 !important; stroke: none !important; }
/* flowchart / state nodes */
.mermaid .node rect, .mermaid .node circle, .mermaid .node ellipse, .mermaid .node polygon, .mermaid .node path { fill: var(--bg-elev-2) !important; stroke: var(--accent) !important; }
.mermaid .node .label, .mermaid .nodeLabel, .mermaid .nodeLabel p { color: var(--heading) !important; fill: var(--heading) !important; }
.mermaid .cluster rect { fill: var(--bg-elev) !important; stroke: var(--border) !important; }
.mermaid .cluster .cluster-label, .mermaid .cluster text { fill: var(--text-dim) !important; }
/* flowchart edges */
.mermaid .edgePath .path, .mermaid .flowchart-link { stroke: var(--text-dim) !important; }
.mermaid .edgeLabel, .mermaid .edgeLabel p, .mermaid .edgeLabel rect { color: var(--text) !important; fill: var(--text) !important; background: var(--bg) !important; }
.mermaid .edgeLabel .labelBkg { background: var(--bg) !important; fill: var(--bg) !important; }
.mermaid .edgeLabel foreignObject { background: transparent; }
/* state diagrams */
.mermaid .stateGroup rect, .mermaid .stateGroup path { fill: var(--bg-elev-2) !important; stroke: var(--accent) !important; }
.mermaid .stateGroup text, .mermaid .stateLabel text { fill: var(--heading) !important; }
.mermaid .transition { stroke: var(--text-dim) !important; }

/* ---------- study plan block ---------- */
.study-plan {
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1a130a 0%, var(--bg-elev) 60%);
  padding: 1.3rem 1.4rem;
  margin: 2rem 0;
}
.study-plan h3 { margin-top: 0; color: var(--accent); border: none; }
.study-plan .sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.6rem; }
.study-plan .sp-grid > * { min-width: 0; }
@media (max-width: 700px) { .study-plan .sp-grid { grid-template-columns: 1fr; } }
.study-plan h4 { color: var(--accent-soft); margin: .2rem 0 .4rem; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { display: flex; gap: .55rem; align-items: flex-start; margin: .4rem 0; min-width: 0; }
.checklist li > input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: .45rem;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}
.checklist-body { min-width: 0; flex: 1 1 auto; overflow-x: auto; }
.checklist-body pre { max-width: 100%; }
.checklist li.is-checked { color: var(--text-dim); }
.checklist li.is-checked strong { color: var(--text); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; max-width: 100%; margin: 1.4rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { color: var(--heading); border-bottom: 1px solid var(--border); font-weight: 600; }
tbody tr:hover { background: var(--bg-elev); }
td code { font-size: .82em; }

/* ---------- references ---------- */
.refs { font-size: .88rem; }
.refs ol { padding-left: 1.6rem; }
.refs li { margin: .5rem 0; color: var(--text-dim); }
.refs li a { word-break: break-word; }
.ref-src { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: .05em .4em; border-radius: 3px; margin-right: .4rem; vertical-align: middle; }
.ref-src.code { background: #12325a; color: var(--c-core); }
.ref-src.bip  { background: #3a2d0a; color: var(--c-hist); }
.ref-src.paper{ background: #3a1030; color: var(--c-research); }
.ref-src.forum{ background: #10321a; color: var(--c-obs); }
.ref-src.doc  { background: #23272e; color: var(--text-dim); }
sup.cite a { color: var(--accent); font-size: .72em; border: none; padding: 0 .1em; }

/* ---------- scope tags ---------- */
.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: .08em .4em; border-radius: 3px; letter-spacing: .03em; }
.tag.C { background: #12325a; color: var(--c-core); }
.tag.R { background: #3a1030; color: var(--c-research); }
.tag.O { background: #10321a; color: var(--c-obs); }
.tag.H { background: #3a2d0a; color: var(--c-hist); }

/* ---------- page header / meta ---------- */
.page-eyebrow { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; margin-bottom: .4rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; color: var(--text-faint); font-size: .82rem; margin: .6rem 0 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.page-meta .dot { color: var(--border); }

/* prev/next */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager a { flex: 1; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; color: var(--text-dim); }
.pager a:hover { border-color: var(--accent); color: var(--text); }
.pager a.next { text-align: right; }
.pager .lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.pager .ttl { color: var(--heading); font-size: .95rem; }

/* commit banner */
.commit-banner { background: var(--bg-code); border: 1px solid var(--border-soft); border-radius: 6px; padding: .5rem .8rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); margin: 1.5rem 0; }
.commit-banner b { color: var(--text-dim); }
.commit-banner code { background: none; border: none; color: var(--accent-soft); padding: 0; }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: .5rem; }
.progress-note { color: var(--text-faint); font-size: .82rem; margin: 0 auto 1rem; max-width: 420px; }
.resume { margin: .4rem auto 0; }
.resume a {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent-soft);
  border-radius: 100px;
  padding: .4rem 1.1rem;
  font-size: .9rem;
}
.resume a:hover { border-color: var(--accent-soft); color: var(--heading); }
.hero .subtitle { font-size: 1.25rem; color: var(--text-dim); max-width: 620px; margin: 0 auto 1.5rem; }
.hero .pace-pill { display: inline-block; background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent-soft); border-radius: 100px; padding: .3rem 1rem; font-size: .85rem; }

.progress-summary { display:flex; align-items:center; gap: 1rem; justify-content:center; margin: 1.5rem 0; }
.progress-bar { flex: 0 0 260px; height: 8px; background: var(--bg-elev-2); border-radius: 100px; overflow: hidden; }
.progress-bar > span { display:block; height:100%; background: var(--accent); width: 0; transition: width .4s; }
.progress-summary .pct { color: var(--text-dim); font-size: .9rem; font-variant-numeric: tabular-nums; }

.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 2rem 0; }
.week-card {
  display: block; text-decoration: none;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; transition: border-color .15s, transform .15s;
  position: relative;
}
.week-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.week-card .wk-n { color: var(--text-faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.week-card h3 { color: var(--heading); margin: .3rem 0 .5rem; font-size: 1.12rem; border: none; }
.week-card p { color: var(--text-dim); font-size: .88rem; margin: 0 0 .7rem; line-height: 1.5; }
.week-card .tags { display: flex; gap: .3rem; }
.week-card .status-dot { position: absolute; top: 1.1rem; right: 1.1rem; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.week-card .status-dot.in-review { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.week-card .status-dot.done { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.week-card .status-dot.published { background: var(--ok); }

.appendix-list { display:flex; flex-wrap:wrap; gap:.7rem; margin: 1rem 0 2rem; }
.appendix-list a { text-decoration:none; background: var(--bg-elev-2); border:1px solid var(--border); border-radius:100px; padding:.4rem 1rem; color: var(--text-dim); font-size:.88rem; }
.appendix-list a:hover { border-color: var(--accent); color: var(--text); }

footer.site { color: var(--text-faint); font-size: .82rem; text-align: center; padding: 3rem 1rem 2rem; border-top: 1px solid var(--border-soft); margin-top: 3rem; }
footer.site a { color: var(--text-dim); }

/* ---------- theme switch ---------- */
.theme-switch {
  display: flex;
  gap: 0;
  margin: .7rem 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.theme-switch button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 650;
  padding: .4rem .3rem;
  cursor: pointer;
}
.theme-switch button + button { border-left: 1px solid var(--border); }
.theme-switch button[aria-pressed="true"] {
  background: var(--bg-elev-2);
  color: var(--heading);
}
.theme-fab {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elev);
}
.theme-fab button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 650;
  padding: .45rem .65rem;
  cursor: pointer;
}
.theme-fab button + button { border-left: 1px solid var(--border); }
.theme-fab button[aria-pressed="true"] {
  background: var(--bg-elev-2);
  color: var(--heading);
}
@media (max-width: 820px) {
  .theme-fab { display: inline-flex; }
}

/* ============================================================
   Paper theme — Daylight Computer DC-1 / greyscale Live Paper
   Hue is meaningless on that panel. Contrast and weight carry
   structure. Warm paper + ink also reads under the amber backlight
   (where "black" goes chocolate-brown).
   ============================================================ */
html[data-theme="paper"] {
  --bg:          #f3efe4;
  --bg-elev:     #ebe6d6;
  --bg-elev-2:   #e0d8c4;
  --bg-code:     #e7e0ce;
  --border:      #2a2418;
  --border-soft: #6f6758;

  --text:        #1c1812;
  --text-dim:    #3b352a;
  --text-faint:  #5c5548;
  --heading:     #11100b;

  --accent:      #11100b;
  --accent-soft: #1c1812;
  --accent-dim:  #11100b26;

  --c-core:      #11100b;
  --c-research:  #11100b;
  --c-obs:       #11100b;
  --c-hist:      #11100b;

  --ok:          #11100b;
  --warn:        #11100b;
  --danger:      #11100b;
  --info:        #11100b;
}

html[data-theme="paper"] body {
  font-size: 18.5px;
  line-height: 1.75;
  font-weight: 450;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

html[data-theme="paper"] article h3 { color: var(--heading); }
html[data-theme="paper"] article a { border-bottom-width: 2px; }
html[data-theme="paper"] code {
  color: var(--text);
  font-weight: 600;
}
html[data-theme="paper"] pre {
  border-width: 2px;
  font-size: .88rem;
}
html[data-theme="paper"] pre code { color: var(--text); }

html[data-theme="paper"] .callout {
  border: 2px solid var(--border);
  border-left-width: 7px;
  background: var(--bg-elev);
}
html[data-theme="paper"] .callout .callout-head,
html[data-theme="paper"] .callout.research .callout-head,
html[data-theme="paper"] .callout.attack .callout-head,
html[data-theme="paper"] .callout.lab .callout-head,
html[data-theme="paper"] .callout.history .callout-head,
html[data-theme="paper"] .callout.note .callout-head,
html[data-theme="paper"] .callout.warn .callout-head {
  color: var(--heading);
}

html[data-theme="paper"] .study-plan {
  background: var(--bg-elev);
  border: 2px solid var(--border);
}
html[data-theme="paper"] .study-plan h3,
html[data-theme="paper"] .study-plan h4 { color: var(--heading); }

html[data-theme="paper"] .tag,
html[data-theme="paper"] .tag.C,
html[data-theme="paper"] .tag.R,
html[data-theme="paper"] .tag.O,
html[data-theme="paper"] .tag.H {
  background: var(--bg);
  color: var(--heading);
  border: 2px solid var(--border);
}

html[data-theme="paper"] .ref-src,
html[data-theme="paper"] .ref-src.code,
html[data-theme="paper"] .ref-src.bip,
html[data-theme="paper"] .ref-src.paper,
html[data-theme="paper"] .ref-src.forum,
html[data-theme="paper"] .ref-src.doc {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}

html[data-theme="paper"] .week-card:hover { transform: none; }
html[data-theme="paper"] .week-card .status-dot { box-shadow: none; border: 2px solid var(--border); background: transparent; }
html[data-theme="paper"] .week-card .status-dot.done,
html[data-theme="paper"] .week-card .status-dot.published { background: var(--heading); }
html[data-theme="paper"] .week-card .status-dot.in-review { background: var(--text-faint); }

html[data-theme="paper"] .menu-btn,
html[data-theme="paper"] .pager a,
html[data-theme="paper"] figure.code figcaption,
html[data-theme="paper"] figure.diagram,
html[data-theme="paper"] .commit-banner {
  border-width: 2px;
}

html[data-theme="paper"] .mermaid .note { fill: var(--bg-elev-2) !important; stroke: var(--border) !important; }
html[data-theme="paper"] .mermaid .noteText,
html[data-theme="paper"] .mermaid .noteText > tspan { fill: var(--text) !important; }
