/* =========================================================
   Theme tokens
   ========================================================= */

:root {
  --bg: #0b0f14;
  --bg-elevated: #121821;
  --bg-hover: #1a2230;
  --border: #232d3b;
  --border-soft: #1a2230;

  --text: #dbe3ec;
  --text-muted: #8b98a8;
  --text-faint: #64707e;

  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-dim: rgba(125, 211, 252, 0.12);
  --violet: #a78bfa;

  --sidebar-w: 16.5rem;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 78% -10%, rgba(125, 211, 252, 0.07), transparent 60%),
    radial-gradient(45rem 35rem at 5% 8%, rgba(167, 139, 250, 0.06), transparent 62%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover,
a:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 3px;
}

h1,
h2,
h3,
h4 {
  color: #f1f5f9;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 3rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--violet);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #06131d;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.75rem 1.25rem 1.5rem;
  background: rgba(14, 19, 27, 0.92);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand:hover {
  text-decoration: none;
}

.avatar {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  object-fit: cover;
  background: var(--bg-hover);
  box-shadow: 0 0 0 1px var(--border);
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-name {
  display: block;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}

.sidebar-role {
  display: block;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.35;
}

.nav-label {
  margin: 0 0 0.4rem;
  padding: 0 0.7rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-group + .nav-group {
  margin-top: 1.5rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.nav-list a:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  background: var(--accent-dim);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.nav-list svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  opacity: 0.85;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* Mobile sidebar toggle */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 60;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(3, 6, 10, 0.6);
  border: 0;
  padding: 0;
}

/* =========================================================
   Layout
   ========================================================= */

.content {
  margin-left: var(--sidebar-w);
  padding: 3.5rem 2.5rem 2rem;
}

.container {
  width: 100%;
  max-width: 54rem;
  margin: 0 auto;
}

.section {
  margin: 0 0 3.5rem;
  scroll-margin-top: 2rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2.75rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

/* The headshot sits on a flat yellow backdrop, so the outer ring picks that
   yellow up faintly to tie it to the rest of the dark palette. */
.hero-portrait img {
  display: block;
  width: 12.5rem;
  height: 12.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 1px var(--border),
    0 0 0 0.5rem rgba(255, 230, 89, 0.07),
    0 1.25rem 2.5rem rgba(0, 0, 0, 0.5);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  margin-bottom: 0.65rem;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 46rem;
  margin-bottom: 1.25rem;
}

.hero-tagline strong {
  color: var(--text);
  font-weight: 600;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-meta svg {
  width: 0.95rem;
  height: 0.95rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: #33405280;
  color: var(--text);
  text-decoration: none;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06131d;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #06131d;
}

/* =========================================================
   Cards, stats, lists
   ========================================================= */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.stat {
  text-align: center;
  padding: 1rem 0.75rem;
}

.stat-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* Timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  border-left: 1px solid var(--border);
}

.timeline > li {
  position: relative;
  padding-bottom: 2rem;
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 0.3rem - 1px);
  top: 0.45rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.15rem;
}

.timeline-role {
  font-size: 1.02rem;
  font-weight: 600;
  color: #f1f5f9;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.timeline-org {
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.timeline p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0;
}

/* Publications */

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0 1rem;
  align-items: start;
  padding: 0.95rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pub:hover {
  border-color: #2f3d4e;
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  padding-top: 0.15rem;
}

.pub-title {
  display: block;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.2rem;
}

.pub-venue {
  display: block;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Project cards */

.project {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project h3 {
  font-size: 1rem;
  margin: 0;
}

.project p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.lang-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--violet);
  margin-right: 0.35rem;
  vertical-align: -0.03rem;
}

/* Plain bulleted list */

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.plain-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.plain-list strong {
  color: var(--text);
  font-weight: 600;
}

/* Sketch pages */

.sketch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2.5rem;
  align-items: start;
}

.sketch-canvas {
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 0;
}

.sketch-canvas canvas {
  max-width: 100%;
  height: auto !important;
  border-radius: var(--radius-sm);
  display: block;
}

.lede {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 62rem) {
  .sketch-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 48rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    justify-items: start;
  }

  /* Lead with the face on narrow screens. */
  .hero-portrait {
    order: -1;
  }

  .hero-portrait img {
    width: 8.5rem;
    height: 8.5rem;
  }
}

@media (max-width: 52rem) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.45);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .content {
    margin-left: 0;
    padding: 4.75rem 1.25rem 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sidebar {
    transition: none;
  }
}
