/* expenseforge.com: site styles. Palette and typefaces from the project plan. */
@font-face { font-family: "Almendra"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/almendra-normal-400.woff2") format("woff2"); }
@font-face { font-family: "Almendra"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/almendra-normal-700.woff2") format("woff2"); }
@font-face { font-family: "Almendra"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/almendra-italic-400.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/alegreya-normal-400-800.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/alegreya-italic-400-800.woff2") format("woff2"); }
@font-face { font-family: "Kode Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/kode-mono-normal-400-700.woff2") format("woff2"); }

/* metric-matched fallbacks: the page barely moves when the real fonts arrive */
@font-face { font-family: "Alegreya Fallback"; font-weight: 400 600; src: local("Times New Roman"), local("Liberation Serif"), local("Times"); size-adjust: 98.8%; }
@font-face { font-family: "Alegreya Fallback"; font-weight: 700 800; src: local("Times New Roman Bold"), local("Times New Roman"), local("Liberation Serif"), local("Times"); size-adjust: 94.2%; }
@font-face { font-family: "Almendra Fallback"; src: local("Georgia"), local("Palatino Linotype"), local("Book Antiqua"), local("Palatino"); size-adjust: 90%; }

:root {
  --iron: #36323B;
  --iron-2: #4A4552;
  --ink-soft: #5E5866;
  --ember: #E0603A;
  --ember-ink: #B03E1B;
  --moss: #6E9B57;
  --moss-ink: #45692F;
  --parch: #F1E6CC;
  --parch-2: #E7D9B6;
  --bg: #F8F1E0;
  --paper: #FCF8EC;
  --line: rgba(54, 50, 59, 0.22);
  --line-strong: rgba(54, 50, 59, 0.6);
  --grid: rgba(54, 50, 59, 0.07);
  --cell: 32px;
  --font-display: "Almendra", "Almendra Fallback", "Palatino Linotype", Georgia, serif;
  --font-body: "Alegreya", "Alegreya Fallback", "Times New Roman", Georgia, serif;
  --font-mono: "Kode Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 41rem;
  --wrap: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  color: var(--iron);
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--ember-ink); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--iron); }
:focus-visible { outline: 3px solid var(--ember-ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ember); color: var(--iron); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 0.5rem; top: -4rem; background: var(--iron); color: var(--parch); padding: 0.6rem 1rem; z-index: 100; font-weight: 700; }
.skip:focus { top: 0.5rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0 0 0.5em; color: var(--iron); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 4.6vw + 0.6rem, 4.3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 2.2vw + 0.8rem, 2.5rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.mono { font-family: var(--font-mono); }
.lead { font-size: clamp(1.25rem, 0.5vw + 1.1rem, 1.5rem); line-height: 1.5; color: var(--iron-2); max-width: 36rem; }
.muted { color: var(--ink-soft); }

/* ---------- header ---------- */
.site-header { background: var(--bg); border-bottom: 2px solid var(--iron); position: relative; }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 10px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--iron) 0 2px, transparent 2px 80px) bottom / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, var(--iron) 0 1px, transparent 1px 16px) bottom / 100% 5px no-repeat;
  opacity: 0.55;
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--iron); font-family: var(--font-display); font-size: 1.65rem; line-height: 1; }
.brand:hover { color: var(--ember-ink); }
.brand svg { width: 2rem; height: 2rem; flex: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.6rem; }
.nav a { color: var(--iron); text-decoration: none; font-size: 1.15rem; font-weight: 600; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ember); color: var(--iron); }
.nav a[aria-current="page"] { border-bottom-color: var(--iron); }
.nav .nav-cta { background: var(--iron); color: var(--parch); padding: 0.45rem 1rem; border: 2px solid var(--iron); border-radius: 2px; }
.nav .nav-cta:hover { background: var(--ember); color: var(--iron); border-color: var(--iron); }
.nav .nav-cta[aria-current="page"] { border-bottom-color: var(--iron); background: var(--ember); color: var(--iron); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-body); font-weight: 700; font-size: 1.2rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  padding: 0.85rem 1.4rem; border: 2px solid var(--iron); border-radius: 2px; background: var(--parch); color: var(--iron);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { background: var(--parch-2); color: var(--iron); }
.btn-primary { background: var(--ember); color: var(--iron); box-shadow: 4px 4px 0 var(--iron); font-size: 1.3rem; }
.btn-primary:hover { background: #EA704B; color: var(--iron); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--iron); }
.btn-dark { background: var(--iron); color: var(--parch); }
.btn-dark:hover { background: var(--iron-2); color: var(--parch); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.link-quiet { font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2rem, 5vw, 4.5rem) clamp(2.5rem, 5vw, 4rem); }
.hero-in { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 62rem) { .hero-in { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.hero h1 { margin-bottom: 0.4em; }
.hero .lead { margin-bottom: 1.6rem; }
.hero .note { margin-top: 1.2rem; font-size: 1.05rem; color: var(--ink-soft); max-width: 30rem; }

.board { display: grid; grid-template-columns: minmax(0, 1fr); border: 2px solid var(--iron); background: var(--parch); box-shadow: 8px 8px 0 var(--iron); }
@media (min-width: 40rem) { .board { grid-template-columns: 4.4rem minmax(0, 1fr) 8.8rem; } }
.board-drawer, .board-layers { display: none; background: var(--parch); }
@media (min-width: 40rem) { .board-drawer, .board-layers { display: block; } }
.board-drawer { border-right: 2px solid var(--iron); padding: 0.6rem; display: none; }
@media (min-width: 40rem) { .board-drawer { display: grid; gap: 0.5rem; align-content: start; } }
.board-drawer span { display: block; background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 2px; padding: 0.2rem; }
.board-drawer span.on { border-color: var(--ember-ink); box-shadow: inset 0 0 0 2px var(--ember); }
.board-drawer svg { display: block; width: 100%; height: 2.2rem; }
.board-layers { border-left: 2px solid var(--iron); padding: 0.7rem 0.6rem; font-size: 0.95rem; }
.board-layers b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; margin-bottom: 0.5rem; }
.board-layers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.board-layers li { display: flex; align-items: center; gap: 0.45rem; padding: 0.25rem 0.4rem; border: 1.5px solid var(--line); background: var(--paper); line-height: 1.1; }
.board-layers li.on { border-color: var(--iron); background: #fff; font-weight: 700; }
.board-layers li svg { width: 1rem; height: 1rem; flex: none; }
.board-map { background: var(--bg); min-width: 0; }
.board-map svg { display: block; width: 100%; height: auto; }
.pc.stamp { animation: stamp 0.35s ease-out both; animation-delay: calc(1.1s + var(--i) * 22ms); }
.layer.fade { animation: fadein 0.7s ease-out both; animation-delay: calc(var(--i) * 0.4s); }
@keyframes stamp { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .pc.stamp, .layer.fade { animation: none; }
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-head { max-width: 44rem; margin-bottom: 2rem; }
.section-head p { color: var(--iron-2); font-size: 1.25rem; margin: 0; }
.panel { background: var(--bg); }
.band { background: var(--parch); border-block: 2px solid var(--iron); }

/* atlas tiles */
.atlas { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); border-top: 2px solid var(--iron); border-left: 2px solid var(--iron); background: var(--bg); }
.atlas > li, .atlas > div { list-style: none; border-right: 2px solid var(--iron); border-bottom: 2px solid var(--iron); }
.atlas { padding: 0; margin: 0; }
.tile { display: flex; flex-direction: column; gap: 0.7rem; height: 100%; padding: 1.3rem 1.2rem 1.4rem; text-decoration: none; color: var(--iron); transition: background 0.12s; }
.tile:hover { background: var(--parch); color: var(--iron); }
.tile:hover .tile-name { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.coord { display: inline-grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding-inline: 0.4rem; border: 2px solid var(--iron); background: var(--paper); font-family: var(--font-mono); font-weight: 600; font-size: 1.15rem; line-height: 1; color: var(--iron); border-radius: 2px; }
.coord-lg { min-width: 3.6rem; height: 3.6rem; font-size: 1.8rem; background: var(--parch); }
.tile-name { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.12; }
.tile p { margin: 0; font-size: 1.1rem; color: var(--iron-2); line-height: 1.45; }
.tile-count { margin-top: auto; font-weight: 700; color: var(--ember-ink); font-size: 1.05rem; }

/* ruled list */
.ruled { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); column-gap: 3rem; }
.ruled li { border-top: 2px solid var(--iron); }
.ruled a { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1.1rem; padding: 1.1rem 0 1.3rem; text-decoration: none; color: var(--iron); }
.ruled a:hover .r-title { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.ruled .coord { grid-row: span 2; align-self: start; margin-top: 0.15rem; }
.r-title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.15; }
.r-desc { font-size: 1.1rem; color: var(--iron-2); line-height: 1.45; }

/* templates */
.templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.template a { display: block; text-decoration: none; color: var(--iron); border: 2px solid var(--iron); background: var(--paper); }
.template a:hover { background: var(--parch); }
.template img { display: block; width: 100%; border-bottom: 2px solid var(--iron); background: var(--bg); }
.template .t-body { padding: 0.9rem 1.1rem 1.1rem; }
.template .t-name { font-family: var(--font-display); font-size: 1.45rem; display: block; line-height: 1.15; }
.template .t-desc { font-size: 1.05rem; color: var(--iron-2); line-height: 1.4; }

/* transparency */
.trust { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.trust h3 { font-size: 1.45rem; margin-bottom: 0.3rem; }
.trust p { font-size: 1.1rem; margin: 0; color: var(--iron-2); }
.trust-foot { margin-top: 1.6rem; font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { background: var(--iron); color: var(--parch); margin-top: 4rem; padding-block: 3rem 2rem; font-size: 1.05rem; }
.site-footer a { color: var(--parch); text-decoration-color: rgba(241, 230, 204, 0.4); }
.site-footer a:hover { color: #fff; text-decoration-color: var(--ember); }
.site-footer :focus-visible { outline-color: var(--parch); }
.footer-grid { display: grid; gap: 2.2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.footer-grid h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--parch); margin: 0 0 0.6rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.7rem; color: var(--parch); margin: 0 0 0.5rem; }
.footer-grid p { margin: 0; color: rgba(241, 230, 204, 0.85); max-width: 22rem; }
.footer-base { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid rgba(241, 230, 204, 0.3); display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; font-size: 0.95rem; color: rgba(241, 230, 204, 0.8); }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: 1rem; padding-block: 1.3rem 0.4rem; color: var(--ink-soft); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line-strong); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--ember-ink); }
.crumbs [aria-current] { color: var(--iron); font-weight: 600; }

/* ---------- article ---------- */
.article-head { padding-block: 1rem 1.6rem; max-width: 56rem; }
.kicker { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.kicker a { font-weight: 700; font-size: 1.1rem; }
.article-head h1 { font-size: clamp(2.2rem, 3.6vw + 0.8rem, 3.6rem); margin-bottom: 0.45em; }
.facts { display: flex; flex-wrap: wrap; gap: 0.3rem 2rem; margin: 0; font-size: 1rem; color: var(--ink-soft); }
.facts div { display: flex; gap: 0.45rem; }
.facts dt { font-weight: 700; color: var(--iron); }
.facts dd { margin: 0; }
.figure { max-width: 56rem; margin: 0 0 2.4rem; border: 2px solid var(--iron); background: var(--paper); }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { padding: 0.55rem 0.9rem; font-size: 0.98rem; color: var(--ink-soft); border-top: 2px solid var(--iron); background: var(--parch); }

.article-layout { display: grid; gap: 2rem 3.5rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 2rem; }
@media (min-width: 68rem) { .article-layout { grid-template-columns: 14.5rem minmax(0, var(--measure)); justify-content: start; } }
.toc { font-size: 1.02rem; }
.toc nav { position: sticky; top: 1.2rem; }
.toc h2 { font-size: 1.2rem; margin-bottom: 0.6rem; font-family: var(--font-display); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--iron); }
.toc a { display: block; padding: 0.35rem 0 0.35rem 0.9rem; color: var(--iron-2); text-decoration: none; line-height: 1.3; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--iron); border-left-color: var(--ember); background: rgba(224, 96, 58, 0.08); }
@media (max-width: 67.99rem) { .toc { background: var(--parch); border: 2px solid var(--iron); padding: 0.9rem 1.1rem; } .toc nav { position: static; } .toc ol { border-left: 0; columns: 2 14rem; } .toc a { padding-left: 0; border-left: 0; } }

.prose { max-width: var(--measure); font-size: 1.22rem; line-height: 1.65; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin-top: 2.6rem; scroll-margin-top: 1.5rem; }
.prose h2::before { content: ""; display: block; width: 4.8rem; height: 0.55rem; margin-bottom: 0.7rem; border: 1.5px solid var(--iron); background: linear-gradient(90deg, var(--iron) 0 20%, var(--paper) 20% 40%, var(--iron) 40% 60%, var(--paper) 60% 80%, var(--iron) 80%); }
.prose h3 { margin-top: 1.8rem; font-size: 1.45rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; padding-left: 0.2rem; }
.prose li::marker { color: var(--ember-ink); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose .callout { margin: 1.6rem 0; padding: 1rem 1.3rem; background: var(--parch); border: 2px solid var(--iron); border-left-width: 8px; border-left-color: var(--ember); }
.prose .callout p { margin: 0; }
.prose .checklist { list-style: none; padding: 0; margin: 1.4rem 0; border: 2px solid var(--iron); background: var(--paper); }
.prose .checklist li { display: flex; gap: 0.8rem; align-items: flex-start; margin: 0; padding: 0.7rem 1rem; border-top: 1.5px solid var(--line); }
.prose .checklist li:first-child { border-top: 0; }
.prose .checklist .box { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.38rem; border: 2px solid var(--iron); background: #fff; border-radius: 2px; }
.table-wrap { overflow-x: auto; margin: 1.6rem 0; border: 2px solid var(--iron); background: var(--paper); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 1.02rem; line-height: 1.4; min-width: 28rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.85rem; border: 1px solid var(--line-strong); }
.prose thead th { background: var(--iron); color: var(--parch); font-weight: 700; border-color: var(--iron); }
.prose tbody th { background: var(--parch); font-weight: 700; }
.prose .sources { list-style: decimal; font-size: 1.05rem; line-height: 1.5; }
.prose .sources .cite { font-style: normal; }
.prose .sources .note { color: var(--iron-2); display: block; margin-top: 0.15rem; }
.try { margin: 2.6rem 0 0; padding: 1.5rem 1.6rem; background: var(--iron); color: var(--parch); border-radius: 2px; }
.try h2 { color: var(--parch); font-size: 1.7rem; margin-bottom: 0.4rem; }
.try h2::before { display: none; }
.try p { color: rgba(241, 230, 204, 0.92); max-width: 34rem; }
.try .btn { background: var(--ember); border-color: var(--parch); }
.try :focus-visible { outline-color: var(--parch); }

.more { margin-top: 3.5rem; padding-top: 1.6rem; border-top: 2px solid var(--iron); }
.more h2 { font-size: 1.7rem; }
.more .ruled a { padding-block: 0.8rem 0.95rem; }
.more .r-title { font-size: 1.3rem; }
.pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.pager a { display: block; padding: 1rem 1.2rem; border: 2px solid var(--iron); text-decoration: none; color: var(--iron); background: var(--paper); }
.pager a:hover { background: var(--parch); }
.pager small { display: block; font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.2rem; }
.pager span { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; }
.pager .next { text-align: right; }

/* ---------- explorer ---------- */
.explorer-bar { display: grid; gap: 1rem 1.5rem; margin: 0 0 1.8rem; }
.search { display: block; max-width: 30rem; }
.search span { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.field, .search input, select, textarea, input[type="text"], input[type="email"], input[type="number"], input[type="search"] {
  font: inherit; font-size: 1.1rem; color: var(--iron); background: #fff; border: 2px solid var(--iron); border-radius: 2px; padding: 0.6rem 0.8rem; width: 100%;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.chip { font: inherit; font-weight: 700; font-size: 1.05rem; padding: 0.4rem 0.9rem; border: 2px solid var(--iron); background: var(--paper); color: var(--iron); cursor: pointer; border-radius: 2px; }
.chip:hover { background: var(--parch); }
.chip[aria-pressed="true"] { background: var(--iron); color: var(--parch); }
.result-count { font-weight: 600; color: var(--iron-2); min-height: 1.6em; }
.index { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); border-top: 2px solid var(--iron); border-left: 2px solid var(--iron); background: var(--bg); }
.index-col { border-right: 2px solid var(--iron); border-bottom: 2px solid var(--iron); }
.index-col > header { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem; background: var(--parch); border-bottom: 2px solid var(--iron); }
.index-col h2 { font-size: 1.3rem; margin: 0; line-height: 1.1; }
.index-col h2 a { color: var(--iron); text-decoration: none; }
.index-col h2 a:hover { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 3px; }
.index-col ol { list-style: none; margin: 0; padding: 0; }
.index-col li { border-top: 1px solid var(--line); }
.index-col li:first-child { border-top: 0; }
.index-col li a { display: grid; grid-template-columns: 2.1rem 1fr; gap: 0.5rem; padding: 0.7rem 1rem; text-decoration: none; color: var(--iron); font-size: 1.05rem; line-height: 1.3; }
.index-col li a:hover { background: var(--parch); }
.index-col li a:hover span:last-child { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 2px; }
.index-col .c { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--ember-ink); padding-top: 0.1rem; }
.index-col [hidden], .index-col[hidden] { display: none !important; }
.empty { padding: 2rem; border: 2px dashed var(--line-strong); background: var(--paper); font-size: 1.15rem; }

/* ---------- topic page ---------- */
.topic-head { padding-block: 1rem 2rem; max-width: 52rem; }
.topic-head .coord { margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.card a { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--iron); height: 100%; border: 2px solid var(--iron); background: var(--paper); }
.card a:hover { background: var(--parch); }
.card img { display: block; width: 100%; border-bottom: 2px solid var(--iron); }
.card .body { padding: 0.9rem 1.1rem 1.2rem; display: grid; gap: 0.35rem; align-content: start; }
.card .r-title { font-size: 1.4rem; }
.card .r-desc { font-size: 1.05rem; }

/* ---------- plain pages ---------- */
.page-head { padding-block: 1rem 1.2rem; max-width: 50rem; }
.page-body { padding-bottom: 2rem; }
.page-body .prose { max-width: 44rem; }
.panel-note { margin: 1.4rem 0; padding: 1rem 1.3rem; border: 2px solid var(--iron); background: var(--parch); }
.panel-note p:last-child { margin-bottom: 0; }

/* forms */
.form { display: grid; gap: 1.1rem; max-width: 36rem; margin: 1.6rem 0; padding: 1.5rem; border: 2px solid var(--iron); background: var(--paper); }
.form label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.form textarea { min-height: 9rem; resize: vertical; }
.form .hint { font-weight: 400; color: var(--ink-soft); font-size: 1rem; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: var(--moss-ink); }
.form-status.err { color: var(--ember-ink); }

/* 404 */
.lost { padding-block: 3rem 2rem; display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .lost { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.lost-grid { display: grid; grid-template-columns: repeat(8, 1fr); border-top: 2px solid var(--iron); border-left: 2px solid var(--iron); max-width: 26rem; background: var(--paper); }
.lost-grid i { aspect-ratio: 1; border-right: 2px solid var(--iron); border-bottom: 2px solid var(--iron); display: grid; place-items: center; font-style: normal; font-family: var(--font-mono); font-weight: 700; color: var(--ember-ink); font-size: 1.6rem; }

/* ---------- tool intro ---------- */
.tool-intro { padding-block: 0.7rem 0.6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.6rem; }
.tool-intro h1 { font-size: clamp(1.8rem, 2vw + 1rem, 2.5rem); margin: 0; }
.tool-intro p { margin: 0; color: var(--iron-2); font-size: 1.1rem; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .toc, .try, .skip { display: none; }
}

/* ---------- refinements ---------- */
h1, h2, h3, h4, .brand, .tile-name, .r-title, .t-name, .footer-brand, .footer-grid h2, .board-layers b, .pager span, .fg-app h2, .fg-app h3, .fg-selname { font-variant-ligatures: none; font-feature-settings: 'liga' 0, 'dlig' 0, 'calt' 0; }
.tile .coord { align-self: flex-start; }
.tile-all { background: var(--iron); color: var(--parch); }
.tile-all:hover { background: var(--iron-2); color: var(--parch); }
.tile-all .tile-name, .tile-all p { color: var(--parch); }
.tile-all .tile-count { color: #F6B08F; }
.tile-all .coord { background: var(--ember); color: var(--iron); border-color: var(--parch); }
.tile-all:focus-visible { outline-color: var(--ember); }
.board-map { display: flex; align-items: center; }
.board-map svg { width: 100%; }
.template { display: block; }
.template a { height: 100%; display: flex; flex-direction: column; }
.template .t-body { display: block; padding: 0.9rem 1.1rem 1.1rem; }
.template img { aspect-ratio: 800 / 580; object-fit: cover; }
.trust-foot { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; }

@media (max-width: 40rem) {
  .header-in { gap: 0.5rem 1rem; }
  .brand { font-size: 1.5rem; }
  .nav { gap: 0.3rem 1.05rem; }
  .nav a { font-size: 1.02rem; }
  .nav .nav-cta { padding: 0.4rem 0.75rem; }
}

/* page headings: align with the content grid, keep the text measure */
.page-head, .topic-head { max-width: var(--wrap); }
.page-head > *, .topic-head > * { max-width: 50rem; }
.page-head h1, .topic-head h1 { font-size: clamp(2.2rem, 3.2vw + 0.9rem, 3.5rem); }
.topic-head .coord-lg { max-width: none; }
.card .body .coord { justify-self: start; }

/* ===================== design pass ===================== */
:root {
  --c-a: #36323B; --c-b: #E0603A; --c-c: #D99A2B; --c-d: #6E9B57; --c-e: #4F8DB5;
  --wrap-wide: 84rem;
  --noise: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .21 0 0 0 0 .2 0 0 0 0 .23 0 0 0 .085 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-part="A"], [data-cluster="A"] { --part: var(--c-a); }
[data-part="B"], [data-cluster="B"] { --part: var(--c-b); }
[data-part="C"], [data-cluster="C"] { --part: var(--c-c); }
[data-part="D"], [data-cluster="D"] { --part: var(--c-d); }
[data-part="E"], [data-cluster="E"] { --part: var(--c-e); }
.wrap-wide { max-width: var(--wrap-wide); }

/* every part of the atlas has its own color: the letter says where you are */
.coord[data-part] { border-top: 5px solid var(--part); }
.coord-lg[data-part] { background: var(--part); color: var(--iron); border-top-width: 2px; border-top-color: var(--iron); }
.coord-lg[data-part="A"] { color: var(--parch); }

/* paper grain on parchment bands */
.band { background-color: var(--parch); background-image: var(--noise); }
.section-head::before { content: ""; display: block; width: 4.8rem; height: 0.55rem; margin-bottom: 0.9rem; border: 1.5px solid var(--iron); background: linear-gradient(90deg, var(--iron) 0 20%, var(--paper) 20% 40%, var(--iron) 40% 60%, var(--paper) 60% 80%, var(--iron) 80%); }

/* hero */
@media (min-width: 62rem) { .hero-in { grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr); } }
.hero h1 { font-size: clamp(2.4rem, 3.4vw + 0.8rem, 4rem); }
.hero-art { min-width: 0; }
.board-cap { margin: 1.5rem 0 0; font-size: 1rem; color: var(--ink-soft); max-width: 38rem; }

/* atlas tiles with a picture */
.atlas { grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }
.tile { padding: 0; gap: 0; }
.tile::before { content: ""; display: block; height: 0.6rem; background: var(--part, var(--iron)); border-bottom: 2px solid var(--iron); }
.tile-img { display: block; overflow: hidden; background: var(--bg); border-bottom: 2px solid var(--iron); }
.tile-img img { display: block; width: 100%; height: auto; transition: transform 0.5s ease; }
.tile:hover .tile-img img { transform: scale(1.05); }
.tile-body { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; padding: 0 1.2rem 1.4rem; }
.tile-body .coord-lg { margin-top: -1.9rem; position: relative; z-index: 1; box-shadow: 3px 3px 0 var(--iron); }
.tile-img-all { display: grid; place-items: center; aspect-ratio: 1200 / 615; background-color: var(--iron); background-image: linear-gradient(rgba(241, 230, 204, 0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(241, 230, 204, 0.14) 1px, transparent 1px); background-size: 28px 28px; color: var(--parch); }
.tile-img-all span { font-family: var(--font-display); font-size: clamp(3.6rem, 6vw, 5rem); line-height: 1; font-variant-ligatures: none; }
.tile.tile-all .coord-lg { background: var(--ember); color: var(--iron); border-color: var(--parch); box-shadow: 3px 3px 0 var(--parch); }
.tile.tile-all::before { background: var(--ember); border-bottom-color: var(--parch); }
.tile-all .tile-img { border-bottom-color: var(--parch); }

/* start-here list with thumbnails */
.ruled.with-thumbs { column-gap: 3.5rem; }
.ruled.with-thumbs a { grid-template-columns: 11.5rem auto 1fr; grid-template-areas: "thumb coord title" "thumb desc desc"; column-gap: 1rem; align-items: start; }
.ruled.with-thumbs .thumb { grid-area: thumb; display: block; border: 2px solid var(--iron); background: var(--paper); overflow: hidden; }
.ruled.with-thumbs .thumb img { display: block; width: 100%; height: auto; transition: transform 0.5s ease; }
.ruled.with-thumbs a:hover .thumb img { transform: scale(1.05); }
.ruled.with-thumbs .coord { grid-area: coord; grid-row: auto; margin-top: 0.1rem; }
.ruled.with-thumbs .r-title { grid-area: title; }
.ruled.with-thumbs .r-desc { grid-area: desc; }
@media (max-width: 40rem) { .ruled.with-thumbs a { grid-template-columns: 6.5rem auto 1fr; column-gap: 0.7rem; } .ruled.with-thumbs .coord { min-width: 2.2rem; height: 2.2rem; font-size: 1rem; } }

/* trust icons */
.trust-ico { display: block; margin-bottom: 0.7rem; }
.trust-ico svg { display: block; width: 3.2rem; height: 3.2rem; }

/* footer: ruler edge and compass */
.site-footer { position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; pointer-events: none; background: repeating-linear-gradient(90deg, rgba(241, 230, 204, 0.6) 0 2px, transparent 2px 80px) top / 100% 12px no-repeat, repeating-linear-gradient(90deg, rgba(241, 230, 204, 0.45) 0 1px, transparent 1px 16px) top / 100% 6px no-repeat; }
.footer-grid .compass { display: block; width: 5.2rem; height: 5.2rem; margin-top: 1.5rem; color: var(--parch); opacity: 0.85; }

/* explorer: each column wears its color */
.index-col > header { box-shadow: inset 0 6px 0 var(--part, var(--iron)); padding-top: 1.25rem; }
.chip[data-cluster]:not([data-cluster="all"]) { border-left: 6px solid var(--part); }

/* article page */
.progress { position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 60; background: rgba(54, 50, 59, 0.12); }
.progress i { display: block; height: 100%; width: 0; background: var(--ember); }
.figure::before { content: ""; display: block; height: 14px; border-bottom: 2px solid var(--iron); background-color: var(--parch); background-image: repeating-linear-gradient(90deg, var(--iron) 0 1.5px, transparent 1.5px 12px), repeating-linear-gradient(90deg, var(--iron) 0 2px, transparent 2px 60px); background-size: 100% 6px, 100% 12px; background-position: bottom, bottom; background-repeat: no-repeat; }
.article-main .prose > p:first-child { font-size: 1.38rem; line-height: 1.5; color: var(--iron-2); }
.toc a.is-active { color: var(--iron); font-weight: 700; border-left-color: var(--ember-ink); background: rgba(224, 96, 58, 0.1); }
.rail { display: none; }
.rail-in { position: sticky; top: 1.2rem; border: 2px solid var(--iron); background: var(--paper); }
.rail-in h2 { margin: 0; padding: 1.1rem 1rem 0.7rem; font-size: 1.2rem; background: var(--parch); border-bottom: 2px solid var(--iron); box-shadow: inset 0 6px 0 var(--part, var(--iron)); }
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { border-top: 1px solid var(--line); }
.rail-list li:first-child { border-top: 0; }
.rail-list a, .rail-list li[aria-current] { display: grid; grid-template-columns: 2.1rem 1fr; gap: 0.35rem; padding: 0.6rem 0.9rem; font-size: 0.98rem; line-height: 1.3; text-decoration: none; color: var(--iron); }
.rail-list a:hover { background: var(--parch); }
.rail-list a:hover span:last-child { text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 2px; }
.rail-list li[aria-current] { background: var(--parch); font-weight: 700; box-shadow: inset 4px 0 0 var(--part, var(--iron)); }
.rail-list .coord { min-width: 0; height: auto; padding: 0; border: 0; background: none; font-size: 0.85rem; color: var(--ember-ink); justify-self: start; padding-top: 0.1rem; }
@media (min-width: 90rem) {
  .article-layout { grid-template-columns: 13.5rem minmax(0, 42rem) 16.5rem; gap: 2.5rem 3rem; }
  .rail { display: block; }
  .more { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tile-img img, .ruled.with-thumbs .thumb img { transition: none; }
  .tile:hover .tile-img img, .ruled.with-thumbs a:hover .thumb img { transform: none; }
}

.home .site-footer { margin-top: 0; }
