/* ============================================================
   Al Hossain Shawn — Portfolio
   Design: Minimal Mistakes-inspired academic layout
   Mode: Light (clean, content-first, EEE researcher style)
   ============================================================ */

/* ── 0. Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lora:ital,wght@0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── 1. CSS Custom Properties ──────────────────────────────── */
:root {
  /* Background */
  --bg:           #f5f5f7;
  --bg-white:     #ffffff;
  --bg-sidebar:   #ffffff;
  --bg-hero:      #1a2744;      /* Dark hero splash */
  --bg-section-alt: #f0f0f5;   /* Alternating section bg */

  /* Text */
  --text:         #3d4144;
  --text-muted:   #6c757d;
  --text-light:   #9ca3af;
  --text-heading: #1a1a2e;

  /* Accent */
  --accent:       #4a5d8c;      /* Deep slate blue */
  --accent-dark:  #303e66;
  --accent-light: #eaecf5;
  --accent-rgb:   74, 93, 140;

  /* Links */
  --link:         #4a5d8c;
  --link-hover:   #303e66;

  /* UI */
  --border:       #e0e2e8;
  --border-hover: #b0b5c8;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.12);

  /* Tags */
  --tag-bg:       #e8ecf5;
  --tag-text:     #4a5d8c;
  --tag-border:   #c5cde8;

  /* Status */
  --status-green:     #16a34a;
  --status-green-bg:  #dcfce7;
  --status-amber:     #d97706;
  --status-amber-bg:  #fef3c7;
  --status-blue:      #2563eb;
  --status-blue-bg:   #dbeafe;

  /* Layout */
  --sidebar-w:    360px;
  --content-max:  1200px;
  --gap:          2rem;
  --section-gap:  4rem;

  /* Typography */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-heading: 'Lora', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-size:    17px;
  --line-height:  1.7;
}

/* ── Dark Mode Overrides ──────────────────────────────────── */
body.dark-mode {
  --bg:           #0f121d;
  --bg-white:     #171c2c;
  --bg-sidebar:   #171c2c;
  --bg-hero:      #111422;
  --bg-section-alt: #1f253a;

  --text:         #cbd5e1;
  --text-muted:   #94a3b8;
  --text-light:   #475569;
  --text-heading: #f8fafc;

  --accent:       #748dbf;
  --accent-dark:  #8da4d4;
  --accent-light: #222c42;
  --accent-rgb:   116, 141, 191;

  --link:         #748dbf;
  --link-hover:   #8da4d4;

  --border:       #232a3f;
  --border-hover: #333d5c;
  
  --tag-bg:       #222c42;
  --tag-text:     #748dbf;
  --tag-border:   #313d5a;
}

body.dark-mode .btn--primary {
  background: #748dbf;
  color: #0f121d;
  border-color: #748dbf;
}
body.dark-mode .btn--primary:hover {
  background: #8da4d4;
  border-color: #8da4d4;
  color: #0f121d;
}

/* ── 2. Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: var(--line-height);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

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

ul, ol { padding-left: 1.4em; }

/* ── 3. Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; color: var(--text-heading); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  transition: background 0.2s, color 0.2s;
}

pre {
  background: var(--bg-section-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  transition: background 0.2s, border-color 0.2s;
}
pre code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: none;
  color: var(--text);
  padding: 0;
  border-radius: 0;
}
body.dark-mode pre {
  background: #111524;
  border-color: #232a3f;
}

/* ── 4. Site Header ────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.site-header__inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 4rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-wordmark {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  text-decoration: none;
}
.site-wordmark:hover { color: var(--accent); text-decoration: none; }
.site-wordmark span { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  width: 36px;
  height: 36px;
  margin-left: 0.5rem;
}
.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}
.theme-toggle__icon {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 10px;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}
.mobile-nav.open { display: flex; }
.mobile-nav__drawer {
  width: 280px;
  background: var(--bg-white);
  height: 100%;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mobile-nav__close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.mobile-nav__drawer a {
  display: block;
  padding: 0.7rem 1rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.mobile-nav__drawer a:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.mobile-nav__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}
.mobile-nav__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

/* ── 5. Page Layout ────────────────────────────────────────── */
.page-layout {
  max-width: 100%;
  margin: 0 auto;
  padding: 2.5rem 4rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── 6. Left Sidebar ───────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-right: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar__photo-wrap {
  display: flex;
  justify-content: center;
}
.sidebar__photo {
  width: 200px;
  height: 250px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar__identity {
  text-align: center;
}
.sidebar__name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.sidebar__role {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sidebar__dept {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}
.sidebar__school {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}
.sidebar__institution {
  font-size: 0.88rem;
  color: var(--text-heading);
  font-weight: 600;
  margin-top: 0.4rem;
  line-height: 1.45;
}

.sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.15s;
  border: none;
}
.sidebar__link:hover { color: var(--accent); text-decoration: none; }
.sidebar__link svg { width: 14px; height: 14px; flex-shrink: 0; fill: currentColor; }
.sidebar__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar__divider {
  border: none;
  border-top: 1px solid var(--border);
}

.sidebar__section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.sidebar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.sidebar__tag {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  border-radius: 99px;
  padding: 0.2em 0.7em;
}

/* ── 7. Main Content Area ─────────────────────────────────── */
.main-content {
  min-width: 0;
}

/* ── 8. Hero / Splash ────────────────────────────────────── */
.hero {
  background: var(--bg-hero);
  border-radius: 12px;
  padding: 1.8rem 2.2rem;
  margin-bottom: 1.6rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(74,93,140,0.6) 0%, rgba(26,39,68,0.8) 60%, rgba(10,14,30,0.95) 100%);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 1; }

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__kicker::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  flex-shrink: 0;
}

.hero__name {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.hero__name span { color: rgba(180,192,230,0.9); }

.hero__tagline {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  font-style: italic;
  margin-bottom: 1.5rem;
  max-width: 900px;
  line-height: 1.6;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); text-decoration: none; }

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

.btn--outline-white {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.4);
}
.btn--outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.8);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--outline:hover { background: var(--accent); color: #fff; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.hero__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 250px;
}
.hero__meta-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}
.hero__meta-value {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  line-height: 1.5;
}

/* ── 9. Section Headers ───────────────────────────────────── */
.section {
  margin-bottom: var(--section-gap);
}

.section-header {
  margin-bottom: 1.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 1.5rem;
  color: var(--text-heading);
  margin: 0;
}
.section-header h2 em {
  font-style: italic;
  color: var(--accent);
}

.section-header p {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── 10. About Section ─────────────────────────────────────── */
.about__bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}
.about__bio + .about__bio { margin-top: 1em; }

.edu-timeline {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.edu-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child { border-bottom: none; }

.edu-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
}
.edu-degree {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  margin-bottom: 0.15rem;
}
.edu-institute {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── 11. Capability Cards ─────────────────────────────────── */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cap-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.cap-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.cap-card__icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cap-card__icon svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
}

.cap-card__name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.2;
}
.cap-card__tools {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── 12. Research Cards ──────────────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.res-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.res-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.res-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.res-card__id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.7em;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.badge--green { background: var(--status-green-bg); color: var(--status-green); }
.badge--amber { background: var(--status-amber-bg); color: var(--status-amber); }
.badge--blue  { background: var(--status-blue-bg);  color: var(--status-blue); }

.res-card h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin: 0;
}
.res-card h3 em { color: var(--accent); }

.res-card__summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.res-card__bullets {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.6;
  padding-left: 1.1em;
  margin: 0;
}
.res-card__bullets li { margin-bottom: 0.3em; }

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  border-radius: 4px;
  padding: 0.15em 0.55em;
  font-weight: 500;
}

.res-card__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

/* ── 13. Interest / Domain Cards ─────────────────────────── */
.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.int-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.int-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.int-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.int-card__id {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.int-card__id svg { width: 15px; height: 15px; fill: var(--accent); }
.int-card__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 0 2px var(--status-green-bg);
}

.int-card h3 {
  font-size: 0.95rem;
  color: var(--text-heading);
  margin: 0;
}

.int-card ul {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  padding-left: 1.1em;
}
.int-card ul li { margin-bottom: 0.3em; }

.int-card__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── 14. Project Grid ─────────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.proj-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.proj-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  text-decoration: none;
  color: inherit;
}

.proj-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-section-alt);
}
.proj-card__img--placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent-light), var(--bg-section-alt));
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-card__img--placeholder svg {
  width: 48px;
  height: 48px;
  fill: var(--accent);
  opacity: 0.4;
}

.proj-card__body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.proj-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.proj-card__id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.proj-card h3 {
  font-size: 0.95rem;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.3;
}
.proj-card h3 em { color: var(--accent); }

.proj-card__role {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.proj-card__desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.proj-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}
.proj-card__period { color: var(--text-muted); }
.proj-card__link {
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── 15. Current Role Feature Card ──────────────────────── */
.current-role-card {
  background: var(--bg-white);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.8rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.current-role-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.current-role-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 12px 0 0 12px;
}

.cr-icon {
  width: 56px; height: 56px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cr-icon svg { width: 28px; height: 28px; fill: var(--accent); }

.cr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--status-green);
  background: var(--status-green-bg);
  padding: 0.2em 0.7em;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.cr-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-green);
}

.cr-title {
  font-size: 1.15rem;
  color: var(--text-heading);
  margin: 0.2rem 0;
}
.cr-org {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.cr-detail {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}
.cr-period {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-light);
}

/* ── 16. Past Roles / Timeline ───────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 128px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2.2rem;
  padding: 1rem 0;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 124px;
  top: 1.4rem;
  width: 10px; height: 10px;
  background: var(--bg-white);
  border: 2px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
  padding-top: 0.15rem;
  line-height: 1.4;
}
.timeline-role {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.1rem;
}
.timeline-org {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ── 17. Publications ─────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem 1.2rem;
  align-items: start;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:first-child { border-top: none; }

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.2rem;
}
.pub-authors {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.3rem;
  font-family: var(--font-heading);
  line-height: 1.4;
}
.pub-venue {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.pub-venue a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(74,93,140,0.4);
}
.pub-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2em 0.7em;
  border-radius: 99px;
  white-space: nowrap;
  align-self: start;
}
.pub-status--approved { background: var(--status-green-bg); color: var(--status-green); }
.pub-status--published { background: var(--status-blue-bg); color: var(--status-blue); }

/* ── 18. Tools Grid ──────────────────────────────────────── */
.tools-section__grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-category { }
.tool-category__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tool-category__label svg { width: 14px; height: 14px; fill: var(--accent); }

.tool-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tool-tile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.tool-tile img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

/* ── 19. List Sections (Awards, Certs, Training) ─────────── */
.simple-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-entry {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.list-entry:last-child { border-bottom: none; }

.list-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.1rem;
}
.list-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
}
.list-detail {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ── 20. Contact / Footer ─────────────────────────────────── */
.contact-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 3rem;
}
.contact-section h2 { margin-bottom: 0.5rem; }
.contact-section > p { color: var(--text-muted); margin-bottom: 2rem; }

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

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
}
.contact-item__icon {
  width: 36px; height: 36px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-item__icon svg { width: 16px; height: 16px; fill: var(--accent); }

.contact-item__label {
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.contact-item__value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}
.contact-item__value a { color: var(--link); }
.contact-item__value a:hover { color: var(--link-hover); }

/* ── 21. Site Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 1.5rem 4rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ── 22. Reveal Animation ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── 23. Subpage Layout ──────────────────────────────────── */
.subpage-layout {
  max-width: 100%;
  margin: 0 auto;
  padding: 2.5rem 4rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 2.5rem;
  align-items: start;
}

.subpage-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-right: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.subpage-sidebar::-webkit-scrollbar {
  display: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.back-link svg { width: 14px; height: 14px; fill: currentColor; }

.subpage-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.subpage-nav-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.subpage-nav a {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  display: block;
}
.subpage-nav a:hover,
.subpage-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.subpage-content {
  min-width: 0;
}

.subpage-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.subpage-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.subpage-header h1 em { color: var(--accent); }
.subpage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.subpage-meta span { display: flex; align-items: center; gap: 0.3rem; }

.prose {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--text);
}
.prose h2 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.prose h2:first-child { border-top: none; margin-top: 0; }
.prose h3 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1em; }
.prose li { margin-bottom: 0.4em; }
.prose p { margin-bottom: 1em; }

.prose figure {
  margin: 1.5rem 0;
  text-align: center;
}
.prose figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: block;
  margin: 0 auto;
  transition: transform 0.2s, box-shadow 0.2s;
}
.prose figure img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.prose figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
  line-height: 1.4;
}

.simulation-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}
@media (max-width: 768px) {
  .simulation-gallery {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 1rem;
}
.spec-table th {
  background: var(--bg-section-alt);
  font-weight: 600;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  color: var(--text-heading);
}
.spec-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.spec-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  width: 160px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .responsive-table thead {
    display: none;
  }
  .responsive-table, 
  .responsive-table tbody, 
  .responsive-table tr, 
  .responsive-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .responsive-table tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    transition: border-color 0.2s, background 0.2s;
  }
  body.dark-mode .responsive-table tr {
    background: #111524;
    border-color: #232a3f;
  }
  .responsive-table td {
    border-bottom: none;
    padding: 0.4rem 0 !important;
    text-align: left !important;
  }
  .responsive-table td:first-child {
    width: 100% !important;
    white-space: normal !important;
    font-size: 0.9rem !important;
  }
  .responsive-table td:not(:last-child) {
    border-bottom: 1px dashed var(--border);
  }
  .responsive-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
  }
}

/* ── 24. Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: var(--text-light); }

/* ── 25. Responsive ──────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --font-size: 16px; }

  .page-layout,
  .subpage-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 2rem;
  }

  .sidebar,
  .subpage-sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
  }
  .sidebar__photo-wrap { align-self: flex-start; }
  .sidebar__photo { width: 80px; height: 100px; aspect-ratio: 4 / 5; border-radius: 6px; }
  .sidebar__identity { text-align: left; flex: 1; min-width: 160px; }
  .sidebar__links { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
  .sidebar__link { font-size: 0.8rem; }
  .sidebar__tags { gap: 0.35rem; }

  .menu-toggle { display: flex; }
  .site-nav { display: none; }

  .hero { padding: 2rem 1.5rem; }
  .hero__name { font-size: 2rem; }
  .contact-section { padding: 1.5rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
  .research-grid,
  .interests-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 98px; }
  .timeline-item { grid-template-columns: 85px 1fr; gap: 1.5rem; }
  .timeline-item::before { left: 94px; }
  .pub-item { grid-template-columns: 48px 1fr auto; gap: 0.75rem; }
  .theme-toggle { margin-left: auto; }

  .subpage-sidebar {
    position: static;
    flex-direction: column;
  }
}

@media (max-width: 500px) {
  .cap-grid { grid-template-columns: 1fr; }
  .hero__name { font-size: 1.7rem; }
  .hero { border-radius: 8px; }
  .pub-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .pub-year { padding-top: 0; }
  .pub-status { align-self: auto; }
  .current-role-card { grid-template-columns: 1fr; }
  .cr-icon { display: none; }
  .timeline::before { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.25rem; padding: 0.75rem 0; }
  .timeline-item::before { display: none; }
  .timeline-date { text-align: left; font-weight: 600; color: var(--accent); margin-bottom: 0.2rem; }
}

/* ── 26. Utilities ───────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-mono   { font-family: var(--font-mono); }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ── 27. Clickable Cards Hover Tooltip ────────────────────── */
.current-role-card, .int-card, .res-card, .proj-card {
  position: relative;
}

.current-role-card::after, .int-card::after, .res-card::after, .proj-card::after {
  content: 'Click for more details';
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(17, 24, 39, 0.9);
  color: #93c5fd;
  border: 1px solid rgba(74, 93, 140, 0.5);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-sans);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.current-role-card:hover::after, .int-card:hover::after, .res-card:hover::after, .proj-card:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}