/* ============================================================
   Design tokens — dark scholar palette
   ============================================================ */
:root {
  --bg:          #0c0c0e;
  --surface:     #141418;
  --surface-2:   #1c1c22;
  --border:      #2a2a32;
  --text:        #e8e8f0;
  --muted:       #8888a0;
  --accent:      #7aa2f7;   /* cool blue — readable on dark */
  --accent-dim:  #3d5a99;
  --tag-bg:      #1a1a28;
  --tag-border:  #2e2e4a;

  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --radius: 10px;
  --transition: 180ms ease;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Header / hero
   ============================================================ */
header {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 0.6rem;
}

.role {
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

header > p:not(.role) {
  max-width: 54ch;
  color: var(--text);
  opacity: 0.85;
}

/* ============================================================
   Navigation bar (sticky)
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}

nav .nav-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

nav a {
  font-size: 0.825rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

nav a:hover {
  color: var(--text);
}

/* ============================================================
   Main sections
   ============================================================ */
main {
  padding-top: 3.5rem;
}

section {
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

section:last-child {
  border-bottom: none;
}

section h2 {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding-top: 3.5rem;
}

section p {
  color: var(--text);
  opacity: 0.88;
  max-width: 62ch;
  margin-bottom: 0.9rem;
}

section p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition), background var(--transition);
}

.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  border-color: var(--accent-dim);
  background: var(--surface-2);
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.9rem;
  max-width: none;
  margin-bottom: 0.75rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity var(--transition);
}

.card a::after {
  content: "↗";
  font-size: 0.75em;
}

.card a:hover {
  opacity: 0.75;
}

/* ============================================================
   Projects grid
   ============================================================ */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ============================================================
   Work card
   ============================================================ */
.work-card {
  margin-bottom: 0;
}

.work-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.work-detail {
  padding: 0.15rem 1.1rem 0.1rem 0;
}

.work-detail + .work-detail {
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
}

.work-detail h4 {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.work-detail p {
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .work-details {
    grid-template-columns: 1fr;
  }

  .work-detail {
    padding: 0;
  }

  .work-detail + .work-detail {
    padding-left: 0;
    padding-top: 1rem;
    margin-top: 1rem;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* ============================================================
   Skills / tags
   ============================================================ */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.skills span {
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 5px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color var(--transition), border-color var(--transition);
}

.skills span:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

/* ============================================================
   Contact section
   ============================================================ */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity var(--transition);
}

.contact-list a:hover {
  opacity: 0.7;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.contact-row .label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--muted);
  min-width: 5rem;
  text-transform: uppercase;
}

/* ============================================================
   Tech Stack badges
   ============================================================ */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stack-group {
  padding: 1rem 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

.stack-group:hover {
  background: var(--surface-2);
  border-color: var(--accent-dim);
}

.stack-group h3 {
  margin: 0 0 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.stack-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1;
  transition: border-color var(--transition), transform var(--transition);
}

.stack-badge:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .stack-groups {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Publications list
   ============================================================ */
.pub-list {
  list-style: none;
  counter-reset: pub-counter;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0;
}

.pub-list li {
  counter-increment: pub-counter;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0 0.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

.pub-list li:hover {
  border-color: var(--accent-dim);
  background: var(--surface-2);
}

.pub-list li::before {
  content: counter(pub-counter);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  padding-top: 0.2rem;
  text-align: right;
}

.pub-list li > * {
  grid-column: 2;
  margin: 0;
}

.pub-authors {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem !important;
}

.pub-title {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.2rem !important;
}

.pub-venue {
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.8;
}

.pub-venue em {
  font-style: italic;
  color: var(--accent);
  opacity: 0.85;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2rem 0 3rem;
  margin-top: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--text);
}

footer p {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ============================================================
   Links (generic inline)
   ============================================================ */
a {
  color: var(--accent);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 520px) {
  header {
    padding: 3rem 0 2.5rem;
  }

  .projects {
    grid-template-columns: 1fr;
  }

  footer p {
    margin-left: 0;
    width: 100%;
  }
}
