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

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --border:    #21262d;
  --accent:    #4ecca3;
  --accent-dim: rgba(78, 204, 163, 0.12);
  --accent-mid: rgba(78, 204, 163, 0.25);
  --text:      #c9d1d9;
  --text-muted: #8b949e;
  --text-head: #e6edf3;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
  --radius:    10px;
  --radius-sm: 6px;
  --personal-color: #FFA500;
  --research-color: #63b3ed;
}

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #7fffd4; text-decoration: underline; }

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.8; text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-links a:hover {
  color: var(--text-head);
  background: var(--accent-dim);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: auto;
  font-size: 1rem;
}

/* ==================== HERO ==================== */
.hero {
  background: linear-gradient(160deg, #111820 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
  padding: 5rem 1.25rem 4rem;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: #0d1117;
}
.btn-accent:hover {
  background: #7fffd4;
  color: #0d1117;
  text-decoration: none;
}

.btn-ghost {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
}
.btn-ghost:hover {
  background: var(--accent-mid);
  color: var(--text-head);
  text-decoration: none;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
}
.btn-sm:hover {
  background: var(--accent-mid);
  color: var(--text-head);
  text-decoration: none;
}

.icon { width: 1rem; height: 1rem; flex-shrink: 0; }

/* ==================== PAGE BODY ==================== */
.page-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* ==================== SECTIONS ==================== */
.section {
  padding-top: 4rem;
  scroll-margin-top: 70px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.section-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  margin-top: -0.75rem;
}

.subsection-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2rem 0 1rem;
}

/* ==================== CARD ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.prose p { color: var(--text); margin-bottom: 0.9rem; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--accent); }
.prose ul { padding-left: 1.4rem; color: var(--text); }

.affil-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.affil-tag {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
}

/* ==================== FEATURE CARD (PARLASPEECH) ==================== */
.feature-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.feature-logo-slot {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

.parlaspeech-logo {
  width: 80px;
  height: auto;
  border-radius: 6px;
}

.parlaspeech-logo-placeholder {
  width: 80px;
  height: 80px;
  background: var(--accent-dim);
  border: 1px dashed var(--accent-mid);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  text-align: center;
}

.feature-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-head);
  margin-bottom: 0.2rem;
}
.feature-title a { color: var(--text-head); }
.feature-title a:hover { color: var(--accent); }

.feature-sub {
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.feature-body p { color: var(--text); font-size: 0.93rem; margin-bottom: 0.75rem; }

.feature-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* ==================== MINI CARDS GRID ==================== */
.card-grid {
  display: grid;
  gap: 1rem;
}
.three-col { grid-template-columns: repeat(3, 1fr); }

.mini-card {
  padding: 1.1rem 1.25rem;
}

.mini-icon {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.mini-card h4 {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-head);
  margin-bottom: 0.4rem;
}

.mini-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==================== PROJECT LIST (research) ==================== */
.project-list { display: flex; flex-direction: column; gap: 0; }

.project-row {
  display: flex;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.project-row:last-child { border-bottom: none; }

.project-meta {
  flex-shrink: 0;
  width: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.15rem;
}

.project-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.project-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}
.project-status.active { background: rgba(78,204,163,0.15); color: var(--accent); }
.project-status.ended  { background: rgba(139,148,158,0.15); color: var(--text-muted); }

.project-body strong { color: var(--text-head); font-size: 0.92rem; }
.project-body p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ==================== PUBLICATIONS ==================== */
.pub-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }

.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s;
}
.pub-card:hover { border-color: rgba(78,204,163,0.3); }

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

.venue-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
}

.venue-top  { background: rgba(78,204,163,0.18); color: var(--accent); border: 1px solid rgba(78,204,163,0.35); }
.venue-conf { background: rgba(100,149,237,0.15); color: #82aff0; border: 1px solid rgba(100,149,237,0.3); }
.venue-journal { background: rgba(218,165,32,0.15); color: #d4a84b; border: 1px solid rgba(218,165,32,0.3); }
.venue-data { background: rgba(180,100,220,0.15); color: #c084f5; border: 1px solid rgba(180,100,220,0.3); }

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-head);
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.pub-authors {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.accent { color: var(--accent); }

.pub-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.pub-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-mid);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.pub-link:hover { background: var(--accent-mid); color: var(--text-head); text-decoration: none; }

.cite-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.cite-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cite-block {
  margin-top: 0.75rem;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.cite-block pre {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #c9d1d9;
  line-height: 1.6;
  padding: 1rem 1.1rem;
  white-space: pre;
}

/* ==================== CONFERENCES ==================== */
.conf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.conf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.conf-card.conf-major {
  border-color: rgba(78,204,163,0.2);
}

.conf-year {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent);
}

.conf-card strong {
  font-size: 0.92rem;
  color: var(--text-head);
}

.conf-loc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.workshop-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.workshop-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text);
}

.wk-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
}

/* ==================== PROJECT CARDS (personal) ==================== */
.project-cards { display: flex; flex-direction: column; gap: 1rem; }

.project-card-full { }

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.project-card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-head);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.project-card-links {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.project-card-full p {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.project-card-full a { color: var(--accent); }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(139,148,158,0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.mk-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-mid);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}

.mk-badge.wip {
  background: rgba(218,165,32,0.12);
  color: #d4a84b;
  border-color: rgba(218,165,32,0.3);
}

/* ==================== SKILLS ==================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.skill-card h4 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.skill-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.skill-card li {
  font-size: 0.83rem;
  color: var(--text);
  padding-left: 0.8rem;
  position: relative;
}

.skill-card li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.6;
}

/* ==================== TIMELINE ==================== */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 110px;
  padding-top: 0.15rem;
}

.timeline-body strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-head);
  margin-bottom: 0.15rem;
}

.tl-place {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==================== CV CARD ==================== */
.cv-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cv-card h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--text-head);
  margin-bottom: 0.3rem;
}

.cv-card p { font-size: 0.85rem; color: var(--text-muted); }

.cv-links {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* ==================== FOOTER ==================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
}

.footer-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; width: 100%; padding: 0.5rem 0 0.75rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; height: auto; padding: 0.65rem 1.25rem; }
  .nav-brand { padding: 0.25rem 0; }

  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 2.2rem; }

  .feature-card { flex-direction: column; }
  .feature-logo-slot { width: 60px; }
  .parlaspeech-logo { width: 60px; }

  .three-col { grid-template-columns: 1fr 1fr; }
  .conf-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }

  .project-card-header { flex-direction: column; }
  .cv-card { flex-direction: column; }
}

@media (max-width: 480px) {
  .three-col { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .conf-grid { grid-template-columns: 1fr; }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}



 
.legend {
  display: inline-flex;
  gap: 1.1rem;
  margin-left: 0.75rem;
}
 
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85em;
}
 
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
 
.dot-personal { background: var(--personal-color); }
.dot-research { background: var(--research-color); }
 
/* ==================== PROJECT TILE GRID ==================== */
.project-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-tile {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top: 3px solid var(--tile-accent, var(--research-color));
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease;
  min-height: 280px;
}

.project-tile:hover {
  transform: translateY(-4px);
  border-color: var(--tile-accent, var(--research-color));
}

.tile-personal { --tile-accent: #FFA500; }
.tile-research { --tile-accent: #63b3ed; }

.tile-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.badge-personal {
  color: #FFA500;
  background: rgba(255, 165, 0, 0.12);
  border: 1px solid rgba(255, 165, 0, 0.35);
}

.badge-research {
  color: #63b3ed;
  background: rgba(99, 179, 237, 0.14);
  border: 1px solid rgba(99, 179, 237, 0.4);
}

.tile-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.3;
  margin: 0 0 0.6rem;
}

.tile-tagline {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
  flex-grow: 1;
  margin: 0 0 0.9rem;
}

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
}

.tile-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

@media (max-width: 600px) {
  .project-tile-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== TILE IMAGE OVERLAY ==================== */
.project-tile {
  position: relative;
  overflow: hidden;
}

.tile-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.tile-image-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,17,23,0.5), rgba(13,17,23,0.7));
  z-index: 1;
}

.project-tile:hover .tile-image-overlay {
  opacity: 1;
}

.project-tile > *:not(.tile-image-overlay) {
  position: relative;
  z-index: 2;
}