@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800&family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf9f7;
  --ink: #1a1916;
  --ink-2: #4a4845;
  --ink-3: #8a8784;
  --accent: #b5422a;
  --border: #e2dfd9;
  --max: 1100px;
  --nav-h: 52px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
}

/* ── NAV ── */
nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  background: rgba(10,10,8,0.35);
  backdrop-filter: blur(4px);
}

nav.solid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

.nav-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  flex-shrink: 0;
  z-index: 101;
}
nav.solid .nav-logo { color: var(--ink); }

/* ── HAMBURGER BUTTON ── */
.nav-hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
nav.solid .nav-hamburger span { background: var(--ink); }

/* Animate to X when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── NAV LINKS ── */
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.15s;
}
nav.solid .nav-links a { color: var(--ink-2); }
.nav-links a:hover { color: white; }
nav.solid .nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: white; }
nav.solid .nav-links a.active { color: var(--accent); }

/* ── HERO ── */
.hero {
  position: relative;
  width: 100%;
  height: clamp(420px, 55vw, 620px);
  overflow: hidden;
  background: #2a3540;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,10,8,0.95) 0%,
    rgba(10,10,8,0.7) 25%,
    rgba(10,10,8,0.2) 60%,
    rgba(10,10,8,0.0) 100%
  );
}

.hero-text {
  position: absolute;
  bottom: clamp(2rem, 4vw, 3rem);
  left: clamp(1.5rem, 5vw, 3.5rem);
  right: clamp(1.5rem, 5vw, 3.5rem);
}

.hero-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 7rem);
  line-height: 0.93;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 0.55rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* ── PAGE CONTENT ── */
.page-content {
  width: 100%;
  padding-top: 0;
}

.content-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 3rem);
}

.intro-heading {
  font-family: 'EB Garamond', serif;
  font-size: 3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 0.1rem;
}

.intro-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.intro-left {
  display: flex;
  flex-direction: column;
}

.intro-photo {
  width: 100%;
  display: block;
  border-radius: 3px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.social-row {
  display: flex;
  flex-direction: column;
  margin-top: 1.5rem;
}

.social-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
  padding: 1.1rem 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
}
.social-btn:last-child { border-bottom: 1px solid var(--border); }
.social-btn:hover { color: var(--ink); }

.content-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.content-heading {
  font-family: 'EB Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

/* ── PHOTO NAV GRID ── */
.photo-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.photo-nav-item {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 3px;
}

.photo-nav-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.photo-nav-item:hover img {
  transform: scale(1.04);
}

.photo-nav-item::after {
  content: '→';
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 1.2rem;
  color: white;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

.photo-nav-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.photo-nav-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 0.75rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(to top, rgba(10,10,8,0.75) 0%, rgba(10,10,8,0) 100%);
}

/* ── SECTIONS (inner pages) ── */
.section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}

/* ── PROSE ── */
.prose p { font-size: 1.25rem; color: var(--ink-2); margin-bottom: 1rem; line-height: 1.78; }
.prose p:last-child { margin-bottom: 0; }
.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.prose a:hover { opacity: 0.75; }

/* ── RESEARCH ── */
.research-item {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}
.research-item:last-child { margin-bottom: 0; }
.research-bar { width: 3px; background: var(--border); align-self: stretch; min-height: 54px; transition: background 0.2s; }
.research-item:hover .research-bar { background: var(--accent); }
.research-item h3 { font-size: 1.02rem; font-weight: 500; color: var(--ink); margin-bottom: 0.25rem; }
.research-item p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 0.35rem; }
.research-tag { font-family: 'IBM Plex Mono', monospace; font-size: 0.63rem; color: var(--ink-3); letter-spacing: 0.03em; }

/* ── PUBLICATIONS ── */
.pub-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1.1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:first-child { border-top: 1px solid var(--border); }
.pub-year { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--ink-3); padding-top: 0.2rem; }
.pub-title { font-size: 0.98rem; font-weight: 500; color: var(--ink); margin-bottom: 0.2rem; line-height: 1.42; }
.pub-authors { font-size: 0.86rem; color: var(--ink-2); margin-bottom: 0.12rem; }
.pub-venue { font-size: 0.86rem; color: var(--ink-3); font-style: italic; }
.pub-status {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: 0.4rem;
  font-style: normal;
}

/* ── CV ── */
.cv-group-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 2.5rem 0 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cv-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.75rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
}
.cv-entry:first-of-type { border-top: 1px solid var(--border); }
.cv-date { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--ink-3); padding-top: 0.2rem; line-height: 1.5; }
.cv-entry h3 { font-size: 1rem; font-weight: 500; color: var(--ink); margin-bottom: 0.1rem; }
.cv-place { font-family: 'Inter', sans-serif; font-size: 0.76rem; color: var(--accent); margin-bottom: 0.5rem; }
.cv-entry ul { list-style: none; }
.cv-entry ul li { font-size: 0.86rem; color: var(--ink-2); padding-left: 1rem; position: relative; margin-bottom: 0.22rem; line-height: 1.52; }
.cv-entry ul li::before { content: '–'; position: absolute; left: 0; color: var(--ink-3); }

/* ── PROJECTS ── */
.project-item { padding: 1.4rem 0; border-bottom: 1px solid var(--border); }
.project-item:first-child { border-top: 1px solid var(--border); }
.project-org { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; color: var(--ink-3); letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.project-item h3 { font-size: 1.05rem; font-weight: 500; color: var(--ink); margin-bottom: 0.35rem; }
.project-item p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; }
.project-result { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; color: var(--accent); margin-top: 0.35rem; }

/* ── CONTACT ── */
.contact-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: color 0.15s;
}
.contact-row:first-child { border-top: 1px solid var(--border); }
.contact-row:hover { color: var(--accent); }
.contact-row-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; min-width: 80px; }
.contact-row:hover .contact-row-label { color: var(--accent); }
.contact-row-val { font-size: 0.93rem; color: var(--ink-2); }
.contact-row:hover .contact-row-val { color: var(--accent); }

/* ── LINK ── */
.text-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* ── FOOTER ── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 2.5rem) 3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── INNER PAGE HERO (no photo) ── */
.inner-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  max-width: var(--max);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 5vw, 2.5rem);
  padding-right: clamp(1.25rem, 5vw, 2.5rem);
}


/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET  (max 900px)
   Two-column intro becomes narrower but stays 2-col
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 260px 1fr;
    gap: 2rem;
  }

  .photo-nav-grid {
    gap: 0.75rem;
  }

  .photo-nav-item img {
    height: 160px;
  }
}


/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE  (max 680px)
   ═══════════════════════════════════════════════ */
@media (max-width: 680px) {

  /* ── Nav: show hamburger, hide horizontal links ── */
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    /* Hidden by default — slide down when .open */
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0 1rem;
    /* Slide up and fade out when closed */
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
    z-index: 99;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:first-child {
    border-top: 1px solid var(--border);
  }

  .nav-links a {
    display: block;
    padding: 0.9rem clamp(1.5rem, 5vw, 3.5rem);
    font-size: 0.78rem;
    color: var(--ink-2) !important; /* always dark on white bg */
  }
  .nav-links a.active { color: var(--accent) !important; }
  .nav-links a:hover { color: var(--ink) !important; }

  /* ── Hero: shorter on mobile, bigger tagline ── */
  .hero {
    height: clamp(320px, 75vw, 460px);
  }

  .hero-tagline {
    font-size: clamp(0.78rem, 3.5vw, 1.1rem);
    /* Break "Northeastern University · Interdisciplinary Engineering" more gracefully */
    max-width: 90vw;
  }

  /* ── Content wrap: tighter padding ── */
  .content-wrap {
    padding: 2rem 1.25rem;
  }

  /* ── Intro section: stack vertically ── */
  .intro-heading {
    font-size: 2.2rem;
  }

  .intro-sub {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* On mobile, photo goes to a reasonable width and centers */
  .intro-photo {
    max-width: 280px;
    margin: 0 auto 0;
    display: block;
  }

  /* Social buttons go 2-across instead of stacked list */
  .social-row {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 1rem;
    gap: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .social-btn {
    flex: 1 1 50%;
    border-top: none;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 0.85rem 0.5rem;
    font-size: 0.72rem;
    justify-content: center;
  }

  /* Remove the last-child bottom border since social-row handles it */
  .social-btn:last-child {
    border-bottom: none;
    border-right: none;
  }
  /* 4 items: 2x2 grid — remove right border on even items */
  .social-btn:nth-child(2n) {
    border-right: none;
  }
  /* Add a top border on the second row */
  .social-btn:nth-child(3),
  .social-btn:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  /* Prose text slightly smaller */
  .prose p {
    font-size: 1.1rem;
  }

  /* ── Photo nav: 2 columns instead of 3 ── */
  .photo-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .photo-nav-item img {
    height: 130px;
    transform: scale(1); /* disable the zoom-in so no overflow on mobile */
  }

  .photo-nav-label {
    font-size: 1.1rem;
    padding: 1.5rem 0.75rem 0.6rem;
  }

  /* ── CV entries: stack date above content ── */
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  /* ── Pub items: tighter ── */
  .pub-item {
    grid-template-columns: 32px 1fr;
    gap: 0.6rem;
  }

  /* ── Footer: stack vertically ── */
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.68rem;
  }
}


/* ═══════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  (max 400px)
   Extra polish for 375px iPhones etc.
   ═══════════════════════════════════════════════ */
@media (max-width: 400px) {
  .hero-name {
    font-size: clamp(2.8rem, 12vw, 3.8rem);
  }

  .intro-heading {
    font-size: 1.9rem;
  }

  .intro-sub {
    font-size: 0.78rem;
  }

  .photo-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .photo-nav-item img {
    height: 110px;
  }

  .social-btn {
    font-size: 0.65rem;
    padding: 0.75rem 0.25rem;
  }
}