:root {
  --bg: #050505;
  --panel: rgba(4, 8, 7, 0.32);
  --panel-strong: rgba(2, 6, 5, 0.72);
  --line: rgba(174, 231, 205, 0.18);
  --text: #eeeeee;
  --muted: #c7d2cc;
  --soft: #9eaba4;
  --accent: #16805d;
  --accent-bright: #56d39f;
  --accent-dark: #064733;
  --accent-soft: rgba(22, 128, 93, 0.22);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --font-main: Georgia, "Times New Roman", Times, serif;
  --font-display: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
}

body.bg-static {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.86)),
    url("background.png") center / cover fixed no-repeat;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 34%);
}

a {
  color: #bff7dd;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.84);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  color: #d0d0d0;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.nav-button:hover,
.nav-button.active {
  color: #ffffff;
  background: var(--accent-soft);
  border-color: rgba(86, 211, 159, 0.45);
  text-shadow: 0 0 10px rgba(86, 211, 159, 0.35);
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4.5rem 0 5rem;
}

.page-shell.with-toc {
  padding-right: 14.5rem;
}

.hero-panel,
.page-heading,
.feature-band,
.info-card,
.project-card,
.contact-card,
.timeline {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.hero-panel {
  min-height: 64vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(3rem, 8vw, 7rem) clamp(1.25rem, 6vw, 5rem);
  text-align: center;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.eyebrow,
.card-kicker {
  margin: 0 0 0.9rem;
  color: #7ee7b6;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem); 
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.18), 0 0 28px rgba(86, 211, 159, 0.2);
  scroll-margin-top: 6rem;
}

h2 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.12;
}

h3 {
  margin: 0 0 0.75rem;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero-copy,
.page-heading p {
  width: min(720px, 100%);
  margin-top: 1.25rem;
  color: #d8d8d8;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.page-heading .eyebrow {
  margin-top: 0;
  color: #7ee7b6;
  font-size: 0.88rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 700;
}

.primary-link {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.secondary-link {
  background: rgba(255, 255, 255, 0.07);
}

.primary-link:hover,
.secondary-link:hover {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 24px rgba(86, 211, 159, 0.28);
}

.section-grid,
.result-grid,
.project-grid,
.split-section {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.section-grid,
.result-grid,
.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-section {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.info-card,
.project-card,
.contact-card {
  padding: 1.35rem;
}

.info-card h2,
.contact-card h2 {
  margin-bottom: 0.8rem;
}

.muted {
  color: var(--soft);
}

.feature-band {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 1.5rem;
  align-items: center;
  margin: 1rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(6, 13, 11, 0.66), rgba(6, 71, 51, 0.32));
}

.tag-list,
.detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 1rem 0 1.25rem;
  list-style: none;
}

.tag-list li,
.detail-list li {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #dedede;
}

.tag-list li {
  padding: 0.55rem 0.75rem;
}

.detail-list {
  display: grid;
}

.detail-list li {
  padding: 0.75rem 0.9rem;
  line-height: 1.45;
}

.stack-list li {
  border-color: rgba(126, 231, 182, 0.24);
  background: rgba(4, 71, 51, 0.18);
}

details {
  margin-top: 0.6rem;
}

details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #dedede;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

details summary::before {
  content: "\25B8";
  font-size: 0.75em;
  color: var(--accent-bright);
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

details summary:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

details + details {
  margin-top: 0.6rem;
}

details summary ~ p,
details summary ~ .pdf-embed {
  margin-top: 0.9rem;
}

.page-heading {
  margin-bottom: 1rem;
  padding: clamp(2rem, 5vw, 4rem);
}

.page-heading h1 {
  font-size: clamp(2.75rem, 6vw, 5.1rem);
}

.content-section {
  margin-top: 2rem;
  scroll-margin-top: 6rem;
}

.publication-card {
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent-bright);
}

.divider {
  height: 3px;
  margin: 3rem 0 0;
  border: none;
  background: linear-gradient(90deg, rgba(126, 231, 182, 0.4) 0%, rgba(126, 231, 182, 0.4) 20%, transparent 100%);
}

.divider-soft {
  height: 2px;
  margin: 2.5rem 0 0;
  border: none;
  background: linear-gradient(90deg, var(--line) 0%, var(--line) 20%, transparent 100%);
}

.pdf-embed {
  margin-top: 1rem;
}

.pdf-embed iframe {
  display: block;
  width: 100%;
  height: 32rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #ffffff;
}

.pdf-embed p {
  margin-top: 0.6rem;
  font-size: 0.92rem;
}

.section-title {
  margin-bottom: 1rem;
}

.project-card.featured {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1.65rem;
}

.toc {
  position: fixed;
  top: 5.75rem;
  right: 1rem;
  z-index: 99;
  width: 13rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.toc h2 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.toc-header h2 {
  margin-bottom: 0;
}

.toc-toggle-input {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toc-toggle-label,
.toc-backdrop,
.toc-close {
  display: none;
}

.toc a {
  display: block;
  padding: 0.35rem 0;
  color: #cfcfcf;
  font-size: 0.98rem;
}

.toc .toc-sub {
  margin: 0.15rem 0 0.45rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(126, 231, 182, 0.25);
}

.toc .toc-sub a {
  padding: 0.22rem 0;
  color: #a9b8b0;
  font-size: 0.88rem;
}

.toc a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(86, 211, 159, 0.5);
}

.timeline {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.timeline-item {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date {
  color: #7ee7b6;
  font-family: var(--font-display);
  font-weight: 700;
}

.timeline-item h2 {
  margin-bottom: 0.65rem;
  font-size: 1.6rem;
}

@media (max-width: 980px) {
  .page-shell.with-toc {
    padding-right: 0;
  }

  .toc-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: fixed;
    top: 4.85rem;
    right: 1rem;
    z-index: 120;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    color: #dedede;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .toc-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .toc-toggle-input:checked ~ .toc-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .toc-close {
    display: block;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #dedede;
    font-size: 1.1rem;
    line-height: 1.4;
    cursor: pointer;
  }

  .toc {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 20rem);
    height: 100vh;
    margin: 0;
    padding: 5.5rem 1.25rem 2rem;
    border-radius: 0;
    border-width: 0 0 0 1px;
    z-index: 130;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .toc-toggle-input:checked ~ .toc {
    transform: translateX(0);
  }

  .section-grid,
  .result-grid,
  .project-grid,
  .split-section,
  .feature-band,
  .project-card.featured {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body.bg-static {
    background-attachment: scroll;
  }

  nav {
    gap: 0.35rem;
    justify-content: stretch;
  }

  .nav-button {
    min-width: 0;
    flex: 1;
    padding: 0.6rem 0.35rem;
    font-size: 0.78rem;
  }

  .page-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1rem;
  }

  .hero-panel {
    min-height: calc(100vh - 5rem);
  }

  .button-row,
  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .feature-band,
  .page-heading,
  .info-card,
  .project-card,
  .contact-card,
  .project-card.featured {
    padding: 1.1rem;
  }
}
