:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5b616b;
  --line: #e4e1da;
  --accent: #1f4e5f;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1f3;
  --radius: 6px;
  --max: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; gap: 1.75rem; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .8rem; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--accent); font-weight: 600; }
}

/* Typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .75rem; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; margin-bottom: .75rem; }

/* Layout */
section { padding: 4rem 0; }
.hero { padding: 5rem 0 4rem; border-bottom: 1px solid var(--line); }
.page-head { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 2.25rem; }

.btn { display: inline-block; padding: .75rem 1.3rem; border-radius: var(--radius); font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #173b49; }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.band .card { background: var(--bg); }
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.tag { display: inline-block; font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: .1rem .5rem; margin: 0 .35rem .35rem 0; }

.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.meta-list li span:first-child { color: var(--muted); }

/* Prose pages */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .35rem; }

.hub { display: grid; grid-template-columns: 220px 1fr; gap: 3.5rem; align-items: start; }
.toc { position: sticky; top: 88px; font-size: .92rem; }
.toc p { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem .9rem; color: var(--muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }
@media (max-width: 860px) {
  .hub { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; }
}
.hub article section { padding: 0 0 2.75rem; margin-bottom: 2.75rem; border-bottom: 1px solid var(--line); }
.hub article section:last-child { border-bottom: 0; }
.hub article h2 { scroll-margin-top: 90px; }
.hub table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0 1.25rem; }
.hub th, .hub td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.hub th { font-weight: 600; background: var(--accent-soft); }
.table-scroll { overflow-x: auto; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--accent-soft); padding: .1em .35em; border-radius: 3px; }

/* Form */
.form { display: grid; gap: 1.1rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9c5bb; border-radius: var(--radius); padding: .7rem .85rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; }
.field-error { color: #9b1c1c; font-size: .85rem; margin-top: .3rem; min-height: 1.1em; }
.form-note { font-size: .88rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .site-header, .site-footer, .toc, .actions { display: none; } }

/* Contact icons */
.social { display: flex; gap: .6rem; align-items: center; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: var(--surface); }
.social a:hover { background: var(--accent-soft); border-color: var(--accent); }
