@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700&family=Lora:ital,wght@1,400&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --nav-bg:       #1c2438;
  --nav-text:     #c8d0e0;
  --nav-active:   #93c5fd;
  --bg:           #ffffff;
  --bg-subtle:    #f8f9fb;
  --text:         #1f2937;
  --muted:        #6b7280;
  --light:        #9ca3af;
  --accent:       #1d4ed8;
  --accent-hover: #1e40af;
  --accent-light: #eff6ff;
  --accent-border:#bfdbfe;
  --rule:         #e5e7eb;
  --heading:      'Manrope', system-ui, sans-serif;
  --mono:         'JetBrains Mono', 'Fira Code', monospace;
  --serif:        'Lora', Georgia, 'Times New Roman', serif;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;
  --max-w:        720px;
  --nav-h:        56px;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: calc(var(--max-w) + 80px);
  margin: 0 auto;
  padding: 0 40px;
}

main {
  padding-top: 72px;
  padding-bottom: 100px;
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--nav-active);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.nav-brand:hover { color: #bfdbfe; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}
.nav-links a:hover        { opacity: 1; background: rgba(255,255,255,0.06); color: var(--nav-text); }
.nav-links a[aria-current="page"] { opacity: 1; color: var(--nav-active); }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0;
  margin-top: 40px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--light);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rule);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: #d1d5db; color: var(--text); }

/* ============================================================
   Section label  (mono uppercase, accent, with trailing rule)
   ============================================================ */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ============================================================
   Tag / badge
   ============================================================ */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
}

/* ============================================================
   Publication list  (shared by home + research)
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-entry {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.pub-entry:first-child { border-top: 1px solid var(--rule); }

.pub-year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--light);
  font-weight: 500;
  padding-top: 3px;
  text-align: right;
}

.pub-body {}

.pub-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.97rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.55;
  display: block;
  margin-bottom: 5px;
  transition: color 0.12s;
}
.pub-title:hover { color: var(--accent); }

.pub-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.pub-meta .tag { margin-left: 6px; vertical-align: middle; }

/* ============================================================
   Page hero
   ============================================================ */
.page-hero {
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-eyebrow::before {
  content: '// ';
  opacity: 0.5;
}

.page-hero h1 {
  font-family: var(--heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-role {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}
.hero-role .accent { color: var(--accent); font-weight: 500; }

.hero-bio {
  font-size: 1rem;
  color: #374151;
  line-height: 1.8;
  max-width: 580px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   Inner page title  (research, cv, applied, contact)
   ============================================================ */
.page-title {
  font-family: var(--heading);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 52px;
}

/* ============================================================
   Research page — grouped sections
   ============================================================ */
.research-section {
  margin-bottom: 56px;
}

/* ============================================================
   CV page — timeline
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 56px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.timeline-entry:first-child { border-top: 1px solid var(--rule); }

.timeline-period {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--light);
  font-weight: 500;
  padding-top: 3px;
  text-align: right;
  letter-spacing: 0.01em;
}

.timeline-body {}

.timeline-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-org {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.timeline-org::before { content: '@'; margin-right: 1px; color: var(--accent); }

.timeline-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================================================
   Applied page — project cards
   ============================================================ */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.project-entry:first-child { border-top: 1px solid var(--rule); }

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.project-title {
  font-family: var(--heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.project-title:hover { color: var(--accent); }

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 580px;
}

.project-links {
  margin-top: 10px;
  display: flex;
  gap: 14px;
}
.project-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.project-links a::before { content: '→ '; }
.project-links a:hover { color: var(--accent-hover); }

/* ============================================================
   Contact page
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.contact-entry {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--text);
  transition: color 0.12s;
}
.contact-entry:nth-child(odd)  { padding-right: 32px; }
.contact-entry:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--rule); }
.contact-entry:nth-last-child(-n+2) { border-bottom: none; }
.contact-entry:hover { color: var(--accent); }

.contact-icon {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}

.contact-label {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.contact-value {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============================================================
   "View all" link
   ============================================================ */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  margin-top: 24px;
}
.view-all::after { content: ' →'; }
.view-all:hover  { color: var(--accent-hover); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  main { padding-top: 48px; padding-bottom: 72px; }

  .nav-links { display: none; flex-direction: column; gap: 0; }
  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links.is-open a {
    padding: 10px 20px;
    border-radius: 0;
    font-size: 0.85rem;
  }
  .nav-toggle { display: flex; }

  .page-hero h1  { font-size: 1.9rem; }
  .page-title    { font-size: 1.5rem; }
  .hero-actions  { flex-direction: column; align-items: flex-start; }

  .pub-entry,
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .pub-year,
  .timeline-period { text-align: left; }

  .contact-grid  { grid-template-columns: 1fr; }
  .contact-entry:nth-child(even) { padding-left: 0; border-left: none; }
  .contact-entry:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .contact-entry:last-child { border-bottom: none; }
}
