:root {
  --bg: #f4f4f4;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e6e6e6;
  --accent: #0e6b5c;
  --accent-soft: #e4f3ef;
  --sidebar-text: #14332d;
  --gold: #6b6b6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --serif: "Source Serif 4", "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #121212;
  --paper: #1c1c1c;
  --ink: #f4f4f4;
  --muted: #b0b0b0;
  --line: #2e2e2e;
  --accent: #7dccb8;
  --accent-soft: #1a2e29;
  --sidebar-text: #e8f6f2;
  --gold: #c8c8c8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sidebar a {
  color: var(--accent);
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.page {
  width: min(980px, calc(100% - 32px));
  margin: 32px auto 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-header {
  position: relative;
  padding: 36px 40px 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

[data-theme="dark"] .site-header {
  background: var(--paper);
}

.header-actions {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--ink);
}

.theme-icon::before {
  content: "Dark";
}

[data-theme="dark"] .theme-icon::before {
  content: "Light";
}

.hero {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 28px;
  align-items: start;
}

.avatar {
  width: 148px;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 1px var(--line);
  background: #fff;
}

.avatar img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.avatar-initials {
  color: #fff;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
}

.identity h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
}

.role {
  margin: 6px 0 0;
  font-weight: 600;
}

.tagline {
  margin: 4px 0 14px;
  color: var(--muted);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.contact-row a {
  color: var(--muted);
}

.contact-row li + li::before {
  content: "·";
  margin-right: 16px;
  color: #b0b0b0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
}

.icon-link:hover {
  text-decoration: none;
  opacity: 0.7;
}

.github-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: inline-block !important;
  vertical-align: middle;
}

.icon-link img.site-icon,
.icon-link img.github-icon,
img.site-icon,
img.github-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: inline-block !important;
  vertical-align: middle;
}

.site-icon {
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.site-icon-prometheus {
  object-fit: cover;
  background: #000;
}

.entry-links {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-top: 8px !important;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 28px 28px 36px 40px;
  border-right: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--sidebar-text);
}

.content {
  padding: 28px 40px 36px 32px;
  background: var(--paper);
}

section + section {
  margin-top: 28px;
}

.content h2 {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.sidebar h2 {
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding-bottom: 8px;
}

.meta-list,
.link-list,
.simple-list,
.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-list li {
  margin-bottom: 12px;
}

.meta-list span {
  display: block;
  color: color-mix(in srgb, var(--sidebar-text) 70%, transparent);
  font-size: 12px;
}

.meta-list strong,
.simple-list strong {
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
  font-size: 12px;
}

.skill-group + .skill-group {
  margin-top: 12px;
}

.skill-group h3 {
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--accent);
}

.skill-group p,
.link-list,
.content p {
  margin: 0;
  color: var(--muted);
}

.sidebar .skill-group p,
.sidebar .link-list {
  color: color-mix(in srgb, var(--sidebar-text) 78%, transparent);
}

.link-list li + li,
.simple-list li + li,
.pub-list li + li {
  margin-top: 10px;
}

.entry {
  display: grid;
  grid-template-columns: 158px 1fr;
  gap: 16px;
  padding: 10px 0;
}

.entry + .entry {
  border-top: 1px dashed var(--line);
}

.entry-meta time {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

.place {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.entry-body h3 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-body p,
.entry-body ul {
  margin: 4px 0 0;
  color: var(--muted);
}

.entry-body ul {
  padding-left: 18px;
}

.coursework {
  margin-top: 8px;
}

.coursework summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
  user-select: none;
}

.coursework summary::-webkit-details-marker {
  display: none;
}

.coursework summary::before {
  content: "▸ ";
  color: var(--gold);
}

.coursework[open] summary::before {
  content: "▾ ";
}

.course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0 !important;
  list-style: none;
}

.course-term {
  margin-top: 10px;
}

.course-term h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.course-list li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.pub-list {
  counter-reset: pub;
}

.pub-list li {
  counter-increment: pub;
  padding-left: 28px;
  position: relative;
  color: var(--muted);
}

.pub-list li::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}

.pub-list strong {
  color: var(--ink);
}

.pub-status {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f3f3;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
}

[data-theme="dark"] .pub-status {
  background: #2a2a2a;
}

.simple-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 16px 40px 22px;
  color: var(--muted);
  font-size: 12px;
  background: var(--paper);
}

.site-footer p {
  margin: 0;
}

.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 24px;
}

.error-page h1 {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--ink);
}

@media (max-width: 800px) {
  .page {
    margin: 12px auto 24px;
  }

  .site-header,
  .sidebar,
  .content,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero,
  .layout,
  .entry,
  .simple-list li {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .header-actions {
    position: static;
    justify-content: flex-end;
    margin-bottom: 16px;
  }
}

@media print {
  :root {
    --bg: #fff;
    --paper: #fff;
    --shadow: none;
  }

  body {
    background: #fff;
  }

  .page {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .header-actions {
    display: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .contact-row a[href]::after,
  .link-list a[href]::after {
    content: " (" attr(href) ")";
    font-size: 11px;
    color: #666;
  }
}
