/* ============================================================
   THEME TOKENS
============================================================ */
:root {
  --bg:     #F4F1EA;
  --panel:  #FBFAF7;
  --ink:    #1B1A17;
  --muted:  #6E6A62;
  --line:   rgba(27, 26, 23, 0.12);
  --accent: #3A6E55;
}
[data-theme="dark"] {
  --bg:     #141310;
  --panel:  #1C1B17;
  --ink:    #ECE9E1;
  --muted:  #928D83;
  --line:   rgba(236, 233, 225, 0.15);
}

/* ============================================================
   RESET & BASE
============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
strong { font-weight: 600; }
.accent { color: var(--accent); }
.mono {
  font-family: 'JetBrains Mono', monospace;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Shared layout container */
.nav-inner,
.hero,
.section,
.contact-inner { max-width: 1180px; margin: 0 auto; }

.section { padding: 56px 32px; scroll-margin-top: 70px; }
#top { scroll-margin-top: 0; }

/* ============================================================
   NAV
============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}
.brand-dot {
  width: 9px; height: 9px;
  background: var(--accent);
  display: inline-block;
  border-radius: 1px;
}
.brand-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 7px 11px;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  transition: color .2s;
}
.nav-link .num { opacity: 0.55; font-size: 9.5px; }
.nav-link:hover,
.nav-link.is-active { color: var(--accent); }
.theme-btn {
  margin-left: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, border-color .2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   HERO
============================================================ */
.hero { padding: 72px 32px 56px; }
.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 30px;
}
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.hero-lead-col { flex: 1 1 540px; min-width: 300px; }
.hero-headline {
  margin: 0;
  font-size: clamp(2.9rem, 8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.hero-lead {
  margin: 34px 0 0;
  max-width: 560px;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink);
}
.status-card {
  flex: 0 1 320px;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  padding: 22px 22px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
}
.status-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3a9d57;
  display: inline-block;
  animation: blink 2.4s ease-in-out infinite;
}
.status-label { color: var(--muted); }
.status-val { margin-bottom: 12px; }
.status-val.no-gap { margin-bottom: 0; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 44px;
}
.action-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 16px;
  transition: all .2s;
}
.action-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.action-link--cv { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   SECTION HEADINGS
============================================================ */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 40px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
}
.section-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ============================================================
   FOCUS
============================================================ */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: -4px;
}
.focus-cell { background: var(--bg); padding: 26px 24px; }
.focus-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 12px;
}
.focus-text { font-size: 1.05rem; font-weight: 500; }

/* ============================================================
   RESEARCH
============================================================ */
.exp {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}
.exp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.exp-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.exp-org { font-size: 1.05rem; color: var(--accent); font-weight: 500; }
.exp-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  line-height: 1.6;
}
.exp-points {
  margin-top: 22px;
  display: grid;
  gap: 13px;
  max-width: 880px;
}
.point { display: flex; gap: 13px; }
.point-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  margin-top: 8px;
  flex: none;
  border-radius: 1px;
}
.point-text { font-size: 1rem; line-height: 1.5; }

/* ============================================================
   PUBLICATIONS
============================================================ */
.pub {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 28px;
  background: var(--panel);
  margin-bottom: 16px;
  transition: border-color .2s;
}
.pub--paper:hover { border-color: var(--accent); }
.pub-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 14px;
}
.pub-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}
.pub-doi {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.pub-title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 760px;
}
.pub-authors { margin-top: 12px; font-size: 0.97rem; color: var(--muted); }
.pub-authors strong { color: var(--ink); }
.pub--poster .pub-kind { margin-bottom: 14px; display: block; }

/* ============================================================
   PROJECTS
============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  perspective: 1100px;
}
.proj-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .14s ease, border-color .2s, box-shadow .2s;
  transform-style: preserve-3d;
  will-change: transform;
}
.proj-card:not(.proj-card--feature):hover { border-color: var(--accent); }
.proj-card--feature { background: var(--accent); color: #fff; }
.proj-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.proj-title { margin: 0; font-size: 1.2rem; font-weight: 600; }
.proj-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
}
.proj-card--feature .proj-tag { color: rgba(255,255,255,0.8); }
.proj-desc {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.5;
  flex: 1;
}
.proj-card--feature .proj-desc { opacity: 0.95; }
.proj-metric {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}
.proj-card--feature .proj-metric { color: #fff; opacity: 0.9; }
.proj-stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.proj-card--feature .proj-stack { color: rgba(255,255,255,0.75); }

/* ============================================================
   RECOGNITION
============================================================ */
.awards { display: grid; gap: 0; }
.award {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.award--last { border-bottom: 1px solid var(--line); }
.award-main { flex: 1 1 380px; }
.award-name { font-size: 1.12rem; font-weight: 600; }
.award-org { color: var(--muted); }
.award-note { margin-top: 4px; font-size: 0.95rem; color: var(--muted); }
.award-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--accent);
}

/* ============================================================
   SKILLS
============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 34px;
}
.skill-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.92rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 11px;
  transition: border-color .2s, color .2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   CONTACT / FOOTER
============================================================ */
.contact {
  background: var(--ink);
  color: var(--bg);
  margin-top: 48px;
  transition: background .35s ease, color .35s ease;
}
.contact-inner { padding: 84px 32px; }
.contact-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 28px;
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  align-items: flex-end;
}
.contact-big {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 680px;
}
.contact-email {
  display: inline-block;
  margin-top: 30px;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 500;
  color: var(--bg);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  transition: color .2s;
}
.contact-email:hover { color: var(--accent); }
.contact-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 2;
  opacity: 0.85;
}
.foot-link { color: inherit; text-decoration: none; transition: color .2s; }
.foot-link:hover { color: var(--accent); }
.contact-loc { opacity: 0.6; }
.colophon {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  opacity: 0.55;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .nav-inner { padding: 12px 18px; }
  .hero { padding: 48px 18px 40px; }
  .section { padding: 44px 18px; }
  .contact-inner { padding: 60px 18px; }
  .exp-meta { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .status-dot { animation: none; }
  .proj-card { transition: border-color .2s; }
}
