/* =====================================================
   PERSONAL WEBSITE — DESIGN SYSTEM
   Eitan Gerber · e-gerber-technion.github.io
   ===================================================== */


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

/* =====================================================
   THEME TOKENS
   ===================================================== */
:root {
  /* --- Dark Theme (default) --- */
  --bg: #0d1117;
  --bg-alt: #080c10;
  --surface: #161b22;
  --surface-2: #1f2937;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-rgb: 88, 166, 255;
  --accent-2: #7ee787;
  --accent-2-rgb: 126, 231, 135;
  --text: #e6edf3;
  --text-rgb: 230, 237, 243;
  --muted: #8b949e;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);

  /* --- Layout --- */
  --nav-height: 64px;
  --max-width: 1180px;
  --section-gap: 6rem;

  /* --- Transitions --- */
  --t: 200ms ease;
  --t-theme: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Radii --- */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-alt: #eaedf0;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-rgb: 9, 105, 218;
  --accent-2: #1a7f37;
  --accent-2-rgb: 26, 127, 55;
  --text: #1f2328;
  --text-rgb: 31, 35, 40;
  --muted: #636c76;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* =====================================================
   BASE
   ===================================================== */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition:
    background-color var(--t-theme),
    color var(--t-theme);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  transition: color var(--t-theme);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t), opacity var(--t);
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =====================================================
   LAYOUT UTILITIES
   ===================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.page-wrapper {
  padding-top: var(--nav-height);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: rgba(13, 17, 23, 0.75);
  border-bottom: 1px solid var(--border);
  transition:
    background var(--t-theme),
    border-color var(--t-theme);
}

[data-theme="light"] .navbar {
  background: rgba(246, 248, 250, 0.85);
}

.navbar-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Logo */
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  transition: color var(--t-theme);
}

.nav-logo span {
  color: var(--accent);
}

/* Links */
.nav-links {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  margin: 0 auto;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-sm);
  position: relative;
  transition: color var(--t), background var(--t);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
  opacity: 1;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--muted);
  transition:
    background var(--t),
    border-color var(--t),
    transform var(--t);
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: rotate(15deg);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   SECTION SHARED STYLES
   ===================================================== */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 60px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 560px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--t);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  opacity: 1;
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
}

/* =====================================================
   HERO — index.html
   ===================================================== */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
}

/* Ambient background */
.hero-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 65% at 65% 45%, rgba(88, 166, 255, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 15% 85%, rgba(126, 231, 135, 0.05) 0%, transparent 55%);
  transition: opacity var(--t-theme);
}

/* Dot grid */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse 70% 80% at 70% 50%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 50%, black 10%, transparent 70%);
  transition: opacity var(--t-theme);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: center;
}

/* Avatar */
.hero-avatar-wrap {
  position: relative;
}

.hero-avatar {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  border: 2px solid var(--border);
  overflow: hidden;
  position: relative;
  transition: border-color var(--t), box-shadow var(--t);
}

.hero-avatar:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.12);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1d3461 0%, #1f6feb 50%, #58a6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.02em;
}

.hero-status {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  background: var(--accent-2);
  border-radius: 50%;
  border: 3px solid var(--bg);
  transition: background var(--t-theme), border-color var(--t-theme);
}

.hero-status-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.3;
  animation: status-pulse 2.5s ease-in-out infinite;
}

@keyframes status-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Hero text */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  transition: background var(--t-theme), border-color var(--t-theme);
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.hero-name {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.4rem;
}

.hero-name .accent {
  color: var(--accent);
}

.hero-role {
  font-size: 1.1rem;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  margin-bottom: 0.2rem;
}

.hero-institution {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 520px;
  margin-bottom: 2.25rem;
  line-height: 1.7;
  opacity: 0.85;
}

.hero-ctas {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* =====================================================
   ABOUT SECTION — index.html
   ===================================================== */
.about-section {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.8;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* Info highlights */
.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t),
    background var(--t-theme);
}

.highlight-item:hover {
  border-color: var(--accent);
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

.highlight-icon {
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-theme);
}

.highlight-text strong {
  display: block;
  font-size: 0.9rem;
  font-family: 'Syne', sans-serif;
  margin-bottom: 0.2rem;
}

.highlight-text span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* =====================================================
   QUICK LINKS SECTION — index.html
   ===================================================== */
.quicklinks-section {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.quicklinks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.quicklink-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t),
    background var(--t-theme);
}

.quicklink-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.06), transparent 60%);
  opacity: 0;
  transition: opacity var(--t);
}

.quicklink-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  opacity: 1;
}

.quicklink-card:hover::after {
  opacity: 1;
}

.quicklink-emoji {
  font-size: 2.2rem;
}

.quicklink-title {
  font-size: 1.15rem;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  transition: color var(--t-theme);
}

.quicklink-desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
}

.quicklink-arrow {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* =====================================================
   PAGE HEADER (research, photography, contact)
   ===================================================== */
.page-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-header-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 90% at 0% 50%, rgba(88, 166, 255, 0.05) 0%, transparent 60%);
  z-index: 0;
  transition: opacity var(--t-theme);
}

.page-header-content {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 580px;
}

/* =====================================================
   RESEARCH PAGE
   ===================================================== */
.research-section {
  padding: var(--section-gap) 0;
}

.research-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.research-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1.75rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t),
    background var(--t-theme);
}

.research-card:hover {
  border-color: var(--accent);
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

.research-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.research-thumb-blue {
  background: linear-gradient(135deg, #1d3461, #1f6feb);
}

.research-thumb-green {
  background: linear-gradient(135deg, #064e3b, #059669);
}

.research-thumb-purple {
  background: linear-gradient(135deg, #312e81, #7c3aed);
}

.research-thumb-amber {
  background: linear-gradient(135deg, #78350f, #d97706);
}

.research-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.award-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  letter-spacing: 0.01em;
  margin-left: auto;
}

[data-theme="light"] .award-tag {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

.pub-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  letter-spacing: 0.01em;
  margin-left: auto;
}

[data-theme="light"] .pub-tag {
  background: rgba(9, 105, 218, 0.12);
  color: #0969da;
  border-color: rgba(9, 105, 218, 0.3);
}

.research-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
}

.research-title {
  font-size: 1.1rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text);
  transition: color var(--t-theme);
}

.research-abstract {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  letter-spacing: 0.01em;
}

.tag.green {
  background: rgba(var(--accent-2-rgb), 0.1);
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), 0.2);
}

.tag.purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.28);
}

[data-theme="light"] .tag.purple {
  background: rgba(126, 34, 206, 0.1);
  color: #7e22ce;
  border-color: rgba(126, 34, 206, 0.25);
}

.research-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Empty state (shared) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--muted);
  font-family: 'Syne', sans-serif;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 380px;
  line-height: 1.65;
}

.empty-state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

/* =====================================================
   PHOTOGRAPHY PAGE
   ===================================================== */
.photography-section {
  padding: var(--section-gap) 0;
}

/* Masonry grid */
.masonry-grid {
  columns: 3;
  column-gap: 1rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
  transition:
    transform var(--t),
    border-color var(--t),
    box-shadow var(--t);
}

.masonry-item:hover {
  transform: scale(1.012);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.masonry-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.masonry-item:hover img {
  transform: scale(1.05);
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--t);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

.masonry-caption {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
}

/* =====================================================
   LIGHTBOX
   ===================================================== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.93);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: lb-fadein 0.2s ease;
}

.lightbox.active {
  display: flex;
}

@keyframes lb-fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox-img {
  max-width: 88vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.8);
  animation: lb-slide 0.2s ease;
}

@keyframes lb-slide {
  from {
    transform: scale(0.97);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  max-width: 90vw;
  text-align: center;
  line-height: 1.4;
}

/* =====================================================
   CONTACT PAGE
   ===================================================== */
.contact-section {
  padding: var(--section-gap) 0;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t),
    background var(--t-theme);
}

.link-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  opacity: 1;
}

.link-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: background var(--t-theme);
}

.link-card-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  font-family: 'Syne', sans-serif;
}

.link-card-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Container for the email and button */
.email-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
  /* Allows children to shrink/wrap */
}

/* The mailto link styling and wrapping fix */
#email-text {
  display: block;
  text-decoration: none;
  color: inherit;
  /* Keeps your site's text color */
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
}

#email-text:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Ensure the button doesn't shrink when text is long */
.copy-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
}

/* =====================================================
   FOOTER
   ===================================================== */
footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.83rem;
  transition: border-color var(--t-theme);
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--accent);
  opacity: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-sep {
  opacity: 0.35;
}

/* =====================================================
   SCROLL REVEAL ANIMATIONS
   ===================================================== */
.js-enabled .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.js-enabled .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.08s;
}

.reveal-delay-2 {
  transition-delay: 0.16s;
}

.reveal-delay-3 {
  transition-delay: 0.24s;
}

.reveal-delay-4 {
  transition-delay: 0.32s;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-avatar-wrap {
    margin: 0 auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-institution {
    justify-content: center;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .quicklinks-grid {
    grid-template-columns: 1fr;
  }

  .research-card {
    grid-template-columns: 1fr;
  }

  .research-thumb {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .masonry-grid {
    columns: 2;
  }
}

@media (max-width: 640px) {
  :root {
    --section-gap: 4rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  /* Mobile nav */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
    gap: 0.2rem;
    transition: background var(--t-theme);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a.active::after {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .masonry-grid {
    columns: 1;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }

  .hero-avatar {
    width: 148px;
    height: 148px;
  }

  .avatar-placeholder {
    font-size: 2.6rem;
  }
}

/* =====================================================
   PREFERS REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-status-pulse,
  .hero-eyebrow-dot {
    animation: none;
  }

  .reveal,
  .js-enabled .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}