/* ===== Design tokens ===== */
:root {
  --cream: #fdf6f3;
  --cream-alt: #faeeea;
  --charcoal: #362a2c;
  --charcoal-soft: #6b5a5c;
  --rose: #b76e79;
  --rose-dark: #9c5763;
  --rose-light: #f3c6ce;
  --blush: #f7d9dc;
  --gold: #cda45e;
  --white: #ffffff;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-soft: 0 10px 30px rgba(183, 110, 121, 0.12);
  --shadow-card: 0 6px 20px rgba(54, 42, 44, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Progress bar ===== */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ===== Header / Nav ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  padding: 20px 0;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease;
}
.site-header.scrolled {
  background: rgba(253, 246, 243, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(54, 42, 44, 0.08);
  padding: 12px 0;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--charcoal);
}
.site-header:not(.scrolled) .nav-brand { color: var(--white); }
.nav-brand span { color: var(--gold); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--charcoal);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}
.site-header:not(.scrolled) .nav-link:not(.nav-cta) { color: var(--white); }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-cta {
  background: var(--rose);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--rose-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 950;
}
.nav-toggle span {
  width: 26px; height: 2px;
  background: var(--charcoal);
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.site-header:not(.scrolled) .nav-toggle span { background: var(--white); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-header.scrolled .nav-toggle.open span { background: var(--charcoal); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(54,42,44,0.55) 0%, rgba(54,42,44,0.45) 45%, rgba(183,110,121,0.55) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  padding-top: 100px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rose-light);
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.1;
  margin-bottom: 24px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.2);
}
.hero-tagline {
  max-width: 560px;
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.92);
  margin-bottom: 36px;
}
.hero-tagline strong { color: var(--gold); font-weight: 600; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-socials { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.hero-social svg { width: 20px; height: 20px; }
.hero-social:hover {
  background: linear-gradient(120deg, var(--rose), var(--gold));
  border-color: transparent;
  transform: translateY(-3px);
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}
.btn-primary {
  background: linear-gradient(120deg, var(--rose), var(--gold));
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(183,110,121,0.3); }
.btn-outline {
  border: 1.5px solid rgba(255,255,255,0.7);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: var(--white); }

.scroll-cue {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-cue span {
  display: block;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 20px;
  position: relative;
}
.scroll-cue span::before {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: scrollDown 1.8s infinite;
}
@keyframes scrollDown {
  0% { top: 8px; opacity: 1; }
  70% { top: 24px; opacity: 0; }
  100% { top: 24px; opacity: 0; }
}

/* ===== Sections ===== */
.section { padding: 120px 0; }
.section-alt { background: var(--cream-alt); }
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rose);
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: 48px;
  color: var(--charcoal);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 72px;
  align-items: center;
}
.about-portrait { position: relative; justify-self: center; }
.portrait-frame {
  width: 300px; height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--white);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 1;
}
.portrait-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.portrait-accent {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 2px dashed var(--rose-light);
  top: 24px; left: 24px;
  z-index: 0;
}
.about-copy .section-title { margin-bottom: 24px; }
.about-text { color: var(--charcoal-soft); margin-bottom: 18px; max-width: 620px; }
.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--rose-dark);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--charcoal-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Timeline (Experience) ===== */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--rose-light);
}
.timeline-item { position: relative; margin-bottom: 48px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -39px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--rose), var(--gold));
  border: 3px solid var(--cream-alt);
  box-shadow: 0 0 0 2px var(--rose-light);
}
.timeline-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.timeline-head h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--charcoal);
}
.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rose-dark);
  background: var(--blush);
  padding: 4px 14px;
  border-radius: 999px;
}
.timeline-org {
  font-weight: 500;
  color: var(--charcoal-soft);
  margin-bottom: 16px;
}
.timeline-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--charcoal-soft);
  font-size: 0.95rem;
}
.timeline-list li:last-child { margin-bottom: 0; }
.timeline-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.timeline-list strong { color: var(--charcoal); }

/* ===== Card grid (Education / Publications) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
#publications .card-grid { grid-template-columns: repeat(2, 1fr); }

.edu-card, .pub-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--rose), var(--gold)) 1;
}
.edu-card:hover, .pub-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}
.edu-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rose-dark);
  background: var(--blush);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.edu-card h3, .pub-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--charcoal);
}
.edu-school, .pub-detail { color: var(--charcoal-soft); font-size: 0.92rem; }
.edu-detail { color: var(--charcoal-soft); font-size: 0.88rem; margin-top: 8px; }

.pub-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  background: linear-gradient(120deg, var(--rose), var(--gold));
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.pub-detail { margin: 10px 0 18px; }
.pub-links { display: flex; gap: 20px; }
.pub-links a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--rose-dark);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.pub-links a:hover { border-color: var(--rose-dark); }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.skill-group h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 18px;
  color: var(--charcoal);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--white);
  border: 1px solid var(--rose-light);
  color: var(--charcoal-soft);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.25s ease;
}
.tag:hover {
  background: var(--rose);
  border-color: var(--rose);
  color: var(--white);
}

/* ===== Hobbies ===== */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hobby-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hobby-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}
.hobby-icon {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 14px;
}
.hobby-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--charcoal);
}

/* ===== Footer / Contact ===== */
.footer {
  background: linear-gradient(160deg, var(--charcoal) 0%, #4a3437 100%);
  color: var(--white);
  padding: 110px 0 40px;
  text-align: center;
}
.footer .section-eyebrow { color: var(--gold); }
.footer .section-title { color: var(--white); margin-bottom: 12px; }
.footer-text { color: rgba(255,255,255,0.75); margin-bottom: 48px; }
.social-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover {
  background: linear-gradient(120deg, var(--rose), var(--gold));
  border-color: transparent;
  transform: translateY(-3px);
}
.footer-copy {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 28px;
}

/* ===== Scroll reveal (progressive enhancement: hidden only once JS confirms it can reveal them) ===== */
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span::before { animation: none; }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-text { margin-left: auto; margin-right: auto; }
  .about-stats { justify-content: center; }
  .card-grid, #publications .card-grid, .skills-grid { grid-template-columns: 1fr; }
  .hobby-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--cream);
    flex-direction: column;
    justify-content: center;
    gap: 36px;
    transition: right 0.4s ease;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  }
  .nav-links.open { right: 0; }
  .nav-links .nav-link { color: var(--charcoal) !important; font-size: 1.1rem; }
  .nav-cta { display: inline-block; }
  .hero-content { padding-top: 0; }
  .section { padding: 90px 0; }
  .timeline { padding-left: 24px; }
  .timeline-dot { left: -31px; }
}
