:root {
  color-scheme: dark;
  --bg-deep: #050917;
  --bg-card: rgba(8, 12, 25, 0.72);
  --bg-card-solid: #0c1124;
  --bg-panel: rgba(255, 255, 255, 0.04);
  --brand-blue: #4f9bff;
  --brand-cyan: #5cf4ff;
  --brand-orange: #ffb347;
  --brand-purple: #a289ff;
  --text-strong: #f8fbff;
  --text-muted: #94a3b8;
  --grid-line: rgba(255, 255, 255, 0.08);
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-hero: 0 25px 80px rgba(15, 23, 42, 0.45);
  --shadow-card: 0 20px 60px rgba(3, 7, 18, 0.45);
  --gradient-brand: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  --gradient-hero: radial-gradient(circle at top, rgba(79, 155, 255, 0.4), transparent 55%),
    radial-gradient(circle at 20% 20%, rgba(92, 244, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(162, 137, 255, 0.4), transparent 45%);
}

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

body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

body {
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(15, 118, 255, 0.18), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(92, 244, 255, 0.15), transparent 35%),
    var(--bg-deep);
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.6;
  padding: 0 0 4rem;
  position: relative;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

.app-body::before,
.app-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.app-body::before {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.25;
}

.bg-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  z-index: -2;
}

.bg-glow--one {
  background: #0ea5e9;
  top: -100px;
  left: -80px;
}

.bg-glow--two {
  background: #9333ea;
  bottom: 0;
  right: -120px;
}

.page-layout {
  max-width: 1340px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding: 0 clamp(1rem, 3vw, 3.5rem);
}

#page {
  max-width: 100%;
  margin: 0;
}

/* Header actions and theme toggle */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.theme-icon {
  display: none;
  animation: rotateIn 0.5s ease;
}

@keyframes rotateIn {
  from { transform: rotate(-90deg) scale(0); opacity: 0; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}

[data-theme="dark"] .theme-icon-light,
:root .theme-icon-light {
  display: block;
}

[data-theme="light"] .theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-dark {
  display: block;
}

/* Light theme variables */
[data-theme="light"] {
  color-scheme: light;
  --bg-deep: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-solid: #ffffff;
  --bg-panel: rgba(0, 0, 0, 0.03);
  --brand-blue: #2563eb;
  --brand-cyan: #0284c7;
  --brand-orange: #ea580c;
  --brand-purple: #7c3aed;
  --text-strong: #000000;
  --text-muted: #000000;
  --grid-line: rgba(0, 0, 0, 0.08);
  --shadow-hero: 0 25px 80px rgba(148, 163, 184, 0.2);
  --shadow-card: 0 10px 30px rgba(148, 163, 184, 0.15);
  --gradient-hero: linear-gradient(135deg, #eff6ff, #f0f9ff);
}

body {
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.05), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(8, 145, 178, 0.05), transparent 35%),
    var(--bg-deep);
  color: var(--text-strong);
}

/* Light mode: force all text to solid black (per preference) */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] p,
[data-theme="light"] li,
[data-theme="light"] a,
[data-theme="light"] span,
[data-theme="light"] strong,
[data-theme="light"] button {
  color: var(--text-strong);
}

/* Ensure section eyebrow/lead text also goes black */
[data-theme="light"] .eyebrow,
[data-theme="light"] .section p.lead {
  color: var(--text-strong);
}

/* Light Mode specific overrides for visibility */
[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .site-nav__links button {
  color: var(--text-muted);
}

[data-theme="light"] .site-nav__links button:hover,
[data-theme="light"] .site-nav__links button.is-active {
  color: var(--brand-blue);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .ghost-link {
  color: var(--brand-blue);
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.05);
}

[data-theme="light"] .ghost-link:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--brand-blue);
}

[data-theme="light"] .about-me-unified-content {
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-strong);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Updated Header Layout */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 0 1.75rem;
  background: rgba(7, 12, 30, 0.95);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
  /* Match main content width (same as `.page-layout`) */
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 3.5rem);
  display: grid;
  grid-template-columns: auto 1fr auto; /* brand | nav | actions */
  align-items: center;
  column-gap: 0.75rem;
}

/* Center the nav group in the middle column */
.site-nav {
  justify-self: center;
}

.header-actions {
  justify-self: end;
  margin-left: 0;
}

/* Ensure links are visible in light mode for cards */
[data-theme="light"] .card,
[data-theme="light"] .skill-card,
[data-theme="light"] .project-showcase-item,
[data-theme="light"] .education-item,
[data-theme="light"] .experience-item,
[data-theme="light"] .contact-main-card,
[data-theme="light"] .contact-socials {
  background: white;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .about-me-content p,
[data-theme="light"] .education-details,
[data-theme="light"] .experience-bullets li,
[data-theme="light"] .project-showcase-description,
[data-theme="light"] .contact-office-text {
  color: var(--text-muted);
}

[data-theme="light"] .highlight-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(8, 145, 178, 0.05));
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .project-showcase-item {
  background: white;
}

[data-theme="light"] .contact-social-link {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .contact-social-link:hover {
  border-color: var(--brand-blue);
}

/* Light mode typography fixes (ensure text is readable on white cards) */
[data-theme="light"] .card li,
[data-theme="light"] .skill-card li,
[data-theme="light"] .technical-skill-item span,
[data-theme="light"] .education-details,
[data-theme="light"] .experience-bullets li {
  color: var(--text-muted);
}

[data-theme="light"] .card h3,
[data-theme="light"] .skill-card h3,
[data-theme="light"] .technical-skill-item strong,
[data-theme="light"] .education-degree,
[data-theme="light"] .experience-role {
  color: var(--text-strong);
}

[data-theme="light"] .highlight-card__label {
  color: var(--text-strong);
}

[data-theme="light"] .tag {
  border-color: rgba(0, 0, 0, 0.12);
}

/* Light mode: highlights banner readability */
[data-theme="light"] .highlights-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(8, 145, 178, 0.05));
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .highlights-banner p {
  color: var(--text-strong);
}

/* Light mode: technical skills cards (were not part of the generic card override) */
[data-theme="light"] .technical-skill-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .technical-skill-item:hover {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.25);
}

/* Light mode: left profile rail (profile card + links) */
[data-theme="light"] .profile-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .profile-card__text p {
  color: var(--text-muted);
}

[data-theme="light"] .profile-card__text p:first-child {
  color: var(--text-strong);
}

[data-theme="light"] .profile-card__link {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-strong);
}

[data-theme="light"] .profile-card__link:hover {
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .profile-card__link .icon {
  background: rgba(0, 0, 0, 0.05);
}

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

.brand-mark__logo {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px;
  min-height: 64px;
  max-width: 64px;
  max-height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: inline-block;
  flex-shrink: 0;
}

.brand-mark__name {
  color: var(--text-strong);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
}

.site-nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-strong);
  display: block;
}

.site-nav__links {
  display: flex;
  gap: 0.5rem;
}

.site-nav__links button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 1.1rem;
  transition: color 0.2s ease, border 0.2s ease, background 0.2s ease;
  cursor: pointer;
  }
  
.site-nav__links button:hover,
.site-nav__links button.is-active {
  color: var(--text-strong);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.ghost-link {
  color: var(--text-strong);
  text-decoration: none;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

.profile-rail {
  position: sticky;
  top: 6rem;
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.profile-rail::-webkit-scrollbar {
  width: 4px;
}

.profile-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.profile-card {
  background: rgba(5, 7, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-card__identity {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.profile-card__media img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.55);
}

.profile-card__text p {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
}

.profile-card__text p:first-child {
  font-size: 1.6rem;
  font-weight: 600;
}

.profile-card__text p:nth-child(2) {
  color: var(--brand-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.profile-card__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.profile-card__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border 0.2s ease, transform 0.2s ease;
  }
  
.profile-card__link .icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--brand-cyan);
}

.profile-card__link svg {
  width: 18px;
  height: 18px;
}

.profile-card__link:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.section {
  margin-bottom: 3rem;
  padding: 0 1rem;
  scroll-margin-top: 7rem; /* Adjust for sticky header height */
}

.shell {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.75rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}

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

.header-with-icon {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-with-icon h2 {
  margin: 0;
}

.scholar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 50%;
  color: #4285f4;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.scholar-link:hover {
  background: rgba(66, 133, 244, 0.2);
  border-color: #4285f4;
  transform: scale(1.1);
}

.scholar-link svg {
  width: 28px;
  height: 28px;
  display: block;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--brand-cyan);
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.section p.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
  }
  
.hero {
  min-height: 480px;
  border-radius: var(--radius-lg);
  padding: 3rem;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-hero);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='90' fill='rgba(255,255,255,0.07)'/%3E%3Crect y='45' width='90' height='1' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E");
  opacity: 0.3;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.hero__text h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero__text p {
  color: rgba(248, 251, 255, 0.85);
  font-size: 1.05rem;
}

.hero__cta {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__cta a {
  text-decoration: none;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-strong);
  transition: transform 0.2s ease;
}

.hero__cta a.primary {
  background: #fff;
  color: #020617;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.hero__metrics {
  display: grid;
  gap: 1rem;
}

.metric-card {
  background: rgba(5, 5, 5, 0.35);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-card strong {
  display: block;
  font-size: 1.5rem;
}

.hero__profile {
  background: rgba(5, 5, 5, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero__portrait img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 35px rgba(2, 6, 23, 0.45);
}

.hero__caption {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__profile ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Specific override to fix width alignment */
#aboutMe.section,
#gallery.section {
  padding-left: 0;
  padding-right: 0;
}

.media-slider {
  padding: 0 0 1rem;
  margin-bottom: 0;
}

.media-slider .swiper {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-card);
}

.media-slider .swiper-slide {
  /* Prevent the gallery from monopolizing the viewport on first load (no JS) */
  height: clamp(200px, 34svh, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #01030b;
}

.media-slider .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-slider .swiper-button-next,
.media-slider .swiper-button-prev {
  color: #fff;
}

.media-slider .swiper-pagination-bullet-active {
  background: var(--brand-cyan);
}

.about-me-box {
  margin: 0 0 2.5rem;
}

.about-me-unified-content {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.about-me-content {
  margin-bottom: 2.5rem;
  position: relative;
}

.about-me-content h2 {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  color: var(--brand-cyan);
  letter-spacing: 0.02em;
}

.about-me-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(248, 251, 255, 0.9);
  text-align: justify;
}

.about-subsection {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.about-subsection-title {
  font-size: 1.65rem;
  color: var(--brand-cyan);
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.education-list,
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.education-item,
.experience-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.education-item:hover,
.experience-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(92, 244, 255, 0.2);
}

.education-header,
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.education-degree,
.experience-role {
  color: var(--text-strong);
  font-size: 1.2rem;
  font-weight: 600;
  flex: 1;
  min-width: 200px;
}

.education-period,
.experience-period {
  color: var(--brand-orange);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.education-institution,
.experience-organization {
  color: var(--brand-cyan);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.education-details {
  color: rgba(248, 251, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.experience-bullets {
  margin: 0.75rem 0 0 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.experience-bullets li {
  color: rgba(248, 251, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.experience-bullets li:last-child {
  margin-bottom: 0;
}

.highlights-section {
  margin: 1rem 0 2.5rem;
  padding: 0;
}

.about-me-unified-content .highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.highlight-card {
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.12), rgba(162, 137, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeInUp 0.6s ease-out backwards;
}

.highlight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.highlight-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(79, 155, 255, 0.3);
  border-color: var(--brand-cyan);
}

.highlight-card:hover::before {
  transform: scaleX(1);
}

.highlight-card__value {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.highlight-card__label {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(248, 251, 255, 0.85);
  font-weight: 500;
}

.highlights-banner {
  background: linear-gradient(135deg, rgba(162, 137, 255, 0.12), rgba(79, 155, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out backwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-me-unified-content .highlights-banner {
  margin-top: 0;
}

.highlights-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-cyan), var(--brand-blue));
}

.highlights-banner:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(162, 137, 255, 0.25);
}

.highlights-banner p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(248, 251, 255, 0.9);
  margin: 0;
  font-weight: 500;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--two {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--three {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.grid--projects {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#skills header h2,
#publications header h2,
#projects header h2,
#news header h2,
#honors header h2,
#contact header h2 {
  font-size: 2rem;
  color: var(--brand-cyan);
  letter-spacing: 0.02em;
}

.card {
  background: var(--bg-card-solid);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.12), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 1;
}

.card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand-cyan);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.card ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-left: 1.2rem;
}

.card li {
  color: rgba(248, 251, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.skill-card {
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.06), rgba(92, 244, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(92, 244, 255, 0.3);
  box-shadow: 0 20px 50px rgba(79, 155, 255, 0.25);
}

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

.skill-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.skill-card ul {
  gap: 0.3rem;
}

.skill-card li {
  font-size: 0.95rem;
  line-height: 1.65;
}

.technical-skills-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.technical-skills-title {
  font-size: 1.65rem;
  color: var(--brand-cyan);
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.technical-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.technical-skill-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.technical-skill-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(92, 244, 255, 0.2);
}

.technical-skill-item strong {
  color: var(--brand-cyan);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.technical-skill-item span {
  color: rgba(248, 251, 255, 0.85);
  font-size: 1rem;
  line-height: 1.6;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.project-card .media-frame {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #020617;
}

.project-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.project-card .actions {
  margin-top: auto;
}

.project-card .actions a {
  text-decoration: none;
  color: var(--brand-cyan);
  font-weight: 600;
}

.projects-showcase {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-showcase-item {
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.06), rgba(92, 244, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.project-showcase-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-showcase-item:hover {
  transform: translateY(-4px);
  border-color: rgba(92, 244, 255, 0.3);
  box-shadow: 0 20px 60px rgba(79, 155, 255, 0.25);
}

.project-showcase-item:hover::before {
  opacity: 1;
}

.project-showcase-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
}

.project-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-showcase-header h3 {
  font-size: 1.5rem;
  color: var(--text-strong);
  margin: 0;
  font-weight: 600;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--brand-cyan);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.github-link:hover {
  background: rgba(92, 244, 255, 0.1);
  border-color: var(--brand-cyan);
  transform: translateX(4px);
}

.github-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.project-showcase-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(248, 251, 255, 0.85);
  margin: 0;
}

.project-showcase-media {
  background: #01030b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 300px;
}

.project-showcase-media video,
.project-showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-showcase-media video {
  background: #000;
}

.news-timeline {
  display: grid;
  gap: 1.25rem;
}

.news-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item__date {
  font-weight: 600;
  color: var(--brand-orange);
}

.timeline {
  display: grid;
  gap: 1.5rem;
}

.timeline-entry {
  padding-left: 1.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-blue);
}

.list-columns {
  columns: 2;
  column-gap: 2rem;
}

.list-columns li {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.publication-groups {
  display: grid;
  gap: 1.8rem;
}

.publication-group h3 {
  color: var(--brand-purple);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}

.publication-group ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
}

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

.contact-tile {
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.08), rgba(92, 244, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  color: var(--text-strong);
  position: relative;
  overflow: hidden;
  min-height: 120px; /* equal card heights */
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(92, 244, 255, 0.3);
  box-shadow: 0 20px 50px rgba(79, 155, 255, 0.25);
}

.contact-tile:hover::before {
  opacity: 1;
}

.contact-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.contact-tile:hover .contact-tile__icon {
  transform: scale(1.08) rotate(4deg);
}

.contact-tile__icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.contact-tile__body strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-tile__body span {
  display: block;
  color: rgba(248, 251, 255, 0.85);
  font-size: 0.95rem;
}

/* platform accents */
.contact-tile.linkedin:hover { border-color: rgba(10, 102, 194, 0.5); }
.contact-tile.github:hover { border-color: rgba(255, 255, 255, 0.35); }
.contact-tile.x:hover { border-color: rgba(29, 161, 242, 0.5); }
.contact-tile.email:hover { border-color: rgba(92, 244, 255, 0.45); }

[data-theme="light"] .contact-tile {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .contact-tile__icon {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .contact-tile__body span {
  color: var(--text-muted);
}

.site-footer {
  text-align: center;
  margin: 3rem 0 1rem;
  color: var(--text-muted);
}

.noscript {
  text-align: center;
  padding: 1rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  body {
    padding: 0 0 3rem;
  }

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

  /* Mobile overflow guards (prevent horizontal scrolling / text spilling off-screen) */
  #page,
  main,
  .section,
  .profile-rail,
  .profile-card,
  .card {
    min-width: 0;
    max-width: 100%;
  }

  .profile-card__text,
  .profile-card__text p,
  .about-me-content p,
  .experience-bullets li,
  .education-details,
  .project-showcase-description,
  .contact-tile__body span {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Mobile: make the profile rail a compact intro card above the content */
  .profile-rail {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .profile-card {
    padding: 1.25rem;
    gap: 1rem;
  }

  .profile-card__identity {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
  }

  .profile-card__media img {
    width: 96px;
    height: 96px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .profile-card__text p:first-child {
    font-size: 1.35rem;
  }

  /* Mobile: keep the intro card compact (avoid huge text blocks) */
  .profile-card__text p:nth-child(n + 3) {
    display: none;
  }

  /* Mobile: circular icon buttons in one row */
  .profile-card__links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .profile-card__link {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    gap: 0;
    border-radius: 999px;
    font-size: 0.95rem;
    flex: 0 0 auto;
  }

  .profile-card__link span:not(.icon) {
    display: none;
  }

  .profile-card__link .icon {
    width: 30px;
    height: 30px;
  }

  /* Mobile: avoid justified text (causes big word gaps) */
  .about-me-content p,
  .highlights-banner p,
  .education-details,
  .experience-bullets li {
    text-align: left;
    hyphens: auto;
    text-justify: auto;
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-nav__toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav__links {
    position: static;
    flex-direction: column;
    width: 100%;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    display: none;
    margin-top: 1rem;
    gap: 0.25rem;
  }

  .site-nav.is-open .site-nav__links {
    display: flex;
    animation: fadeInDown 0.3s ease;
  }

  @keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .site-nav__links button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
  }

  [data-theme="light"] .site-nav__links button {
    background: rgba(0, 0, 0, 0.03);
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 2rem;
  }

  .list-columns {
    columns: 1;
  }

  .media-slider .swiper-slide {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .media-slider .swiper {
    aspect-ratio: 1 / 1;
  }

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

  .skill-card {
    padding: 1.75rem;
  }

  .technical-skills-grid {
    grid-template-columns: 1fr;
  }

  .technical-skills-section {
    margin-top: 2rem;
    padding-top: 2rem;
  }

  .technical-skill-item {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 1.5rem;
  }

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

  .hero__cta {
    flex-direction: column;
  }

  .contact-grid-2x2 {
    grid-template-columns: 1fr;
  }

  .contact-tile {
    padding: 1.5rem;
  }

  .contact-tile__icon {
    width: 52px;
    height: 52px;
  }

  .highlights-grid,
  .about-me-unified-content .highlights-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .highlight-card {
    padding: 1.5rem 1rem;
  }

  .highlight-card__value {
    font-size: 2.5rem;
  }

  .highlights-banner {
    padding: 1.5rem 1.25rem;
  }

  .highlights-banner p {
    font-size: 0.95rem;
  }

  .about-me-unified-content {
    padding: 2rem;
  }

  .about-me-content {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }

  .about-subsection {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
  }

  .about-subsection-title {
    font-size: 1.3rem;
  }

  .education-item,
  .experience-item {
    padding: 1.25rem;
  }

  .education-header,
  .experience-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .education-degree,
  .experience-role {
    font-size: 1.1rem;
  }

  .education-period,
  .experience-period {
    font-size: 0.85rem;
  }

  .experience-bullets {
    padding-left: 1.25rem;
  }

  .experience-bullets li {
    font-size: 0.85rem;
  }

  .project-showcase-item {
    grid-template-columns: 1fr;
  }

  .project-showcase-content {
    padding: 2rem;
    order: 2;
  }

  .project-showcase-media {
    order: 1;
    min-height: 250px;
  }

  .project-showcase-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-showcase-header h3 {
    font-size: 1.25rem;
  }

  .github-link {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
  }

  .projects-showcase {
    gap: 2rem;
  }

  .scholar-link svg {
    width: 24px;
    height: 24px;
  }

  .scholar-link {
    padding: 0.4rem;
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 17rem;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
  box-shadow: 0 8px 25px rgba(79, 155, 255, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: 0 12px 35px rgba(79, 155, 255, 0.5);
  transform: translateY(-3px);
}

.back-to-top:active {
  transform: translateY(-1px);
}

[data-theme="light"] .back-to-top {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .back-to-top:hover {
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.4);
}

@media (max-width: 960px) {
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    transition: none;
  }

  .site-nav__links button,
  .hero__cta a {
    transition: none;
  }

  .back-to-top {
    transition: none;
  }
}