/* ---- palette ---- */
:root {
  --green:  #778873;
  --sage:   #A1BC98;
  --sand:   #DCCFC0;
  --cream:  #FDF6ED;

  --ink:    #33402F;   /* body text: dark green-grey, readable on cream */
  --muted:  #6B7A66;
  --radius: 14px;
  --nav-h:  72px;

  /* one content width for the whole page… */
  --content: 1180px;
  /* …and the left edge everything lines up against: the nav, the section
     headings, and the intro text all start here */
  --gutter: max(32px, calc((100vw - var(--content)) / 2 + 32px));
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* keeps section headings clear of the sticky nav when jumping */
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: Fraunces, Georgia, serif;
  color: var(--green);
  line-height: 1.15;
  margin: 0;
}

a { color: var(--green); }

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 246, 237, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sand);
}

.nav-inner {
  max-width: var(--content);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .18s, background .18s;
}

.nav-links a:hover { color: var(--green); background: var(--sand); }

/* set by main.js as you scroll */
.nav-links a.active {
  color: var(--cream);
  background: var(--green);
}

/* ---- hero ---- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  /* text starts at the top and grows down, so a long intro has room;
     the photos stay centered against it */
  align-items: start;
  gap: 24px;
  /* starts at the shared gutter; the art column still runs off the right edge */
  padding: 56px 0 90px var(--gutter);
}

.hero-text {
  max-width: 660px;
  padding-right: 8px;
}


.eyebrow {
  margin: 0 0 18px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .16em;
}

.hero h1 {
  font-size: clamp(38px, 4.4vw, 56px);
  margin-bottom: 24px;
}

.hero h1 span { color: var(--ink); }

.hero-text p { color: var(--ink); }

/* inline links in the bio (advisors, labs) */
.hero-text p a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--sand);
  text-underline-offset: 3px;
  transition: text-decoration-color .18s;
}

.hero-text p a:hover { text-decoration-color: var(--green); }

/* buttons */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s, background .18s, color .18s, box-shadow .18s;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  padding: 12px 22px;
  background: var(--green);
  color: var(--cream);
  box-shadow: 0 6px 18px rgba(119, 136, 115, .28);
}

.btn-primary:hover { background: #66765F; }

.btn-icon {
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--sand);
}

.btn-icon svg { width: 20px; height: 20px; }

.btn-icon:hover {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}

/* right-hand art: sage panel bleeding off the right edge,
   portrait card overlapping it from the left (see photo/template.png) */
.hero-art {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  align-self: center;   /* stays vertically centred however long the intro gets */
}

.hero-panel {
  position: absolute;
  inset: 0 -40px 0 80px;   /* runs past the right edge of the viewport */
  background: var(--sage);
  border-radius: var(--radius) 0 0 var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* the two photos overlap; hovering either one lifts it above the other.
   .hero-panel deliberately has no z-index — giving it one would trap the
   drawing in its stacking context and it could never rise above the portrait. */
.panel-img {
  position: relative;
  z-index: 0;
  width: 74%;
  max-width: 400px;
  background: #fff;   /* the drawing's own white ground, squared off as a card */
  border-radius: 10px;
  transition: transform .3s ease, box-shadow .3s ease;
}

.hero-portrait {
  position: relative;
  z-index: 1;
  width: 62%;
  max-width: 340px;
  margin-left: -20px;
  padding: 10px;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: 0 24px 50px rgba(51, 64, 47, .18);
  transition: transform .3s ease, box-shadow .3s ease;
}

.panel-img:hover {
  z-index: 3;
  transform: scale(1.04);
  box-shadow: 0 24px 50px rgba(51, 64, 47, .22);
}

.hero-portrait:hover {
  z-index: 2;
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 32px 60px rgba(51, 64, 47, .26);
}

.hero-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 8px;
}

/* ---- sections ---- */
.section { padding: 90px 0; }

.section-alt {
  background: #F6EFE3;
  border-block: 1px solid var(--sand);
}

.section h2 {
  font-size: clamp(28px, 3vw, 36px);
  margin-bottom: 36px;
}

/* ---- news ---- */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--sand);
}

.news-item:last-child { border-bottom: 0; }

.news-date {
  color: var(--sage);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  padding-top: 4px;
}

.news-text { margin: 0; }

/* ---- publications ---- */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.pub-item {
  display: grid;
  grid-template-columns: 130px 1fr;   /* fits the longest badge, "NFV-SDN '22" */
  gap: 22px;
  align-items: start;
}

.pub-venue {
  margin-top: 5px;
  padding: 4px 10px;
  background: var(--green);
  color: var(--cream);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.pub-title {
  display: inline-block;
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}

.pub-title:hover { text-decoration: underline; }

.pub-authors {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.pub-full {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  font-style: italic;
}

/* your own name, highlighted in the author list */
.pub-authors .me {
  color: var(--ink);
  font-weight: 600;
  background: var(--sand);
  padding: 1px 4px;
  margin: 0 -2px;   /* keeps the comma tight against the name */
  border-radius: 4px;
}

/* ---- footer ---- */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--sand);
  color: var(--muted);
  font-size: 14px;
}

/* ---- small screens ---- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 56px 0 72px;
  }

  .hero-text {
    margin: 0 auto;
    max-width: 640px;
    padding: 0 32px;
  }

  /* stacked, not overlapping edge-to-edge: the drawing sits in the sage card
     and the portrait laps over its bottom edge */
  .hero-art {
    display: block;
    min-height: 0;
    padding: 0 32px;
  }

  .hero-panel {
    position: relative;
    inset: auto;
    padding: 28px;
    border-radius: var(--radius);
  }

  .panel-img {
    width: 64%;
    max-width: 260px;
  }

  .hero-portrait {
    width: 72%;
    max-width: 290px;
    margin: -56px auto 0;
  }

  .news-item,
  .pub-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pub-venue { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* photos still come to the front on hover, they just don't move to do it */
  .btn:hover,
  .panel-img:hover,
  .hero-portrait:hover { transform: none; }
}
