/* Minimalist CSS inspired by Niko Sirmpilatze's website */

/* Import clean, modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Theme variables */
:root {
  --bg: #ffffff;
  --text: #333333;
  --text-strong: #222222;
  --text-muted: #666666;
  --border: #eeeeee;
  --surface: #fafafa;
  --surface-hover: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

.dark-theme {
  --bg: #0f1115;
  --text: #d1d5db;
  --text-strong: #e5e7eb;
  --text-muted: #9aa0a6;
  --border: #1f2937;
  --surface: #111318;
  --surface-hover: #161922;
  --shadow: rgba(0, 0, 0, 0.6);
}

/* Apply variables */
body {
  background-color: var(--bg);
  color: var(--text);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
}

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

.nav-links a {
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-strong);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-strong);
  border-color: var(--text-strong);
  transform: translateY(-2px);
}

/* Mobile navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}

/* Main content */
.main {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Hero section */
.hero {
  padding: 2rem 0 3rem;
}

/* Hero content layout */
.hero-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3rem;
}

.hero-left {
  text-align: center;
}

.hero-right {
  text-align: left;
}

/* Profile photo */
.profile-photo {
  margin-bottom: 1.5rem;
}

.profile-photo img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface-hover);
  box-shadow: 0 6px 24px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero .description {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Quick stats */
.quick-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Education section */
.education {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.education h3 {
  text-align: left;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.3rem;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.education-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.education-item:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.education-degree {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.education-institution {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.education-year {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Social links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.9rem;
}

.social-link:hover {
  color: var(--text-strong);
  border-color: var(--text-strong);
  transform: translateY(-2px);
}

/* Research interests */
.research-interests {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.research-interests h3 {
  text-align: left;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.3rem;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.interest-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  transition: all 0.2s ease;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.interest-item:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.interest-item.active {
  border-color: var(--text-strong);
  background: var(--surface-hover);
  box-shadow: 0 2px 8px var(--shadow);
}

.interest-item.active i {
  color: var(--text-strong);
}

.interest-item.active span {
  color: var(--text-strong);
  font-weight: 500;
}

.interest-item i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
  transition: color 0.2s ease;
}

.interest-item span {
  color: var(--text);
  transition: color 0.2s ease;
}

/* Research Projects Container */
.research-projects-container {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(-10px);
}

.research-projects-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Research Project Items */
.research-project-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.3s ease;
  cursor: pointer;
}

.research-project-item:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.research-project-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
}

.research-project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.research-project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.research-project-title {
  margin: 0 0 0.5rem 0;
  color: var(--text-strong);
  font-size: 1.2rem;
}

.research-project-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.research-project-description {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.research-project-description.collapsed {
  max-height: 4.8em;
  overflow: hidden;
}

.research-project-description.expanded {
  max-height: none;
}

.research-project-description p {
  margin: 0;
  font-size: 0.95rem;
}

.research-project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.research-project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.research-project-link:hover {
  color: var(--text-strong);
  border-color: var(--text-strong);
  background: var(--surface-hover);
}

.research-project-toggle {
  align-self: flex-start;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.research-project-toggle:hover {
  color: var(--text-strong);
  border-color: var(--text-strong);
  background: var(--surface-hover);
}

@media (max-width: 768px) {
  .research-project-item {
    flex-direction: column;
    gap: 1rem;
  }

  .research-project-image {
    width: 100%;
    height: 200px;
  }
}

/* Recent work */
.recent-work {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.recent-work h3 {
  text-align: left;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 1.3rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  align-items: start;
}

.work-grid > * {
  min-width: 0;
  width: 100%;
}

.work-item {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
}

.work-item:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.work-item-image-wrapper {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
}

.work-item-image {
  width: 100% !important;
  max-width: 100% !important;
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  border-radius: 6px;
  overflow: hidden !important;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
  transition: box-shadow 0.3s ease;
  position: relative;
  box-sizing: border-box;
}

.work-item:hover .work-item-image {
  box-shadow: 0 4px 12px var(--shadow);
}

.work-item-image img {
  max-width: calc(100% - 0px) !important;
  max-height: calc(100% - 0px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transition: opacity 0.3s ease;
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

.work-item-image img[src$=".svg"],
.work-item-image img[src*=".svg"] {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.work-item:hover .work-item-image img {
  opacity: 0.95;
}

.work-item h4 {
  margin-bottom: 0.75rem;
  color: var(--text-strong);
  font-size: 1.1rem;
}

.work-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.work-item p {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.work-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
  margin-top: auto;
}

.work-link:hover {
  color: var(--text-strong);
  transform: translateX(4px);
}

/* Page sections */
.page-section {
  padding: 4rem 0;
}

.page-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-strong);
}

/* Projects */
.projects {
  display: grid;
  gap: 3rem;
  margin-top: 2rem;
}

.project {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

/* Project card layout */
.project-card {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.project-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-image:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-image:hover img {
  transform: scale(1.05);
}

.project-content {
  flex: 1;
}

.project:last-child {
  border-bottom: none;
}

.project h3 {
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.project-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-description {
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.project-link:hover {
  color: var(--text-strong);
  border-color: var(--text-strong);
}

/* Publications */
.publications {
  max-width: 800px;
  margin: 0 auto;
}

.publication-category {
  margin-bottom: 3rem;
}

.publication-category h3 {
  color: var(--text-strong);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.publication-item {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.publication-item:last-child {
  border-bottom: none;
}

.publication-title {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.publication-authors {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.publication-venue {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

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

.publication-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.publication-link:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.scholar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--text-strong);
  color: var(--bg);
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.scholar-link:hover {
  background: var(--text-muted);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.scholar-link i {
  font-size: 1.2rem;
}

/* Contact */
.contact {
  text-align: center;
  padding: 4rem 0;
}

.contact h2 {
  margin-bottom: 2rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}

.contact-item:hover {
  border-color: var(--text-strong);
  color: var(--text-strong);
}

/* Responsive design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .container {
    padding: 0 1rem;
  }

  /* Hero responsive */
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-right {
    text-align: center;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero .subtitle {
    font-size: 1.1rem;
  }

  .hero .description {
    font-size: 1rem;
  }

  .quick-stats {
    justify-content: center;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .social-links {
    gap: 1rem;
  }

  /* Education responsive */
  .education-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Interests responsive */
  .interests-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .interest-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Work responsive */
  .work-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .work-item {
    padding: 1.25rem;
  }

  .work-item-image {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
    margin-bottom: 0.75rem;
  }

  .project-links {
    flex-direction: column;
  }

  .project-link {
    justify-content: center;
  }

  /* Project card responsive design */
  .project-card {
    flex-direction: column;
    gap: 1.5rem;
  }

  .project-image {
    width: 100%;
    max-width: 300px;
    height: 200px;
    margin: 0 auto;
  }

  .profile-photo img {
    width: 120px;
    height: 120px;
  }

  .contact-info {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .page-section {
    padding: 2rem 0;
  }

  .profile-photo img {
    width: 100px;
    height: 100px;
  }

  .project-image {
    height: 150px;
  }

  .quick-stats {
    flex-direction: column;
    gap: 1rem;
  }

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

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

/* Utility classes */
.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }