:root {
  --bg: #e8edf2;
  --surface: rgba(243, 248, 252, 0.85);
  --surface-strong: #fdfefe;
  --text: #101b2d;
  --muted: #42566f;
  --accent: #0a6aa1;
  --accent-soft: #b8e1f5;
  --border: rgba(16, 27, 45, 0.12);
  --shadow: 0 20px 60px rgba(13, 33, 56, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(10, 106, 161, 0.22), transparent 35%),
    radial-gradient(circle at bottom right, rgba(184, 225, 245, 0.5), transparent 38%),
    linear-gradient(180deg, #eef4fa 0%, var(--bg) 100%);
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  padding: 3rem;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.eyebrow,
.section-label {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--muted);
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.meta-row p {
  margin: 0;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}

h1,
h2,
p,
ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 5.6vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

h1 span,
h2 {
  color: var(--accent);
}

h1 em {
  font-family: "IBM Plex Serif", serif;
  font-style: italic;
  font-weight: 600;
}

.hero-role {
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  margin: -0.2rem 0 1rem;
  color: var(--muted);
}

.intro {
  max-width: 46rem;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.run-strip {
  position: relative;
  overflow: hidden;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(11, 50, 80, 0.95), rgba(10, 106, 161, 0.92));
}

.run-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-width: max-content;
  animation: run-items 24s linear infinite;
  padding: 0.75rem 0;
}

.run-track span {
  color: #eaf7ff;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 0 1.4rem;
  border-right: 1px solid rgba(255, 255, 255, 0.26);
}

.image-lab {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.image-card {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.image-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.image-card figcaption {
  padding: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.animated-card {
  display: grid;
  grid-template-rows: 220px auto;
}

.photo-reel {
  position: relative;
  overflow: hidden;
  height: 220px;
  background: #0b2d45;
}

.photo-reel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: fade-cycle 20s infinite;
}

/* animation-delay and @keyframes fade-cycle are injected dynamically by JS from manifest.json */

.card-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0 0;
}

.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 44px;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 106, 161, 0.34);
  color: #063d5c;
  font-weight: 500;
  text-decoration: none;
  background: rgba(232, 246, 255, 0.9);
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.actions a svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.actions a:hover {
  transform: translateY(-2px);
  background: #cce8fa;
  box-shadow: 0 4px 14px rgba(10, 106, 161, 0.18);
}

.pub-if {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #065885;
  background: rgba(184, 225, 245, 0.5);
  border: 1px solid rgba(10, 106, 161, 0.2);
  border-radius: 6px;
  padding: 0.1rem 0.38rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 760px;
  gap: 1rem;
  margin-top: 1.25rem;
}

.card-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.card {
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.card h2 {
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.card p,
.card li {
  line-height: 1.7;
  color: var(--muted);
}

.card ul {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.link-row a {
  text-decoration: none;
  color: var(--accent);
  border: 1px solid rgba(10, 106, 161, 0.2);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 500;
  background: rgba(232, 246, 255, 0.7);
}

.stack-card {
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stack-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(184, 225, 245, 0.2), transparent 42%);
  pointer-events: none;
}

.skill-bars {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.skill-bars li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  background: rgba(239, 249, 255, 0.9);
  border: 1px solid rgba(10, 106, 161, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.skill-bars span {
  font-weight: 500;
}

.skill-bars strong {
  color: #064c75;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pub-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.pub-section-head h2 {
  margin-bottom: 0;
}

.scholar-inline {
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #065885;
  border: 1px solid rgba(10, 106, 161, 0.3);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  background: rgba(232, 246, 255, 0.85);
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.pub-list {
  list-style: decimal;
  padding-left: 1.3rem;
  margin: 0 0 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.pub-cite {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--muted);
}

.pub-cite em {
  color: var(--text);
  font-style: italic;
}

.more-link {
  display: inline-block;
  margin-top: 0.3rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
}

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

.gh-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  margin-right: 0.35em;
  fill: var(--muted);
}

.gh-tagline {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.2rem 0 0.6rem;
  line-height: 1.5;
}

.gh-repo-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.gh-repo-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(10,106,161,0.25);
}

.gh-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.gh-repo-list a {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.gh-repo-list a:hover {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.card-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0.3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(10,106,161,0.25) transparent;
}

.projects-card {
  background: linear-gradient(130deg, #edf8ff 0%, #f4fbff 100%);
}

.project-list {
  padding-left: 1.1rem;
  margin: 0 0 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.project-list li {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--muted);
}

.accent-card {
  background: linear-gradient(135deg, #ebf7ff 0%, #d9f2ff 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@keyframes run-items {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1rem, 1100px);
    padding-top: 1rem;
  }

  .meta-row,
  .image-lab {
    grid-template-columns: 1fr;
  }

  .hero,
  .card {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-col {
    gap: 1rem;
  }

  .pub-section-head {
    flex-direction: column;
  }

  h1 {
    line-height: 1.02;
  }
}