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

:root {
  --green: #1a6b4a;
  --green-light: #c8e6d5;
  --green-faint: #eef6f1;
  --black: #1c2b22;
  --gray-dark: #3d4f44;
  --gray: #607a6b;
  --gray-light: #d2ddd6;
  --white: #fafcfa;
  --bg: #f2f7f4;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Lora', Georgia, serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

::selection {
  background: var(--green-light);
  color: var(--black);
}

/* === Navigation === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

nav.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

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

nav .nav-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--black);
  letter-spacing: -0.01em;
}

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

nav .nav-links a {
  color: var(--gray);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

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

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--black);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* === Hero Section === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--black);
}

.hero-text .subtitle {
  font-size: 1.05rem;
  color: var(--gray-dark);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-text .subtitle .fields {
  color: var(--green);
  font-weight: 500;
}

.hero-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.hero-links a {
  font-size: 0.9rem;
  color: var(--gray);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-links a:hover {
  color: var(--green);
}

.hero-links .btn-cv {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.hero-links .btn-cv:hover {
  background: var(--green);
  color: var(--white);
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  filter: grayscale(15%);
  transition: filter 0.3s ease;
}

.hero-photo img:hover {
  filter: grayscale(0%);
}

/* === Sections === */
section {
  padding: 5rem 2rem;
}

section:nth-child(even) {
  background: var(--bg);
}

.section-inner {
  max-width: 820px;
  margin: 0 auto;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  margin-bottom: 2.5rem;
}

/* === Research === */
.research-group {
  margin-bottom: 3rem;
}

.research-group:last-child {
  margin-bottom: 0;
}

.research-group h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.paper {
  margin-bottom: 2rem;
}

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

.paper-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  color: var(--black);
}

.paper-title a {
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-light);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.paper-title a:hover {
  color: var(--green);
  border-color: var(--green);
}

.paper-info {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.paper-info em {
  font-style: italic;
}

.paper-info .status {
  color: var(--green);
  font-weight: 500;
}

.paper-abstract {
  font-size: 0.875rem;
  color: var(--gray-dark);
  line-height: 1.65;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.paper-abstract.open {
  max-height: 500px;
  opacity: 1;
  margin-top: 0.5rem;
}

.abstract-toggle {
  background: none;
  border: none;
  font-size: 0.8rem;
  color: var(--gray);
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  transition: color 0.2s ease;
}

.abstract-toggle:hover {
  color: var(--green);
}

/* === Teaching === */
.course {
  margin-bottom: 1.5rem;
}

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

.course-name {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.course-detail {
  font-size: 0.9rem;
  color: var(--gray);
}

/* === About === */
.about-content {
  max-width: 640px;
}

.about-content p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: var(--gray-dark);
  line-height: 1.75;
}

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

/* Bad jokes / fun section */
.fun-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-light);
}

.fun-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.fun-intro {
  font-size: 0.95rem;
  color: var(--gray-dark);
  margin-bottom: 1.5rem;
}

.joke {
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--green-light);
}

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

.joke-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.joke-intro {
  font-size: 0.9rem;
  color: var(--gray-dark);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.joke blockquote {
  font-size: 0.9rem;
  color: var(--gray-dark);
  line-height: 1.7;
  font-style: italic;
  margin: 0.5rem 0;
}

.joke-punchline {
  font-size: 0.9rem;
  color: var(--gray-dark);
  font-weight: 500;
  margin-top: 0.5rem;
}

.joke .source {
  font-size: 0.8rem;
  color: var(--gray);
  font-style: normal;
  margin-top: 0.4rem;
}

.fun-section blockquote {
  font-size: 0.9rem;
  color: var(--gray-dark);
  line-height: 1.7;
  font-style: italic;
  margin: 0.75rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--green-light);
}

/* === Footer === */
footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

footer p {
  font-size: 0.825rem;
  color: var(--gray);
}

footer a {
  color: var(--gray);
}

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

footer .photo-credit {
  font-size: 0.75rem;
  color: var(--gray-light);
  margin-top: 0.5rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column-reverse;
    gap: 2rem;
    text-align: center;
    padding-top: 6rem;
  }

  .hero-text h1 {
    font-size: 2.1rem;
  }

  .hero-links {
    justify-content: center;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }

  .menu-toggle {
    display: block;
  }

  nav .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

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

  section {
    padding: 3.5rem 1.5rem;
  }
}

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

  .hero-text .subtitle {
    font-size: 0.95rem;
  }
}
