/* ============================================================
   ROOT & THEME TOKENS
   ============================================================ */
:root {
  --bg:          #ffffff;
  --bg-alt:      #f5f7fa;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1a202c;
  --text-muted:  #64748b;
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --accent-rgb:  37, 99, 235;
  --lead-color:  #16a34a;
  --co-color:    #7c3aed;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.1);
  --nav-h:       64px;
  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;
  --transition:  .2s ease;
}

[data-theme="dark"] {
  --bg:         #0f172a;
  --bg-alt:     #1e293b;
  --surface:    #1e293b;
  --border:     #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --accent:     #60a5fa;
  --accent-dark:#3b82f6;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

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

/* ============================================================
   NAVIGATION
   ============================================================ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .topnav {
  background: rgba(15,23,42,.85);
}

/* dark mode: bump the pattern opacity slightly so it shows on dark bg */
[data-theme="dark"] .hero::before {
  opacity: 1.4;
  filter: brightness(1.8);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: .05em;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem;
  flex: 1;
}

.nav-inner nav a {
  padding: .35rem .65rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-inner nav a:hover,
.nav-inner nav a.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .08);
  text-decoration: none;
}

.theme-toggle {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color var(--transition), background var(--transition);
}

.theme-toggle:hover { border-color: var(--accent); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 5rem) 2rem 4rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* SVG pattern rendered via ::before so it sits under all content */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3C!-- hex grid top-left --%3E%3Cg stroke='%232563eb' stroke-width='1.2' fill='none' opacity='0.18'%3E%3Cpolygon points='40,14 68,14 82,38 68,62 40,62 26,38'/%3E%3Cpolygon points='96,14 124,14 138,38 124,62 96,62 82,38'/%3E%3Cpolygon points='152,14 180,14 194,38 180,62 152,62 138,38'/%3E%3Cpolygon points='208,14 236,14 250,38 236,62 208,62 194,38'/%3E%3Cpolygon points='68,62 96,62 110,86 96,110 68,110 54,86'/%3E%3Cpolygon points='124,62 152,62 166,86 152,110 124,110 110,86'/%3E%3Cpolygon points='180,62 208,62 222,86 208,110 180,110 166,86'/%3E%3Cpolygon points='40,110 68,110 82,134 68,158 40,158 26,134'/%3E%3Cpolygon points='96,110 124,110 138,134 124,158 96,158 82,134'/%3E%3Cpolygon points='152,110 180,110 194,134 180,158 152,158 138,134'/%3E%3Cpolygon points='68,158 96,158 110,182 96,206 68,206 54,182'/%3E%3Cpolygon points='124,158 152,158 166,182 152,206 124,206 110,182'/%3E%3C/g%3E%3C!-- hex grid bottom-right --%3E%3Cg stroke='%232563eb' stroke-width='1.2' fill='none' opacity='0.18'%3E%3Cpolygon points='660,318 688,318 702,342 688,366 660,366 646,342'/%3E%3Cpolygon points='716,318 744,318 758,342 744,366 716,366 702,342'/%3E%3Cpolygon points='772,318 800,318 814,342 800,366 772,366 758,342'/%3E%3Cpolygon points='828,318 856,318 870,342 856,366 828,366 814,342'/%3E%3Cpolygon points='688,366 716,366 730,390 716,414 688,414 674,390'/%3E%3Cpolygon points='744,366 772,366 786,390 772,414 744,414 730,390'/%3E%3Cpolygon points='800,366 828,366 842,390 828,414 800,414 786,390'/%3E%3Cpolygon points='660,414 688,414 702,438 688,462 660,462 646,438'/%3E%3Cpolygon points='716,414 744,414 758,438 744,462 716,462 702,438'/%3E%3Cpolygon points='772,414 800,414 814,438 800,462 772,462 758,438'/%3E%3C/g%3E%3C!-- power-grid network --%3E%3Cg stroke='%232563eb' stroke-width='1.8' fill='none' opacity='0.28'%3E%3Cline x1='320' y1='60' x2='460' y2='60'/%3E%3Cline x1='460' y1='60' x2='540' y2='140'/%3E%3Cline x1='540' y1='140' x2='660' y2='140'/%3E%3Cline x1='660' y1='140' x2='740' y2='220'/%3E%3Cline x1='740' y1='220' x2='840' y2='220'/%3E%3Cline x1='320' y1='60' x2='320' y2='200'/%3E%3Cline x1='320' y1='200' x2='460' y2='200'/%3E%3Cline x1='460' y1='200' x2='540' y2='140'/%3E%3Cline x1='460' y1='200' x2='460' y2='340'/%3E%3Cline x1='320' y1='200' x2='200' y2='300'/%3E%3Cline x1='200' y1='300' x2='320' y2='400'/%3E%3Cline x1='320' y1='400' x2='460' y2='340'/%3E%3Cline x1='460' y1='340' x2='580' y2='340'/%3E%3Cline x1='580' y1='340' x2='660' y2='260'/%3E%3Cline x1='660' y1='260' x2='740' y2='220'/%3E%3Cline x1='660' y1='140' x2='660' y2='260'/%3E%3Cline x1='580' y1='340' x2='580' y2='440'/%3E%3Cline x1='320' y1='400' x2='320' y2='480'/%3E%3C/g%3E%3C!-- substation nodes --%3E%3Cg fill='%232563eb' opacity='0.38'%3E%3Ccircle cx='320' cy='60' r='6'/%3E%3Ccircle cx='460' cy='60' r='6'/%3E%3Ccircle cx='540' cy='140' r='9'/%3E%3Ccircle cx='660' cy='140' r='6'/%3E%3Ccircle cx='740' cy='220' r='6'/%3E%3Ccircle cx='320' cy='200' r='9'/%3E%3Ccircle cx='460' cy='200' r='6'/%3E%3Ccircle cx='200' cy='300' r='6'/%3E%3Ccircle cx='320' cy='400' r='9'/%3E%3Ccircle cx='460' cy='340' r='6'/%3E%3Ccircle cx='580' cy='340' r='9'/%3E%3Ccircle cx='660' cy='260' r='6'/%3E%3Ccircle cx='580' cy='440' r='5'/%3E%3Ccircle cx='320' cy='480' r='5'/%3E%3C/g%3E%3C!-- circuit traces top-right --%3E%3Cg stroke='%232563eb' stroke-width='1.5' fill='none' opacity='0.22'%3E%3Cpath d='M700,40 H780 V100 H860'/%3E%3Cpath d='M700,100 H750 V160 H860'/%3E%3Cpath d='M700,40 V160'/%3E%3Ccircle cx='700' cy='40' r='4' fill='%232563eb'/%3E%3Ccircle cx='780' cy='40' r='4' fill='%232563eb'/%3E%3Ccircle cx='780' cy='100' r='4' fill='%232563eb'/%3E%3Ccircle cx='700' cy='100' r='4' fill='%232563eb'/%3E%3Ccircle cx='750' cy='100' r='4' fill='%232563eb'/%3E%3Ccircle cx='750' cy='160' r='4' fill='%232563eb'/%3E%3Ccircle cx='700' cy='160' r='4' fill='%232563eb'/%3E%3C/g%3E%3C!-- circuit traces bottom-left --%3E%3Cg stroke='%232563eb' stroke-width='1.5' fill='none' opacity='0.22'%3E%3Cpath d='M20,300 H100 V360 H180'/%3E%3Cpath d='M20,360 H60 V420 H140 V460 H220'/%3E%3Ccircle cx='100' cy='300' r='4' fill='%232563eb'/%3E%3Ccircle cx='100' cy='360' r='4' fill='%232563eb'/%3E%3Ccircle cx='180' cy='360' r='4' fill='%232563eb'/%3E%3Ccircle cx='60' cy='360' r='4' fill='%232563eb'/%3E%3Ccircle cx='60' cy='420' r='4' fill='%232563eb'/%3E%3Ccircle cx='140' cy='420' r='4' fill='%232563eb'/%3E%3Ccircle cx='140' cy='460' r='4' fill='%232563eb'/%3E%3C/g%3E%3C!-- padlock icon --%3E%3Cg opacity='0.22'%3E%3Crect x='836' y='260' width='44' height='36' rx='5' stroke='%232563eb' stroke-width='2' fill='none'/%3E%3Cpath d='M843 260 v-12 a15 15 0 0 1 30 0 v12' stroke='%232563eb' stroke-width='2' fill='none'/%3E%3Ccircle cx='858' cy='280' r='5' fill='%232563eb'/%3E%3Cline x1='858' y1='285' x2='858' y2='292' stroke='%232563eb' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* keep hero content above the ::before layer */
.hero-content,
.hero-badge-row {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

/* Photo */
.hero-photo {
  flex-shrink: 0;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}

.photo-fallback {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  position: absolute;
}

.hero-photo img:not([style*="display:none"]) + .photo-fallback {
  display: none;
}

/* Text */
.hero-text { flex: 1; min-width: 280px; }

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: .4rem;
}

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

.hero-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.hero-sub {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: .97rem;
  max-width: 620px;
  margin-bottom: 1.5rem;
}

/* Buttons */
.hero-links { display: flex; gap: .75rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: .55rem 1.3rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(var(--accent-rgb), .1);
  text-decoration: none;
}

/* Badge row */
.hero-badge-row {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.badge {
  display: inline-block;
  padding: .3rem .85rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  transition: all var(--transition);
}

.badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   SECTIONS — SHARED
   ============================================================ */
.section { padding: 5rem 2rem; }
.section-alt { background: var(--bg-alt); }

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: .6rem;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-note {
  margin-top: -.8rem;
  margin-bottom: 1.8rem;
  font-size: .9rem;
  color: var(--text-muted);
}

/* ============================================================
   ABOUT CARDS
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.2rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.about-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.about-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; margin-top: .1rem; }
.about-card strong { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.about-card p { font-size: .88rem; color: var(--text-muted); margin: 0; }
.about-card li { font-size: .88rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   PROJECT LIST
   ============================================================ */
.project-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.project-year {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: .15rem;
  min-width: 80px;
}

.project-role {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: .1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.project-role.lead {
  background: rgba(22, 163, 74, .12);
  color: var(--lead-color);
  border: 1px solid rgba(22, 163, 74, .3);
}

.project-role.co {
  background: rgba(124, 58, 237, .12);
  color: var(--co-color);
  border: 1px solid rgba(124, 58, 237, .3);
}

.project-body h3 {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .2rem;
}

.project-body p {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================================
   TEACHING
   ============================================================ */
.teaching-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.teaching-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.teaching-code {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb), .08);
  padding: .3rem .7rem;
  border-radius: 6px;
  white-space: nowrap;
}

.teaching-item strong { font-size: .95rem; display: block; }

.teaching-inst {
  font-size: .83rem;
  color: var(--text-muted);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.6rem;
}

.pub-filter {
  padding: .35rem .9rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.pub-filter:hover,
.pub-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.pub-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  display: flex;
  gap: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.pub-item:hover { box-shadow: var(--shadow-md); }
.pub-item.hidden { display: none; }

.pub-year {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 34px;
  padding-top: .2rem;
}

.pub-content { flex: 1; }

.pub-title {
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: .25rem;
}

.pub-authors {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
}

.pub-venue {
  font-size: .82rem;
  font-style: italic;
  color: var(--text-muted);
}

.pub-tag {
  display: inline-block;
  margin-top: .4rem;
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(var(--accent-rgb), .1);
  color: var(--accent);
}

.pub-tag.award {
  background: rgba(234, 179, 8, .15);
  color: #b45309;
}

.pub-cta {
  margin-top: 2rem;
  text-align: center;
}

/* Year group divider in full publication list */
.pub-year-group {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1.4rem 0 .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .4rem;
}

/* Page header (publications.html) */
.page-header {
  padding: calc(var(--nav-h) + 3rem) 2rem 2.5rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  margin: .5rem 0 .4rem;
}

.page-header-sub {
  font-size: .92rem;
  color: var(--text-muted);
}

.back-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: .5rem;
  transition: color var(--transition);
}

.back-link:hover { color: var(--accent); text-decoration: none; }

[data-theme="dark"] .pub-tag.award { color: #fcd34d; }

/* ============================================================
   AWARDS & PATENTS
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.sub-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .8rem;
}

.award-list li,
.patent-list li {
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  display: flex;
  align-items: baseline;
  gap: .8rem;
}

.award-year {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.patent-link { margin-top: 1rem; font-size: .85rem; }

/* ============================================================
   SERVICE
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.service-card h3 {
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: .9rem;
}

.service-card li {
  font-size: .87rem;
  color: var(--text-muted);
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.service-card li:last-child { border-bottom: none; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  padding: 0 0 2.2rem 1.5rem;
}

.tl-dot {
  position: absolute;
  left: -2rem;
  top: .35rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
}

.tl-dot.accent-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.tl-date {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: .3rem;
}

.tl-content h3 { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.tl-content p  { font-size: .88rem; color: var(--text-muted); margin-bottom: .15rem; }
.tl-detail     { font-size: .82rem !important; font-style: italic; }

/* ============================================================
   FOOTER
   ============================================================ */
/* ============================================================
   PROJECT PAGES
   ============================================================ */

/* page-header extras */
.proj-header-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .6rem;
}

.proj-funder {
  font-size: .85rem;
  color: var(--text-muted);
}

/* two-column overview layout */
.proj-overview-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .proj-overview-grid {
    grid-template-columns: 1fr;
  }
}

.proj-main p {
  margin-bottom: 1rem;
  font-size: .97rem;
}

.proj-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 .8rem;
  color: var(--text);
}

/* objectives list */
.proj-obj-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.proj-obj-list li {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.proj-obj-num {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(var(--accent-rgb), .1);
  border: 1px solid rgba(var(--accent-rgb), .25);
  border-radius: 6px;
  padding: .25rem .5rem;
  flex-shrink: 0;
  margin-top: .15rem;
}

.proj-obj-list strong {
  display: block;
  font-size: .95rem;
  margin-bottom: .25rem;
}

.proj-obj-list p {
  font-size: .88rem;
  color: var(--text-muted);
  margin: 0;
}

/* sidebar */
.proj-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.proj-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.proj-info-card h3 {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: .9rem;
}

.proj-info-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem 1rem;
}

.proj-info-card dt {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.proj-info-card dd {
  font-size: .85rem;
}

.status-badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.status-badge.active {
  background: rgba(22, 163, 74, .12);
  color: var(--lead-color);
  border: 1px solid rgba(22, 163, 74, .3);
}

.proj-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.proj-pub-ref {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.proj-pub-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.proj-pub-list li {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border);
}

.proj-pub-list li:last-child { border-bottom: none; padding-bottom: 0; }

.proj-partner-list li {
  font-size: .87rem;
  color: var(--text-muted);
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
}

.proj-partner-list li:last-child { border-bottom: none; }

/* team list */
.team-list {
  max-width: 640px;
}

.team-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}

.team-list li:last-child { border-bottom: none; }

.team-name {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  min-width: 200px;
}

.team-pos {
  font-size: .88rem;
  color: var(--text-muted);
}

/* ── talks list (shared by index snippet + talks.html full list) ── */
.talk-list {
  display: flex;
  flex-direction: column;
  max-width: 820px;
}

.talk-item {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}

.talk-item:last-child { border-bottom: none; }

.talk-year {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 36px;
  flex-shrink: 0;
}

.talk-body { flex: 1; }

.talk-title {
  font-size: .93rem;
  font-weight: 600;
  margin-bottom: .2rem;
}

.talk-detail {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── service full-page list ── */
.service-full-list {
  display: flex;
  flex-direction: column;
  max-width: 860px;
}

.service-full-item {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.service-full-item:last-child { border-bottom: none; }

.service-year {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 90px;
  flex-shrink: 0;
}

/* "learn more" link on project cards in index */
.project-more {
  display: inline-block;
  margin-top: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
}

.project-more:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer p {
  font-size: .87rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.footer-sub { font-size: .78rem !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-inner nav { display: none; }

  .hero-content { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-links   { justify-content: center; }
  .hero-badge-row { justify-content: center; }

  .two-col { grid-template-columns: 1fr; gap: 2rem; }

  .project-card { flex-wrap: wrap; }
  .project-year { min-width: auto; }

  .pub-item { flex-direction: column; gap: .4rem; }

  .teaching-item { flex-wrap: wrap; }

  .section { padding: 3.5rem 1.2rem; }
}

@media (max-width: 480px) {
  .hero { padding: calc(var(--nav-h) + 3rem) 1.2rem 3rem; }
  .section-title { font-size: 1.4rem; }
  .hero-photo { width: 160px; height: 160px; }
}

/* ============================================================
   SCROLL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}
