:root {
  --paper: #F5F1E6;
  --paper-2: #FBF8EF;
  --grid: #BFD3E6;
  --ink: #1F2A44;
  --ink-soft: #46516B;
  --brass: #B8893B;
  --red: #C2412D;
  --display: "Yeseva One", Georgia, serif;
  --body: "Mukta", "Segoe UI", sans-serif;
  --mono: "Kode Mono", ui-monospace, monospace;
  --cell: 24px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-attachment: fixed;
}
a { color: var(--ink); text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible, .table-wrap:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--paper-2); border: 1px dashed var(--grid); padding: .1em .35em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2.5rem); }

.masthead { background: var(--paper-2); border-bottom: 3px double var(--ink); position: relative; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px var(--cell)); opacity: .35; }
.masthead__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; padding: 1rem 0; }
.brand { font-family: var(--display); font-size: 1.55rem; text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.brand__pan { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 2px solid var(--ink); background: var(--brass); color: var(--ink); font-size: 1.15rem; transform: rotate(-4deg); }
.topnav { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: .9rem; text-transform: lowercase; }
.topnav a { text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current="page"], .topnav a:hover { border-bottom-color: var(--red); }

.sheet { position: relative; }
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: max(1rem, calc(50% - 600px)); width: 2px; background: var(--red); opacity: .55; pointer-events: none; }

.tag { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: .8rem; }
.tag::before { content: "▸ "; }
.tag--light { color: #F3B8A9; }

.hero { padding: clamp(3rem, 8vw, 6rem) 0 3.5rem; }
.hero__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: end; }
.hero h1 { max-width: 17ch; }
.hero h1::after { content: ""; display: block; width: 7rem; height: 6px; margin-top: 1.1rem; background: var(--brass); }
.hero__lede { font-size: 1.15rem; max-width: 60ch; color: var(--ink-soft); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn { display: inline-block; font-family: var(--mono); font-size: .9rem; padding: .7rem 1.2rem; background: var(--ink); color: var(--paper); text-decoration: none; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--brass); }
.btn:hover { color: var(--paper); background: var(--red); border-color: var(--red); }
.btn--ghost { background: transparent; color: var(--ink); }
.hero__steps { list-style: none; margin: 0; padding: 1.4rem; background: var(--paper-2); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--grid); transform: rotate(1.2deg); }
.hero__steps li { display: flex; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--grid); }
.hero__steps li:last-child { border-bottom: 0; }
.hero__steps span { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--red); color: var(--red); flex: none; }

.band { padding: 4rem 0; background: rgba(251, 248, 239, .88); border-block: 1px solid var(--grid); }
.band--ink { background: var(--ink); color: var(--paper); }
.band--ink a { color: var(--paper); }
.page { padding: 3.5rem 0; }

.scale-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 3rem; align-items: center; }
.scale-figure { margin: 0; background: var(--paper-2); border: 2px solid var(--ink); padding: .75rem; box-shadow: -10px 10px 0 var(--brass); }
.scale-figure figcaption { padding: .6rem .25rem 0; color: var(--ink-soft); font-size: .8rem; }
.scale { display: block; width: 100%; height: auto; }
.scale__beam { transform-box: view-box; transform-origin: 280px 92px; animation: tilt 6s ease-in-out infinite alternate; }
.scale__pan { transform-box: view-box; animation: counter 6s ease-in-out infinite alternate; }
.scale__pan--left { transform-origin: 120px 92px; }
.scale__pan--right { transform-origin: 440px 92px; }
@keyframes tilt { from { transform: rotate(-2deg); } to { transform: rotate(-9deg); } }
@keyframes counter { from { transform: rotate(2deg); } to { transform: rotate(9deg); } }

.table-wrap { overflow-x: auto; background: var(--paper-2); border: 2px solid var(--ink); }
.ledger { width: 100%; border-collapse: collapse; min-width: 640px; }
.ledger caption { text-align: left; font-family: var(--mono); font-size: .8rem; padding: .8rem 1rem; color: var(--ink-soft); border-bottom: 1px solid var(--grid); }
.ledger th, .ledger td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--grid); vertical-align: top; }
.ledger th { font-family: var(--mono); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; background: var(--ink); color: var(--paper); }
.ledger td:first-child { font-weight: 600; border-left: 4px solid var(--brass); }
.ledger tr:last-child td:first-child { border-left-color: var(--red); }
.ledger td:nth-child(2) { font-family: var(--mono); font-size: .85rem; color: var(--red); }

.risks { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.risks li { border: 1px solid rgba(245, 241, 230, .35); border-top: 4px solid var(--red); padding: 1.2rem; background: rgba(245, 241, 230, .04); }
.risks h3 { color: #F0D29A; }
.risks p { margin: 0; font-size: .97rem; }

.entries { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1rem; }
.entry { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.2rem; padding: 1.3rem; background: var(--paper-2); border: 1px solid var(--ink); border-left: 6px solid var(--brass); }
.entry__num { font-size: 1.8rem; color: var(--red); line-height: 1; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry p { margin: 0; color: var(--ink-soft); }

.dochead { padding: 3.5rem 0 1.5rem; }
.dochead__meta { color: var(--ink-soft); }
.prose { background: var(--paper-2); border: 1px solid var(--grid); padding: clamp(1.4rem, 4vw, 3rem); box-shadow: 6px 6px 0 rgba(31, 42, 68, .08); }
.prose h2 { margin-top: 1.8em; font-size: 1.55rem; }
.prose h2::before { content: "§ "; color: var(--brass); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--red); }
.lede { font-family: var(--display); font-size: 1.35rem; line-height: 1.4; border-left: 4px solid var(--red); padding-left: 1rem; }
.note { font-family: var(--mono); font-size: .82rem; color: var(--ink-soft); border-top: 1px dashed var(--grid); padding-top: 1rem; margin-top: 2rem; }
.more { margin-top: 2.5rem; padding: 1.2rem 1.4rem; border: 2px dashed var(--brass); }
.more h2 { margin-top: 0; font-size: 1.2rem; }
.more h2::before { content: ""; }
.mailbox { font-family: var(--mono); font-size: 1.2rem; padding: 1rem; border: 2px solid var(--ink); background: var(--paper); display: inline-block; }
.back { font-family: var(--mono); font-size: .9rem; }

.colophon { background: var(--ink); color: var(--paper); padding: 2.5rem 0; border-top: 6px solid var(--brass); }
.colophon a { color: var(--paper); }
.colophon__nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-family: var(--mono); font-size: .85rem; margin-bottom: 1.2rem; }
.colophon__note { font-size: .9rem; opacity: .85; margin: 0 0 .4rem; }

@media (max-width: 860px) {
  .hero__grid, .scale-grid { grid-template-columns: 1fr; }
  .hero__steps { transform: none; }
  .sheet::before { display: none; }
}
@media (max-width: 520px) {
  .entry { grid-template-columns: 1fr; gap: .4rem; }
  .masthead__row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scale__beam { animation: none; transform: rotate(-6deg); }
  .scale__pan { animation: none; transform: rotate(6deg); }
}
