:root {
  color-scheme: dark;
  --bg: #101615;
  --text: #eef4f2;
  --muted: #a8b8b5;
  --line: #2a3a37;
  --accent: #76d6d0;
  --accent-2: #d7a969;
  --panel: #17211f;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbf8;
  --text: #1e2528;
  --muted: #647075;
  --line: #d7dedc;
  --accent: #0d5c63;
  --accent-2: #7b3f00;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 2rem max(1rem, calc((100vw - 1040px) / 2));
}

.nav {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1040px;
  padding: 1rem;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}


.profile-icons {
  align-items: center;
  display: inline-flex;
  gap: 0.72rem;
  margin-right: 0.25rem;
}

.profile-icon {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  height: 1.55em;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
  width: 1.55em;
}

.profile-icon:hover,
.profile-icon:focus {
  color: var(--text);
}

.profile-icon svg {
  fill: currentColor;
  height: 1.35em;
  width: 1.35em;
}

.theme-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 1rem;
  height: 2rem;
  justify-content: center;
  min-height: 2rem;
  padding: 0;
  width: 2rem;
}

.theme-toggle:hover,
.theme-toggle:focus {
  border-color: var(--accent);
  color: var(--text);
}

.profile-icon span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  margin: 0 auto;
  max-width: 1040px;
  padding: 2.5rem 1rem 4rem;
}

.hero {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
  margin-bottom: 3rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin: 0 0 1rem;
}

h2 {
  border-bottom: 1px solid var(--line);
  font-size: 1.4rem;
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.eyebrow,
.meta,
.authors,
figcaption {
  color: var(--muted);
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lede {
  font-size: 1.2rem;
}

.profile-image {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.action-row,
.link-row,
.compact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.button,
button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

.link-button {
  background: none;
  border: 0;
  color: var(--accent);
  display: inline;
  min-height: 0;
  padding: 0;
  text-decoration: underline;
}

.copy-source {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: pre;
  width: 1px;
}

.item-list,
.publication-list,
.tag-grid {
  display: grid;
  gap: 1rem;
}

.item,
.publication-item,
.tag-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.timeline article {
  border-left: 2px solid var(--line);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 8rem 1fr;
  padding-left: 1rem;
}

.page-header {
  margin-bottom: 2rem;
}

.section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

pre {
  background: #182024;
  border-radius: 8px;
  color: #f4f7f7;
  overflow-x: auto;
  padding: 1rem;
}

.post-body > * + * {
  margin-top: 1.25rem;
}

figure {
  margin: 2rem 0;
}

blockquote,
.callout {
  border-left: 4px solid var(--accent-2);
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
}

.equation {
  overflow-x: auto;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .site-footer,
  .action-row {
    display: none;
  }

  body {
    background: white;
  }
}
