/* ==========================================================================
   RUDRA SARKER PORTFOLIO (v2) — MASTER INSTITUTIONAL LIGHT THEME
   Architecture: Zero-Overlap · Strict Box Model · Precision Grid & Flexbox
   Typography: Inter (Body/Headings) + JetBrains Mono (Tech/Metrics/BibTeX)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap");

:root {
  /* Surface & Canvas Colors (Crisp Modern Light Mode) */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfdfe;
  --bg-subtle: rgba(15, 23, 42, 0.04);

  /* Hairline Precision Borders */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-card: rgba(15, 23, 42, 0.12);
  --border-hover: rgba(37, 99, 235, 0.4);
  --border-accent: rgba(37, 99, 235, 0.45);
  --border-emerald: rgba(5, 150, 105, 0.35);

  /* Accent Jewel Tones */
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-emerald: #059669;
  --accent-emerald-subtle: rgba(5, 150, 105, 0.08);
  --accent-amber: #d97706;
  --accent-orange: #ea580c;

  /* Typography Palette (High-Contrast Slate) */
  --text-white: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Fonts */
  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Layout Metrics */
  --header-height: 72px;
  --container-width: 1200px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 9999px;

  /* Clean Diffuse Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px -1px rgba(15, 23, 42, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 14px 30px -4px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(37, 99, 235, 0.06);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent-blue-hover);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-white);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Container Structure */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-spacer {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.content-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.section-title-wrap {
  margin-bottom: 2.5rem;
}

.section-label, .page-kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}

.section-h2, .section-title, .page-title {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.section-desc, .section-subtitle, .page-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.65;
}

.skip-link, .skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top 0.2s ease;
}
.skip-link:focus, .skip-to-content:focus {
  top: 1rem;
}

/* Grid Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

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

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

/* Detail Card */
.detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   NAVIGATION BAR & HEADER
   ========================================================================== */
.site-nav, header.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.brand-wrapper, .brand-mark, .nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-gem, .f-brand span {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.verified-icon {
  color: #2563eb;
  font-size: 0.85rem;
}

.brand-subtitle {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.nav-links-desktop, .nav-links-wrap, .nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
}

.nav-link-item, .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.18s ease;
  position: relative;
  padding: 0.35rem 0;
}

.nav-link-item:hover, .nav-link-item.active, .nav-link:hover, .nav-link.active {
  color: var(--accent-blue);
}

.nav-link-item.active::after, .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
}

.nav-cta-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-nav-primary, .btn-nav-paper {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  background: #0f172a;
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-nav-primary:hover, .btn-nav-paper:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.mobile-menu-btn, .nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-card);
  color: var(--text-white);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  cursor: pointer;
}

.nav-mobile-dropdown, .mobile-dropdown {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  z-index: 999;
}

.nav-mobile-dropdown.open, .mobile-dropdown.open {
  display: flex;
}

.mobile-nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   HERO SECTION — ZERO-OVERLAP 2-COLUMN ARCHITECTURE
   ========================================================================== */
.hero-section, #hero {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-text-col, .hero-content {
  display: flex;
  flex-direction: column;
}

.academic-badge, .academic-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 4px 14px;
  background: var(--accent-emerald-subtle);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-bottom: 1.25rem;
  align-self: flex-start;
}

.badge-dot, .live-dot, .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.hero-name, .hero-title {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-white);
  letter-spacing: -0.035em;
  margin-bottom: 0.5rem;
}

.hero-title-role, .hero-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero-summary, .hero-lead-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-summary strong, .hero-lead-text strong {
  color: var(--text-white);
}

.hero-btn-row, .hero-btn-group, .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.75rem;
}

.btn-primary-dark, .cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f172a;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid #0f172a;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.btn-primary-dark:hover, .cta-button:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-secondary-dark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  color: var(--text-white) !important;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid var(--border-card);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-secondary-dark:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-blue);
  color: var(--accent-blue) !important;
  transform: translateY(-2px);
}

.hero-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.metric-cell {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.1;
  font-family: var(--font-mono);
}

.metric-val.green, .green {
  color: var(--accent-emerald);
}

.metric-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ==========================================================================
   HERO RIGHT COLUMN: SEGMENTED DUAL-VIEW CONTAINER
   ========================================================================== */
.hero-portrait-col {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-dual-card, .portrait-frame {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.hero-dual-card:hover, .portrait-frame:hover {
  box-shadow: var(--shadow-hover);
}

.hero-tab-header {
  display: flex;
  background: #f1f5f9;
  padding: 6px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 6px;
}

.hero-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-tab-btn.active {
  background: #ffffff;
  color: var(--text-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.hero-tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.hero-tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.portrait-panel-wrap {
  padding: 1.25rem;
}

.portrait-img-box, .profile-pic {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.portrait-img-box img, .profile-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-meta-row, .portrait-caption {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portrait-meta-info h4, .portrait-caption h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 2px;
}

.portrait-meta-info p, .portrait-caption p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.loc-pill, .loc-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* 3D WebGL Canvas Viewport */
.viewport-topbar {
  background: var(--bg-surface-elevated);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.viewport-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-white);
  font-weight: 600;
}

.viewport-telemetry {
  display: flex;
  gap: 6px;
}

.telemetry-chip {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 300px;
  background: #e2e8f0;
}

#interactive-3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.canvas-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(6px);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  color: var(--text-secondary);
  pointer-events: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.viewport-bottom-bar {
  display: flex;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 6px;
  gap: 4px;
}

.shape-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.shape-btn.active {
  background: #ffffff;
  color: var(--text-white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   ACADEMIC PUBLICATION SPOTLIGHT & SCIENTIFIC FIGURES
   ========================================================================== */
.publication-hero-card, .pub-flagship-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.pub-top-meta, .elsevier-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.pub-journal-pill {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pub-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pub-article-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-white);
  margin-bottom: 1rem;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.pub-authors strong {
  color: var(--text-white);
}

.pub-abstract-text {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.pub-data-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.pub-data-item, .pub-data-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

.pub-data-item h5, .pub-data-box h5 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 4px;
}

.pub-data-item p, .pub-data-box p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.pub-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* BibTeX Box */
.bibtex-box, pre.code {
  background: #f1f5f9;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #1e293b;
  overflow-x: auto;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* Scientific Figure Cards */
.research-figure-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.research-figure-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: block;
  background: #f8fafc;
  cursor: zoom-in;
}

.research-figure-caption {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.research-figure-caption strong {
  color: var(--text-white);
  font-weight: 700;
}

/* ==========================================================================
   PROJECTS SECTION & CATEGORY FILTERS
   ========================================================================== */
.category-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}

.c-filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.c-filter-btn:hover, .c-filter-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
}

.work-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-hover);
}

.project-card-media {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.15rem;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.35s ease;
}

.work-card:hover .project-card-media img {
  transform: scale(1.03);
}

.work-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.work-category-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.work-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.work-card p, .work-card .desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.tech-tag-row, .skills-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.t-tag, .s-chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
}

.work-card-footer, .work-card-links {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   ACHIEVEMENTS, CERTIFICATES & GALLERY
   ========================================================================== */
.card, .achievement-card, .certificate-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover, .achievement-card:hover, .certificate-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  background-color: #f1f5f9;
  border: 1px solid var(--border-subtle);
  display: block;
  cursor: zoom-in;
}

.certificate-card .card-image {
  height: 190px;
  object-fit: contain;
  background: #f8fafc;
  padding: 6px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ==========================================================================
   DOMAIN MATRIX & TIMELINE & WRITING
   ========================================================================== */
.domain-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.domain-box {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.domain-box h3 {
  font-size: 1.15rem;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.domain-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.timeline-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-card);
}

.timeline-entry {
  position: relative;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -1.95rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.t-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.t-content h3 {
  font-size: 1.15rem;
  color: var(--text-white);
  margin-bottom: 4px;
}

.t-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.writing-card, .blog-post {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.writing-card:hover, .blog-post:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.w-date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.writing-card h3 {
  font-size: 1.15rem;
  color: var(--text-white);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.writing-card p, .blog-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.w-link, .card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-card-box {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.contact-flex-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.contact-email-text {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
}

.contact-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.c-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.c-social-btn:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* ==========================================================================
   INSTITUTIONAL LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

.lightbox-caption {
  margin-top: 1rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  max-width: 700px;
  line-height: 1.5;
}

.lightbox-close-btn {
  position: absolute;
  top: -42px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* Toast */
.copy-toast, .copy-feedback-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 10000;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer, footer.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2.5rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.f-brand h4, .f-col h4, .f-col h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1.15rem;
}

.f-col p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.f-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.f-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.f-col a:hover {
  color: var(--accent-blue);
}

.footer-bottom-line {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Reveal Helper */
.reveal {
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (PREVENT OVERLAPPING)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-portrait-col {
    order: -1;
  }
  .hero-dual-card, .portrait-frame {
    max-width: 100%;
  }
  .pub-data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links-desktop, .nav-links-wrap, .nav-links {
    display: none;
  }
  .mobile-menu-btn, .nav-toggle {
    display: block;
  }
  .hero-section, #hero {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  .hero-name, .hero-title {
    font-size: 2.2rem;
  }
  .hero-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .pub-data-grid {
    grid-template-columns: 1fr;
  }
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .canvas-wrap {
    height: 250px;
  }
}

/* Missing page specific helpers */
.about-container, .blog-container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.about-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.blog-post-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.blog-post-hidden {
  display: none !important;
}

.page-intro-header {
  margin-bottom: 3.5rem;
  text-align: center;
}

.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

/* Zero-Blowout Grid Item Resets */
.hero-text-col, .hero-portrait-col, .work-card, .card, .detail-card, .pub-data-item, .pub-data-box, .research-figure-card {
  min-width: 0;
}

/* ==========================================================================
   KILLER-GRADE BLOG & EDITORIAL DESIGN SYSTEM
   ========================================================================== */
.blog-featured-hero {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 3.5rem;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.blog-featured-hero:hover {
  box-shadow: var(--shadow-hover);
}

.blog-grid, .blog-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  width: 100%;
  margin-bottom: 3.5rem;
}

.blog-card, .card.blog-post {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.blog-card:hover, .card.blog-post:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-hover);
}

.post-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post-cat-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-blue);
}

.post-cat-badge.q1 {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.post-cat-badge.hardware {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.post-reading-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.blog-card h3, .card.blog-post h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.blog-card p, .card.blog-post .blog-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.post-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.post-author-tag {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.post-read-link {
  font-weight: 600;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Projects media placeholder for non-gif projects */
.project-banner-placeholder {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fafc, #edf2f7);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  position: relative;
  overflow: hidden;
}

.project-banner-placeholder i {
  font-size: 2.4rem;
  color: var(--accent-blue);
  opacity: 0.85;
}

.project-banner-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-card);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 992px) {
  .blog-featured-hero {
    grid-template-columns: 1fr;
  }
}
