:root {
  --ink: #1a2332;
  --muted: #3e4c59;
  --paper: #f4f1ea;
  --card: #ffffff;
  --line: #d9d3c7;
  --navy: #123a5f;
  --navy-deep: #0c2a46;
  --sky: #1e4f7a;
  --gold: #6f5410;
  --gold-line: #c9a227;
  --focus: #0b3a66;
  --space: 1.25rem;
  --header: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--sky);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--navy-deep);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.cta-button:focus-visible {
  outline-color: #e2b93b;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: 0;
  transform: translateY(-120%);
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 50;
}

.skip-link:focus {
  transform: none;
  color: #fff;
}

.visually-hidden,
.nav-toggle,
.sticky-off {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sticky-off:focus-visible + .sticky-cta .text-button {
  outline: 3px solid #e2b93b;
  outline-offset: 3px;
}

.sticky-off:checked {
  display: none;
}

.wrap {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: #000;
  border-bottom: 3px solid var(--gold-line);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 52px;
}

.nav-toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle:focus-visible ~ .header-bar .nav-toggle-label {
  outline: 3px solid #e2b93b;
  outline-offset: 3px;
}

.site-nav {
  display: none;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding-top: 0.25rem;
  padding-bottom: 0.35rem;
}

.nav-toggle:checked ~ .site-nav {
  display: block;
}

@media (max-width: 959px) {
  .site-nav.wrap {
    width: auto;
    max-width: none;
    margin: 0;
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: #eef4f9;
  color: var(--navy);
  box-shadow: inset 3px 0 0 var(--gold-line);
}

.age-note {
  margin: 0;
  background: var(--navy);
  color: #fff;
  font-size: 0.92rem;
}

.age-note .wrap {
  display: block;
  padding: 0.45rem 0;
}

.age-note a {
  color: #fff;
}

main {
  padding: 1.5rem 0 3rem;
}

.prose {
  max-width: 68ch;
}

.page-head h1,
.home h1,
h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--ink);
  margin-top: 0;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2rem 0 0.6rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.4rem 0 0.4rem;
}

p,
ul,
ol,
dl {
  margin: 0.8rem 0;
}

ul,
ol {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.35rem;
}

.cta-block {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold-line);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  background: var(--sky);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.cta-button:hover {
  background: var(--navy-deep);
  color: #fff;
}

.cta-note,
.sticky-cta-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--muted);
}

.topic-grid,
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.topic-card strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.topic-card span {
  color: var(--muted);
}

.home-section {
  margin-top: 2rem;
}

.diagram {
  margin: 1.25rem 0;
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--card);
}

.diagram figcaption,
.editorial,
.related {
  color: var(--ink);
}

.prose img,
.hero-banner img,
.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-logo {
  margin: 0 0 1rem;
}

.hero-logo img {
  width: min(100%, 28rem);
}

.hero-banner {
  margin: 0 0 1.25rem;
}

.hero-banner figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.editorial,
.related {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.editorial dl div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.editorial dt {
  font-weight: 700;
}

.site-footer {
  background: var(--navy-deep);
  color: #f4f1ea;
  padding: 2rem 0 1.5rem;
}

.site-footer a {
  color: #fff;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.site-footer h2 {
  margin-top: 0;
  font-size: 1.05rem;
  color: #e2b93b;
}

.site-footer ul {
  list-style: none;
  padding: 0;
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.legal-line {
  margin-top: 1rem;
  color: #d9e2ea;
  font-size: 0.95rem;
}

.sticky-cta {
  display: none;
}

@media (min-width: 700px) {
  .topic-grid,
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .site-header {
    display: grid;
  }

  .nav-toggle,
  .nav-toggle-label {
    display: none;
  }

  .header-bar,
  .site-nav {
    grid-area: 1 / 1;
  }

  .header-bar {
    justify-self: center;
  }

  .age-note {
    grid-area: 2 / 1;
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    align-self: center;
    justify-self: center;
    width: min(72rem, calc(100% - 2rem));
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    gap: 0.15rem;
    z-index: 1;
  }

  .site-nav a {
    min-height: 44px;
    color: #f4f7fb;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .topic-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .sticky-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    position: static;
    z-index: 1;
    margin: 0;
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
  }

  .sticky-off:checked + .sticky-cta {
    display: none;
  }

  .sticky-cta-text {
    flex: 1 1 100%;
    margin: 0;
  }

  .sticky-cta .cta-button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .skip-link,
  .nav-toggle-label,
  .sticky-cta,
  .age-note {
    display: none !important;
  }

  body {
    padding-bottom: 0;
    background: #fff;
  }

  .cta-button::after {
    content: " (" attr(href) ")";
    font-weight: 400;
  }
}
