:root {
  --navy: #0e2240;
  --navy-2: #163056;
  --ink: #1a2332;
  --muted: #3d4b5e;
  --paper: #f3f0e8;
  --sheet: #fffcf7;
  --line: #ddd4c4;
  --gold: #c6a15a;
  --gold-deep: #8a6230;
  --burgundy: #7c2f32;
  --link: #0d3f78;
  --link-hover: #082848;
  --cream: #f7f4ee;
  --cream-dim: #e7e1d6;
  --max: 44rem;
  --wide: 72rem;
  --header: 4.25rem;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a {
  color: var(--link);
  text-underline-offset: 0.16em;
  overflow-wrap: break-word;
}
a:hover { color: var(--link-hover); }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

::selection {
  background: #e7d3a4;
  color: var(--ink);
}

h1, h2, h3, [id] { scroll-margin-top: 5.25rem; }

h1, h2, h3 {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 1.25rem + 2.4vw, 3.15rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.75rem);
  margin: 2.5rem 0 0.7rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.7rem 0 0.45rem;
}

p { margin: 0.8rem 0; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transform: translateY(-150%);
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  z-index: 80;
  border-radius: 0.4rem;
  text-decoration: none;
}
.skip:focus {
  position: fixed;
  top: 0.6rem;
  transform: none;
  color: var(--navy);
}

.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;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin-inline: auto;
}
.wrap.wide { width: min(var(--wide), calc(100% - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  color: var(--cream);
  padding-top: env(safe-area-inset-top);
  border-bottom: 3px solid var(--gold);
}

.site-header :focus-visible { outline-color: var(--gold); }

.header-inner {
  width: min(var(--wide), calc(100% - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin-inline: auto;
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.brand {
  display: block;
  flex: 0 1 15.75rem;
  min-width: 0;
  max-width: 15.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: 0.4rem;
}
.brand:hover { color: inherit; }

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(247, 244, 238, 0.35);
  border-radius: 0.55rem;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.08); }

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--cream);
  border-radius: 1px;
  position: relative;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }

.site-header.is-open .nav-toggle-icon { background: transparent; }
.site-header.is-open .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--navy-2);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 16px 32px rgba(8, 16, 32, 0.28);
  max-height: calc(100vh - 4.5rem);
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  padding: 0.4rem 0 0.7rem;
}

.site-header.is-open .site-nav { display: block; }

.site-nav ul {
  width: min(var(--wide), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0.8rem 0.75rem;
  border-radius: 0.55rem;
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.site-nav a[aria-current="page"] {
  color: #f3e6c4;
  background: rgba(198, 161, 90, 0.16);
  box-shadow: inset 0 0 0 1px rgba(198, 161, 90, 0.5);
}

@media (min-width: 64rem) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    flex: 0 1 auto;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav ul {
    width: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.1rem;
    margin: 0;
  }
  .site-nav a {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
  }
}

.notice {
  background: #efe6d4;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.45;
}
.notice p { margin-block: 0; padding: 0.55rem 0; }

.hero {
  background: var(--navy);
  color: var(--cream);
}
.hero picture { display: block; }
.hero img {
  display: block;
  width: 100%;
  max-width: none;
  height: clamp(11.5rem, 42vw, 26rem);
  object-fit: cover;
  object-position: center 40%;
}
.hero-panel {
  border-top: 3px solid var(--gold);
  padding: 1.6rem 0 1.7rem;
}
.hero :focus-visible { outline-color: var(--gold); }
.hero h1 { color: var(--cream); }
.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero .lead {
  color: var(--cream-dim);
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  max-width: 42rem;
}
.hero .meta { color: #e4d7bc; margin-bottom: 0.35rem; }
.hero a { color: #f3e6c4; }
.hero a:hover { color: #fff; }
.photo-credit {
  margin: 0.85rem 0 0;
  color: #e4d7bc;
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 46rem;
}

.guides { padding: 1.75rem 0 0.5rem; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 0;
}
@media (min-width: 42rem) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.9rem;
  row-gap: 0.3rem;
  align-items: start;
  background: var(--sheet);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.1rem 1.1rem 1.15rem;
  box-shadow: 0 1px 0 rgba(14, 34, 64, 0.04);
  min-width: 0;
}
.card:hover {
  border-color: var(--gold);
  color: inherit;
  box-shadow: 0 10px 28px rgba(14, 34, 64, 0.08);
}
.card strong {
  color: var(--navy);
  font-size: 1.12rem;
  letter-spacing: -0.015em;
}
.card:hover strong { color: var(--burgundy); }
.card-blurb {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: break-word;
}
.card-icon {
  grid-row: span 2;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--navy);
  color: #f3e6c4;
}
.card-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
}

.page-intro {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 3px solid var(--gold);
  padding: 1.5rem 0 1.65rem;
}
.page-intro :focus-visible { outline-color: var(--gold); }
.page-intro h1 {
  color: var(--cream);
  margin-top: 0.35rem;
}
.page-intro .lead {
  color: var(--cream-dim);
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 42rem;
}
.page-intro .meta { color: #e4d7bc; }
.page-intro a { color: #f3e6c4; }
.page-intro a:hover { color: #fff; }

.prose { padding: 0.4rem 0 3rem; }
.prose h2 {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.lead { font-size: 1.15rem; line-height: 1.6; }
.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.crumbs {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: #8d8374;
}
.page-intro .crumbs { color: #e4d7bc; }
.page-intro .crumbs li:not(:last-child)::after { color: var(--gold); }

blockquote {
  margin: 1.15rem 0;
  padding: 1rem 1.1rem 0.9rem;
  background: var(--sheet);
  border-left: 4px solid var(--gold);
  border-radius: 0 0.7rem 0.7rem 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.55;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }
blockquote footer {
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 0.55rem;
}

ul.plain { padding-left: 1.25rem; }
ul.plain li { margin: 0.35rem 0; }

.table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 1rem 0 1.5rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.table-scroll:focus-visible { outline-offset: 3px; }
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  padding: 0.8rem 0.85rem 0.35rem;
  caption-side: top;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table-scroll tbody th,
.table-scroll thead th:first-child { width: 28%; }
thead th {
  background: #e6edf5;
  color: var(--navy);
  font-weight: 700;
}
tbody th { color: var(--navy); font-weight: 600; }
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f7f4ee; }

.notes {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem 0.9rem 2.3rem;
  font-size: 0.95rem;
}
.notes li { margin: 0.6rem 0; padding-left: 0.15rem; }
.notes a { overflow-wrap: anywhere; }
sup a {
  text-decoration: none;
  font-weight: 700;
  padding: 0 0.12rem;
}

pre.machine {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.05rem;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.5;
}

.site-footer {
  background: var(--navy);
  color: var(--cream-dim);
  border-top: 3px solid var(--gold);
  padding: 2.1rem 0 calc(2.2rem + env(safe-area-inset-bottom));
  font-size: 0.95rem;
}
.site-footer :focus-visible { outline-color: var(--gold); }
.site-footer a { color: #f3e6c4; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  gap: 1.5rem 2rem;
}
@media (min-width: 48rem) {
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 1.15fr; align-items: start; }
}
.footer-name {
  margin: 0 0 0.4rem;
  color: var(--cream);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.site-footer p { margin: 0.45rem 0; }
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer nav a {
  display: inline-block;
  padding: 0.2rem 0;
  text-decoration: none;
  font-weight: 600;
}
.site-footer nav a:hover { text-decoration: underline; }
.site-footer nav a[aria-current="page"] { color: var(--gold); }
.footer-machine {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.7rem;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-toggle-icon,
  .nav-toggle-icon::before,
  .nav-toggle-icon::after { transition: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .skip, .notice, .nav-toggle, .site-nav, .site-footer { display: none; }
  .site-header { position: static; background: #fff; color: #000; border-bottom: 2px solid #000; }
  .wordmark { width: 12rem; }
  .hero, .page-intro { background: #fff; color: #000; }
  .hero h1, .page-intro h1, .hero .lead, .page-intro .lead, .hero .meta, .page-intro .meta, .photo-credit, .eyebrow { color: #000; }
  a { color: #000; }
  .card, blockquote, .notes, .table-scroll { break-inside: avoid; }
}
