/* Self-hosted Inter: no requests to a third-party font service. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  color-scheme: dark;
  --bg: #1f1f1f;
  --surface: #2b2b2b;
  --surface2: #333;
  --border: #484848;
  --text: #dadada;
  --heading: #f5f5f5;
  --muted: #aaa;
  --teal: #488a99;
  --teal-hi: #5ba3b3;
  --gold: #dbae58;
  --maxw: 1080px;
}
* { box-sizing: border-box; }
/* Keep centered content in place when navigating between short and long pages. */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--teal-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; border-radius: 3px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--heading); line-height: 1.25; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
.skip-link { position: absolute; left: 16px; top: -100px; background: var(--surface); padding: 12px; z-index: 20; }
.skip-link:focus { top: 12px; }
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(31, 31, 31, .96);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { flex-shrink: 0; }
.brand img { height: 36px; width: auto; }
.links { display: flex; align-items: center; gap: 26px; font-size: 15px; font-weight: 500; }
.links > a { color: var(--text); }
.links > a:hover { color: var(--heading); text-decoration: none; }
.links > a[aria-current="page"] { color: var(--gold); }
.languages { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.languages a, .languages span { padding: 6px 9px; }
.languages a { color: var(--muted); }
.languages .current { color: var(--heading); font-weight: 700; background: var(--surface2); }
.languages > :first-child { border-radius: 5px 0 0 5px; }
.languages > :last-child { border-radius: 0 5px 5px 0; }
main { flex: 1; }
.hero { text-align: center; padding-top: 56px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0; }
.hero h1 span { display: block; color: var(--gold); }
.hero .sub { max-width: 600px; margin: 14px auto 0; font-size: 18px; color: var(--muted); }
.hero .sub .nowrap { white-space: nowrap; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { font-size: 18px; margin: 0; font-weight: 600; }
.section-heading p { color: var(--muted); font-size: 13px; margin: 0; }
/* Keep ready articles in one grid: every card matches the tallest, without clipping. */
.posts { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; gap: 24px; margin-bottom: 72px; }
.post {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
a.post { transition: border-color .15s ease; }
@media (hover: hover) {
  a.post:hover { border-color: var(--gold); text-decoration: none; }
}
a.post:focus-visible { border-color: var(--gold); text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  a.post { transition: none; }
}
.thumb { display: flex; align-items: center; justify-content: center; background: var(--surface2); padding: 36px; }
.thumb img { width: 100%; height: auto; aspect-ratio: 420 / 230; object-fit: contain; }
/* Keep the normal thumbnail footprint; full-bleed cover avoids thin edges at rounded corners. */
.thumb.thumb--map { position: relative; padding: 0; overflow: hidden; }
.thumb--map::before { content: ""; width: calc(100% - 72px); aspect-ratio: 420 / 230; margin: 36px; }
.thumb.thumb--map img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; max-width: none; object-fit: cover; }
.post-body { min-width: 0; padding: 32px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.post-meta { color: var(--teal-hi); font-size: 12px; font-weight: 600; }
.post h3 { font-size: 26px; letter-spacing: -.02em; margin: 12px 0; overflow-wrap: anywhere; }
.post p { color: var(--muted); font-size: 15px; margin: 0; }
.page { max-width: 800px; margin: 0 auto; padding: 56px 24px 72px; }
.page h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 20px; }
.page h2 { font-size: 23px; margin: 36px 0 16px; }
.page h3 { font-size: 17px; margin: 0 0 10px; }
.page .intro { font-size: 19px; margin-bottom: 36px; }
.service-list { padding-left: 22px; margin: 0 0 1em; }
.service-list li + li { margin-top: 10px; }
.service-list strong { color: var(--heading); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0 36px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 22px 18px; }
.step .num { color: var(--teal-hi); font-weight: 700; font-size: 14px; display: block; margin-bottom: 14px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }
.about-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0 36px;
}
.about-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio strong { color: var(--heading); }
.contact-box { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--teal-hi); border-radius: 8px; padding: 24px; }
.contact-box h2 { margin-top: 0; }
.contact-box p:last-child { margin-bottom: 0; }
/* Article pages: narrow prose with more room for figures and tables. */
.article-page { max-width: 1488px; width: 100%; margin: 0 auto; padding: 56px 24px 72px; }
.article-header, .article-body > * { max-width: 752px; margin-left: auto; margin-right: auto; }
.article-header { margin-bottom: 40px; }
.article-back { display: inline-block; margin-bottom: 24px; font-size: 14px; }
.article-header h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 20px; overflow-wrap: anywhere; }
.article-summary { font-size: 19px; }
.article-meta, .translation-note { color: var(--muted); font-size: 14px; }
.translation-note { margin-bottom: 0; }
.article-body { overflow-wrap: anywhere; }
.article-body h2 { font-size: 25px; margin-top: 40px; margin-bottom: 16px; }
.article-body h3 { font-size: 20px; margin-top: 28px; margin-bottom: 12px; }
.article-body [id] { scroll-margin-top: 140px; }
.article-body a, .article-summary a { text-decoration: underline; text-underline-offset: .15em; }
.article-body ul, .article-body ol { padding-left: 28px; margin-bottom: 24px; }
.article-body li + li { margin-top: 8px; }
.article-body li > ul, .article-body li > ol { margin-top: 8px; margin-bottom: 8px; }
.article-body > figure { max-width: 100%; margin-top: 32px; margin-bottom: 32px; }
.article-body > .table-scroll { max-width: 752px; margin-top: 32px; margin-bottom: 32px; }
.article-body figure img { width: auto; height: auto; margin: 0 auto; }
/* Charts fill the available width up to 1440px; scroll rather than shrink below 960px. */
.article-body > .chart-scroll { overflow-x: auto; }
.chart-scroll > a { display: block; }
.article-body .chart-scroll img { width: 100%; min-width: 960px; max-width: 1440px; }
.article-body figcaption { max-width: 752px; margin: 12px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.article-body blockquote { border-left: 3px solid var(--teal-hi); padding: 12px 20px; background: var(--surface); }
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--surface); padding: 2px 5px; border-radius: 3px; }
.article-body pre { overflow-x: auto; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.article-body pre code { padding: 0; background: none; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible, .chart-scroll:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.article-body .table-scroll table { min-width: 640px; }
.article-body caption { text-align: left; color: var(--muted); padding-bottom: 12px; }
.article-body th, .article-body td { text-align: left; vertical-align: top; padding: 9px 12px; border: 1px solid var(--border); }
.article-body th { background: var(--surface); color: var(--heading); }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin-top: 36px; margin-bottom: 36px; }
.article-body section[role="doc-endnotes"] { border-top: 1px solid var(--border); margin-top: 48px; padding-top: 8px; font-size: 15px; line-height: 1.55; color: #bdbdbd; }
.article-body section[role="doc-endnotes"] h2 { font-size: 20px; color: var(--text); margin-top: 24px; }
.article-body section[role="doc-endnotes"] p { margin-bottom: .75em; }
.article-body section[role="doc-endnotes"] li:last-child p:last-child { margin-bottom: 0; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0; font-size: 14px; color: var(--muted); }
.foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--heading); }
@media (max-width: 800px), (max-height: 550px), (hover: none) and (pointer: coarse) {
  .site-header { position: static; }
  .article-body [id] { scroll-margin-top: 24px; }
}
@media (max-width: 800px) {
  .post { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .thumb { padding: 24px; }
  .thumb img { max-width: 420px; }
  .thumb--map::before { width: calc(100% - 48px); max-width: 420px; margin: 24px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .about-card { grid-template-columns: 1fr; gap: 20px; }
  .about-photo { max-width: 160px; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .nav { flex-direction: column; gap: 10px; padding-top: 14px; padding-bottom: 12px; }
  .links { width: 100%; justify-content: center; gap: 22px; font-size: 14px; }
  .hero { padding-top: 40px; padding-bottom: 32px; }
  .hero .sub { font-size: 16px; }
  .post-body { padding: 24px; }
  .post h3 { font-size: 24px; }
  .section-heading { flex-direction: column; gap: 4px; }
  .page { padding-top: 40px; }
  .article-page { padding: 40px 20px 56px; }
  .article-header { margin-bottom: 32px; }
  .article-summary { font-size: 18px; }
  .article-body h2 { font-size: 23px; }
}
