:root {
  --paper: #F3F1E9;
  --ink: #263A40;
  --sheet: #FFFEFA;
  --accent: #B76A4E;
  --accent-2: #688D87;
  --panel: #253C43;
  --border: #D6D5CC;
  --muted: #75817D;
  --highlight: #E9DFC5;
  --max: 1260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, transparent 58px, rgba(104, 141, 135, 0.07) 59px, transparent 60px),
    linear-gradient(#e8e6dc 1px, transparent 1px);
  background-size: auto, 100% 2.1rem;
  background-color: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a { color: #6d4334; text-underline-offset: 0.16em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--panel);
  color: #fff;
  padding: 0.5rem 0.8rem;
  z-index: 20;
}
.skip-link:focus { top: 0.5rem; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.site-header {
  height: 68px;
  border-bottom: 1px solid var(--border);
  background: rgba(243, 241, 233, 0.96);
  position: sticky;
  top: 0;
  z-index: 12;
}
.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: grid;
  font-family: "Iowan Old Style", Palatino, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.05;
  color: var(--panel);
  text-decoration: none;
  font-size: 0.9rem;
}
.wordmark span { display: block; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.section-kicker {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

h1, h2, h3 {
  font-family: "Iowan Old Style", Palatino, "Times New Roman", serif;
  color: var(--panel);
  line-height: 1.2;
}
h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); margin: 0 0 0.55rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.5rem; }
h3 { font-size: 1.08rem; margin: 0 0 0.35rem; }

.lede, .muted { color: var(--muted); }
.page-section {
  padding: 2.2rem 0;
  border-top: 1px solid var(--border);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; }
.prose { max-width: 42rem; }
.prose p { margin: 0 0 1rem; }
.prose h2 { margin-top: 1.7rem; }
.prose h3 { margin-top: 1.15rem; }

.num {
  font-family: ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}
.tech-line, code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.example-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.8rem;
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.tool-tabs { display: grid; gap: 0.7rem; }
.tool-tabs a {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}
.tool-tabs a.is-active { color: var(--accent); }

.btn {
  appearance: none;
  border: 1px solid var(--panel);
  background: var(--panel);
  color: #F3F1E9;
  font: inherit;
  padding: 0.58rem 0.85rem;
  cursor: pointer;
}
.btn:hover { background: #1b2d32; }
.btn-secondary { background: transparent; color: var(--panel); }
.btn-secondary:hover { background: var(--highlight); }
.btn-row, .actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; }
.status { min-height: 1.35em; }
.status.is-error { color: #7A3A2C; }

label span, .field-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  padding: 0.55rem 0.65rem;
  min-height: 2.55rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.3rem 0 2rem;
  font-size: 0.9rem;
}
.footer-id { font-family: Palatino, serif; margin: 0 0 0.7rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
}
.city-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.city-card { border-top: 1px solid var(--border); padding-top: 0.7rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 759px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 68px;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1rem 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.5rem; }
  .grid-2, .example-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .actions .btn, .btn-row .btn { width: auto; flex: 1 1 10rem; }
}
