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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  color: #3a3a3a;
  background: #fafaf8;
  line-height: 1.7;
  font-size: 17px;
}

h1, h2, h3 {
  font-family: 'Lora', 'Georgia', serif;
  color: #1a2744;
}

a {
  color: #2b5797;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1a2744;
}

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

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 32px;
  position: relative;
  padding-bottom: 12px;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: #4a7ab5;
  border-radius: 2px;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 250, 248, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
  border-bottom-color: #e0ddd6;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a2744;
}

.nav-logo:hover {
  color: #2b5797;
}

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

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: #2b5797;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a2744;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #1e3155 url('images/hero.jpg') center/cover no-repeat;
  color: #fff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 39, 68, 0.7) 0%,
    rgba(43, 87, 151, 0.45) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  max-width: 700px;
}

.hero h1 {
  font-size: 3.5rem;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 1.3rem;
  font-weight: 300;
  margin-bottom: 16px;
  opacity: 0.95;
}

.hero-tagline {
  font-size: 1.05rem;
  font-weight: 300;
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto;
}

/* ========== About ========== */
.about {
  background: #fff;
}

.about-content {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  flex-shrink: 0;
}

.about-text p {
  margin-bottom: 16px;
}

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

/* ========== Publications ========== */
.publications {
  background: #fafaf8;
}

.pub-category {
  font-size: 1.1rem;
  color: #2b5797;
  margin-top: 32px;
  margin-bottom: 8px;
}

.pub-category:first-of-type {
  margin-top: 0;
}

.pub-list {
  list-style: none;
}

.pub-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e8e6e0;
}

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

.pub-year {
  flex-shrink: 0;
  font-family: 'Lora', serif;
  font-weight: 600;
  color: #4a7ab5;
  font-size: 0.95rem;
  padding-top: 2px;
  min-width: 48px;
}

.pub-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pub-title {
  font-weight: 600;
  line-height: 1.4;
}

.pub-venue {
  font-size: 0.9rem;
  color: #777;
  font-style: italic;
}

/* ========== CV ========== */
.cv {
  background: #fff;
}

.cv-group {
  margin-bottom: 40px;
}

.cv-group h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: #2b5797;
}

.cv-list {
  list-style: none;
}

.cv-list li {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-left: 2px solid #c8d5e8;
  padding-left: 20px;
  margin-left: 4px;
}

.cv-date {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #888;
  min-width: 110px;
}

.cv-institution {
  display: block;
  font-size: 0.9rem;
  color: #777;
}

.cv-fields {
  display: block;
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
}

.cv-download {
  margin-top: 32px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: #2b5797;
  color: #fff;
  border: 2px solid #2b5797;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.btn:hover {
  background: #1e3d6e;
  border-color: #1e3d6e;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #2b5797;
}

.btn-outline:hover {
  background: #2b5797;
  color: #fff;
}

/* ========== Contact ========== */
.contact {
  background: #f5f4f0;
}

.contact-intro {
  margin-bottom: 32px;
  color: #555;
}

#contact-form {
  max-width: 560px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #444;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0cdc6;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #3a3a3a;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4a7ab5;
  box-shadow: 0 0 0 3px rgba(43, 87, 151, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.form-status {
  margin-top: 16px;
  font-size: 0.9rem;
}

.form-status.success {
  color: #2b5797;
}

.form-status.error {
  color: #b04040;
}

/* ========== Footer ========== */
.footer {
  background: #1a2744;
  color: #c8d1e0;
  text-align: center;
  padding: 40px 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  color: #a0b4d0;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a svg {
  flex-shrink: 0;
}

.footer-links a:hover {
  color: #fff;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ========== Photography Page ========== */
.photo-header {
  padding-top: 120px;
  padding-bottom: 40px;
}

.photo-intro {
  color: #555;
  margin-top: -16px;
}

.photo-intro code {
  background: #eef1f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.nav-active {
  color: #2b5797 !important;
}

.gallery-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
  column-count: 2;
  column-gap: 20px;
}

.gallery-container > * {
  break-inside: avoid;
  margin-bottom: 20px;
}

.flip-card {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
}

.flip-card img {
  width: 100%;
  display: block;
  transition: opacity 0.4s;
}

.flip-card .flip-card-note {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 39, 68, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: 4px;
}

.flip-card.show-note .flip-card-note {
  opacity: 1;
}

.flip-card-note p {
  color: #c8d1e0;
  font-family: 'Lora', serif;
  font-size: 1rem;
  text-align: center;
  line-height: 1.6;
}

.gallery-item-static {
}

.gallery-item-static img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.gallery-loading {
  color: #888;
  font-style: italic;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(250, 250, 248, 0.98);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    border-bottom: 1px solid #e0ddd6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

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

  .nav-links li a {
    display: block;
    padding: 14px 24px;
  }

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

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

  .section {
    padding: 56px 0;
  }

  .section h2 {
    font-size: 1.6rem;
  }

  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 160px;
    height: 160px;
  }

  .pub-item {
    flex-direction: column;
    gap: 4px;
  }

  .cv-list li {
    flex-direction: column;
    gap: 4px;
  }

  .cv-date {
    min-width: auto;
  }

  .gallery-container {
    column-count: 1;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

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

  .container {
    padding: 0 16px;
  }
}
