/* Small, hand-authored styles. Fonts match the live site and are served locally. */
@font-face {
  font-family: Merriweather;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/merriweather-700.woff2") format("woff2");
}

@font-face {
  font-family: Oxygen;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/oxygen-400.woff2") format("woff2");
}

@font-face {
  font-family: Oxygen;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/oxygen-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: Oxygen, Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.65;
  color: #292d31;
  background: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #245d87; text-underline-offset: 0.18em; }
a:hover { color: #163d5a; }
:focus-visible { outline: 3px solid #245d87; outline-offset: 4px; }

.container {
  width: min(100% - 3rem, 68rem);
  margin-inline: auto;
}

/* Retain the existing blue banner, wordmark, and right-aligned profile links. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #3f6689;
}

.header-content {
  width: min(100% - 3rem, 69.375rem);
  min-height: 70px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-brand { display: block; max-width: 100%; line-height: 0; transform: translateY(2px); }
.site-brand img { display: block; width: min(593px, 100%); height: auto; }
.header-content nav { margin-left: auto; margin-bottom: 3px; }
.header-profile-links { display: flex; gap: 0.125rem; margin: 0; padding: 0; list-style: none; }
.header-profile-links li { margin: 0; }
.header-profile-links a {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  text-decoration: none;
  border-radius: 0.25rem;
  opacity: 0.85;
}
.header-profile-links a:hover,
.header-profile-links a:focus-visible { background: #ffffff14; opacity: 1; }
.header-profile-links img {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  /* External SVGs cannot inherit the link color; match the reference site's white icons. */
  filter: brightness(0) invert(1);
}
.header-profile-links .email-icon {
  /* The @ asset includes more internal space than the brand icons. */
  width: 1.75rem;
  height: 1.75rem;
}
.site-header :focus-visible { outline-color: #fff; }

.skip-link {
  position: fixed;
  top: 0;
  left: 1rem;
  z-index: 3;
  padding: 0.65rem 1rem;
  color: #fff;
  background: #163d5a;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* Ordinary links keep the bordered tab navigation usable without JavaScript. */
.page-nav { margin-top: 1.75rem; }
.page-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0 0.5rem;
  border-bottom: 1px solid #d8dde1;
  list-style: none;
}
.page-nav li { margin-top: 0; margin-bottom: -1px; }
.page-nav a {
  display: block;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem 0.5rem 0 0;
  text-decoration: none;
}
.page-nav a:hover { background: #f5f6f7; }
.page-nav a[aria-current="page"] {
  color: #292d31;
  background: #fff;
  border-color: #d8dde1 #d8dde1 #fff;
}

main { padding-top: 2rem; scroll-margin-top: 6rem; }
.prose { max-width: 72ch; overflow-wrap: break-word; }
h1, h2, h3 {
  font-family: Merriweather, Cambria, serif;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}
h1 { margin: 0 0 0.75rem; font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { margin: 0 0 0.75rem; font-size: 1.5rem; }
h3 { margin: 1.25rem 0 0.35rem; font-size: 1.15rem; }
p { margin: 0 0 1rem; }
section { margin-top: 2rem; }
li + li { margin-top: 0.35rem; }
.intro { color: #515961; font-size: 1.2rem; }
.post-header { margin-bottom: 2rem; }
.post-meta { color: #59616a; font-size: 0.9rem; }
.post-list, .project-list { margin: 0; padding: 0; list-style: none; }
.post-list > li, .project-list > li { margin-block: 1.75rem; }
.post-list h2, .post-list h3, .project-list h2 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.post-list .post-meta { margin-bottom: 0.5rem; }
.post-back { margin-top: 2rem; }
.prose img { display: block; max-width: 100%; height: auto; margin-block: 1.5rem; }
blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 3px solid #d8dde1; color: #515961; }
blockquote p:last-child { margin-bottom: 0; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.9em; }
:not(pre) > code { padding: 0.1em 0.3em; background: #f3f5f7; border-radius: 0.2rem; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1.1rem;
  margin: 1.5rem 0;
  border: 1px solid #d8dde1;
  border-radius: 0.3rem;
  background: #f6f8fa;
  line-height: 1.55;
  tab-size: 4;
}
/* Prism emits static spans during the build; highlighting needs no browser script. */
.token.comment { color: #536350; }
.token.keyword, .token.boolean { color: #654193; }
.token.string { color: #8c3525; }
.token.number { color: #005e83; }
.token.function, .token.class-name { color: #235d78; }
.token.operator, .token.punctuation { color: #515961; }
table { border-collapse: collapse; }
th, td { padding: 0.5rem; border: 1px solid #d8dde1; text-align: left; }
/* Historical data tables scroll within the article instead of widening the page. */
.table-scroll { max-width: 100%; overflow-x: auto; margin-block: 1.5rem; }
.table-scroll p:last-child { margin-bottom: 0; }
.migration-note { padding-left: 1rem; border-left: 3px solid #d8dde1; color: #59616a; font-size: 0.9rem; }

.site-footer {
  margin-top: 3rem;
  padding-block: 1rem 1.5rem;
  border-top: 1px solid #e4e7e9;
  color: #59616a;
  font-size: 0.85rem;
}
.site-footer p { margin-bottom: 0.35rem; }

@media (max-width: 48rem) {
  .header-content { gap: 0; }
  .site-brand { margin-top: 0.5rem; }
  .header-content nav { margin-bottom: 0; }
}

@media (max-width: 35rem) {
  .container, .header-content { width: calc(100% - 2rem); }
  .page-nav { margin-top: 1.25rem; }
  main { padding-top: 1.5rem; }
  .site-footer { line-height: 1.9; }
}

@media print {
  .site-header, .page-nav, .skip-link, .site-footer, .post-back { display: none; }
  :root { color: #000; font-size: 10pt; }
  .container { width: 100%; }
  .prose { max-width: none; }
  a { color: inherit; }
  h1, h2, h3 { break-after: avoid; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
