/* ===== CSS Variables ===== */
:root {
  --color-primary: #1a1a2e;
  --color-secondary: #16213e;
  --color-accent: #0f9b8e;
  --color-accent-light: #14b8a6;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-bg: #f8fafc;
  --color-white: #ffffff;
  --color-border: #e2e8f0;
  --color-card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --nav-height: 64px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 20px); }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: #000000;
  background-image: url("tlo.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
  background-size: auto 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-light); }

h1, h2, h3, h4 { line-height: 1.3; color: var(--color-primary); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-primary);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

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

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, #0d3b66 100%);
  color: white;
  padding: 3rem 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.hero-info h1 { color: white; margin-bottom: 0.25rem; }

.hero-title {
  color: var(--color-accent-light);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hero-affiliation {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

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

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: white;
  background: rgba(255,255,255,0.1);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.hero-links a:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* ===== Page Header (for subpages) ===== */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  padding: 2rem 0;
}

.page-header h1 { color: white; margin-bottom: 0.25rem; }
.page-header p { color: rgba(255,255,255,0.75); font-size: 0.95rem; }

/* ===== Main Content ===== */
.main { padding: 2.5rem 0 3rem; }

/* ===== Cards ===== */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.card h2 {
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

/* ===== Two-column layout ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ===== Sidebar layout ===== */
.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.sidebar-card {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

/* ===== Research IDs ===== */
.research-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.research-ids a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--color-bg);
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}

.research-ids a:hover {
  border-color: var(--color-accent);
  background: white;
}

/* ===== Publication list ===== */
.pub-list { list-style: none; padding: 0; counter-reset: pub; }
.pub-list > li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  counter-increment: pub;
  display: flex;
  gap: 0.75rem;
}
.pub-list > li::before {
  content: counter(pub) ".";
  color: var(--color-accent);
  font-weight: 700;
  min-width: 2rem;
  text-align: right;
  flex-shrink: 0;
}
.pub-list > li:last-child { border-bottom: none; }
.pub-title { font-weight: 600; }
.pub-journal { color: var(--color-text-light); font-style: italic; }
.pub-links a {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.pub-links a:hover { border-color: var(--color-accent); }

/* ===== Conference list ===== */
.conf-list { list-style: none; padding: 0; }
.conf-list > li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.conf-list > li:last-child { border-bottom: none; }
.conf-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  margin-right: 0.5rem;
}
.conf-type.invited { background: #fef3c7; color: #92400e; }
.conf-type.talk { background: #dbeafe; color: #1e40af; }
.conf-type.poster { background: #e0e7ff; color: #3730a3; }

/* ===== Teaching ===== */
.course-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}
.course-card:hover { box-shadow: var(--shadow-md); }
.course-card h3 { color: var(--color-primary); }
.course-card p { font-size: 0.9rem; color: var(--color-text-light); margin-top: 0.25rem; }
.course-card a { font-size: 0.9rem; }

/* ===== Office hours ===== */
.office-hours {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
  border-radius: var(--radius-lg);
  border: 1px solid #99f6e4;
  margin-bottom: 1.5rem;
}

.office-hours img {
  width: 80px;
  border-radius: var(--radius);
}

/* ===== Grant card ===== */
.grant-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--color-accent);
  box-shadow: var(--shadow-sm);
}
.grant-card h3 { margin-bottom: 0.5rem; }
.grant-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

/* ===== Team list ===== */
.team-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}
.team-list li {
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* ===== Media grid ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}
.media-grid li a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
  font-size: 0.9rem;
}
.media-grid li a:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

/* ===== Video embed ===== */
.video-wrapper {
  position: relative;
  padding-top: 56.25%;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ===== Footer ===== */
.footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.85rem;
}
.footer a { color: var(--color-accent-light); }

/* ===== Utility ===== */
.text-muted { color: var(--color-text-light); }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; font-size: 1rem; }

  .hero { padding: 2rem 0; }
  .hero-inner { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-photo { width: 140px; height: 140px; }
  .hero-links { justify-content: center; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }

  .office-hours { flex-direction: column; text-align: center; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .card { padding: 1.25rem; }
  .hero-photo { width: 120px; height: 120px; }
}
