/* --- FONTS (Restored from original template) --- */
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- BASE STYLES --- */
body, td, th, tr, p, a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  margin: 0;
  padding: 0;
}

/* --- STICKY HEADER --- */
.sticky-header {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 1000;
  border-bottom: 1px solid #f0f0f0;
  padding: 20px 0 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.name {
  font-size: 32px;
  margin: 0;
  font-weight: normal;
}

.blurb {
  margin: 10px 0;
  line-height: 1.5;
}

.social-links {
  margin-top: 15px;
  font-size: 14px;
}

.social-links a {
  color: #1772d0;
  text-decoration: none;
}
.social-links a:hover { color: #f09228; }

.profile-thumb img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* --- NAVIGATION MENU (Refined) --- */
.nav-menu {
  max-width: 800px;
  margin: 20px auto 0 auto;
  text-align: center;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.nav-menu a {
  margin: 0 15px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  color: #666;
  letter-spacing: 0.5px;
  padding-bottom: 3px;
  transition: 0.2s;
}

.nav-menu a.active, .nav-menu a:hover {
  color: #f09228;
  border-bottom: 2px solid #f09228;
}

/* --- MAIN CONTENT --- */
.main-wrap {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

h2 { font-weight: normal; font-size: 24px; margin-bottom: 20px; }

.about-photo {
  width: 100%;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- PUBLICATION TABLES --- */
.paper-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 25px;
}

.papertitle {
  font-weight: 700;
  color: #1772d0;
  font-size: 15px;
}
.papertitle:hover { color: #f09228; }

/* --- HOVER VIDEO EFFECT (Fixed) --- */
.one {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden; /* Ensures content conforms to border-radius */
}

/* The static image */
.one img {
  width: 100%;
  display: block;
  transition: opacity 0.3s ease-in-out;
}

/* The video container */
.two {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background: white; /* Fills any gaps if aspect ratios differ slightly */
}

.two video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hover actions: Fade in video, fade out image */
.one:hover .two { opacity: 1; }
.one:hover img { opacity: 0; }

/* --- ROBOT GALLERY GRID --- */
.robot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
}
.robot-card { text-align: center; }
.robot-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.robot-card img:hover { transform: scale(1.03); }
.robot-card p { margin-top: 10px; font-weight: 700; color: #555; }

/* --- PROJECT CARDS --- */
.project-card {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}
.project-card h3 { margin: 0 0 10px 0; color: #1772d0; }

/* Dense Gallery Grid */
.dense-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px; /* Minimal gap for dense look */
  margin-top: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Hover Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: bold;
  text-align: center;
  padding: 10px;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item:hover img { transform: scale(1.1); }

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
}
/* Dense Gallery Grid - Updated for 2x Size */
.dense-gallery {
  display: grid;
  /* Changed from 150px to 300px for 2x size */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
  gap: 8px; /* Slightly larger gap looks better with larger images */
  margin-top: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  border-radius: 4px; /* Optional: subtle rounding for larger images */
}

/* Highlighted Publications - Deitke Style */
.pub-table { width: 100%; border-spacing: 0 40px; border-collapse: separate; }
.pub-media-container { 
    position: relative; width: 100%; height: 200px; border-radius: 8px; overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); background: #fff; 
}
.pub-media-container img { width: 100%; height: 100%; object-fit: cover; }
.pub-media-container img:first-child { position: relative; z-index: 1; }
.pub-media-container img.hover-gif { position: absolute !important; top: 0; left: 0; opacity: 0; transition: opacity 0.3s; z-index: 2 !important; }
.pub-media-container:hover img.hover-gif { opacity: 1; }
.pub-media-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; z-index: 10; }
.pub-media-container:hover video { opacity: 1; }
.pub-media-container iframe { width: 100%; height: 100%; border: 0; }