/* =========================
   CSS VARIABLES
   ========================= */
:root{
  --bg: #0f1113;
  --card: #171a1f;
  --text: #f2f2f2;
  --muted: #c7c7c7;
  --line: rgba(255,255,255,.10);
  --accent: #8fbf6a;
}

/* =========================
   RESET / BASE
   ========================= */
*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
}

html{
  scroll-padding-top: 96px; /* prevents scrolling under sticky header */
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);

  /* Global background image */
  background:
    linear-gradient(rgba(255,255,255,.10), rgba(255,255,255,.10)),
    url("../images/background.jpg") center / cover fixed no-repeat;
}

a{
  color: inherit;
  text-underline-offset: 3px;
}

a:hover{ opacity: .9; }

/* =========================
   LAYOUT HELPERS
   ========================= */
.wrap{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* =========================
   HEADER / NAVIGATION
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 10;

  /* Solid header: NO background image */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand{
  text-decoration: none;
}

.brand-title{
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: .2px;
}

/* Navigation */
.nav{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.nav-link{
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
}

.nav-link:hover{
  border-color: var(--line);
  color: var(--text);
}

.nav-link.active{
  color: var(--text);
  border-color: rgba(143,191,106,.35);
  background: rgba(143,191,106,.10);
}

/* =========================
   HERO SECTION
   ========================= */
.hero{
  border-bottom: 1px solid var(--line);

  /* Hero-specific background image */
  background:
    linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)),
    url("../images/hero-background.jpg") center / cover no-repeat;
}

.hero-inner{
  padding: 28px 0;
}

.hero h1{
  margin: 0 0 8px 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(28px, 3.2vw, 44px);
}

.lead{
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

/* Box around hero text */
.hero-text{
  display: inline-block;
  max-width: 70ch;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(23,26,31,.80);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

/* =========================
   MAIN CONTENT
   ========================= */
.layout{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  padding: 22px 0 34px;
}

.card{
  background: rgba(23,26,31,.90);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.sidebar .card + .card{
  margin-top: 16px;
}

/* =========================
   LAB TOUR VIDEOS
   ========================= */
.video-stack{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.video-box{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.video-frame iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption{
  color: var(--muted);
  font-size: 14px;
}

/* Clickable thumbnails (if you use them) */
.video-thumb{
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-thumb:hover .video-frame{
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}

.video-frame img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 56px;
  color: #fff;
  background: rgba(0,0,0,.35);
  opacity: .85;
  pointer-events: none;
}

/* =========================
   PROJECTS
   ========================= */
.project-image{
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 14px 0 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.muted-line{
  color: var(--muted);
  margin-top: -6px;
}

/* =========================
   PUBLICATIONS
   ========================= */
.pub-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
}

.pub-btn{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(23,26,31,.85);
  text-decoration: none;
}

.pub-btn:hover{
  border-color: rgba(143,191,106,.35);
}

.pub-list{
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.pub-list li{
  margin-bottom: 14px;
  padding-left: 0;
}

.pub-cite{
  line-height: 1.55;
}

/* =========================
   PERSONNEL
   ========================= */
.photo-stack{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.photo-card{
  margin: 0;
}

.photo-img{
  width: 100%;
  max-width: 950px;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
}

/* =========================
   CONTACT
   ========================= */
.contact-card{
  max-width: 900px; /* makes the box wider */
}

.contact-content{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.contact-text{
  flex: 1;
}

.contact-photo{
  flex-shrink: 0;
}

.contact-photo img{
  width: 180px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =========================
   FOOTER
   ========================= */
.footer{
  border-top: 1px solid var(--line);
  padding: 16px 0;
  color: var(--muted);
  background: rgba(15,17,19,.35);
}

.footer-inner{
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 900px){
  .layout{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px){
  body{
    background-attachment: scroll; /* mobile fix */
  }

  .contact-content{
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-photo{
    margin-top: 1rem;
  }
}

/* =========================
   Data Gallery buttons (GFP green)
   ========================= */
.video-stack ~ .pub-buttons .pub-btn,
.pub-buttons .pub-btn {
  border-color: rgba(143, 255, 143, 0.45);
  background: linear-gradient(
    180deg,
    rgba(143, 255, 143, 0.18),
    rgba(143, 255, 143, 0.08)
  );
  color: #eaffea;
  box-shadow:
    0 0 0 rgba(0,0,0,0),
    inset 0 0 0 rgba(0,0,0,0);
}

.pub-buttons .pub-btn:hover{
  border-color: rgba(143, 255, 143, 0.85);
  background: linear-gradient(
    180deg,
    rgba(143, 255, 143, 0.30),
    rgba(143, 255, 143, 0.15)
  );
  box-shadow:
    0 0 14px rgba(143, 255, 143, 0.55);
}
/* =========================
   Video thumbnail brightness fix
   ========================= */

/* Restore native brightness/contrast */
.video-frame img{
  filter: brightness(1.05) contrast(1.05);
}

/* Lighten the play overlay so it doesn't dim the image */
.play-overlay{
  background: rgba(0, 0, 0, 0.18);
}

/* =========================
   Funding banner (Home)
   ========================= */
.funding-banner{
  margin: 0;
  padding: 12px;
}

.funding-banner img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* =========================
   Mobile nav (hamburger)
   ========================= */

/* Button (hidden on desktop) */
.nav-toggle{
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1;
}

/* Mobile behavior */
@media (max-width: 768px){
  .header-inner{
    align-items: center;
  }

  .nav-toggle{
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  /* Hide nav by default on mobile */
  .nav{
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
  }

  /* Show nav when header has data-nav-open="true" */
  .site-header[data-nav-open="true"] .nav{
    display: flex;
  }

  .nav-link{
    padding: 10px 12px;
    border-radius: 12px;
  }
}
/* =========================
   Fix mobile nav overflow (wrap header)
   ========================= */
@media (max-width: 768px){
  .header-inner{
    flex-wrap: wrap;           /* key fix: allow nav to drop to next line */
  }

  .brand{
    flex: 1 1 auto;            /* keep brand on the left */
  }

  .nav-toggle{
    flex: 0 0 auto;            /* keep button on the right */
  }

  .nav{
    flex-basis: 100%;          /* nav becomes its own full-width row */
    width: 100%;
    align-items: stretch;
  }

  .nav-link{
    text-align: left;          /* prevents awkward right-alignment look */
  }
}
