@import url('./typography.css');

:root {
  color-scheme: light;
  --paper: #f3f1eb;
  --ink: #252b28;
  --muted: #626962;
  --green: #007a5b;
  --line: #d6d9cf;
  --soft-green: #e4eae0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: var(--body-weight) var(--body-size)/var(--body-leading) var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; }
::selection { background: #c5dfd0; color: #182b23; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: var(--heading-weight); }
h1 { font-size: var(--title-size); line-height: var(--title-leading); letter-spacing: var(--title-tracking); }
h2 { font-size: var(--section-size); line-height: var(--section-leading); letter-spacing: var(--section-tracking); }
h3 { font-size: var(--subheading-size); line-height: var(--subheading-leading); font-weight: var(--subheading-weight); letter-spacing: var(--subheading-tracking); }
p + p { margin-top: 1.2em; }
img { display: block; max-width: 100%; height: auto; }
.skip-link { position: absolute; z-index: 10; left: 1rem; top: -5rem; padding: .5rem 1rem; background: var(--paper); }
.skip-link:focus { top: 1rem; }
.site-header, .page-shell, .site-footer { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: flex-end; gap: 38px; min-height: 100px; }
nav { display: flex; align-items: center; gap: 30px; }
nav a { display: inline-block; color: var(--muted); font-size: var(--nav-size); line-height: var(--nav-leading); text-decoration: none; padding-block: 6px; }
nav a:hover { color: var(--green); }
nav a[aria-current='page'] { color: var(--ink); box-shadow: 0 2px 0 var(--green); }
.language-switcher { position: relative; padding-left: 28px; border-left: 1px solid var(--line); flex-shrink: 0; }
.language-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--ink); cursor: pointer; list-style: none; border-radius: 6px; }
.language-toggle::-webkit-details-marker { display: none; }
.language-toggle::marker { content: ''; }
.language-toggle:hover, .language-switcher[open] .language-toggle { color: var(--green); }
.language-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.language-menu { position: absolute; top: calc(100% + 12px); right: 0; z-index: 20; display: grid; gap: 0; width: 200px; max-width: calc(100vw - 40px); padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(37 43 40 / 10%); }
.language-menu a { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; padding: 12px 16px; border-radius: 6px; color: var(--muted); font-size: var(--nav-size); line-height: var(--nav-leading); font-weight: var(--menu-weight); white-space: nowrap; }
.language-menu a:hover { color: var(--ink); background: var(--soft-green); }
.language-menu a[aria-current='true'] { color: var(--ink); font-weight: 600; }
.language-menu a[aria-current='true']::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.language-menu a:focus-visible { outline-offset: -2px; }
.page-shell { min-height: calc(100svh - 225px); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
.home-intro { padding: 78px 0 82px; }
.home-section { padding: 48px 0 72px; border-top: 1px solid var(--line); align-items: baseline; }
.home-section h2 { font-size: 2rem; line-height: 1.25; }
.eyebrow { color: var(--green); font-size: .875rem; letter-spacing: .04em; }
.intro-grid { align-items: end; }
.intro-grid h1, .page-intro h1 { font-size: 2rem; line-height: 1.25; }
.intro-grid h1 span { display: block; }
.intro-copy { max-width: 440px; padding-bottom: 5px; }
.intro-copy p { font-size: var(--intro-size); line-height: var(--intro-leading); white-space: pre-line; }
.text-link { display: inline-block; font-size: .9375rem; }
.badge { display: inline-block; color: #42634f; background: var(--soft-green); font-size: .8125rem; line-height: 1.5; padding: 3px 9px; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 28px; padding: 29px 0 31px; border-top: 1px solid var(--line); }
.post-row:first-child { border-top: 0; padding-top: 0; }
.post-meta { display: flex; align-items: flex-start; flex-direction: column; gap: 10px; color: var(--muted); font-size: .875rem; }
.post-row h3 a { color: var(--ink); text-decoration: none; }
.post-row h3 a:hover { color: var(--green); text-decoration: underline; }
.post-row p { margin-top: 10px; color: var(--muted); }
.page-intro { padding: 82px 0 72px; align-items: start; }
.page-intro > p, .about-copy { padding-top: 8px; max-width: 480px; }
.about-copy p { white-space: pre-line; }
.about-updates { padding: 40px 0 72px; border-top: 1px solid var(--line); align-items: start; }
.about-updates h2 { font-size: 2rem; line-height: 1.25; }
.update-list { list-style: none; margin: 0; padding: 5px 0 0 5px; max-width: 480px; }
.update-list li { position: relative; padding: 0 0 32px 24px; border-left: 1px solid var(--line); }
.update-list li:last-child { padding-bottom: 4px; }
.update-list li::before { content: ''; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.update-list time { display: block; margin-bottom: 8px; color: var(--muted); font-size: .875rem; }
.rainbow-keyword { display: inline-block; color: var(--green); white-space: nowrap; }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .rainbow-keyword {
    background-image: linear-gradient(90deg, #b72f39 0%, #a64d12 17%, #806600 33%, #20763e 50%, #007680 66%, #365bb5 83%, #7b42a0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .rainbow-keyword { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
@media print {
  .rainbow-keyword { background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); }
}
.writing-index { padding: 40px 0 90px; border-top: 1px solid var(--line); }
.writing-index .post-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
.content-section { padding: 40px 0 50px; border-top: 1px solid var(--line); }
.content-section > h2 { font-size: 1.75rem; line-height: 1.25; }
.content-section:last-child { padding-bottom: 90px; }
.content-section .badge { margin-bottom: 14px; }
.empty-state { color: var(--muted); }
.publications-page { font-family: 'Rethink Sans', sans-serif; font-size: 1.125rem; line-height: 1.6; font-weight: var(--publication-weight); --title-tracking: -.006em; }
.publication-list { margin: 0; padding: 0; list-style: none; }
.publication-list li { padding-left: 1.5rem; text-indent: -1.5rem; overflow-wrap: anywhere; }
.publication-list li + li { margin-top: 28px; }
.muted { color: var(--muted); }
.inline-links { display: flex; flex-wrap: wrap; gap: 20px; }
.reading-layout { max-width: 730px; margin-inline: auto; padding: 62px 0 90px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 38px 0 20px; color: var(--muted); font-size: .875rem; }
.article-summary { color: var(--muted); margin-top: 24px; }
.article-preface { margin-top: 24px; }
.article-body { margin-top: 42px; border-top: 1px solid var(--line); padding-top: 34px; }
.article-body section + section { margin-top: 36px; }
.article-body h2 { margin-bottom: 18px; }
.article-body ul { padding-left: 1.4em; }
.article-body li + li { margin-top: .5em; }
.article-body blockquote { margin: 24px 0; padding: 8px 0 8px 24px; border-left: 3px solid var(--green); color: var(--muted); }
.article-body pre { max-width: 100%; overflow: auto; padding: 24px; background: #e7e8e0; font-size: .9375rem; line-height: 1.7; }
.article-body figure { margin: 28px 0; }
.article-body figcaption { margin-top: 10px; font-size: .875rem; color: var(--muted); }
.post-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 28px; margin-top: 56px; border-top: 1px solid var(--line); }
.post-navigation a { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-block: 24px; color: var(--ink); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.post-navigation a:hover { color: var(--green); }
.post-navigation a:hover .post-navigation-title { text-decoration: underline; text-underline-offset: .25em; }
.post-navigation-label { color: var(--muted); font-size: .875rem; }
.post-navigation .post-navigation-next { grid-column: 2; align-items: flex-end; text-align: right; }
.imported-handout { overflow-wrap: anywhere; }
.imported-handout h1 { font-size: var(--section-size); line-height: var(--section-leading); margin-block: 2em .8em; }
.imported-handout > h1:first-child { margin-top: 0; }
.imported-handout h2 { font-size: 1.375rem; line-height: 1.4; margin-block: 1.8em .8em; }
.imported-handout img { margin: 28px auto; }
.imported-handout code { font-size: .9em; }
.imported-handout table { display: block; max-width: 100%; overflow-x: auto; margin-block: 28px; border-collapse: collapse; }
.imported-handout th, .imported-handout td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.imported-handout th { background: var(--soft-green); }
.imported-handout ol { padding-left: 1.6em; }
.imported-handout li > p + p, .imported-handout li > ol, .imported-handout li > ul { margin-top: .7em; }
.imported-handout strong { font-weight: 700; }
.imported-handout .mermaid { overflow-x: auto; padding: 20px; margin-block: 28px; background: #faf9f5; border: 1px solid var(--line); white-space: pre; }
.imported-handout .mermaid svg { display: block; max-width: none; height: auto; }
.imported-handout .mermaid:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.imported-handout mjx-container[display='true'] { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-block: .4em; }
.imported-handout mjx-container:not([display='true']) { max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding-block: .15em; }
.translation-notice { background: var(--soft-green); padding: 14px 18px; font-size: .9375rem; margin-bottom: 22px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: .875rem; }
.site-footer a { color: var(--muted); }
.site-footer .footer-icon-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; text-decoration: none; }
.site-footer .footer-icon-link:hover { color: var(--green); }
.not-found { padding: 80px 0; }
.not-found p { margin: 24px 0; }

@media (min-width: 1500px) { .home-intro { padding-top: 100px; padding-bottom: 100px; } }
@media (max-width: 850px) {
  .site-header, .page-shell, .site-footer { width: calc(100% - 56px); }
  .split, .writing-index .post-row { gap: 36px; }
  .home-intro { padding: 58px 0 64px; }
  .page-intro { padding: 60px 0 54px; }
  .site-footer { flex-wrap: wrap; }
  .site-footer span:nth-child(2) { order: 3; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .site-header, .page-shell, .site-footer { width: calc(100% - 40px); }
  .header-inner { --nav-size: .875rem; min-height: 80px; gap: 6px 12px; flex-wrap: wrap; padding-block: 18px; }
  nav { gap: 12px; flex-shrink: 0; }
  .language-switcher { padding-left: 10px; }
  .split { grid-template-columns: 1fr; gap: 25px; }
  .home-intro { padding: 48px 0 50px; }
  .home-section { padding: 36px 0 48px; }
  .intro-grid { gap: 32px; }
  .intro-copy { max-width: 100%; }
  .content-section { padding: 30px 0 36px; }
  .page-intro { padding: 50px 0 44px; }
  .about-updates { padding: 32px 0 48px; }
  .page-intro > p, .about-copy { padding: 0; }
  .writing-index .post-row { grid-template-columns: 1fr; gap: 18px; }
  .post-meta { flex-direction: row; align-items: center; gap: 16px; }
  .reading-layout { padding-top: 38px; }
  .post-navigation { grid-template-columns: 1fr; gap: 0; margin-top: 40px; }
  .post-navigation .post-navigation-next { grid-column: auto; }
  .article-meta { margin-top: 30px; }
  .site-footer { gap: 14px; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
