:root {
  --ink: #17223b;
  --muted: #526077;
  --ground: #f2f1ff;
  --paper: #ffffff;
  --cobalt: #2a4bff;
  --orange: #ff8e4f;
  --mint: #b7f0d6;
  --yellow: #ffe66d;
  --line: #17223b;
  --max: 1180px;
  --display: Georgia, "Times New Roman", serif;
  --body: Arial, Helvetica, sans-serif;
  --utility: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--body);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .8rem 1rem;
  color: var(--paper);
  background: var(--ink);
}
.skip-link:focus { top: 1rem; }

.site-header {
  border-bottom: 3px solid var(--line);
  background: var(--paper);
}
.header-inner {
  width: min(calc(100% - 2rem), var(--max));
  min-height: 82px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(1.12rem, 2.2vw, 1.45rem);
  font-weight: 700;
}
.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--utility);
  font-size: .84rem;
}
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.4rem);
  flex-wrap: wrap;
}
.primary-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.primary-nav a[aria-current="page"], .primary-nav a:hover { border-color: var(--cobalt); }

main { min-height: 60vh; }
.shell { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.hero { padding: clamp(3.5rem, 8vw, 7.5rem) 0 clamp(4rem, 8vw, 7rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.eyebrow, .utility {
  margin: 0 0 1rem;
  font-family: var(--utility);
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.06; text-wrap: balance; }
h1 { max-width: 11ch; margin: 0; font-size: clamp(3rem, 7.2vw, 6.9rem); letter-spacing: -.055em; }
h2 { margin: 0 0 1.25rem; font-size: clamp(2rem, 4.4vw, 4.35rem); letter-spacing: -.035em; }
h3 { margin: 0 0 .65rem; font-size: clamp(1.35rem, 2.4vw, 2rem); }
p { max-width: 70ch; }
.lede { max-width: 58ch; margin: 1.5rem 0 0; font-size: clamp(1.08rem, 1.7vw, 1.35rem); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .72rem 1.2rem;
  border: 2px solid var(--line);
  color: var(--paper);
  background: var(--cobalt);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--line);
  cursor: pointer;
}
.button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--line); }
.button.secondary { color: var(--ink); background: var(--paper); }

.ledger {
  position: relative;
  min-height: 470px;
  padding: 2rem 0 0 1rem;
}
.ledger::before {
  content: "";
  position: absolute;
  inset: 1rem auto 0 12%;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--cobalt) 0 12px, transparent 12px 25px);
}
.sheet {
  position: relative;
  width: 88%;
  min-height: 145px;
  margin: 0 0 -1rem;
  padding: 1.35rem 1.4rem 1.35rem 5rem;
  border: 3px solid var(--line);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--line);
}
.sheet:nth-child(2) { margin-left: 7%; background: var(--mint); }
.sheet:nth-child(3) { margin-left: 14%; background: var(--yellow); }
.sheet-tab {
  position: absolute;
  top: -2.05rem;
  right: -3px;
  min-width: 9.5rem;
  padding: .35rem .65rem;
  border: 3px solid var(--line);
  border-bottom: 0;
  background: inherit;
  font-family: var(--utility);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
}
.sheet-number { position: absolute; left: 1.2rem; top: 1.15rem; font: 700 1.9rem/1 var(--utility); }
.sheet p { margin: 0; }

.section { padding: clamp(4rem, 8vw, 7rem) 0; border-top: 3px solid var(--line); }
.section.white { background: var(--paper); }
.section.ink { color: var(--paper); background: var(--ink); }
.section-head { display: grid; grid-template-columns: .35fr 1fr; gap: 2rem; align-items: start; margin-bottom: 2.5rem; }
.section-head p { margin-top: .35rem; font-size: 1.08rem; }
.ledger-list { border-top: 3px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row .utility { margin: .25rem 0 0; }
.ledger-row p { margin: 0; }
.ledger-row a { font-weight: 700; }
.rule-note {
  display: grid;
  grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr);
  border: 3px solid var(--line);
  background: var(--yellow);
}
.rule-note > * { padding: clamp(1.25rem, 3vw, 2.4rem); }
.rule-note .rule-number { display: grid; place-items: center; border-right: 3px solid var(--line); font: 700 clamp(3rem, 7vw, 6rem)/1 var(--display); }
.rule-note p { margin: 0 0 .75rem; }

.source-toggle {
  margin-top: 2rem;
  padding: .65rem 1rem;
  border: 2px solid currentColor;
  color: inherit;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.source-notes { margin-top: 1rem; padding: 1.25rem; border-left: 6px solid var(--orange); background: rgba(255,255,255,.1); }
.source-notes[hidden] { display: none; }

.form-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.form-copy { position: sticky; top: 1.5rem; }
.form-copy .receipt { margin-top: 2rem; padding: 1rem; border: 2px dashed currentColor; font-family: var(--utility); font-size: .88rem; }
.form-panel { padding: clamp(1.25rem, 3vw, 2.5rem); border: 3px solid var(--line); color: var(--ink); background: var(--paper); box-shadow: 10px 10px 0 var(--orange); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1rem; }
.field.full { grid-column: 1 / -1; }
label, legend { display: block; margin-bottom: .35rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .7rem .8rem;
  border: 2px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
}
textarea { min-height: 150px; resize: vertical; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: .65rem; align-items: start; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: .2rem; }
.help { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.form-status { min-height: 1.7rem; margin: 1rem 0; font-weight: 700; }
.form-status[data-state="error"] { color: #9b1c1c; }
.form-result { margin-top: 1.25rem; padding: 1rem; border: 3px solid var(--line); background: var(--mint); }
.form-result code { display: block; margin-top: .5rem; font-family: var(--utility); font-weight: 700; }

.page-hero { padding: clamp(3rem, 7vw, 6rem) 0; border-bottom: 3px solid var(--line); background: var(--paper); }
.page-hero h1 { max-width: 13ch; font-size: clamp(2.7rem, 6.5vw, 6rem); }
.prose { max-width: 820px; }
.prose h2 { margin-top: 2.5rem; font-size: clamp(1.8rem, 3.5vw, 3rem); }
.prose h3 { margin-top: 2rem; }
.prose li + li { margin-top: .45rem; }
.contact-block { margin: 2rem 0; padding: 1.4rem; border: 3px solid var(--line); background: var(--mint); }
.address { font-style: normal; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 3px solid var(--line); border-left: 3px solid var(--line); }
.source-item { padding: 1.3rem; border-right: 3px solid var(--line); border-bottom: 3px solid var(--line); background: var(--paper); }
.source-item p { margin-bottom: 0; }

.cookie-notice {
  position: relative;
  z-index: 20;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  color: var(--ink);
  background: var(--yellow);
}
.cookie-inner { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; padding: 1rem 0; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.cookie-inner p { margin: 0; }
.cookie-notice button { padding: .6rem 1rem; border: 2px solid var(--line); color: var(--paper); background: var(--ink); font-weight: 700; cursor: pointer; }
.cookie-status { min-height: 1px; margin: 0; }

.site-footer { padding: 3.5rem 0 2rem; color: var(--paper); background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.1fr .9fr .9fr; gap: 2rem; }
.site-footer h2 { font: 700 1rem/1.3 var(--utility); letter-spacing: .04em; text-transform: uppercase; }
.site-footer a { color: var(--paper); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: .35rem; }
.cookie-settings {
  position: fixed;
  right: .75rem;
  bottom: .75rem;
  z-index: 40;
  min-height: 44px;
  padding: .6rem .8rem;
  border: 2px solid var(--paper);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--orange);
  cursor: pointer;
}
.footer-note { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.35); font-size: .9rem; }

@media (max-width: 800px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: 1rem 0; }
  .primary-nav { width: 100%; }
  .primary-nav ul { gap: .35rem 1rem; }
  .hero-grid, .form-layout, .section-head { grid-template-columns: 1fr; }
  .ledger { min-height: 430px; padding-left: 0; }
  .ledger::before { left: 8%; }
  .sheet { width: 92%; padding-left: 4rem; }
  .sheet:nth-child(2) { margin-left: 4%; }
  .sheet:nth-child(3) { margin-left: 8%; }
  .ledger-row { grid-template-columns: 1fr; gap: .45rem; }
  .rule-note { grid-template-columns: 1fr; }
  .rule-note .rule-number { border-right: 0; border-bottom: 3px solid var(--line); }
  .form-copy { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .shell, .header-inner, .cookie-inner { width: min(calc(100% - 1.2rem), var(--max)); }
  h1 { font-size: clamp(2.65rem, 15vw, 4.4rem); }
  .sheet { width: 94%; min-height: 155px; padding: 1.2rem 1rem 1.2rem 3.5rem; }
  .sheet:nth-child(2) { margin-left: 3%; }
  .sheet:nth-child(3) { margin-left: 6%; }
  .sheet-number { left: .8rem; }
  .sheet-tab { min-width: 7.6rem; }
  .form-grid, .source-grid, .footer-grid, .cookie-inner { grid-template-columns: 1fr; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .button, .form-panel, .sheet, .rule-note { box-shadow: none; }
}
