/* ========================================================
   Byung-Kwan Lee — Personal Homepage
   Sage/Teal Pastel Palette (matching CV design)
   ======================================================== */

/* ========== Light theme (default) ========== */
:root,
[data-theme="light"] {
  --primary:      #2D3E40;
  --accent:       #A8C5BF;
  --accent-dark:  #4F8077;
  --muted:        #5F6E70;
  --highlight:    #DDE9E5;
  --box-bg:       #F4F8F6;
  --badge-bg:     #E5EFEC;
  --pill-bg:      #EAF2EE;
  --nvidia:       #76B900;
  --bg:           #FBFCFB;
  --bg-soft:      #F7FAF9;
  --border:       #E2E8E5;

  --shadow-soft:  0 8px 24px rgba(47, 84, 78, 0.18);
  --glow-accent:  0 0 0 rgba(168, 197, 191, 0);
  --glow-nvidia:  0 0 0 rgba(118, 185, 0, 0);
  --glow-name:    0 0 24px rgba(168, 197, 191, 0.18);
  --glow-photo:   0 0 0 rgba(168, 197, 191, 0);
  --glow-hover:   0 4px 14px rgba(79, 128, 119, 0.18);
}

/* ========== Dark theme (neon) ========== */
[data-theme="dark"] {
  --primary:      #E6EDEA;
  --accent:       #4FB8A6;
  --accent-dark:  #7BD4C4;
  --muted:        #8FA09F;
  --highlight:    #1E3B36;
  --box-bg:       #161E1C;
  --badge-bg:     #1A2E2A;
  --pill-bg:      #15231F;
  --nvidia:       #9CDF00;
  --bg:           #0B0F11;
  --bg-soft:      #0F1517;
  --border:       #1F2A28;

  --shadow-soft:  0 8px 24px rgba(0, 0, 0, 0.6);
  --glow-accent:  0 0 18px rgba(79, 184, 166, 0.55);
  --glow-nvidia:  0 0 22px rgba(156, 223, 0, 0.55);
  --glow-name:    0 0 12px rgba(123, 212, 196, 0.45), 0 0 36px rgba(79, 184, 166, 0.25);
  --glow-photo:   0 0 28px rgba(79, 184, 166, 0.45);
  --glow-hover:   0 0 22px rgba(123, 212, 196, 0.5);
}

/* -------- Reset & Base -------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--primary);
  background: var(--bg);
  transition: background-color 0.4s ease, color 0.4s ease;
}
.topnav,
.hero,
.content,
.site-footer {
  position: relative;
  z-index: 1;
}

/* -------- AI circuit signal background (dark mode) -------- */
.circuit-bg {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  /* Show circuits only outside the centered content column. */
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) calc(50% - 470px),
    rgba(0, 0, 0, 0) calc(50% - 350px),
    rgba(0, 0, 0, 0) calc(50% + 350px),
    rgba(0, 0, 0, 1) calc(50% + 470px),
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) calc(50% - 470px),
    rgba(0, 0, 0, 0) calc(50% - 350px),
    rgba(0, 0, 0, 0) calc(50% + 350px),
    rgba(0, 0, 0, 1) calc(50% + 470px),
    rgba(0, 0, 0, 1) 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.circuit-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}
[data-theme="dark"] .circuit-bg {
  opacity: 0.34;
}
[data-theme="light"] .circuit-bg {
  opacity: 0.32;
  filter: saturate(1.12) brightness(1.08);
}
.circuit-bg .trace {
  fill: none;
  stroke: rgba(123, 212, 196, 0.17);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.circuit-bg .signal {
  fill: none;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 6 30;
  animation: circuitFlow 34s linear infinite;
}
.circuit-bg .signal-lime {
  stroke: rgba(156, 223, 0, 0.48);
  filter: drop-shadow(0 0 4px rgba(156, 223, 0, 0.30));
}
.circuit-bg .signal-teal {
  stroke: rgba(123, 212, 196, 0.44);
  filter: drop-shadow(0 0 4px rgba(79, 184, 166, 0.26));
}
.circuit-bg .signal-pink {
  stroke: rgba(114, 210, 171, 0.40);
  filter: drop-shadow(0 0 4px rgba(79, 184, 166, 0.24));
}
.circuit-bg .signal-cyan {
  stroke: rgba(122, 229, 247, 0.40);
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.24));
}
.circuit-bg .signal-violet {
  stroke: rgba(148, 222, 92, 0.38);
  filter: drop-shadow(0 0 4px rgba(148, 222, 92, 0.22));
}
.circuit-bg .signal-amber {
  stroke: rgba(105, 188, 169, 0.36);
  filter: drop-shadow(0 0 4px rgba(105, 188, 169, 0.22));
}
[data-theme="light"] .circuit-bg .trace {
  stroke: rgba(57, 99, 93, 0.26);
}
[data-theme="light"] .circuit-bg .signal-lime {
  stroke: rgba(118, 185, 0, 0.54);
  filter: drop-shadow(0 0 3px rgba(118, 185, 0, 0.30));
}
[data-theme="light"] .circuit-bg .signal-teal {
  stroke: rgba(61, 148, 136, 0.52);
  filter: drop-shadow(0 0 3px rgba(61, 148, 136, 0.28));
}
[data-theme="light"] .circuit-bg .signal-pink {
  stroke: rgba(79, 150, 134, 0.50);
  filter: drop-shadow(0 0 3px rgba(79, 150, 134, 0.27));
}
[data-theme="light"] .circuit-bg .signal-cyan {
  stroke: rgba(50, 170, 214, 0.50);
  filter: drop-shadow(0 0 3px rgba(50, 170, 214, 0.27));
}
[data-theme="light"] .circuit-bg .signal-violet {
  stroke: rgba(116, 171, 67, 0.48);
  filter: drop-shadow(0 0 3px rgba(116, 171, 67, 0.26));
}
[data-theme="light"] .circuit-bg .signal-amber {
  stroke: rgba(79, 142, 130, 0.48);
  filter: drop-shadow(0 0 3px rgba(79, 142, 130, 0.26));
}
.circuit-bg .signal-a { animation-duration: 44s; }
.circuit-bg .signal-b { animation-duration: 38s; animation-delay: -4.8s; }
.circuit-bg .signal-c { animation-duration: 52s; animation-delay: -7.4s; }
.circuit-bg .signal-d { animation-name: circuitFlowReverse; animation-duration: 41s; animation-delay: -3.9s; }
.circuit-bg .signal-e { animation-name: circuitFlowReverse; animation-duration: 56s; animation-delay: -8.2s; }
.circuit-bg .signal-f { animation-duration: 47s; animation-delay: -5.6s; }

.circuit-bg .node {
  opacity: 0.22;
  animation: circuitNodePulse 7.2s ease-in-out infinite;
}
.circuit-bg .node-lime { fill: rgba(156, 223, 0, 0.80); filter: drop-shadow(0 0 4px rgba(156, 223, 0, 0.24)); }
.circuit-bg .node-teal { fill: rgba(123, 212, 196, 0.80); filter: drop-shadow(0 0 4px rgba(79, 184, 166, 0.22)); }
.circuit-bg .node-pink { fill: rgba(105, 188, 169, 0.78); filter: drop-shadow(0 0 4px rgba(79, 184, 166, 0.20)); }
.circuit-bg .node-cyan { fill: rgba(103, 232, 249, 0.78); filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.22)); }
.circuit-bg .node-violet { fill: rgba(148, 222, 92, 0.76); filter: drop-shadow(0 0 4px rgba(148, 222, 92, 0.20)); }
.circuit-bg .node-amber { fill: rgba(122, 197, 164, 0.76); filter: drop-shadow(0 0 4px rgba(122, 197, 164, 0.20)); }
[data-theme="light"] .circuit-bg .node { opacity: 0.26; }
[data-theme="light"] .circuit-bg .node-lime { fill: rgba(118, 185, 0, 0.82); filter: drop-shadow(0 0 3px rgba(118, 185, 0, 0.22)); }
[data-theme="light"] .circuit-bg .node-teal { fill: rgba(61, 148, 136, 0.80); filter: drop-shadow(0 0 3px rgba(61, 148, 136, 0.20)); }
[data-theme="light"] .circuit-bg .node-pink { fill: rgba(79, 142, 130, 0.80); filter: drop-shadow(0 0 3px rgba(79, 142, 130, 0.19)); }
[data-theme="light"] .circuit-bg .node-cyan { fill: rgba(50, 170, 214, 0.80); filter: drop-shadow(0 0 3px rgba(50, 170, 214, 0.20)); }
[data-theme="light"] .circuit-bg .node-violet { fill: rgba(116, 171, 67, 0.78); filter: drop-shadow(0 0 3px rgba(116, 171, 67, 0.19)); }
[data-theme="light"] .circuit-bg .node-amber { fill: rgba(79, 142, 130, 0.78); filter: drop-shadow(0 0 3px rgba(79, 142, 130, 0.19)); }
.circuit-bg .n2 { animation-delay: -0.6s; }
.circuit-bg .n3 { animation-delay: -1.1s; }
.circuit-bg .n4 { animation-delay: -1.7s; }
.circuit-bg .n5 { animation-delay: -2.3s; }
.circuit-bg .n6 { animation-delay: -2.8s; }
.circuit-bg .n7 { animation-delay: -3.2s; }
.circuit-bg .n8 { animation-delay: -3.6s; }
.circuit-bg .n9 { animation-delay: -1.3s; }
.circuit-bg .n10 { animation-delay: -2.0s; }
.circuit-bg .n11 { animation-delay: -4.1s; }
.circuit-bg .n12 { animation-delay: -4.6s; }

@keyframes circuitFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -320; }
}
@keyframes circuitFlowReverse {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 320; }
}
@keyframes circuitNodePulse {
  0%, 100% { opacity: 0.10; }
  50%      { opacity: 0.52; }
}

/* -------- Easter egg: profile emoji cursor (desktop only) -------- */
@media (hover: hover) and (pointer: fine) {
  html, body {
    cursor: url("assets/cursor-profile-emoji.png") 6 6, default;
  }
  button, [role="button"], summary,
  .theme-toggle, .pub-thumb,
  input[type="button"], input[type="submit"], label[for] {
    cursor: url("assets/cursor-profile-emoji.png") 6 6, pointer;
  }
  a[href], a[href] * {
    cursor: pointer;
  }
  input[type="text"], input[type="email"], input[type="search"],
  textarea {
    cursor: url("assets/cursor-profile-emoji.png") 6 6, text;
  }
}
body,
.topnav,
.hero,
.pub-thumb,
.role-pill,
.hero-photo img,
.badge,
.edu-sub .gpa,
.project-list > li {
  transition: background-color 0.4s ease, color 0.4s ease,
              border-color 0.4s ease, box-shadow 0.4s ease;
}
a { color: var(--accent-dark); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary); text-decoration: underline; }
h1, h2, h3 { font-family: 'Lora', Georgia, serif; color: var(--primary); margin: 0; }
em { color: var(--muted); }
ul, ol { padding-left: 1.4em; }

/* -------- Sticky Nav -------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 252, 251, 0.85);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .topnav {
  background: rgba(11, 15, 17, 0.65);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgba(79, 184, 166, 0.14);
  box-shadow: 0 1px 0 rgba(79, 184, 166, 0.06);
}
.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.nav-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}
.nav-brand:hover { text-decoration: none; color: var(--accent-dark); }
.nav-links-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
  font-weight: 500;
  justify-content: flex-end;
  min-width: 0;
}
.nav-links a { color: var(--muted); padding: 4px 2px; border-bottom: 2px solid transparent; transition: all 0.15s; }
.nav-links a:hover { color: var(--accent-dark); border-bottom-color: var(--accent); text-decoration: none; }
.nav-slide-hint {
  display: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.78;
  white-space: nowrap;
  user-select: none;
}
.nav-slide-hint i {
  margin-right: 4px;
  font-size: 10px;
}

/* Hero CV view button (compact, opens PDF in browser viewer) */
.role-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  border-radius: 11px;
  border: 1px solid rgba(229, 62, 62, 0.26);
  background: linear-gradient(135deg, var(--bg-soft), var(--box-bg));
  color: var(--primary);
  text-decoration: none;
  box-shadow:
    0 1px 2px rgba(15, 20, 25, 0.05),
    0 4px 12px rgba(15, 20, 25, 0.03),
    0 0 0 1px rgba(229, 62, 62, 0.08),
    0 0 14px rgba(229, 62, 62, 0.10);
  transition: transform 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: hidden;
  min-height: 40px;
  box-sizing: border-box;
}
.cv-btn:hover {
  text-decoration: none;
  border-color: rgba(229, 62, 62, 0.62);
  transform: translateY(-1.5px);
  box-shadow:
    0 1px 2px rgba(15, 20, 25, 0.06),
    0 8px 20px rgba(229, 62, 62, 0.13),
    0 0 0 1px rgba(229, 62, 62, 0.16),
    0 0 18px rgba(229, 62, 62, 0.18);
}

.cv-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #E53E3E, #C53030);
  color: #fff;
  font-size: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1.5px 4px rgba(229, 62, 62, 0.30);
  flex-shrink: 0;
}
.cv-btn-icon i { transform: translateY(0.5px); }

.cv-btn-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--primary);
  line-height: 1;
}

.cv-btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 9.5px;
  margin-left: 2px;
  transition: transform 0.25s ease, color 0.18s ease;
}
.cv-btn:hover .cv-btn-arrow {
  color: var(--accent-dark);
  transform: translate(2px, -2px);
}

[data-theme="dark"] .cv-btn {
  background: linear-gradient(135deg, rgba(22, 30, 28, 0.85), rgba(15, 21, 23, 0.85));
  border-color: rgba(245, 101, 101, 0.44);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(245, 101, 101, 0.18),
    0 0 18px rgba(229, 62, 62, 0.22);
}
[data-theme="dark"] .cv-btn:hover {
  border-color: rgba(245, 101, 101, 0.78);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 30px rgba(229, 62, 62, 0.18),
    0 0 0 1px rgba(245, 101, 101, 0.30),
    0 0 22px rgba(229, 62, 62, 0.30);
}
[data-theme="dark"] .cv-btn-icon {
  background: linear-gradient(135deg, #F56565, #C53030);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 14px rgba(229, 62, 62, 0.4);
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1.2px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  font-size: 13px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
  transform: scale(1.08);
}
.theme-toggle .icon-moon,
.theme-toggle .icon-sun {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.4s ease;
}
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }
[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: rotate(90deg); }
[data-theme="dark"]  .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="dark"]  .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0); color: #FFD479; }

/* -------- Hero -------- */
.hero {
  max-width: 1230px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 200px auto;
  gap: 22px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  justify-items: stretch;
  justify-content: center;
}
.hero-photo {
  position: relative;
  width: 200px;
  height: 200px;
  justify-self: start;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow-soft), var(--glow-photo);
  background: var(--bg-soft);
}
.hero-text {
  text-align: left;
  justify-self: start;
  width: min(100%, 760px);
  margin-left: 0;
}
.hero .role-row {
  justify-content: flex-start;
}
.stock-card {
  width: 100%;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 8px;
  background:
    linear-gradient(160deg, rgba(168, 197, 191, 0.16), transparent 52%),
    var(--bg-soft);
  box-shadow: 0 3px 14px rgba(15, 20, 25, 0.06);
  position: relative;
}
.stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.stock-card.is-dragging .stock-head { cursor: grabbing; }
.stock-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stock-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.stock-live-link {
  text-decoration: none;
  border: 1px solid rgba(79, 128, 119, 0.30);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--accent-dark);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.stock-live-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 128, 119, 0.16);
  transform: translateY(-1px);
}
.stock-live-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.stock-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #76B900;
  box-shadow: 0 0 0 0 rgba(118, 185, 0, 0.55);
  animation: stockPulse 1.8s ease-out infinite;
}
.stock-info {
  flex: 1 1 auto;
  min-height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(79, 128, 119, 0.24);
  background: rgba(255, 255, 255, 0.52);
  padding: 4px 8px;
}
.stock-info .tradingview-widget-container,
.stock-info .tradingview-widget-container__widget {
  width: 100%;
  min-height: 64px;
}
.stock-info iframe {
  border: 0;
}
.stock-fallback-link {
  min-height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-dark);
  text-align: center;
  padding: 8px 10px;
}
.stock-info-fallback {
  min-height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.stock-fallback-link:hover {
  text-decoration: none;
  color: var(--primary);
}
.stock-resize-handle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: transparent;
  cursor: nwse-resize !important;
  opacity: 0.8;
}
.stock-resize-handle::before {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(135deg, transparent 46%, rgba(79, 128, 119, 0.58) 47%, rgba(79, 128, 119, 0.58) 58%, transparent 59%),
    linear-gradient(135deg, transparent 64%, rgba(79, 128, 119, 0.72) 65%, rgba(79, 128, 119, 0.72) 76%, transparent 77%);
}
.stock-card.is-resizing .stock-resize-handle { opacity: 1; }
@keyframes stockPulse {
  0%   { box-shadow: 0 0 0 0 rgba(118, 185, 0, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(118, 185, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(118, 185, 0, 0); }
}
.name {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.1;
  text-shadow: var(--glow-name);
}
.subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 12px;
}
.subtitle .grad-icon { margin-right: 6px; color: var(--accent-dark); }
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pill-bg);
  border: 1.2px solid var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--primary);
  box-shadow: var(--glow-nvidia);
  min-height: 40px;
  box-sizing: border-box;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
              border-color 0.25s ease, background-color 0.4s ease;
}
a.role-pill { color: var(--primary); }
a.role-pill:hover {
  text-decoration: none;
  color: var(--primary);
  transform: translateY(-1px);
  border-color: var(--nvidia);
}
.role-pill-arrow {
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
a.role-pill:hover .role-pill-arrow {
  color: var(--nvidia);
  opacity: 1;
  transform: translate(2px, -2px);
}
.role-pill .nvidia-logo {
  height: 16px;
  vertical-align: middle;
  margin: 0;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.4s ease;
}
[data-theme="dark"] .role-pill .nvidia-logo {
  filter: drop-shadow(0 0 6px rgba(156, 223, 0, 0.6));
}

/* -------- Hero ambient glow (dark mode only) -------- */
[data-theme="dark"] .hero {
  position: relative;
  isolation: isolate;
}
[data-theme="dark"] .hero::before {
  content: "";
  position: absolute;
  /* Stretch the glow to the full viewport width so it spans
     the entire area above the Research Interest section */
  top: -120px;
  bottom: -60px;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background:
    radial-gradient(ellipse 42% 54% at 18% 42%,
      rgba(156, 223, 0, 0.22),
      transparent 72%),
    radial-gradient(ellipse 42% 54% at 82% 42%,
      rgba(156, 223, 0, 0.20),
      transparent 72%),
    radial-gradient(ellipse 44% 48% at 50% 56%,
      rgba(244, 114, 182, 0.16),
      transparent 75%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.95;
  transform: translate3d(0, calc(var(--scrollY, 0px) * 0.2), 0);
  will-change: transform;
}

[data-theme="dark"] .name {
  color: #F2FFFD;
  text-shadow:
    0 0 4px rgba(191, 239, 229, 0.55),
    0 0 18px rgba(79, 184, 166, 0.35);
}

[data-theme="dark"] .hero-photo img {
  border-color: #5FE0CB;
  box-shadow:
    0 0 0 1px rgba(95, 224, 203, 0.18),
    0 0 22px rgba(79, 184, 166, 0.40),
    0 8px 30px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .role-pill {
  border-color: rgba(156, 223, 0, 0.55);
  background: linear-gradient(135deg, rgba(21, 35, 31, 0.95), rgba(26, 46, 42, 0.95));
  box-shadow:
    0 0 6px  rgba(156, 223, 0, 0.18),
    0 0 14px rgba(156, 223, 0, 0.08);
}
[data-theme="dark"] a.role-pill { color: var(--primary); }
[data-theme="dark"] a.role-pill:hover {
  border-color: rgba(156, 223, 0, 0.85);
  box-shadow:
    0 0 10px rgba(156, 223, 0, 0.35),
    0 0 22px rgba(156, 223, 0, 0.15);
}
[data-theme="dark"] .role-pill .nvidia-text {
  text-shadow:
    0 0 6px rgba(156, 223, 0, 0.45),
    0 0 14px rgba(156, 223, 0, 0.22);
}
[data-theme="dark"] .role-pill .nvidia-logo {
  filter: drop-shadow(0 0 3px rgba(156, 223, 0, 0.45));
}
[data-theme="dark"] .stock-card {
  border-color: rgba(79, 184, 166, 0.24);
  background:
    linear-gradient(155deg, rgba(17, 40, 35, 0.76), rgba(10, 16, 18, 0.86)),
    rgba(11, 15, 17, 0.86);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(79, 184, 166, 0.12);
}
[data-theme="dark"] .stock-title {
  color: #8DE4D4;
  text-shadow: 0 0 8px rgba(79, 184, 166, 0.25);
}
[data-theme="dark"] .stock-live {
  color: #A7C5C2;
}
[data-theme="dark"] .stock-live-link {
  border-color: rgba(79, 184, 166, 0.34);
  background: rgba(15, 21, 23, 0.72);
  color: #8DE4D4;
}
[data-theme="dark"] .stock-live-link:hover {
  border-color: rgba(123, 212, 196, 0.58);
  box-shadow: 0 0 0 1px rgba(123, 212, 196, 0.24), 0 0 10px rgba(79, 184, 166, 0.16);
}
[data-theme="dark"] .stock-info {
  background: rgba(7, 10, 12, 0.78);
  border-color: rgba(79, 184, 166, 0.28);
}
[data-theme="dark"] .stock-fallback-link {
  color: #8DE4D4;
}
[data-theme="dark"] .stock-info-fallback {
  color: #A7C5C2;
}
[data-theme="dark"] .stock-resize-handle::before {
  background:
    linear-gradient(135deg, transparent 46%, rgba(123, 212, 196, 0.62) 47%, rgba(123, 212, 196, 0.62) 58%, transparent 59%),
    linear-gradient(135deg, transparent 64%, rgba(123, 212, 196, 0.82) 65%, rgba(123, 212, 196, 0.82) 76%, transparent 77%);
}

[data-theme="dark"] .subtitle .grad-icon {
  text-shadow: 0 0 6px rgba(123, 212, 196, 0.4);
}
[data-theme="dark"] .contact-row .dot {
  text-shadow: 0 0 6px rgba(79, 184, 166, 0.45);
}
[data-theme="dark"] .contact-row i {
  text-shadow: 0 0 4px rgba(123, 212, 196, 0.3);
}
.role-pill .nvidia-text {
  color: var(--nvidia);
  font-weight: 700;
  text-shadow: var(--glow-nvidia);
}

.contact-row {
  font-size: 14px;
  margin: 5px 0;
  color: var(--muted);
}
.contact-row a {
  color: var(--accent-dark);
  margin: 0 2px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.contact-row a:hover {
  color: var(--primary);
  text-decoration: none;
}
[data-theme="dark"] .contact-row a:hover {
  color: var(--accent-dark);
  text-shadow: 0 0 6px rgba(123, 212, 196, 0.45);
}
.contact-row i { margin-right: 4px; }
.contact-row .dot { color: var(--accent); margin: 0 6px; }

/* -------- Main Content -------- */
.content {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
section { padding: 28px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

.hero-quote-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.hero-quote-text {
  width: 100%;
  margin: 0;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid rgba(127, 184, 173, 0.28);
  background: linear-gradient(135deg, rgba(168, 197, 191, 0.14), rgba(168, 197, 191, 0.02));
  color: var(--primary);
  font-family: 'Lora', Georgia, serif;
  font-size: 19px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.002em;
}
.hero-quote-author {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  font-family: 'Lora', Georgia, serif;
  font-size: 0.94em;
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0.9;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent-dark) 50%,
    transparent 100%);
  background-size: 220% 100%;
  background-position: -110% 0;
  animation: title-shimmer 5s ease-in-out infinite;
  opacity: 0.6;
}
[data-theme="dark"] .section-title::after {
  opacity: 0.85;
  filter: drop-shadow(0 0 4px var(--accent));
}
@keyframes title-shimmer {
  0%   { background-position: -110% 0; }
  50%  { background-position:  110% 0; }
  100% { background-position: -110% 0; }
}
.section-title i {
  color: var(--accent-dark);
  font-size: 20px;
  transition: text-shadow 0.4s ease;
}
[data-theme="dark"] .section-title i {
  text-shadow: 0 0 10px var(--accent);
}

.lead { margin: 8px 0; color: var(--primary); }
.research-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}
.research-list li {
  padding: 4px 0 4px 22px;
  position: relative;
  color: var(--primary);
}
.research-list li::before {
  content: "▪";
  color: var(--accent-dark);
  position: absolute;
  left: 4px;
  top: 4px;
}

/* -------- Collaboration & Applications -------- */
.application-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.application-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(160deg, rgba(168, 197, 191, 0.12), transparent 48%),
    var(--bg-soft);
  box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04);
}
.application-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--primary);
}
.resume-open-btn {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(79, 128, 119, 0.36);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(168, 197, 191, 0.28), rgba(168, 197, 191, 0.10));
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.resume-open-btn:hover {
  border-color: var(--accent-dark);
  box-shadow: var(--glow-hover);
  transform: translateY(-1px);
}
.resume-open-btn:focus-visible {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 2px rgba(79, 128, 119, 0.25);
}
.resume-open-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.resume-open-btn.is-sending,
.resume-open-btn:disabled {
  opacity: 0.82;
  cursor: progress;
  transform: none;
}
.resume-upload-status {
  min-height: 20px;
  margin: 8px 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.resume-upload-status.is-success { color: #2f9e44; }
.resume-upload-status.is-error { color: #d9480f; }
.resume-upload-status.is-muted { color: var(--muted); }
[data-theme="dark"] .application-card {
  background:
    linear-gradient(160deg, rgba(79, 184, 166, 0.10), transparent 48%),
    rgba(15, 21, 23, 0.88);
  border-color: rgba(79, 184, 166, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .resume-open-btn {
  border-color: rgba(79, 184, 166, 0.44);
  background: linear-gradient(145deg, rgba(79, 184, 166, 0.22), rgba(9, 14, 16, 0.88));
  color: #e9f4f1;
}
[data-theme="dark"] .resume-open-btn:hover {
  border-color: rgba(123, 212, 196, 0.72);
}
[data-theme="dark"] .resume-open-btn:focus-visible {
  border-color: rgba(141, 228, 212, 0.92);
  box-shadow: 0 0 0 2px rgba(79, 184, 166, 0.3);
}
[data-theme="dark"] .resume-upload-status.is-success { color: #8ce99a; }
[data-theme="dark"] .resume-upload-status.is-error { color: #ffa94d; }

/* -------- Work Experience -------- */
.role-block { margin-top: 14px; }
.role-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.role-header .company {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.role-header .dot-sep {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent);
  vertical-align: middle;
  margin: 0 6px;
}
.role-header .position {
  font-style: normal;
  color: var(--primary);
  font-weight: 600;
}
.role-header .period {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.project-list { list-style: none; padding-left: 0; margin: 0; }
.project-list > li {
  padding: 10px 0 10px 16px;
  border-left: 2px solid var(--accent);
  margin: 8px 0;
  background: linear-gradient(to right, var(--box-bg) 0%, transparent 60%);
}
.project-list > li > strong { color: var(--primary); font-weight: 700; }
.project-list .dash { color: var(--muted); margin: 0 4px; }
.project-list .desc { color: var(--muted); font-style: italic; font-size: 14.5px; }

.proj-link {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.proj-link strong { color: inherit; font-weight: 700; }
.proj-link .ext-icon {
  font-size: 0.72em;
  opacity: 0.55;
  margin-left: 3px;
  vertical-align: 1px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.proj-link:hover {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom-color: var(--accent);
}
.proj-link:hover .ext-icon { opacity: 1; transform: translate(1px, -1px); }
[data-theme="dark"] .proj-link:hover {
  color: var(--accent-dark);
  text-shadow: 0 0 8px rgba(123, 212, 196, 0.35);
  border-bottom-color: var(--accent);
}

.role-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: 1px;
}
.role-tag.lead { background: var(--accent-dark); color: white; }
.role-tag.coauthor { background: white; color: var(--muted); border: 1px solid var(--muted); }
.phase {
  font-variant: small-caps;
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 700;
  margin-left: 4px;
}

.badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  border: 0.5px solid;
}
.badge.venue   { background: var(--badge-bg); border-color: var(--accent); color: var(--accent-dark); }
.badge.status  { background: var(--box-bg); border-color: var(--border); color: var(--muted); }
.badge.status.internal {
  background: linear-gradient(135deg,
    rgba(148, 163, 184, 0.20),
    rgba(148, 163, 184, 0.06));
  border-color: rgba(100, 116, 139, 0.55);
  color: #475569;
  font-weight: 700;
  box-shadow:
    0 0 6px  rgba(100, 116, 139, 0.20),
    0 0 12px rgba(148, 163, 184, 0.10);
}
.badge.status.provisional {
  background: linear-gradient(135deg,
    rgba(118, 185,   0, 0.08),
    rgba(118, 185,   0, 0.02));
  border-color: rgba(118, 185, 0, 0.40);
  color: #76914A;
  font-weight: 600;
  box-shadow:
    0 0 5px  rgba(118, 185, 0, 0.08),
    0 0 10px rgba(118, 185, 0, 0.04);
}
.badge.patent {
  background: linear-gradient(135deg,
    rgba(118, 185,   0, 0.12),
    rgba(118, 185,   0, 0.04));
  border-color: rgba(118, 185, 0, 0.70);
  color: #5C8F00;
  font-weight: 700;
}
.badge.patent i {
  margin-right: 4px;
  font-size: 10px;
  opacity: 0.95;
}
/* Internal Tech Transfer (blue) */
.badge.tech {
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.10),
    rgba(59, 130, 246, 0.03));
  border-color: rgba(59, 130, 246, 0.60);
  color: #1D4ED8;
  font-weight: 700;
}
/* ArXiv Release (pink) */
.badge.arxiv {
  background: linear-gradient(135deg,
    rgba(236,  72, 153, 0.10),
    rgba(236,  72, 153, 0.03));
  border-color: rgba(236, 72, 153, 0.55);
  color: #BE185D;
  font-weight: 600;
}

[data-theme="dark"] .badge.venue  { box-shadow: 0 0 8px rgba(79, 184, 166, 0.25); }
[data-theme="dark"] .badge.patent {
  background: linear-gradient(135deg,
    rgba(156, 223, 0, 0.18),
    rgba(156, 223, 0, 0.06));
  border-color: rgba(156, 223, 0, 0.70);
  color: #C9F050;
  box-shadow:
    0 0 8px  rgba(156, 223, 0, 0.32),
    0 0 16px rgba(156, 223, 0, 0.12);
}
[data-theme="dark"] .badge.tech {
  background: linear-gradient(135deg,
    rgba(96, 165, 250, 0.18),
    rgba(96, 165, 250, 0.06));
  border-color: rgba(96, 165, 250, 0.65);
  color: #93C5FD;
  box-shadow:
    0 0 8px  rgba( 96, 165, 250, 0.32),
    0 0 16px rgba( 96, 165, 250, 0.12);
}
[data-theme="dark"] .badge.arxiv {
  background: linear-gradient(135deg,
    rgba(244, 114, 182, 0.18),
    rgba(244, 114, 182, 0.06));
  border-color: rgba(244, 114, 182, 0.60);
  color: #F9A8D4;
  box-shadow:
    0 0 7px  rgba(244, 114, 182, 0.28),
    0 0 14px rgba(244, 114, 182, 0.10);
}
[data-theme="dark"] .badge.status.internal {
  background: linear-gradient(135deg,
    rgba(148, 163, 184, 0.20),
    rgba(148, 163, 184, 0.07));
  border-color: rgba(148, 163, 184, 0.62);
  color: #CBD5E1;
  box-shadow:
    0 0 8px  rgba(148, 163, 184, 0.30),
    0 0 16px rgba(148, 163, 184, 0.13);
}
[data-theme="dark"] .badge.status.provisional {
  background: linear-gradient(135deg,
    rgba(156, 223, 0, 0.12),
    rgba(156, 223, 0, 0.03));
  border-color: rgba(156, 223, 0, 0.46);
  color: #A9C970;
  box-shadow:
    0 0 6px  rgba(156, 223, 0, 0.16),
    0 0 12px rgba(156, 223, 0, 0.06);
}
[data-theme="dark"] .role-tag.lead { box-shadow: 0 0 10px rgba(123, 212, 196, 0.4); }

/* Slightly dim figure thumbs in dark mode so they don't strain the eyes */
[data-theme="dark"] .pub-thumb img { filter: brightness(0.92) contrast(0.98); }
[data-theme="dark"] .pub-thumb:hover img { filter: brightness(1); }
/* But keep wide figures (which have white backgrounds) untouched on white */
[data-theme="dark"] .pub-thumb.is-wide { background: #f0f4f3; }

.dashed-divider {
  margin: 18px 0;
  height: 1px;
  background-image: linear-gradient(to right, var(--accent-dark) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  opacity: 0.6;
}

/* -------- Education -------- */
.edu-block {
  padding: 10px 0;
  border-bottom: 1px dotted var(--border);
}
.edu-block:last-child { border-bottom: none; }
.edu-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.edu-head .school {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}
.edu-head .period {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.edu-sub { font-size: 14.5px; color: var(--primary); font-style: italic; margin: 2px 0; }
.edu-sub .gpa {
  display: inline-block;
  font-size: 12px;
  background: var(--badge-bg);
  color: var(--accent-dark);
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  font-style: normal;
  font-weight: 600;
}
.edu-extra { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* -------- Publications Overview -------- */
.pub-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 24px;
  align-items: stretch;
  margin: 6px 0 22px;
}
.pub-summary .pub-overview {
  margin: 0;
  align-self: center;
}
@media (max-width: 900px) {
  .pub-summary { grid-template-columns: 1fr; }
  .pub-summary .pub-overview { align-self: start; }
}

/* Activity-rings style publication profile (Apple Watch-inspired) */
.pub-rings {
  margin: 0;
  padding: 12px 18px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pub-rings::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 30% 40%,
      rgba(156, 223,   0, 0.06), transparent 70%),
    radial-gradient(ellipse 50% 50% at 75% 65%,
      rgba( 79, 184, 166, 0.06), transparent 70%);
  pointer-events: none;
}
.rings-head {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: center;
  position: relative;
}
.pct-single {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  position: relative;
  flex: 1 1 auto;
}
.pct-ring {
  --major: 76;
  --ring-lime: #9CDF00;
  --ring-sky: #62D0FF;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 148px;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--ring-lime) 0 calc(var(--major) * 1%),
    var(--ring-sky) calc(var(--major) * 1%) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(79, 128, 119, 0.22);
}
.pct-ring::before {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.pct-sector-label {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
}
.pct-sector-label .ring-value-pct {
  font-size: 1.16em;
}
.pct-sector-label-lime {
  left: 67%;
  top: 63%;
  color: #6EA300;
}
.pct-sector-label-sky {
  left: 33%;
  top: 36%;
  color: #1F93C4;
}
.pct-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pct-legend-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 4px;
  align-items: start;
}
.pct-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  align-self: center;
}
.pct-dot-lime { background: #9CDF00; }
.pct-dot-sky  { background: #62D0FF; }
.pct-label {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.25;
  white-space: normal;
}
.pct-sub {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 16px;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pct-legend-item-lime .pct-sub { color: #6EA300; }
.pct-legend-item-sky  .pct-sub { color: #1F93C4; }
.pct-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.42;
  color: var(--muted);
  text-align: center;
}

/* Dark mode: subtle background tweaks and per-ring neon glow */
[data-theme="dark"] .pub-rings {
  background: rgba(15, 21, 23, 0.55);
  border-color: rgba(79, 184, 166, 0.22);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
}
[data-theme="dark"] .pub-rings::before {
  background:
    radial-gradient(ellipse 55% 55% at 30% 40%,
      rgba(156, 223,   0, 0.10), transparent 70%),
    radial-gradient(ellipse 55% 55% at 75% 65%,
      rgba( 79, 184, 166, 0.10), transparent 70%);
}
[data-theme="dark"] .pct-ring {
  background: conic-gradient(
    #A7F20A 0 calc(var(--major) * 1%),
    #68D8FF calc(var(--major) * 1%) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(79, 184, 166, 0.26),
    0 0 16px rgba(79, 184, 166, 0.16);
}
[data-theme="dark"] .pct-ring::before {
  background: rgba(11, 15, 17, 0.90);
  border-color: rgba(79, 184, 166, 0.20);
}
[data-theme="dark"] .pct-dot-lime { box-shadow: 0 0 8px rgba(156, 223, 0, 0.45); }
[data-theme="dark"] .pct-dot-sky  { box-shadow: 0 0 8px rgba(104, 216, 255, 0.40); }
[data-theme="dark"] .pct-sector-label-lime {
  color: #B8F769;
  text-shadow: 0 0 8px rgba(156, 223, 0, 0.25);
}
[data-theme="dark"] .pct-sector-label-sky {
  color: #9DEBFF;
  text-shadow: 0 0 8px rgba(104, 216, 255, 0.22);
}
[data-theme="dark"] .pct-legend-item-lime .pct-sub {
  color: #B8F769;
  text-shadow: 0 0 8px rgba(156, 223, 0, 0.30);
}
[data-theme="dark"] .pct-legend-item-sky .pct-sub {
  color: #9DEBFF;
  text-shadow: 0 0 8px rgba(104, 216, 255, 0.22);
}
[data-theme="dark"] .pct-note {
  color: #9fb8b2;
}

@media (max-width: 480px) {
  .pct-single { flex-direction: column; gap: 12px; }
  .pct-ring { width: 132px; height: 132px; flex-basis: 132px; }
  .pct-legend { width: 100%; }
  .pct-sector-label { font-size: 12px; }
  .pct-sector-label-lime { left: 67%; top: 63%; }
  .pct-sector-label-sky { left: 33%; top: 36%; }
  .pct-note { font-size: 11px; }
}

.pub-overview {
  border-collapse: collapse;
  width: 100%;
  max-width: 720px;
}
.pub-overview td { padding: 7px 8px; vertical-align: middle; }
.pub-overview td.label { width: 30%; white-space: nowrap; }
.pub-overview .hl {
  background: var(--highlight);
  font-weight: 700;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 3px;
  display: inline-block;
}
.pub-overview .cnt { color: var(--accent-dark); font-weight: 700; }

/* -------- Publications List (Two-column: thumb + body) -------- */
.pub-list {
  padding-left: 1.6em;
  list-style: none;
  counter-reset: pub;
}
.pub-list > li {
  counter-increment: pub;
  position: relative;
  padding: 14px 0 14px 6px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
}
.pub-list > li:last-child { border-bottom: none; }
.pub-list > li::before {
  content: counter(pub) ".";
  position: absolute;
  left: -1.6em;
  top: 14px;
  font-weight: 700;
  color: var(--accent-dark);
}

.pub-thumb {
  width: 140px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--box-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.pub-thumb:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--glow-hover);
  border-color: var(--accent);
}
.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pub-thumb.is-wide {
  background: white;
}
.pub-thumb.is-wide img {
  object-fit: contain;
  padding: 4px;
}

/* Venue-card fallback (used when no thumbnail image exists) */
.venue-card {
  flex-direction: column;
  font-family: 'Lora', Georgia, serif;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: none;
}
.venue-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.venue-card .vc-line1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  position: relative;
}
.venue-card .vc-line2 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
  opacity: 0.92;
  position: relative;
}
.vc-cvpr    { background: linear-gradient(135deg, #4F8077 0%, #2D3E40 100%); }
.vc-iccv    { background: linear-gradient(135deg, #5b8d83 0%, #3a5751 100%); }
.vc-eccv    { background: linear-gradient(135deg, #6a9e93 0%, #4F8077 100%); }
.vc-neurips { background: linear-gradient(135deg, #4F8077 0%, #354c52 100%); }
.vc-icml    { background: linear-gradient(135deg, #76948c 0%, #4F8077 100%); }
.vc-iclr    { background: linear-gradient(135deg, #527e72 0%, #2D3E40 100%); }
.vc-icip    { background: linear-gradient(135deg, #8aada4 0%, #4F8077 100%); }
.vc-pending { background: linear-gradient(135deg, #b3c5bf 0%, #5f6e70 100%); }

.pub-body { min-width: 0; }
.pub-title { font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.pub-title-link { color: inherit; text-decoration: none; }
.pub-title-link:hover { text-decoration: underline; }
.pub-authors { font-size: 14px; color: var(--primary); margin-bottom: 2px; }
.pub-authors u { font-weight: 600; }
.pub-venue { font-size: 13.5px; color: var(--muted); font-style: italic; }
.pub-extra { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* -------- Reviewer / Lists -------- */
.subhead {
  font-size: 15px;
  margin: 18px 0 6px;
  color: var(--accent-dark);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plain-list { list-style: none; padding-left: 0; }
.plain-list li {
  padding: 4px 0 4px 18px;
  position: relative;
  font-size: 14.5px;
  color: var(--primary);
}
.plain-list li::before {
  content: "▸";
  color: var(--accent-dark);
  position: absolute;
  left: 0;
}
.plain-list.two-col { columns: 2; column-gap: 32px; }
.plain-list .years {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
  margin-left: 8px;
}

/* -------- Awards -------- */
.awards-list {
  list-style: none;
  padding-left: 0;
}
.awards-list li {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
  font-size: 14.5px;
}
.awards-list li:last-child { border-bottom: none; }
.award-text { flex: 1; color: var(--primary); }
.award-year {
  margin-left: 16px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}

/* -------- NVIDIA Stock Section -------- */
.nvda-stock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin-top: 8px;
}
.nvda-quote-panel,
.nvda-chart-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(168, 197, 191, 0.16), transparent 52%),
    var(--bg-soft);
  box-shadow: 0 3px 14px rgba(15, 20, 25, 0.06);
}
.nvda-quote-panel {
  padding: 12px;
}
.nvda-quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.nvda-quote-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.nvda-open-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(79, 128, 119, 0.30);
  background: rgba(255, 255, 255, 0.45);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.nvda-open-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 128, 119, 0.16);
  transform: translateY(-1px);
}
.nvda-quote-widget {
  min-height: 112px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(79, 128, 119, 0.24);
  background: rgba(255, 255, 255, 0.52);
  padding: 4px 8px;
}
.nvda-quote-widget .tradingview-widget-container,
.nvda-quote-widget .tradingview-widget-container__widget {
  width: 100%;
  min-height: 102px;
}
.nvda-chart-panel {
  padding: 10px;
}
.nvda-chart-widget {
  height: 560px;
  min-height: 560px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(79, 128, 119, 0.24);
  background: rgba(255, 255, 255, 0.52);
}
.nvda-chart-widget .tradingview-widget-container,
.nvda-chart-widget .tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
  min-height: 560px;
}
[data-theme="dark"] .nvda-quote-panel,
[data-theme="dark"] .nvda-chart-panel {
  border-color: rgba(79, 184, 166, 0.24);
  background:
    linear-gradient(155deg, rgba(17, 40, 35, 0.76), rgba(10, 16, 18, 0.86)),
    rgba(11, 15, 17, 0.86);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(79, 184, 166, 0.12);
}
[data-theme="dark"] .nvda-quote-title {
  color: #8DE4D4;
  text-shadow: 0 0 8px rgba(79, 184, 166, 0.25);
}
[data-theme="dark"] .nvda-open-link {
  border-color: rgba(79, 184, 166, 0.34);
  background: rgba(15, 21, 23, 0.72);
  color: #8DE4D4;
}
[data-theme="dark"] .nvda-open-link:hover {
  border-color: rgba(123, 212, 196, 0.58);
  box-shadow: 0 0 0 1px rgba(123, 212, 196, 0.24), 0 0 10px rgba(79, 184, 166, 0.16);
}
[data-theme="dark"] .nvda-quote-widget,
[data-theme="dark"] .nvda-chart-widget {
  background: rgba(7, 10, 12, 0.78);
  border-color: rgba(79, 184, 166, 0.28);
}

/* -------- Footer -------- */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* -------- Responsive -------- */
@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: 200px auto;
    gap: 24px;
    justify-content: center;
  }
  .application-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nvda-stock-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .nav-inner { padding: 10px 12px; gap: 6px; }
  .nav-head {
    width: 100%;
    justify-content: space-between;
  }
  .nav-brand { font-size: 15px; }
  .nav-links-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    justify-content: flex-start;
    gap: 0 14px;
    padding: 2px 0 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: 0 0 auto; }
  .nav-links a { padding: 4px 0; }
  .nav-links a { scroll-snap-align: start; }
  .hero { padding: 30px 14px 22px; }
  .content { padding: 0 14px 40px; }
  .hero-quote-section { max-width: 500px; padding: 8px 0 12px; }
  .hero-quote-text { font-size: 17px; padding: 9px 11px; }
  .hero-quote-author { font-size: inherit; margin-left: 6px; }
  .hero-grid { grid-template-columns: 1fr; gap: 18px; justify-items: center; }
  .hero-photo { width: 150px; height: 150px; justify-self: center; margin: 0 auto; }
  .hero-text { text-align: center; margin-left: 0; width: 100%; max-width: 100%; }
  .application-grid { grid-template-columns: 1fr; }
  .application-card { padding: 10px; }
  .resume-open-btn { min-height: 44px; font-size: 13px; }
  .nvda-stock-grid { grid-template-columns: 1fr; gap: 12px; }
  .nvda-quote-panel { padding: 10px; }
  .nvda-quote-title { font-size: 11px; }
  .nvda-open-link { font-size: 11px; padding: 3px 8px; }
  .nvda-quote-widget { min-height: 100px; padding: 4px 6px; }
  .nvda-quote-widget .tradingview-widget-container,
  .nvda-quote-widget .tradingview-widget-container__widget { min-height: 90px; }
  .nvda-chart-panel { padding: 8px; }
  .nvda-chart-widget,
  .nvda-chart-widget .tradingview-widget-container,
  .nvda-chart-widget .tradingview-widget-container__widget { min-height: 360px; height: 360px; }
  .name { font-size: 32px; line-height: 1.12; }
  .subtitle { font-size: 14px; margin-bottom: 10px; }
  .role-row { justify-content: center; gap: 8px; margin-bottom: 10px; }
  .nav-links { font-size: 12.5px; }
  .role-header .period { margin-left: 0; width: 100%; }
  .edu-head .period { margin-left: 0; width: 100%; }
  .plain-list.two-col { columns: 1; }
  .awards-list li { flex-direction: column; gap: 2px; }
  .award-year { margin-left: 0; }
  .role-pill { font-size: 12.5px; padding: 6px 12px; min-height: 36px; }
  .role-pill .nvidia-logo { height: 14px; }
  .cv-btn { gap: 8px; padding: 6px 12px 6px 7px; }
  .cv-btn-icon { width: 24px; height: 24px; font-size: 12px; }
  .cv-btn-title { font-size: 12px; }
  .cv-btn-arrow { display: none; }
  .contact-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 10px;
    font-size: 13px;
    line-height: 1.45;
  }
  .contact-row a { margin: 0; white-space: nowrap; }
  .contact-row .dot { display: none; }

  .pub-list > li {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pub-thumb {
    width: 100%;
    height: 160px;
  }
  .pub-list > li::before { top: 14px; left: -1.4em; }
}

@media (max-width: 760px) and (hover: none) and (pointer: coarse) {
  .nav-slide-hint {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 1px;
  }
}

/* On mobile, force content visible even if reveal observer lags/fails. */
@media (max-width: 760px) {
  html.js-reveal main > section,
  html.js-reveal main > section .section-title,
  html.js-reveal .pub-rings,
  html.js-reveal .pct-ring,
  html.js-reveal .pct-legend-item,
  html.js-reveal main > section .project-list > li,
  html.js-reveal main > section .research-list > li,
  html.js-reveal main > section .awards-list > li,
  html.js-reveal main > section .plain-list > li,
  html.js-reveal .pub-list > li,
  html.js-reveal .pub-list > li:nth-child(odd),
  html.js-reveal .pub-list > li:nth-child(even),
  html.js-reveal .pub-list > li .pub-thumb img {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .role-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .role-pill,
  .cv-btn {
    width: min(100%, 286px);
    justify-content: center;
  }
  .hero-text .contact-row:nth-of-type(2) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-content: center;
    column-gap: 14px;
    row-gap: 6px;
  }
  .hero-quote-section { max-width: 100%; }
  .hero-quote-text { font-size: 16px; }
  .hero-quote-author { font-size: inherit; }
}

@media (max-width: 1280px) {
  .circuit-bg { display: none; }
}

@media (max-width: 600px) {
  .pub-overview,
  .pub-overview tbody,
  .pub-overview tr,
  .pub-overview td {
    display: block;
    width: 100%;
  }
  .pub-overview tr {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }
  .pub-overview tr:last-child {
    border-bottom: none;
  }
  .pub-overview td {
    padding: 2px 0;
  }
  .pub-overview td.label {
    width: auto;
    white-space: normal;
    padding-bottom: 4px;
  }
}

/* =========================================================
   Dynamic scrolling: hero stagger, scroll-reveal, progress bar
   ========================================================= */

/* Hero stage entrance (auto-plays on page load) */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.hero .hero-photo,
.hero .name,
.hero .subtitle,
.hero .role-row,
.hero .contact-row {
  opacity: 0;
  animation: heroFadeUp 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero .hero-photo                  { animation-name: heroFadeIn; animation-delay: 0.05s; }
.hero .name                        { animation-delay: 0.20s; }
.hero .subtitle                    { animation-delay: 0.40s; }
.hero .role-row                    { animation-delay: 0.55s; }
.hero .contact-row:nth-of-type(1)  { animation-delay: 0.75s; }
.hero .contact-row:nth-of-type(2)  { animation-delay: 0.90s; }

/* Scroll-reveal sections (only active when JS is available) */
html.js-reveal main > section,
html.js-reveal main > section .section-title {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-reveal main > section.is-visible,
html.js-reveal main > section.is-visible .section-title {
  opacity: 1;
  transform: none;
}
html.js-reveal main > section .section-title { transition-delay: 0.10s; }

/* Section title underline draws in from left to right */
html.js-reveal main > section .section-title {
  position: relative;
  border-bottom-color: transparent !important;
}
html.js-reveal main > section .section-title::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
html.js-reveal main > section.is-visible .section-title::before {
  transform: scaleX(1);
}
[data-theme="dark"] html.js-reveal main > section .section-title::before {
  box-shadow: 0 0 6px rgba(79, 184, 166, 0.5);
}

/* Letter-by-letter cascade for section titles */
html.js-reveal main > section .section-title .section-title-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}
html.js-reveal main > section .section-title .section-title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) scale(0.85);
  filter: blur(6px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.45s ease;
  transition-delay: 0s;
  will-change: transform, opacity, filter;
}
html.js-reveal main > section.is-visible .section-title .section-title-char {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition-delay: calc(0.20s + var(--char-i, 0) * 0.022s);
}
html.js-reveal main > section .section-title .section-title-space {
  transform: none;
  filter: none;
  opacity: 1;
}

/* Activity rings scroll-reveal: card scales in, rings fill in sequence */
html.js-reveal .pub-rings {
  opacity: 0;
  transform: scale(0.92);
  transform-origin: center;
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.20s,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.20s;
}
html.js-reveal main > section.is-visible .pub-rings {
  opacity: 1;
  transform: scale(1);
}

html.js-reveal .pct-ring,
html.js-reveal .pct-legend-item {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-reveal main > section.is-visible .pct-ring,
html.js-reveal main > section.is-visible .pct-legend-item {
  opacity: 1;
  transform: none;
}
html.js-reveal main > section.is-visible .pct-ring { transition-delay: 0.90s; }
html.js-reveal main > section.is-visible .pct-legend-item:nth-child(1) { transition-delay: 1.02s; }
html.js-reveal main > section.is-visible .pct-legend-item:nth-child(2) { transition-delay: 1.14s; }

/* Stagger items inside a section that just became visible */
html.js-reveal main > section .project-list > li,
html.js-reveal main > section .research-list > li,
html.js-reveal main > section .awards-list > li,
html.js-reveal main > section .plain-list > li {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.js-reveal main > section.is-visible .project-list > li,
html.js-reveal main > section.is-visible .research-list > li,
html.js-reveal main > section.is-visible .awards-list > li,
html.js-reveal main > section.is-visible .plain-list > li {
  opacity: 1;
  transform: none;
}
html.js-reveal main > section.is-visible .project-list > li:nth-child(1),
html.js-reveal main > section.is-visible .research-list > li:nth-child(1),
html.js-reveal main > section.is-visible .awards-list > li:nth-child(1),
html.js-reveal main > section.is-visible .plain-list > li:nth-child(1) { transition-delay: 0.10s; }
html.js-reveal main > section.is-visible .project-list > li:nth-child(2),
html.js-reveal main > section.is-visible .research-list > li:nth-child(2),
html.js-reveal main > section.is-visible .awards-list > li:nth-child(2),
html.js-reveal main > section.is-visible .plain-list > li:nth-child(2) { transition-delay: 0.18s; }
html.js-reveal main > section.is-visible .project-list > li:nth-child(3),
html.js-reveal main > section.is-visible .research-list > li:nth-child(3),
html.js-reveal main > section.is-visible .awards-list > li:nth-child(3),
html.js-reveal main > section.is-visible .plain-list > li:nth-child(3) { transition-delay: 0.26s; }
html.js-reveal main > section.is-visible .project-list > li:nth-child(4),
html.js-reveal main > section.is-visible .research-list > li:nth-child(4),
html.js-reveal main > section.is-visible .awards-list > li:nth-child(4),
html.js-reveal main > section.is-visible .plain-list > li:nth-child(4) { transition-delay: 0.34s; }
html.js-reveal main > section.is-visible .project-list > li:nth-child(n+5),
html.js-reveal main > section.is-visible .research-list > li:nth-child(n+5),
html.js-reveal main > section.is-visible .awards-list > li:nth-child(n+5),
html.js-reveal main > section.is-visible .plain-list > li:nth-child(n+5) { transition-delay: 0.40s; }

/* Publications get an individual scroll-reveal per <li>
   with alternating slide direction + 3D tilt for a cinematic feel */
html.js-reveal .pub-list {
  perspective: 1200px;
  perspective-origin: 50% 30%;
}
html.js-reveal .pub-list > li {
  opacity: 0;
  transform-style: preserve-3d;
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-reveal .pub-list > li:nth-child(odd) {
  transform: translate3d(-32px, 32px, 0) rotateX(-8deg) rotateY(4deg);
}
html.js-reveal .pub-list > li:nth-child(even) {
  transform: translate3d(32px, 32px, 0) rotateX(-8deg) rotateY(-4deg);
}
html.js-reveal .pub-list > li.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotateX(0) rotateY(0);
}

html.js-reveal .pub-list > li .pub-thumb img {
  transform: scale(0.92);
  filter: blur(4px);
  opacity: 0.7;
  transition:
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.1s,
    filter   0.7s ease 0.1s,
    opacity  0.7s ease 0.1s;
}
html.js-reveal .pub-list > li.is-visible .pub-thumb img {
  transform: scale(1);
  filter: blur(0);
  opacity: 1;
}

/* Top scroll-progress bar - shimmering gradient with comet leading edge */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  width: 0%;
  z-index: 200;
  pointer-events: none;
  overflow: hidden;
  transition: width 90ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
  /* Vivid, saturated palette that pops on both white and near-black backgrounds */
  background: linear-gradient(
    90deg,
    #2D7A65 0%,
    #76B900 22%,
    #B8E000 50%,
    #76B900 78%,
    #2D7A65 100%
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  animation: progressShimmer 4.5s linear infinite;
  filter:
    drop-shadow(0 1px 1px rgba(45, 122, 101, 0.55))
    drop-shadow(0 0 6px rgba(118, 185, 0, 0.50))
    drop-shadow(0 0 14px rgba(118, 185, 0, 0.25));
  border-bottom-right-radius: 3px;
}
/* Comet / leading-edge highlight that always sits at the progress tip */
.scroll-progress::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 130px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0)    0%,
    rgba(255, 255, 255, 0.40) 55%,
    rgba(255, 255, 255, 0.90) 92%,
    rgba(255, 255, 255, 1)   100%
  );
  mix-blend-mode: screen;
  pointer-events: none;
}
@keyframes progressShimmer {
  0%   { background-position:    0% 50%; }
  100% { background-position: -220% 50%; }
}

[data-theme="dark"] .scroll-progress {
  filter:
    drop-shadow(0 0 6px rgba(156, 223, 0, 0.75))
    drop-shadow(0 0 16px rgba(79, 184, 166, 0.45));
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .circuit-bg .signal,
  .circuit-bg .node {
    animation: none;
  }
  .hero .hero-photo,
  .hero .name,
  .hero .subtitle,
  .hero .role-row,
  .hero .contact-row { animation: none; opacity: 1; }

  html.js-reveal main > section,
  html.js-reveal main > section .section-title,
  html.js-reveal main > section .section-title .section-title-char,
  html.js-reveal main > section .project-list > li,
  html.js-reveal main > section .research-list > li,
  html.js-reveal main > section .awards-list > li,
  html.js-reveal main > section .plain-list > li,
  html.js-reveal .pub-list > li,
  html.js-reveal .pub-list > li:nth-child(odd),
  html.js-reveal .pub-list > li:nth-child(even),
  html.js-reveal .pub-list > li .pub-thumb img,
  html.js-reveal .pub-rings,
  html.js-reveal .pct-ring,
  html.js-reveal .pct-legend-item {
    opacity: 1; transform: none; filter: none;
    transition: none;
  }
  html.js-reveal main > section .section-title::before {
    transform: scaleX(1); transition: none;
  }

  [data-theme="dark"] .hero::before { transform: none; }
  .scroll-progress { display: none; }
}
