/* ─── Custom Properties ─────────────────────────────────────────────────── */
:root {
  --dark:       #2a2e35;
  --light:      #f7f5f2;
  --amber:      #c8843a;
  --text-dark:  #f0ede8;
  --muted-dark: #9a9590;
  --text-light: #2a2e35;
  --muted-light:#4a4845;
  --nav-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  background: var(--light);
  color: var(--text-light);
  overflow-x: hidden;
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.5rem, 5vw);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-logo {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.975rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo-img {
  height: 40px;
  width: auto;
}

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

.nav-links a {
  color: var(--muted-dark);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 2px;
  background: var(--amber);
  transition: width 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-dark); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: 1rem;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  background: var(--dark);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 4rem) max(2rem, 8vw) 5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4.5rem;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
}

.hero-avatar {
  width: 210px; height: 210px;
  border-radius: 50%;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.25rem;
  font-weight: 500;
  color: var(--dark);
  flex-shrink: 0;
  user-select: none;
  letter-spacing: -0.02em;
  object-fit: cover;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.hero-tagline {
  color: var(--amber);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 1.6rem;
}

.hero-body {
  color: var(--muted-dark);
  font-size: 1rem;
  max-width: 560px;
  margin-bottom: 1.6rem;
}

.hero-signoff {
  color: var(--muted-dark);
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.8;
}

/* ─── Section Shared ─────────────────────────────────────────────────────── */
.section-inner {
  max-width: 880px;
  margin: 0 auto;
}

.section-inner.wide {
  max-width: 1100px;
}

.section-label {
  display: inline-block;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.section-intro {
  font-size: 1rem;
  max-width: 720px;
  margin-bottom: 3rem;
}

/* ─── Research & Publications ────────────────────────────────────────────── */
#research {
  background: var(--dark);
  padding: 5.5rem max(2rem, 8vw);
  color: var(--text-dark);
}

#research .section-title { color: var(--text-dark); }
#research .section-intro { color: var(--muted-dark); }

.publications-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-entry {
  padding: 0.85rem 0 0.85rem 1.25rem;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: border-left-color 0.2s ease;
}

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

.pub-entry:hover { border-left-color: var(--amber); }

.pub-meta {
  display: block;
  color: var(--muted-dark);
  font-size: 0.84rem;
  margin-bottom: 0.3rem;
}

.pub-title {
  display: block;
  color: var(--amber);
  font-weight: 500;
  font-size: 0.96rem;
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.pub-venue {
  display: block;
  color: var(--muted-dark);
  font-size: 0.84rem;
  font-style: italic;
}

/* ─── Teaching ───────────────────────────────────────────────────────────── */
#teaching {
  background: var(--light);
  padding: 5.5rem max(2rem, 8vw);
}

#teaching .section-title  { color: var(--text-light); }
#teaching .section-intro  { color: var(--muted-light); }

/* ─── People & Projects ──────────────────────────────────────────────────── */
#people {
  background: var(--light);
  padding: 5.5rem max(2rem, 8vw);
}

#people .section-title { color: var(--text-light); }

.section-subtext {
  color: var(--muted-light);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: #fff;
  border: 1px solid rgba(42,46,53,0.09);
  border-top: 3px solid transparent;
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card::after {
  content: '↗';
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 0.85rem;
  color: var(--muted-light);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.card:hover {
  border-color: var(--amber);
  border-top-color: var(--amber);
  box-shadow: 0 4px 20px rgba(200,132,58,0.1);
  transform: translateY(-2px);
}

.card:hover::after {
  opacity: 1;
  color: var(--amber);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
}

.card-url {
  font-size: 0.82rem;
  color: var(--muted-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Social Sidebar ─────────────────────────────────────────────────────── */
.social-sidebar {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 190;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(42,46,53,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 28px;
  padding: 0.75rem 0.55rem;
}

.social-sidebar a {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-dark);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}

.social-sidebar a:hover {
  color: var(--amber);
  background: rgba(200,132,58,0.1);
}

/* ─── Contact ────────────────────────────────────────────────────────────── */
#contact {
  background: var(--dark);
  padding: 5.5rem max(2rem, 8vw);
  color: var(--text-dark);
}

#contact .section-title { color: var(--text-dark); }
#contact .section-intro  { color: var(--muted-dark); margin-bottom: 2.5rem; }

.contact-success {
  display: none;
  color: var(--amber);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.contact-form-error {
  display: none;
  color: #e07070;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.875rem;
  color: var(--muted-dark);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted-dark); opacity: 0.6; }

.form-group input:focus,
.form-group textarea:focus { border-color: var(--amber); }

.form-group textarea { resize: vertical; }

.field-error {
  font-size: 0.8rem;
  color: #e07070;
}

.form-submit {
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.form-submit:hover { opacity: 0.85; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer {
  background: var(--dark);
  padding: 2.75rem max(2rem, 8vw);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

.footer-social a {
  color: var(--muted-dark);
  font-size: 1.15rem;
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-social a:hover { color: var(--amber); }

.footer-copy {
  color: var(--muted-dark);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .social-sidebar { display: none; }
}

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

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--dark);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

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

  .nav-links li a {
    display: block;
    padding: 0.9rem max(1.5rem, 5vw);
    font-size: 0.95rem;
  }

  .nav-links a::after { display: none; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-avatar {
    width: 160px; height: 160px;
    font-size: 2.5rem;
    margin: 0 auto;
  }

  .hero-body, .hero-text h1 { max-width: 100%; }
}

@media (max-width: 768px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .cards-grid { grid-template-columns: 1fr; }
}
