:root {
  color-scheme: light;
  --ink: #151b24;
  --ink-soft: #4f5b65;
  --muted: #727c84;
  --paper: #ffffff;
  --paper-soft: #fafbfd;
  --canvas: #f6f7f6;
  --blue-wash: #edf1fb;
  --line: #d8dcdd;
  --line-dark: #aeb7bc;
  --navy: #173878;
  --navy-deep: #10275a;
  --blue: #315bc2;
  --teal: #167c78;
  --red: #ad3d2c;
  --gold: #be8626;
  --sky: #c8dce7;
  --sage: #bfd0c5;
  --rose: #ead8d3;
  --cream: #f3e9d5;
  --sans: "Aptos", "Segoe UI", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --page: min(1260px, calc(100% - 56px));
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.48;
}

a {
  color: inherit;
  overflow-wrap: break-word;
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

h1,
h2,
h3,
p,
li {
  overflow-wrap: break-word;
}

.page {
  width: var(--page);
  margin-inline: auto;
}

.eyebrow,
.meta,
.number,
.nav-label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

/* Shared masthead and topic navigation */
.masthead {
  background: var(--paper);
  border-top: 5px solid var(--navy);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 18px;
  min-width: 0;
}

.brand-name {
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 830;
  white-space: nowrap;
}

.brand-tagline {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: .92rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 27px;
  color: var(--ink-soft);
  font-size: .79rem;
  font-weight: 760;
}

.main-nav>a,
.topics-menu>summary {
  padding: 31px 0 27px;
  border-bottom: 3px solid transparent;
}

.main-nav>a:hover,
.topics-menu>summary:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.topics-menu {
  position: relative;
}

.topics-menu>summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
}

.topics-menu>summary::-webkit-details-marker {
  display: none;
}

.topics-menu>summary::after {
  content: "\2193";
  font-size: .92rem;
  transition: transform 160ms ease;
}

.topics-menu[open]>summary::after {
  transform: rotate(180deg);
}

.topics-panel {
  position: fixed;
  left: 50%;
  right: auto;
  z-index: 20;
  display: none;
  width: min(1280px, calc(100vw - 56px));
  padding: 31px 34px 34px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  box-shadow: 0 18px 38px rgba(16, 39, 90, .16);
  transform: translateX(-50%);
}

.topics-menu[open] .topics-panel {
  display: grid;
}

@media (hover: hover) {
  .topics-menu:hover .topics-panel {
    display: grid;
  }
}

.topic-group {
  min-width: 0;
}

.topic-group+.topic-group {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.topic-group h2 {
  margin: 0 0 17px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.24rem;
  font-weight: 500;
  line-height: 1.1;
}

.topic-group a {
  display: block;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 720;
  line-height: 1.25;
}

.topic-group a:hover {
  color: var(--red);
}

/* Shared footer */
.footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, .72);
}

.footer-inner {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: .8rem;
}

.footer b {
  color: white;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  font-size: .76rem;
  font-weight: 760;
}

.footer-links a {
  color: rgba(255, 255, 255, .76);
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  color: white;
  border-color: rgba(255, 255, 255, .6);
}

@media (max-width: 680px) {
  .masthead-inner {
    min-height: 74px;
    flex-wrap: wrap;
    gap: 6px 20px;
    padding: 12px 0;
  }

  .brand {
    display: block;
  }

  .brand-tagline {
    display: block;
    margin-top: 2px;
    font-size: .77rem;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 14px;
    overflow-x: auto;
    font-size: .71rem;
  }

  .main-nav>a,
  .topics-menu>summary {
    padding: 6px 0 4px;
    white-space: nowrap;
  }

  .topics-panel {
    top: 92px;
    right: 14px;
    left: 14px;
    width: auto;
    max-height: calc(100vh - 110px);
    padding: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
    overflow-y: auto;
    transform: none;
  }

  .topic-group+.topic-group {
    padding-left: 16px;
  }

  .footer-inner {
    min-height: 112px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
  }

  .footer-links {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
