:root {
  --bg: #e4ebe7;
  --surface: rgba(245, 249, 246, 0.84);
  --surface-strong: #f1f6f3;
  --text: #173035;
  --muted: #61777b;
  --accent: #1d7069;
  --accent-strong: #104d4a;
  --line: rgba(23, 48, 53, 0.11);
  --shadow: 0 22px 56px rgba(23, 48, 53, 0.09);
  --radius: 24px;
  color-scheme: light;
}

:root[data-resolved-theme="dark"] {
  --bg: #0e1617;
  --surface: rgba(19, 30, 31, 0.78);
  --surface-strong: #132122;
  --text: #edf4f1;
  --muted: #9ab0ae;
  --accent: #60c4ab;
  --accent-strong: #9ce4d0;
  --line: rgba(171, 216, 207, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Public Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 12%, rgba(66, 124, 115, 0.16), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(108, 145, 176, 0.12), transparent 24%),
    linear-gradient(180deg, #f2f7f4 0%, #e4ebe7 100%);
  min-height: 100vh;
}

:root[data-resolved-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(96, 196, 171, 0.2), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(114, 152, 210, 0.16), transparent 24%),
    linear-gradient(180deg, #0a1213 0%, #121c1d 100%);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 36%),
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.18), transparent 21%);
  opacity: 0.72;
}

:root[data-resolved-theme="dark"] .backdrop {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 35%),
    radial-gradient(circle at 20% 30%, rgba(96, 196, 171, 0.08), transparent 22%);
  opacity: 1;
}

.site-header-shell,
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.2rem auto 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.site-header {
  flex: 1 1 auto;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 249, 246, 0.84);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(19, 38, 39, 0.08);
}

:root[data-resolved-theme="dark"] .site-header {
  background: rgba(19, 30, 31, 0.82);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.brand {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(19, 38, 39, 0.14);
}

.brand-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition:
    color 140ms ease,
    opacity 140ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

.section-rail {
  position: fixed;
  top: 50%;
  left: max(1rem, calc((100vw - 1180px) / 2 - 10.5rem));
  transform: translateY(-50%) translateX(-16px);
  z-index: 3;
  display: grid;
  gap: 0.6rem;
  width: 8.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(244, 249, 246, 0.84);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px rgba(19, 38, 39, 0.16);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

:root[data-resolved-theme="dark"] .section-rail {
  background: rgba(19, 30, 31, 0.82);
}

.section-rail.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.section-rail a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.section-rail a:hover,
.section-rail a:focus-visible {
  background: rgba(29, 112, 105, 0.08);
  color: var(--text);
  outline: none;
}

.section-rail a.is-active {
  background: linear-gradient(135deg, rgba(29, 112, 105, 0.14), rgba(141, 176, 126, 0.16));
  color: var(--accent-strong);
}

.theme-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 249, 246, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(19, 38, 39, 0.08);
}

.theme-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.theme-option:hover,
.theme-option:focus-visible {
  color: var(--text);
  outline: none;
}

.theme-option.is-active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 6px 18px rgba(19, 38, 39, 0.1);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
  padding: 3rem 0 2rem;
}

.hero-copy,
.panel,
.hero-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 3rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.12rem, 3.68vw, 3.82rem);
  max-width: none;
}

h2 {
  font-size: clamp(1.83rem, 3.7vw, 2.93rem);
  max-width: none;
}

h3 {
  font-size: 1.4rem;
}

.hero-role {
  margin: 1rem 0 0;
  font-size: 1.2rem;
  color: var(--muted);
}

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

.hero-summary,
.panel p,
.publication p,
.timeline p,
.contact-form label,
.site-footer,
.plain-list,
.feature-list {
  line-height: 1.7;
}

.hero-summary {
  margin: 1.25rem 0 0;
  max-width: 58ch;
  font-size: 1.06rem;
}

.hero h1 {
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.8rem 0 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, #1f6f69 0%, #4e8d7a 54%, #97b67d 100%);
  color: #f3f8f6;
  border-color: rgba(78, 141, 122, 0.4);
  box-shadow:
    0 16px 38px rgba(31, 92, 86, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.button-primary:hover,
.button-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 20px 44px rgba(31, 92, 86, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

:root[data-resolved-theme="light"] .button-primary {
  color: #f4faf7;
}

.button-secondary {
  color: var(--text);
  background: rgba(245, 249, 246, 0.94);
  border-color: var(--line);
}

:root[data-resolved-theme="dark"] .button-secondary,
:root[data-resolved-theme="dark"] .profile-links a,
:root[data-resolved-theme="dark"] .highlight-link,
:root[data-resolved-theme="dark"] .github-calendar-frame,
:root[data-resolved-theme="dark"] .github-repo-bar-track,
:root[data-resolved-theme="dark"] .contact-form input,
:root[data-resolved-theme="dark"] .contact-form textarea,
:root[data-resolved-theme="dark"] .theme-switch {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-resolved-theme="dark"] .theme-switch {
  background: rgba(19, 30, 31, 0.82);
}

:root[data-resolved-theme="dark"] .contact-form input,
:root[data-resolved-theme="dark"] .contact-form textarea {
  color: var(--text);
}

:root[data-resolved-theme="dark"] .contact-form input::placeholder,
:root[data-resolved-theme="dark"] .contact-form textarea::placeholder {
  color: var(--muted);
}

.hero-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-pills li {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: rgba(29, 112, 105, 0.08);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 600;
}

:root[data-resolved-theme="dark"] .hero-pills li {
  background: rgba(96, 196, 171, 0.12);
}

.hero-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
}

.profile-photo {
  width: 8.5rem;
  height: 8.5rem;
  object-fit: cover;
  border-radius: 1.8rem;
  border: 4px solid rgba(245, 249, 246, 0.94);
  box-shadow: 0 18px 36px rgba(19, 38, 39, 0.18);
}

:root[data-resolved-theme="dark"] .profile-photo {
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-card dl {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.hero-card dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.hero-card dd {
  margin: 0;
  font-weight: 600;
}

.hero-card a,
.contact-list a {
  color: var(--accent-strong);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(245, 249, 246, 0.94);
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.section {
  padding: 2rem 0;
}

.section-heading {
  margin-bottom: 1.4rem;
}

.section-note {
  margin: 0.75rem 0 0;
  max-width: 52rem;
  color: var(--muted);
}

.split,
.grid.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.panel {
  padding: 1.75rem;
}

.facts ul,
.feature-list,
.plain-list,
.contact-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
}

.publication-snaps {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.7;
}

.publication-snaps li + li {
  margin-top: 0.7rem;
}

.highlight-link {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(245, 249, 246, 0.9);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.highlight-link:hover,
.highlight-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(29, 112, 105, 0.26);
  background: rgba(248, 252, 249, 0.98);
  box-shadow: 0 16px 28px rgba(23, 48, 53, 0.08);
}

:root[data-resolved-theme="dark"] .highlight-link:hover,
:root[data-resolved-theme="dark"] .highlight-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.highlight-link em {
  color: var(--muted);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 8.3rem 1fr;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.timeline.compact li {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.date,
.pub-year {
  font-weight: 700;
  color: var(--accent);
}

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

.publication {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.publication-link {
  color: var(--text);
  text-decoration: none;
}

.publication-link:hover,
.publication-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.bluesky-panel {
  padding: 1.5rem;
}

.bluesky-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bluesky-head p {
  margin: 0;
}

.bluesky-button {
  min-height: 2.75rem;
}

.bluesky-feed {
  display: grid;
  gap: 1rem;
  max-height: 36rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.bluesky-post {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(245, 249, 246, 0.88);
}

:root[data-resolved-theme="dark"] .bluesky-post {
  background: rgba(255, 255, 255, 0.05);
}

.bluesky-image {
  width: 100%;
  border-radius: 14px;
  display: block;
}

.bluesky-text {
  margin: 0;
  line-height: 1.7;
}

.bluesky-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.bluesky-meta a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.bluesky-loading {
  margin: 0;
  color: var(--muted);
}

.github-panel {
  min-height: 100%;
}

.github-stack {
  display: grid;
  gap: 1.5rem;
}

.github-calendar-head,
.github-activity-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.github-calendar-frame,
.github-commits {
  margin-top: 1rem;
}

.github-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.github-button {
  white-space: nowrap;
}

.github-calendar-frame {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(245, 249, 246, 0.9);
}

.github-calendar-image {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.github-loading {
  margin: 0;
  color: var(--muted);
}

.github-summary {
  margin-top: 1.25rem;
}

.github-summary-block {
  display: grid;
  gap: 1rem;
}

.github-summary-month {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.github-summary-total {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.35;
  font-weight: 700;
}

.github-repo-list {
  display: grid;
  gap: 1rem;
}

.github-repo-row {
  display: grid;
  gap: 0.5rem;
}

.github-repo-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.github-repo-name {
  font-weight: 700;
}

.github-repo-count {
  color: var(--muted);
}

.github-repo-bar-track {
  width: 100%;
  height: 0.95rem;
  border: 1px solid rgba(29, 112, 105, 0.18);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(245, 249, 246, 0.94);
}

.github-repo-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #87a86f 0%, #1d7069 100%);
}

.github-commit-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.7;
}

.github-commit-list li + li {
  margin-top: 0.8rem;
}

.github-commit-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.github-commit-meta {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-panel,
.contact-form {
  min-height: 100%;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 49, 46, 0.14);
  background: rgba(245, 249, 246, 0.92);
  font: inherit;
  color: var(--text);
}

.contact-form textarea {
  resize: vertical;
}

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding-top: 1rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .site-header-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .split,
  .grid.two-up {
    grid-template-columns: 1fr;
  }

  .site-header {
    border-radius: 24px;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .theme-switch {
    align-self: flex-end;
  }
}

@media (max-width: 1180px) {
  .section-rail {
    display: none;
  }
}

@media (max-width: 1420px) {
  .section-rail {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(66, 124, 115, 0.15), transparent 34%),
      linear-gradient(180deg, #f2f7f4 0%, #e4ebe7 100%);
  }

  .site-header,
  .site-header-shell,
  main,
  .site-footer {
    width: min(100% - 1rem, 100%);
  }

  .theme-switch {
    align-self: stretch;
    justify-content: center;
  }

  .site-header,
  .hero-copy,
  .hero-card,
  .panel,
  .timeline li,
  .publication {
    border-radius: 20px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 1.25rem;
  }

  .github-calendar-image {
    min-width: 680px;
  }

  .hero h1 {
    white-space: normal;
  }

  .timeline li,
  .publication {
    grid-template-columns: 1fr;
  }
}
