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

:root {
  --bg:         #F8F7F4;
  --bg-alt:     #F0EDE8;
  --ink:        #1C1C1E;
  --ink-soft:   #5A5A5E;
  --ink-light:  #9A9A9E;
  --accent:     #3D6B5E;
  --accent-pale:#E9F0EE;
  --border:     #DDD9D2;
  --white:      #FFFFFF;

  --font-display: 'Barlow', system-ui, sans-serif;
  --font-body:    'Barlow', system-ui, sans-serif;

  --r: 12px;
  --nav-h: 60px;
  --max-w: 980px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }


/* ── NAV ───────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(248, 247, 244, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 6vw, 80px);
  z-index: 100;
  transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.07); }

.nav-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .02em;
}

#navbar ul {
  list-style: none;
  display: flex;
  gap: 32px;
}
#navbar ul a {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .2s;
}
#navbar ul a:hover { color: var(--accent); text-decoration: none; }


/* ── HERO ───────────────────────────────────────── */
.hero {
  padding: calc(var(--nav-h) + 80px) clamp(24px, 6vw, 80px) 80px;
  max-width: calc(var(--max-w) + 160px);
  margin: 0 auto;
}
.hero-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  align-items: start;
}

/* Photo */
.hero-photo img {
  width: 240px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--r);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  transition: transform .4s ease, box-shadow .4s ease;
}
.hero-photo img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.16);
}

/* Text */
.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 16px;
}
.name-light { font-weight: 300; font-style: italic; }

.affiliation {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  line-height: 1.7;
}
.bio {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.8;
  max-width: 560px;
  margin-bottom: 28px;
}

/* Hero buttons */
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .02em;
  background: var(--accent);
  color: var(--white);
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.btn:hover {
  background: #2d5347;
  border-color: #2d5347;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(61,107,94,.25);
  text-decoration: none;
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-pale);
  color: var(--accent);
  box-shadow: none;
}


/* ── SECTIONS ───────────────────────────────────── */
.section {
  padding: 80px clamp(24px, 6vw, 80px);
  max-width: calc(var(--max-w) + 160px);
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-alt);
  max-width: 100%;
  padding: 80px clamp(24px, 6vw, 80px);
}
.section-alt .section-inner {
  max-width: calc(var(--max-w) + 160px);
  margin: 0 auto;
}
.section-inner { max-width: calc(var(--max-w) + 160px); margin: 0 auto; }

.section-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 12px;
}
.divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 48px;
}


/* ── EXPERIENCE ITEMS ──────────────────────────── */
.exp-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }

/* Logo container — longest side fills the box, letter-boxed */
.exp-image {
  width: 160px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.exp-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* longest side fits, no cropping */
}

.exp-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.exp-content h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}
.exp-date {
  font-size: 12.5px;
  color: var(--ink-light);
  letter-spacing: .04em;
  white-space: nowrap;
}
.exp-place {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.exp-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.8;
  max-width: 600px;
}


/* ── EDUCATION ──────────────────────────────────── */
.edu-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child { border-bottom: none; }

.edu-logo {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  flex-shrink: 0;
}
.edu-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.edu-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.edu-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}
.school-link {
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: .03em;
  font-weight: 500;
}
.edu-degree {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.edu-details {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 8px;
}
.edu-date {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
}


/* ── PROJECTS GRID ──────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Clickable card — the whole card is a link */
.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,.09);
  border-color: var(--accent);
  text-decoration: none;
  color: inherit;
}

/* Thumbnail image at the top of each card */
.project-thumb {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.project-card:hover .project-thumb img {
  transform: scale(1.04);
}

/* Placeholder shown when no image supplied */
.project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-pale);
  color: var(--accent);
  font-size: 32px;
  opacity: .5;
}

.project-body {
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-top { flex: 1; }

.project-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-pale);
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.project-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.25;
}
.project-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.project-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.project-footer svg { flex-shrink: 0; }


/* ── FOOTER ─────────────────────────────────────── */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-soft);
}
footer a { color: var(--accent); }
.footer-copy { margin-top: 4px; font-size: 12px; color: var(--ink-light); }


/* ── ANIMATIONS ─────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }


/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 700px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-photo img { width: 180px; height: 220px; margin: 0 auto; }
  .exp-item { grid-template-columns: 1fr; gap: 20px; }
  .exp-image { width: 100%; height: 120px; }
  .edu-item { grid-template-columns: 1fr; gap: 16px; }
  .edu-header { flex-direction: column; }
  #navbar ul { gap: 16px; }
  h1 { font-size: 36px; }
}