/* WCP — prep dossier identity. Space Grotesk + Source Serif + JetBrains Mono (code only). */
:root {
  --ink: #0c1224;
  --paper: #121a33;
  --sunken: #0e1530;
  --line: #26345c;
  --text: #e8edf9;
  --fog: #9aa7c7;
  --amber: #ffb224;
  --amber-deep: #b97a0a;
  --ice: #8fd6ff;
  --clear: #3ecf8e;
  --red: #ff6b6b;
  --code-bg: #080d1f;
  --radius: 10px;
  --measure: 76ch;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="light"] {
  --ink: #eef1f7;
  --paper: #ffffff;
  --sunken: #e9edf6;
  --line: #c9d3e8;
  --text: #17203a;
  --fog: #55648a;
  --amber: #9a6204;
  --amber-deep: #9a6204;
  --ice: #075e7e;
  --clear: #0a7a4e;
  --red: #b42323;
  --code-bg: #0c1224;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.75;
}
a { color: var(--ice); }
a:hover { color: var(--text); }

/* thin readiness line */
#read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber)); }

/* top bar */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--text);
  display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand .mark { font-size: 12px; letter-spacing: 1px; border: 1.5px solid var(--amber);
  color: var(--amber); border-radius: 6px; padding: 3px 7px; }
.brand small { font-family: var(--display); font-weight: 400; font-size: 12.5px; color: var(--fog); }
#menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 0; max-width: 480px; margin-left: auto; }
#search { width: 100%; padding: 9px 14px; border-radius: 999px; font-family: var(--display); font-size: 13.5px;
  border: 1px solid var(--line); background: var(--sunken); color: var(--text); }
#search::placeholder { color: var(--fog); }
#search:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
#search-results { position: absolute; top: 112%; left: 0; right: 0; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: none;
  box-shadow: 0 22px 60px rgba(0,0,0,.5); max-height: 60vh; overflow-y: auto; font-family: var(--display); }
#search-results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
#search-results a:hover { background: var(--sunken); text-decoration: none; }
#search-results .sr-sec { font-size: 12px; color: var(--fog); }
#search-results .sr-snip { font-size: 13px; color: var(--fog); font-family: var(--body); }
#theme-btn { background: var(--paper); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 15px; flex: none; }

/* classification strip — the signature element */
.classbar { display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 7px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 12px; color: var(--fog); background: var(--sunken); }
.classbar .cls-left { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.classbar .cls-left b { color: var(--amber); font-weight: 700; }
.classbar .cls-right { font-variant-numeric: tabular-nums; white-space: nowrap; }
.classbar .cls-right b { color: var(--text); }

/* layout */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; }
aside.sidebar { position: sticky; top: 104px; height: calc(100vh - 104px); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 18px 14px; background: var(--ink); }
.nav-group { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--text); margin: 16px 8px 4px; }
.nav-group:first-child { margin-top: 0; }
.nav-item { display: flex; gap: 9px; align-items: baseline; padding: 6px 9px; border-radius: 7px;
  color: var(--fog); font-family: var(--display); font-size: 13.5px; border-left: 2px solid transparent; }
.nav-item:hover { color: var(--text); background: var(--paper); text-decoration: none; }
.nav-item.active { color: var(--text); background: var(--paper); border-left-color: var(--amber); }
.nav-item .num { color: var(--amber-deep); font-size: 12px; min-width: 20px; font-variant-numeric: tabular-nums; }
.nav-item .star { color: var(--amber); }
.nav-item .tick { margin-left: auto; color: var(--clear); font-size: 12px; visibility: hidden; }
.nav-item.done .nav-title { text-decoration: line-through; opacity: .65; }
.nav-item.done .tick { visibility: visible; }

main { padding: 30px 30px 90px; min-width: 0; }
.article { max-width: var(--measure); margin: 0 auto; }
@media (min-width: 1220px) {
  .content-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 215px;
    gap: 36px; justify-content: center; }
  nav.toc { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 170px);
    overflow-y: auto; }
}
@media (max-width: 1219px) { nav.toc { display: none; } }
nav.toc .toc-title { font-family: var(--display); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
nav.toc a { display: block; font-family: var(--display); font-size: 12.5px; color: var(--fog);
  padding: 3px 0 3px 12px; border-left: 2px solid var(--line); }
nav.toc a.lvl-3 { padding-left: 24px; }
nav.toc a:hover { color: var(--text); text-decoration: none; }
nav.toc a.seen { color: var(--amber); border-color: var(--amber); }

/* article */
.article h1, .article h2, .article h3, .article h4 { font-family: var(--display); line-height: 1.3; }
.article h1 { font-size: 1.85rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.article h2 { font-size: 1.32rem; margin: 2.4em 0 0.6em; padding-top: 14px; border-top: 1px solid var(--line); }
.article h3 { font-size: 1.06rem; margin: 1.9em 0 0.5em; color: var(--amber); }
[data-theme="light"] .article h3 { color: var(--amber-deep); }
.article p, .article li { overflow-wrap: anywhere; }
.article ul, .article ol { padding-left: 24px; }
.article li { margin: 5px 0; }
.article li::marker { color: var(--amber-deep); }
.article blockquote { border-left: 3px solid var(--amber); background: var(--paper);
  margin: 18px 0; padding: 12px 18px; border-radius: 0 var(--radius) var(--radius) 0; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px;
  display: block; overflow-x: auto; font-family: var(--display); }
.article th, .article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--paper); font-size: 13px; }
.article code { font-family: var(--mono); font-size: 0.84em; background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.article pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; position: relative; }
.article pre code { background: none; border: none; padding: 0; color: #e6ecf9; font-size: 13.5px; line-height: 1.65; }
.copy-btn { position: absolute; top: 9px; right: 9px; font-family: var(--display); font-size: 12px;
  padding: 4px 11px; border-radius: 7px; border: 1px solid var(--line);
  background: #1b2547; color: #e6ecf9; cursor: pointer; }
.copy-btn:hover { border-color: var(--amber); color: var(--amber); }
.meta { font-family: var(--display); font-size: 13px; color: var(--fog); margin-bottom: 20px; }
.meta .tag { display: inline-block; border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 9px; margin-right: 8px; font-size: 12px; color: var(--text); }
.meta .tag.hot { border-color: var(--amber); color: var(--amber); }
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 52px; }
.pager > span { flex: 1; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 18px;
  background: var(--paper); flex: 1; color: var(--text); font-family: var(--display); font-size: 14px; }
.pager a:hover { text-decoration: none; border-color: var(--amber); }
.pager .dir { font-size: 12px; color: var(--fog); display: block; margin-bottom: 2px; }
.done-bar { margin-top: 30px; border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 15px 18px; display: flex; align-items: center; gap: 14px; background: var(--sunken);
  font-family: var(--display); font-size: 14px; }
#done-btn { border: 1.5px solid var(--amber); background: transparent; color: var(--amber);
  border-radius: 8px; padding: 9px 18px; cursor: pointer; font-family: var(--display);
  font-weight: 700; font-size: 14px; }
#done-btn:hover { background: var(--amber); color: #14100a; }
#done-btn.is-done { border-color: var(--clear); color: var(--clear); }
#done-btn.is-done:hover { background: var(--clear); color: #06130c; }

/* stamp — appears on cleared cards */
.stamp { display: none; font-family: var(--display); font-weight: 700; font-size: 12px;
  letter-spacing: 2px; color: var(--clear); border: 2px solid var(--clear); border-radius: 6px;
  padding: 3px 10px; transform: rotate(-6deg); }
.card.is-done .stamp { display: inline-block; animation: stamp-in 0.25s ease-out; }
@keyframes stamp-in { from { transform: rotate(-6deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-6deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card.is-done .stamp { animation: none; }
  * { transition: none !important; }
}

/* task lists */
li.task { list-style: none; margin-left: -24px; display: flex; gap: 11px; align-items: baseline; }
li.task input { accent-color: var(--amber-deep); width: 16px; height: 16px; flex: none;
  transform: translateY(2px); cursor: pointer; }
li.task.checked span { color: var(--fog); text-decoration: line-through; }

/* home + hub */
.hero { max-width: var(--measure); margin: 0 auto; padding: 44px 0 6px; }
.hero .kicker { font-family: var(--display); font-size: 13px; color: var(--fog); margin: 0 0 12px; }
.hero h1 { font-family: var(--display); font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.12;
  margin: 0 0 14px; letter-spacing: -0.02em; }
.hero h1 .u { text-decoration: underline; text-decoration-color: var(--amber);
  text-decoration-thickness: 4px; text-underline-offset: 6px; }
.hero p { color: var(--fog); max-width: 60ch; margin: 0; font-size: 18px; }
.overall { max-width: var(--measure); margin: 22px auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px;
  font-family: var(--display); }
.overall .readout { display: flex; justify-content: space-between; font-size: 13px; color: var(--fog); }
.overall .readout strong { color: var(--text); font-size: 15px; }
.overall .bar { height: 8px; background: var(--sunken); border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; margin-top: 10px; }
.overall .bar > div { height: 100%; width: 0; background: var(--amber); transition: width 0.4s; }
.cards { max-width: 1060px; margin: 22px auto 64px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 0 16px; padding: 0 4px; }
.card { position: relative; background: var(--paper); border: 1px solid var(--line);
  border-top: 3px solid var(--amber-deep); border-radius: 0 0 var(--radius) var(--radius);
  padding: 18px 20px 16px; margin-top: 18px; }
.card::before { content: "FILE"; position: absolute; top: -13px; left: 14px;
  font-family: var(--display); font-size: 10.5px; letter-spacing: 1.5px; color: var(--ink);
  background: var(--amber); border-radius: 5px 5px 0 0; padding: 2px 9px; font-weight: 700; }
.card.is-done { border-top-color: var(--clear); }
.card.is-done::before { content: "FILE"; background: var(--clear); }
.card h3 { margin: 2px 0 6px; font-family: var(--display); font-size: 1.02rem; line-height: 1.4; }
.card h3 a { color: var(--text); }
.card p { margin: 0 0 10px; font-size: 15px; color: var(--fog); line-height: 1.6; }
.card .row { display: flex; align-items: center; gap: 10px; font-family: var(--display);
  font-size: 12px; color: var(--fog); }
.card .tag { border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.card .star { color: var(--amber); }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card .card-done { border: 1px solid var(--line); background: transparent; color: var(--fog);
  border-radius: 7px; padding: 5px 12px; font-family: var(--display); font-size: 12.5px; cursor: pointer; }
.card .card-done:hover { border-color: var(--amber); color: var(--amber); }
.card.is-done .card-done { border-color: var(--clear); color: var(--clear); }
.path { max-width: var(--measure); margin: 0 auto; }
.path h2 { font-family: var(--display); font-size: 1.25rem; }
.path ol { padding-left: 22px; }
.path li { margin: 7px 0; }
.path li::marker { color: var(--amber); font-family: var(--display); font-weight: 700; }
footer { text-align: center; color: var(--fog); font-family: var(--display); font-size: 12.5px;
  padding: 34px 16px 54px; border-top: 1px solid var(--line); }

/* single load-in for the hero only */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise 0.5s ease-out both; }
.hero > *:nth-child(2) { animation-delay: 0.08s; }
.hero > *:nth-child(3) { animation-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) { .hero > * { animation: none; } }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (max-width: 860px) {
  #menu-btn { display: block; }
  .layout { grid-template-columns: 1fr; }
  aside.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 284px; z-index: 60;
    height: 100vh; transform: translateX(-102%); transition: transform 0.2s; border-right: 1px solid var(--line); }
  body.nav-open aside.sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.55); }
    main { padding: 22px 16px 70px; }
  header.topbar { gap: 10px; padding: 10px 12px; }
  .brand { font-size: 15px; }
  .brand small { display: none; }
  .classbar .cls-left { max-width: 62vw; }
}
@media print {
  header.topbar, .classbar, aside.sidebar, nav.toc, .done-bar, .pager,
  #read-progress, .copy-btn { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; font-size: 12pt; }
}
