@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f0e8;
  --bg-deep: #e7e1d4;
  --surface: #fffcf6;
  --ink: #1a222c;
  --ink-soft: #3d4754;
  --muted: #5c6672;
  --line: #d6d0c3;
  --accent: #1f56c9;
  --accent-hover: #1646a8;
  --accent-soft: #e7eefb;
  --footer-bg: #15202b;
  --footer-text: #c5cdd6;
  --footer-muted: #8b95a1;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  --measure: 42rem;
  --radius: 16px;
  --header-h: 4.35rem;
  --shadow: 0 1px 2px rgba(26, 34, 44, 0.04), 0 8px 24px rgba(26, 34, 44, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 252, 246, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img {
  height: 40px;
  width: auto;
}
.logo:hover { opacity: 0.85; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Hero / page titles */
.hero {
  padding: 3.4rem 0 2.2rem;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
.hero h1,
.page-title,
.article-header h1 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--ink);
}
.hero h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.35rem);
  max-width: 22ch;
}
.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0;
}

/* Homepage sections */
.section { padding: 1.2rem 0 3rem; }
.section h2 {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.4rem;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}
.panel p,
.panel li { color: var(--ink-soft); }
.panel ul {
  margin: 0;
  padding-left: 1.15rem;
}
.panel li + li { margin-top: 0.45rem; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}
.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.3rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.guide-card:hover {
  border-color: #b9c8ea;
  transform: translateY(-1px);
  color: inherit;
}
.guide-card .tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.55rem;
}
.guide-card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 0.55rem;
  color: var(--ink);
}
.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  flex: 1;
}
.guide-card .more {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--accent);
}

.standards-link {
  margin-top: 1.5rem;
  padding: 1.15rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
  color: var(--ink-soft);
}
.standards-link a { font-weight: 600; }

.home-stats {
  padding: 0 0 2.6rem;
}
.home-stats-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 0.95rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.home-stats-card:hover {
  border-color: #b9c8ea;
  transform: translateY(-1px);
  color: inherit;
}
.home-stats-card h2 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem 1rem;
}
.home-stats-value {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.home-stats-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
}

/* Article */
.article-header {
  padding: 3rem 0 1.5rem;
  max-width: var(--measure);
}
.article-header h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  max-width: 20ch;
}
.article-meta {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.article-meta time { color: var(--ink-soft); }

.article-body {
  max-width: var(--measure);
  padding-bottom: 3rem;
}
.article-body .lede {
  font-size: 1.28rem;
  margin-bottom: 1.8rem;
}
.article-body h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 2.3rem 0 0.7rem;
  line-height: 1.25;
}
.article-body p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.article-body ul,
.article-body ol {
  margin: 0 0 1.2rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}
.article-body li + li { margin-top: 0.4rem; }
.article-body strong { color: var(--ink); font-weight: 650; }
.checklist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem 1.05rem 2.2rem;
  box-shadow: var(--shadow);
}
.related {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 3.4rem;
  max-width: var(--measure);
}
.related h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0 0 0.9rem;
}
.related ul { margin: 0; padding-left: 1.15rem; }
.related li + li { margin-top: 0.4rem; }

.page-header {
  padding: 3rem 0 1.4rem;
  max-width: var(--measure);
}
.page-header h1,
.page-title {
  font-size: clamp(2rem, 4vw, 2.85rem);
}
.prose {
  max-width: var(--measure);
  padding-bottom: 3.2rem;
}
.prose p { color: var(--ink-soft); margin: 0 0 1.1rem; }
.prose h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 2rem 0 0.65rem;
}
.prose ul { color: var(--ink-soft); padding-left: 1.2rem; }

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.6rem 0 2.1rem;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.site-footer .logo img { height: 36px; }
.footer-note {
  margin: 1rem 0 0;
  color: var(--footer-muted);
  font-size: 0.98rem;
  max-width: 36rem;
  line-height: 1.55;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-nav a {
  color: var(--footer-text);
  text-decoration: none;
  font-weight: 600;
}
.footer-nav a:hover { color: #fff; }
.footer-copy {
  margin: 0.9rem 0 0;
  color: var(--footer-muted);
  font-size: 0.92rem;
}

.notice-18 {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid #2a3846;
  color: var(--footer-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  grid-column: 1 / -1;
}

/* 404 */
.not-found { padding: 4rem 0 5rem; max-width: var(--measure); }
.not-found h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  margin: 0 0 0.8rem;
}

@media (max-width: 800px) {
  .wrap { width: min(var(--max), calc(100% - 1.6rem)); }
  .split,
  .guide-grid,
  .footer-inner { grid-template-columns: 1fr; }
  .home-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 2.3rem; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 1.1rem 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a {
    display: block;
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid var(--line);
  }
  .site-header { position: sticky; }
  .site-header .wrap { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-card,
  .home-stats-card { transition: none; }
}
