:root {
  --accent: #56345f;
  --accent-dark: #3d2545;
  --ink: #25232a;
  --muted: #6a6670;
  --soft: #f6f3f7;
  --soft-2: #fbfafb;
  --border: #e3dde5;
  --link: #4b2e55;
  --max-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

a:visited {
  color: var(--link);
}

/* Keep long citation URLs inside narrow mobile screens. */
.page-content a,
.page-content blockquote {
  overflow-wrap: anywhere;
}

a:hover,
a:focus {
  color: var(--accent-dark);
  text-decoration-thickness: 2px;
}

.wrapper {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.resource-masthead {
  background: #fff;
  border-top: 6px solid var(--accent);
  border-bottom: 1px solid var(--border);
}

.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 26px;
  padding-bottom: 21px;
}

.masthead-identity {
  min-width: 0;
}

.masthead-title {
  display: inline-block;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.masthead-title:visited,
.masthead-title:hover,
.masthead-title:focus {
  color: var(--ink);
  text-decoration: none;
}

.masthead-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

.masthead-author {
  flex: 0 0 300px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  text-align: right;
}

.masthead-author-name {
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 700;
}

.masthead-author-affiliation {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.resource-nav-wrap {
  background: var(--soft);
  border-top: 1px solid var(--border);
}

.resource-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.resource-nav-link {
  display: block;
  flex: 0 0 auto;
  padding: 12px 13px 10px;
  color: var(--ink);
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.resource-nav-link:visited {
  color: var(--ink);
}

.resource-nav-link:hover,
.resource-nav-link:focus {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.resource-nav-home {
  padding-left: 0;
  margin-right: 4px;
  font-weight: 700;
}

.page-content {
  padding: 42px 0 64px;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
}

.page-content h1 {
  margin: 0 0 24px;
  font-size: 34px;
  letter-spacing: -0.025em;
}

.page-content h2 {
  margin: 42px 0 16px;
  padding-top: 4px;
  font-size: 25px;
  letter-spacing: -0.015em;
}

.page-content h3 {
  margin: 30px 0 10px;
  font-size: 19px;
}

.page-content p,
.page-content ul,
.page-content ol {
  max-width: 790px;
}

.page-content li + li {
  margin-top: 5px;
}

.page-content blockquote {
  max-width: 790px;
  margin: 26px 0;
  padding: 14px 20px;
  color: #514c55;
  background: var(--soft);
  border-left: 4px solid var(--accent);
}

.page-content code {
  padding: 0.12em 0.28em;
  background: var(--soft);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.page-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  background: #f7f7f8;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.page-content pre code {
  padding: 0;
  background: transparent;
}

.page-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 24px 0 32px;
  border-collapse: collapse;
  font-size: 14px;
}

.page-content th,
.page-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.page-content th {
  background: var(--soft);
  font-weight: 700;
}

.page-content hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.resource-hero {
  margin: -4px 0 34px;
  padding: 36px 38px;
  background: var(--soft);
  border-left: 5px solid var(--accent);
  border-radius: 4px;
}

.resource-kicker {
  margin-bottom: 9px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource-hero h1 {
  margin: 0 0 12px;
  max-width: 820px;
  font-size: 36px;
  line-height: 1.15;
}

.resource-hero .resource-lead {
  max-width: 760px;
  margin: 0;
  color: #4c4851;
  font-size: 18px;
  line-height: 1.55;
}

.resource-question {
  max-width: 870px;
  margin: 28px 0 36px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 19px;
  line-height: 1.55;
}

.resource-grid,
.resource-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 38px;
}

.resource-card,
.resource-route {
  min-width: 0;
  padding: 21px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.resource-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.resource-card p {
  margin: 0;
  color: #55515a;
  font-size: 15px;
  line-height: 1.5;
}

.resource-route {
  display: block;
  color: var(--ink);
  border-top: 4px solid var(--accent);
  text-decoration: none;
}

.resource-route:visited {
  color: var(--ink);
}

.resource-route:hover,
.resource-route:focus {
  color: var(--ink);
  border-top-color: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(35, 20, 40, 0.09);
  text-decoration: none;
}

.resource-route strong {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 17px;
}

.resource-route span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.resource-footer {
  margin-top: 40px;
  padding: 28px 0;
  color: var(--muted);
  background: var(--soft-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.resource-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
}

.resource-footer-links {
  text-align: right;
}

.resource-footer-links span {
  padding: 0 0.35em;
}

@media (max-width: 760px) {
  .wrapper {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .masthead-inner {
    display: block;
    padding-top: 20px;
    padding-bottom: 17px;
  }

  .masthead-title {
    font-size: 25px;
  }

  .masthead-author {
    margin-top: 16px;
    padding-top: 13px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    text-align: left;
  }

  .resource-nav-link {
    padding-right: 12px;
    padding-left: 12px;
  }

  .resource-nav-home {
    padding-left: 0;
  }

  .page-content {
    padding-top: 30px;
  }

  .page-content h1 {
    font-size: 30px;
  }

  .resource-hero {
    padding: 25px 22px;
  }

  .resource-hero h1 {
    font-size: 29px;
  }

  .resource-grid,
  .resource-route-grid {
    grid-template-columns: 1fr;
  }

  .resource-footer-inner {
    display: block;
  }

  .resource-footer-links {
    margin-top: 14px;
    text-align: left;
  }
}


/* Risk-page emphasis */
.page-content .risk-rule {
  margin: 28px 0;
  padding: 18px 20px;
  background: #fff8f2;
  border-left: 4px solid #a4582b;
  border-radius: 3px;
}

.page-content .risk-rule strong {
  color: #713817;
}
