:root {
  color-scheme: dark;
  --bg: #080b16;
  --bg-elevated: rgba(12, 18, 34, 0.82);
  --surface: rgba(18, 27, 50, 0.72);
  --surface-strong: rgba(24, 34, 61, 0.95);
  --text: #eef2ff;
  --muted: #aeb8d8;
  --accent: #7c93ff;
  --accent-2: #9a6bff;
  --accent-3: #50d1ff;
  --border: rgba(168, 184, 255, 0.16);
  --shadow: 0 20px 60px rgba(1, 6, 20, 0.35);
  --max-width: 1180px;
}

body[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f7ff;
  --bg-elevated: rgba(255, 255, 255, 0.86);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #13203d;
  --muted: #52607d;
  --accent: #415dff;
  --accent-2: #6f55ff;
  --accent-3: #0aa5ff;
  --border: rgba(65, 93, 255, 0.12);
  --shadow: 0 22px 55px rgba(74, 92, 144, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(80, 209, 255, 0.15), transparent 26%),
    radial-gradient(circle at top right, rgba(154, 107, 255, 0.16), transparent 22%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
}

#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.page-glow {
  position: fixed;
  width: 26rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(75px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -2;
}

.page-glow--one {
  top: 8rem;
  left: -7rem;
  background: rgba(80, 209, 255, 0.34);
}

.page-glow--two {
  right: -5rem;
  top: 18rem;
  background: rgba(154, 107, 255, 0.28);
}

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 1rem;
  background: rgba(8, 11, 22, 0.92);
  z-index: 40;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

body[data-theme='light'] .loader {
  background: rgba(243, 247, 255, 0.92);
}

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

.loader__ring {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-3);
  animation: spin 1s linear infinite;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.8rem;
}

.nav__brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

.nav__brand span,
.eyebrow,
.section__intro h2 span,
.hero h1 span {
  color: var(--accent-3);
}

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

.nav__links a,
.theme-toggle {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav__links a:hover,
.nav__links a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.nav__toggle,
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
}

.nav__toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  flex-direction: column;
  justify-content: space-between;
}

.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
}

.theme-toggle {
  width: 2.75rem;
  height: 2.75rem;
}

main {
  padding-bottom: 4rem;
}

.hero {
  min-height: calc(100vh - 4.8rem);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding-block: 4rem 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  font-size: 0.8rem;
}

.hero h1,
.section__intro h2 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin: 0.5rem 0 1rem;
}

.section__intro h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
}

.hero__lead,
.section__intro p,
.muted,
.contact-list a,
.contact-list span,
.detail-list dd,
.bullet-list,
.repo-card p,
.github-card p {
  color: var(--muted);
}

.hero__actions,
.section__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.button--ghost {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.glass-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--surface) 75%, transparent));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border-radius: 1.5rem;
}

.hero__stats,
.hero__highlights,
.detail-list,
.bullet-list,
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 2rem;
}

.hero__stats li,
.hero__highlights article,
.skill-chip,
.repo-card__meta span {
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero__stats strong {
  display: block;
  font-size: 1.35rem;
}

.hero__spotlight {
  padding: 1.4rem;
}

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

.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 1.4rem;
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(80, 209, 255, 0.18), rgba(154, 107, 255, 0.2));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hero__profile img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 1.4rem;
  object-fit: cover;
}

.profile-avatar__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}

.hero__highlights {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.hero__highlights h3,
.about-card h3,
.github-card h3,
.contact-card h3,
.skills-layout h3 {
  margin-top: 0;
}

.section {
  padding-block: 4.5rem 0;
}

.section__intro {
  max-width: 42rem;
  margin-bottom: 2rem;
}

.about-grid,
.github-grid,
.contact-layout,
.skills-layout {
  display: grid;
  gap: 1.4rem;
}

.about-grid,
.contact-layout,
.skills-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-card,
.contact-card,
.skills-layout article,
.github-card {
  padding: 1.4rem;
}

.detail-list {
  display: grid;
  gap: 0.85rem;
}

.detail-list div {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-list dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-3);
  margin-bottom: 0.25rem;
}

.detail-list dd {
  margin: 0;
}

.bullet-list {
  display: grid;
  gap: 0.85rem;
}

.bullet-list li {
  position: relative;
  padding-left: 1.2rem;
}

.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.social-links a {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

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

.repo-card {
  position: relative;
  padding: 1.35rem;
  min-height: 100%;
  transform-style: preserve-3d;
}

.repo-card__top,
.repo-card__footer,
.repo-card__topics {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.repo-card__top {
  justify-content: space-between;
}

.repo-card__name {
  font-size: 1.08rem;
  font-weight: 700;
}

.repo-card__topics,
.skill-chips {
  margin-top: 1rem;
}

.repo-card__topics span,
.skill-chip {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
}

.repo-card__footer {
  justify-content: space-between;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.repo-card__meta {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.skills-layout {
  grid-template-columns: 1.05fr 0.95fr;
}

.skill-bars,
.skill-chips {
  display: grid;
  gap: 1rem;
}

.skill-bar {
  display: grid;
  gap: 0.45rem;
}

.skill-bar__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.skill-bar__track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.skill-bar__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
}

.github-grid {
  grid-template-columns: 0.9fr 1fr 1fr;
}

.github-card--image {
  display: grid;
  place-items: center;
}

.github-card--image img {
  width: 100%;
  border-radius: 1rem;
}

.contact-layout {
  grid-template-columns: 1.1fr 0.9fr;
}

.contact-form {
  display: grid;
  gap: 0.95rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.9rem 1rem;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.button:focus-visible,
.social-links a:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent-3);
  outline-offset: 3px;
}

.contact-list {
  display: grid;
  gap: 1rem;
}

.contact-list li {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-list span {
  display: block;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

.footer {
  padding-block: 2rem 3rem;
  color: var(--muted);
}

.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.tilt-card:hover {
  border-color: rgba(124, 147, 255, 0.35);
}

@media (max-width: 960px) {
  .hero,
  .about-grid,
  .projects-grid,
  .github-grid,
  .contact-layout,
  .skills-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }

  .nav__toggle {
    display: inline-flex;
  }

  .nav__links {
    position: fixed;
    inset: 4.8rem 1rem auto;
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
    transform: scale(0.96);
    opacity: 0;
    pointer-events: none;
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav__links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .theme-toggle {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .hero__stats {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding-top: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
