:root {
  --bg: #070817;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --text: #f7f7fb;
  --muted: #a7adbf;
  --line: rgba(255, 255, 255, 0.14);
  --primary: #7c3aed;
  --primary-soft: rgba(124, 58, 237, 0.22);
  --cyan: #06b6d4;
  --pink: #ec4899;
  --green: #22c55e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --max-width: 1180px;
}

[data-theme="light"] {
  --bg: #f7f8ff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --muted: #4b5563;
  --line: rgba(17, 24, 39, 0.12);
  --primary-soft: rgba(124, 58, 237, 0.14);
  --shadow: 0 24px 80px rgba(17, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.26), transparent 26%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.18), transparent 24%),
    radial-gradient(circle at 50% 90%, rgba(236, 72, 153, 0.18), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.65;
}

body.no-scroll {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

::selection {
  color: #ffffff;
  background: var(--primary);
}

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
}

.cursor-outline {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(6, 182, 212, 0.58);
  transition: width 0.2s ease, height 0.2s ease, border 0.2s ease;
}

.cursor-outline.cursor-hover {
  width: 58px;
  height: 58px;
  border-color: rgba(236, 72, 153, 0.72);
}

.page-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  background: var(--bg);
  z-index: 9998;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.page-loader p {
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.site-header {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 1000;
  width: min(calc(100% - 32px), var(--max-width));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 8, 23, 0.58);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%);
  transition: 0.28s ease;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.72);
}

.site-header.scrolled {
  top: 10px;
  padding: 10px 16px;
}

.brand,
.header-actions,
.desktop-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.32);
}

.brand-text {
  font-family: Space Grotesk, sans-serif;
  letter-spacing: 0.02em;
}

.desktop-nav {
  gap: 24px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.desktop-nav a {
  position: relative;
  transition: color 0.2s ease;
}

.desktop-nav a::after {
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 0;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 0.2s ease;
}

.desktop-nav a:hover {
  color: var(--text);
}

.desktop-nav a:hover::after {
  width: 100%;
}

.header-actions {
  gap: 10px;
}

.theme-toggle,
.menu-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
}

.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle span {
  position: absolute;
  transition: 0.24s ease;
}

.theme-toggle .moon {
  transform: translateY(36px);
}

[data-theme="light"] .theme-toggle .sun {
  transform: translateY(-36px);
}

[data-theme="light"] .theme-toggle .moon {
  transform: translateY(0);
}

.menu-toggle {
  display: none;
  gap: 4px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: 0.2s ease;
}

.mobile-menu {
  position: fixed;
  top: 88px;
  left: 16px;
  right: 16px;
  z-index: 999;
  display: none;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.mobile-menu.active {
  display: grid;
  gap: 12px;
  animation: slideDown 0.24s ease both;
}

.mobile-menu a {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 700;
}

.section {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 110px 0;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  padding-top: 160px;
}

.hero-bg-orb {
  position: absolute;
  z-index: -1;
  filter: blur(28px);
  border-radius: 999px;
  opacity: 0.54;
  animation: floatOrb 8s ease-in-out infinite;
}

.orb-one {
  top: 22%;
  left: 0;
  width: 180px;
  height: 180px;
  background: var(--primary);
}

.orb-two {
  right: 6%;
  bottom: 14%;
  width: 220px;
  height: 220px;
  background: var(--cyan);
  animation-delay: -3s;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
}

.eyebrow::before {
  width: 34px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
}

h1,
h2,
h3,
h4 {
  font-family: Space Grotesk, Inter, sans-serif;
  line-height: 1.08;
}

.hero h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.7rem);
  letter-spacing: -0.07em;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 5%, var(--cyan) 45%, var(--pink) 85%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #111827 5%, var(--primary) 45%, var(--cyan) 85%);
  background-clip: text;
  -webkit-background-clip: text;
}

.type-line {
  min-height: 44px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: clamp(1.25rem, 3vw, 2rem);
}

#typeWriter {
  color: var(--text);
}

#typeWriter::after {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  content: "";
  vertical-align: -0.12em;
  background: var(--cyan);
  animation: blink 0.8s steps(2, start) infinite;
}

.hero-description {
  max-width: 650px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-cta,
.contact-actions,
.social-strip,
.tag-row,
.contact-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  position: relative;
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.26);
}

.secondary-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
}

.social-strip {
  margin-top: 28px;
}

.social-strip a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.social-strip a:hover {
  color: var(--text);
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-2px);
}

.hero-card {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  transform-style: preserve-3d;
}

.hero-card::before {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 32px;
  pointer-events: none;
}

.profile-ring {
  display: grid;
  width: min(78vw, 300px);
  height: min(78vw, 300px);
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from 90deg, var(--primary), var(--cyan), var(--pink), var(--primary));
  animation: rotateSlow 8s linear infinite;
  box-shadow: 0 0 80px rgba(6, 182, 212, 0.18);
}

.profile-avatar {
  display: grid;
  width: calc(100% - 22px);
  height: calc(100% - 22px);
  place-items: center;
  border: 10px solid rgba(7, 8, 23, 0.9);
  border-radius: inherit;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.32), transparent 20%),
    linear-gradient(135deg, #131735, #0b1028 55%, #161f45);
  color: #ffffff;
  font-family: Space Grotesk, sans-serif;
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  animation: rotateReverse 8s linear infinite;
}

.status-pill {
  position: absolute;
  top: 40px;
  right: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.12);
}

.hero-card-grid {
  position: absolute;
  right: 34px;
  bottom: 34px;
  left: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-card-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  text-align: center;
}

.hero-card-grid strong {
  display: block;
  color: var(--text);
  font-family: Space Grotesk, sans-serif;
  font-size: 1.6rem;
}

.hero-card-grid p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 44px;
}

.section-heading h2,
.contact-card h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -0.05em;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.glass-card,
.timeline-card,
.skill-card,
.project-card,
.experience-card,
.publication-card,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.glass-card,
.timeline-card {
  padding: 30px;
}

.glass-card h3,
.timeline-card h4,
.skill-card h3,
.project-card h3,
.experience-card h3,
.publication-card h3 {
  margin-bottom: 12px;
}

.glass-card p,
.timeline-card p,
.skill-card p,
.project-card p,
.experience-card p,
.experience-card li,
.publication-card h3,
.contact-card p {
  color: var(--muted);
}

.timeline-card {
  display: grid;
  gap: 26px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
}

.timeline-item::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 8px rgba(6, 182, 212, 0.12);
}

.timeline-item span,
.experience-card span,
.publication-card span,
.project-topline span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skills-grid,
.project-grid,
.publication-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill-card,
.project-card,
.publication-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  transform-style: preserve-3d;
}

.skill-card::before,
.project-card::before,
.publication-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), transparent 44%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.skill-card span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-weight: 900;
}

.project-grid {
  grid-template-columns: repeat(2, 1fr);
}

.project-card.featured {
  grid-column: span 2;
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.project-topline a {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
}

.project-card h3 {
  font-size: 1.6rem;
}

.project-card p {
  margin-bottom: 22px;
}

.tag-row span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--text);
  background: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.experience-list {
  display: grid;
  gap: 18px;
}

.experience-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  padding: 28px;
}

.experience-card ul {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.publication-grid {
  grid-template-columns: repeat(2, 1fr);
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
}

.contact-card::before {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 340px;
  height: 340px;
  content: "";
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.18);
  filter: blur(34px);
  transform: translateX(-50%);
}

.contact-card > * {
  position: relative;
}

.contact-card .eyebrow {
  justify-content: center;
}

.contact-card p {
  max-width: 700px;
  margin: 18px auto 30px;
}

.contact-actions,
.contact-info {
  justify-content: center;
}

.contact-info {
  margin-top: 26px;
  color: var(--muted);
  font-weight: 700;
}

.contact-info span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.footer {
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

.scroll-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: 82px;
  left: 50%;
  z-index: 999;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes rotateSlow {
  to { transform: rotate(360deg); }
}

@keyframes rotateReverse {
  to { transform: rotate(-360deg); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -26px, 0) scale(1.08); }
}

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

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .hero,
  .about-layout,
  .experience-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 140px;
  }

  .hero-card {
    min-height: 460px;
  }

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

  .project-card.featured {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .cursor-dot,
  .cursor-outline {
    display: none;
  }

  .section {
    width: min(calc(100% - 24px), var(--max-width));
    padding: 82px 0;
  }

  .site-header {
    width: calc(100% - 24px);
    top: 12px;
  }

  .brand-text {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .hero-card {
    min-height: 430px;
    padding: 22px;
  }

  .status-pill {
    top: 24px;
    right: 22px;
    left: 22px;
    justify-content: center;
  }

  .hero-card-grid {
    right: 18px;
    left: 18px;
    bottom: 18px;
    grid-template-columns: 1fr;
  }

  .profile-ring {
    width: 240px;
    height: 240px;
  }

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

  .contact-info {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
