:root {
  --bg: #f5f7fd;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --accent: #2c6bed;
  --accent-soft: rgba(44, 107, 237, 0.08);
  --accent-strong: #ff9f2f;
  --text: #111827;
  --text-soft: #6b7394;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --nav-height: 72px;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #ffffff 0, #f5f7fd 50%, #e4e8f5 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

main {
  padding-top: var(--nav-height);
}

.container {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(245, 247, 253, 0.96),
    rgba(245, 247, 253, 0.9),
    rgba(245, 247, 253, 0.6)
  );
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: radial-gradient(circle at 10% 0, #2c6bed, #7b5cff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 28px rgba(44, 107, 237, 0.35);
  color: #f9fafb;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

.brand-role {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.nav {
  display: flex;
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.nav a {
  position: relative;
  color: var(--text-soft);
  padding-block: 0.25rem;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2c6bed, #ff9f2f);
  transition: width 0.2s ease-out;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.is-active::after {
  width: 100%;
}

.nav a.is-active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.nav-toggle span + span {
  margin-top: 5px;
}

.hero {
  padding: 4.5rem 0 4rem;
}

.about-hero {
  padding-bottom: 3.25rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 2rem;
  align-items: flex-start;
}

.hero-kicker {
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(2.4rem, 3vw + 1.2rem, 3.4rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.hero-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.about-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.about-quote-mark {
  font-size: 2.4rem;
  line-height: 1;
  color: #e38a1b;
  transform: translateY(-4px);
}

.about-hero h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 2.3rem;
  color: #164225;
}

.about-card {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-md);
  background: #f8f3e9;
  border: 1px solid rgba(148, 163, 184, 0.65);
  box-shadow: 0 8px 26px rgba(148, 163, 184, 0.3);
  margin-bottom: 1.6rem;
}

.about-card p {
  margin: 0 0 0.8rem;
  color: #374151;
  line-height: 1.7;
  font-size: 0.97rem;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-education-heading {
  margin: 1.2rem 0 0.6rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.about-card .timeline {
  margin: 0;
  padding-left: 0;
}

.about-card .timeline h3 {
  font-size: 0.93rem;
}

.about-card .timeline .timeline-meta {
  font-size: 0.84rem;
}

/* ── Education full-width row ── */
.education-row-container {
  margin-top: 2rem;
  padding-bottom: 3.5rem;
}




.inline-link {
  color: #d97706;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: #b45309;
}

/* ── Open to Work banner ── */
.open-to-work-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(44, 107, 237, 0.06), rgba(44, 107, 237, 0.14));
  border: 1.5px solid rgba(44, 107, 237, 0.4);
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 8px rgba(44, 107, 237, 0.1);
}

.otw-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  margin-top: 1px;
}

.otw-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.otw-heading {
  font-weight: 700;
  font-size: 0.97rem;
  color: #1e40af;
  letter-spacing: 0.01em;
}

.otw-roles {
  font-size: 0.85rem;
  color: #1d4ed8;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease-out, transform 0.18s ease-out,
    box-shadow 0.18s ease-out, border-color 0.18s ease-out;
}

.btn.primary {
  background: linear-gradient(135deg, #2c6bed, #7b5cff);
  color: #f9fafb;
  box-shadow: 0 15px 40px rgba(44, 107, 237, 0.35);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(44, 107, 237, 0.5);
}

.btn.ghost {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.btn.ghost:hover {
  background: #e5edff;
}

.hero-meta {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin: 0;
}

.hero-meta div dt {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.hero-meta div dd {
  margin: 0;
  font-size: 0.95rem;
}

.hero-media {
  display: flex;
  justify-content: flex-start;
  order: -1;
}

.portrait-stack {
  position: relative;
  width: min(420px, 100%);
  margin-top: 4.7rem;
}

.portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.portrait-color {
  z-index: 1;
  transform: translate(22px, -22px);
}

.portrait-bw {
  z-index: 2;
  transform: translate(-18px, 18px);
  border: 2px solid rgba(15, 23, 42, 0.12);
}

.hero-socials {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-social-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text-soft);
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-social-link svg {
  width: 22px;
  height: 22px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hero-social-label {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.hero-social-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-social-link:hover svg {
  background: var(--accent-soft);
  box-shadow: 0 6px 20px rgba(44, 107, 237, 0.2);
}

.section {
  padding: 3.25rem 0;
}

.section-alt {
  background: radial-gradient(circle at top left, #ffffff 0, #eef2ff 55%);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.section-heading h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}

.section-heading p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.section-content p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.about-highlight {
  margin-top: 1.25rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.09);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: baseline;
}

.about-label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.about-value {
  font-size: 0.96rem;
}

.section-header {
  text-align: left;
  margin-bottom: 1.8rem;
}

.section-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
}

.section-header p {
  margin: 0;
  color: var(--text-soft);
}

.cards-grid {
  display: grid;
  gap: 1.4rem;
}

.cards-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

.cards-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.card p {
  margin-top: 0;
  margin-bottom: 0.7rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.card ul li + li {
  margin-top: 0.2rem;
}

.icon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.icon-bullet {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
  margin-top: 1px;
}

.icon-bullet svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(44, 107, 237, 0.09),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.project-card:hover::before {
  opacity: 1;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(44, 107, 237, 0.4);
}

.project-link {
  display: inline-flex;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
}

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

.project-note {
  font-size: 0.86rem;
  font-style: italic;
}

/* Project cards – mirrors pub-card layout */
.proj-list {
  display: grid;
  gap: 1.4rem;
}

.proj-card {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  flex-wrap: wrap;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.proj-thumb-group {
  display: flex;
  gap: 0.6rem;
  flex: 0 0 45%;
  min-width: 280px;
}

.proj-thumb-group.single {
  flex: 0 0 45%;
  max-width: 520px;
}

.proj-thumb-group.single .proj-thumb {
  flex: 1 1 100%;
  max-width: none;
}

.proj-card:hover {
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.proj-thumb {
  flex: 0 0 45%;
  min-height: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  display: block;
  text-decoration: none;
  max-width: 520px;
}

.proj-thumb.thumb-rotate {
  position: relative;
  min-height: 240px;
  aspect-ratio: 4 / 3;
  flex: 1 1 100%;
  width: 100%;
}

.proj-thumb.thumb-rotate img {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: thumbSwap 8s infinite ease-in-out;
}

.proj-thumb.thumb-rotate img:first-child {
  opacity: 1;
  animation-delay: 0s;
}

.proj-thumb.thumb-rotate img:nth-child(2) {
  animation-delay: 4s;
}

@keyframes thumbSwap {
  0%,
  45% {
    opacity: 1;
  }
  55%,
  100% {
    opacity: 0;
  }
}

.proj-thumb.proj-thumb-secondary {
  flex: 1 1 45%;
}

.proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
  transform: scale(0.94);
}

.proj-thumb.proj-thumb-secondary img {
  object-position: center;
}

.proj-card:hover .proj-thumb img {
  transform: scale(1.03);
}

.proj-body {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.proj-body .proj-title {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.proj-body .proj-desc {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.proj-highlights {
  margin: 0 0 0.3rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.proj-highlights li + li {
  margin-top: 0.15rem;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.6rem;
}

.proj-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(44, 107, 237, 0.18);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.proj-note {
  margin: 0;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-soft);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px dashed rgba(15, 23, 42, 0.25);
}

.timeline li {
  position: relative;
  padding-left: 1.6rem;
  padding-bottom: 1.2rem;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 0.15rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2c6bed, #ff9f2f);
  box-shadow: 0 0 0 4px rgba(44, 107, 237, 0.2);
}

.timeline-content h3 {
  margin: 0;
  font-size: 1rem;
}

.timeline-meta {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.4rem;
}

.pub-card {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  flex-wrap: wrap;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pub-card:hover {
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.pub-thumb {
  flex: 0 0 45%;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.pub-thumb img {
  width: 112%;
  height: 100%;
  margin-left: -1%;
  margin-right: -13%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.3s ease;
}

.pub-card:hover .pub-thumb img {
  transform: scale(1.05);
}

.pub-body {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pub-body .pub-title {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.pub-body .pub-authors {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.pub-body .author-highlight {
  color: #d97706;
  font-weight: 600;
}

.pub-body .pub-venue {
  display: inline-block;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.contact-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

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

.contact-cards .card {
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.contact-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-icon svg {
  width: 16px;
  height: 16px;
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.contact-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.contact-link {
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-word;
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-item {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cert-asset {
  flex-shrink: 0;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cert-asset:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
  transform: translateY(-3px);
}

.cert-asset:hover img {
  transform: scale(1.15);
}

.cert-asset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cert-asset-pdf {
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.cert-asset-pdf-icon {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #dc2626;
}

.cert-asset-caption {
  font-size: 0.6rem;
  color: var(--text-soft);
  text-align: center;
  padding: 0 0.25rem;
  line-height: 1.2;
  display: none;
}

.cert-main {
  flex: 1 1 280px;
}

.cert-main h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.cert-meta {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.cert-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--accent);
}

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

.cert-file {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(44, 107, 237, 0.35);
  text-decoration: none;
}

.cert-file:hover {
  background: rgba(44, 107, 237, 0.15);
}

.tech-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
}

.tech-list-inline {
  margin-top: 0.65rem;
}

.tech-item {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem 0.25rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.8rem;
  gap: 0.3rem;
}

.tech-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 600;
  color: #ffffff;
}

.tech-label {
  white-space: nowrap;
}

.tech-icon-python {
  background: #3776ab;
}

.tech-icon-sql {
  background: #2563eb;
}

.tech-icon-matlab {
  background: #e76f00;
}

.tech-icon-pytorch {
  background: #ee4c2c;
}

.tech-icon-tensorflow {
  background: #ff6f00;
}

.tech-icon-keras {
  background: #d00000;
}

.tech-icon-gcp {
  background: #4285f4;
}

.tech-icon-aws {
  background: #ff9900;
}

.tech-icon-hf {
  background: #ffcc4d;
  color: #111827;
}

.tech-icon-docker {
  background: #0db7ed;
}

.tech-icon-fastapi {
  background: #059669;
}

.tech-icon-streamlit {
  background: #ef4444;
}

.tech-icon-gradio {
  background: #6366f1;
}

.mt-lg {
  margin-top: 1.75rem;
}

.site-footer {
  padding: 2rem 0 2.4rem;
  background: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.footer-note {
  opacity: 0.85;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
    gap: 1.6rem;
  }

  .portrait-bw {
    inset: 16px -16px auto auto;
  }

  .section-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
  }

  .cards-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pub-thumb,
  .proj-thumb {
    flex: 0 0 40%;
    height: 180px;
    min-height: auto;
  }

  .cert-asset {
    width: 140px;
    height: 105px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset-inline: 0;
    top: var(--nav-height);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out,
      visibility 0.2s ease-out;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav ul {
    flex-direction: column;
    padding: 0.7rem 1.5rem 1.1rem;
  }

  .nav li {
    padding-block: 0.35rem;
  }

  .hero {
    padding-top: 3.4rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Profile image first, then about text */
  .hero-media {
    order: -1;
    justify-content: center;
  }

  .portrait-stack {
    margin-inline: auto;
    margin-top: 0;
    max-width: 280px;
  }

  .portrait-color {
    transform: translate(16px, -16px);
  }

  .portrait-bw {
    transform: translate(-14px, 14px);
  }

  .hero-socials {
    gap: 0.75rem;
    margin-top: 2.5rem;
  }

  .hero-meta {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
  }

  .section-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }

  .pub-thumb,
  .proj-thumb {
    flex: 0 0 100%;
    height: auto;
    min-height: 200px;
    max-height: 300px;
  }

  .proj-thumb {
    max-width: none;
    aspect-ratio: 4 / 3;
  }

  .proj-thumb-group {
    flex: 0 0 100%;
    min-width: auto;
  }

  .proj-thumb-group.single {
    flex: 0 0 100%;
    max-width: none;
  }

  .proj-thumb-group.single .proj-thumb {
    flex: 1 1 100%;
    max-width: none;
  }

  .pub-body,
  .proj-body {
    flex-basis: 100%;
  }

  /* Keep cert items horizontal but compact */
  .cert-item {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .cert-asset {
    width: 110px;
    height: 80px;
  }

  .cert-main {
    flex: 1 1 0;
  }

  .cert-main h3 {
    font-size: 0.9rem;
  }

  .cert-meta {
    font-size: 0.8rem;
  }

  .cert-link {
    font-size: 0.78rem;
  }

  .section {
    padding-block: 2.5rem;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .section-heading h2 {
    font-size: 1.5rem;
  }

  .about-hero h1 {
    font-size: 1.9rem;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 1.5rem, 100%);
  }

  /* Keep both portraits visible and overlapping */
  .portrait-stack {
    max-width: 240px;
  }

  .portrait-color {
    transform: translate(14px, -14px);
  }

  .portrait-bw {
    transform: translate(-12px, 12px);
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .about-hero h1 {
    font-size: 1.7rem;
  }

  .about-card {
    padding: 0.9rem 1rem;
  }

  .about-card p {
    font-size: 0.9rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-socials {
    gap: 0.6rem;
    margin-top: 2.2rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-social-link svg {
    width: 18px;
    height: 18px;
    padding: 7px;
  }

  .hero-social-label {
    font-size: 0.65rem;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .section-heading h2 {
    font-size: 1.35rem;
  }

  .card {
    padding: 1rem 1rem;
  }

  .pub-thumb,
  .proj-thumb {
    min-height: 140px;
    max-height: 190px;
  }

  .pub-body .pub-title,
  .proj-body .proj-title {
    font-size: 0.95rem;
  }

  .pub-body .pub-authors {
    font-size: 0.82rem;
  }

  .proj-highlights {
    font-size: 0.8rem;
    padding-left: 0.9rem;
  }

  /* Cert items: horizontal and compact */
  .cert-item {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }

  .cert-asset {
    width: 90px;
    height: 65px;
  }

  .cert-main {
    flex: 1 1 0;
  }

  .cert-main h3 {
    font-size: 0.85rem;
  }

  .cert-meta {
    font-size: 0.76rem;
  }

  .cert-link {
    font-size: 0.74rem;
    margin-top: 0.25rem;
  }

  .badge {
    font-size: 0.62rem;
    padding: 0.12rem 0.5rem;
  }

  .timeline-content h3 {
    font-size: 0.92rem;
  }

  .timeline-meta {
    font-size: 0.82rem;
  }

  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .contact-cards .card {
    position: relative;
    padding: 0.7rem 0.75rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
  }

  .contact-link {
    font-size: 0;
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .contact-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
  }

  .site-footer {
    padding-block: 1.6rem 2.1rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
  }

  .copy-toast {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
    bottom: 1.2rem;
  }
}

@media (max-width: 380px) {
  .container {
    width: min(100% - 1rem, 100%);
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-role {
    font-size: 0.7rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  /* Keep both portraits overlapping on small phones */
  .portrait-stack {
    max-width: 210px;
  }

  .portrait-color {
    transform: translate(10px, -10px);
  }

  .portrait-bw {
    transform: translate(-10px, 10px);
  }

  .hero-socials {
    gap: 0.45rem;
    margin-top: 2rem;
  }

  .hero-social-link svg {
    width: 16px;
    height: 16px;
    padding: 6px;
    border-radius: 8px;
  }

  .hero-social-label {
    font-size: 0.6rem;
  }

  .about-hero h1 {
    font-size: 1.5rem;
  }

  .about-quote-mark {
    font-size: 1.8rem;
  }

  .about-card p {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .btn {
    font-size: 0.84rem;
    padding: 0.5rem 1.1rem;
  }

  .card h3 {
    font-size: 0.95rem;
  }

  .card p {
    font-size: 0.84rem;
  }

  .icon-list {
    font-size: 0.82rem;
  }

  .icon-bullet {
    width: 17px;
    height: 17px;
  }

  .tech-item {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem 0.2rem 0.3rem;
  }

  .tech-icon {
    width: 17px;
    height: 17px;
    font-size: 0.58rem;
  }

  .pub-thumb,
  .proj-thumb {
    min-height: 120px;
    max-height: 170px;
  }

  .pub-body .pub-title,
  .proj-body .proj-title {
    font-size: 0.88rem;
  }

  .cert-asset {
    width: 75px;
    height: 55px;
  }

  .cert-main h3 {
    font-size: 0.82rem;
  }

  .cert-meta {
    font-size: 0.72rem;
  }

  .cert-link {
    font-size: 0.7rem;
  }

  .section {
    padding-block: 2rem;
  }

  .section-header {
    margin-bottom: 1.3rem;
  }

  .section-header h2 {
    font-size: 1.25rem;
  }

  .section-heading h2 {
    font-size: 1.2rem;
  }

  .contact-cards {
    gap: 0.5rem;
  }

  .contact-cards .card {
    padding: 0.6rem 0.5rem;
    gap: 0.3rem;
  }

  .contact-icon {
    width: 24px;
    height: 24px;
  }

  .contact-icon svg {
    width: 14px;
    height: 14px;
  }

  .contact-label {
    font-size: 0.62rem;
  }
}

/* Button reset for hero-social-link when used as a button */
button.hero-social-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* Toast notification */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, 0.5);
  color: #fff;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

