:root {
  --black: #050505;
  --black-soft: #080808;
  --orange: #ff7a18;
  --purple: #7f1dff;
  --purple-dark: #4b00b5;
  --white: #f8f8ff;
  --muted: rgba(248, 248, 255, 0.65);
  --card: rgba(10, 10, 15, 0.7);
  --border: rgba(255, 255, 255, 0.08);
  --glow: 0 0 40px rgba(127, 29, 255, 0.6);
  --cube-rot-x-angle: -18deg;
  --cube-rot-y-angle: 32deg;

  /* Background and text colors */
  --bg-primary: #050505;
  --bg-secondary: #080808;
  --text-primary: #f8f8ff;
  --text-muted: rgba(248, 248, 255, 0.65);
  --card-bg: rgba(10, 10, 15, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --cube-rot-x: -18deg;
  --cube-rot-y: 32deg;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #050505;
  --text-muted: rgba(5, 5, 5, 0.65);
  --card-bg: rgba(245, 245, 245, 0.9);
  --border-color: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: -40vmax;
  background: radial-gradient(circle at 30% 20%, rgba(255, 122, 24, 0.25), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(127, 29, 255, 0.25), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.07), transparent 50%);
  z-index: -2;
  filter: blur(80px);
  animation: aurora 18s ease-in-out infinite alternate;
}

body::after {
  inset: -60vmax;
  background: radial-gradient(circle at 10% 70%, rgba(255, 122, 24, 0.25), transparent 50%),
    radial-gradient(circle at 90% 40%, rgba(127, 29, 255, 0.35), transparent 50%);
  animation-direction: alternate-reverse;
}

.theme-transition {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.05);
  pointer-events: none;
  z-index: 2000;
  mix-blend-mode: screen;
  animation-duration: 1.45s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

.theme-transition--dark {
  animation-name: themeRippleExpand;
}

.theme-transition--light {
  animation-name: themeRippleContract;
}

.theme-transition--dark {
  background: radial-gradient(circle, rgba(5, 5, 5, 0.95), rgba(5, 5, 5, 0.6));
  mix-blend-mode: normal;
  box-shadow: 0 0 120px rgba(0, 0, 0, 0.5);
}

.theme-transition--light {
  background: radial-gradient(circle, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.65));
  mix-blend-mode: normal;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.45);
}

@keyframes themeRippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.05);
    opacity: 1;
  }

  45% {
    opacity: 0.92;
  }

  100% {
    transform: translate(-50%, -50%) scale(140);
    opacity: 0;
  }
}

@keyframes themeRippleContract {
  0% {
    transform: translate(-50%, -50%) scale(140);
    opacity: 0.95;
  }

  35% {
    opacity: 0.9;
  }

  100% {
    transform: translate(-50%, -50%) scale(0.05);
    opacity: 0;
  }
}

[data-theme="light"] body::before,
[data-theme="light"] body::after {
  background: radial-gradient(circle at 30% 20%, rgba(255, 122, 24, 0.15), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(127, 29, 255, 0.15), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(0, 0, 0, 0.03), transparent 50%);
}

[data-theme="light"] body::after {
  background: radial-gradient(circle at 10% 70%, rgba(255, 122, 24, 0.15), transparent 50%),
    radial-gradient(circle at 90% 40%, rgba(127, 29, 255, 0.2), transparent 50%);
}

@keyframes aurora {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background: rgba(5, 5, 5, 0.75);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.auth-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, 90vw);
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 24, 0.4);
  background: rgba(255, 122, 24, 0.15);
  color: var(--white);
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  text-transform: uppercase;
  text-align: center;
  z-index: 2000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

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

header.scrolled {
  background: rgba(5, 5, 5, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem clamp(1.5rem, 4vw, 4rem);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logo span {
  color: var(--orange);
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

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

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  z-index: 999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  transform: translateY(-50%) scale(1.1);
  border-color: var(--orange);
  box-shadow: 0 6px 20px rgba(255, 122, 24, 0.3);
}

.theme-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
  opacity: 0;
  transform: rotate(90deg);
}

.moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

.page {
  perspective: 1400px;
  transform-style: preserve-3d;
  padding-top: 80px;
  /* Add padding to account for fixed header */
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 5vw, 4rem) 6rem;
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 9vw, 8rem);
  position: relative;
  z-index: 2;
}

section {
  position: relative;
  transform-style: preserve-3d;
}

.hero {
  min-height: 80vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 span {
  display: inline-block;
  background: linear-gradient(120deg, var(--orange), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text p {
  max-width: 520px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.95rem 1.9rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--orange), var(--purple));
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 18px 35px rgba(255, 122, 24, 0.25);
}

.btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.btn:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 25px 45px rgba(127, 29, 255, 0.35);
}

.btn.secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}

/* Highlight CV button in dark mode with project colors */
.btn.secondary.btn--cv,
.btn--cv.secondary {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
    linear-gradient(120deg, var(--orange), var(--purple)) border-box;
  position: relative;
  transition: all 0.3s ease;
}

.btn.secondary.btn--cv:hover,
.btn--cv.secondary:hover {
  background: linear-gradient(120deg, var(--orange), var(--purple));
  color: var(--white);
  box-shadow: 0 8px 25px rgba(255, 122, 24, 0.3);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  border-radius: 32px;
  background: radial-gradient(circle at top left, rgba(127, 29, 255, 0.35), rgba(5, 5, 5, 0.6)),
    linear-gradient(145deg, rgba(10, 10, 10, 0.6), rgba(5, 5, 5, 0.95));
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  z-index: 2;
  /* Optimized GPU acceleration */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.hero-visual::before,
.hero-visual::after {
  content: '';
  background: radial-gradient(circle, rgba(127, 25, 255, 0.5), transparent 60%);
  animation-duration: 18s;
  right: -160px;
  bottom: -160px;
}

/* Optimized float animation with transform3d for GPU */
@keyframes float {

  0%,
  100% {
    transform: translate3d(-10%, -10%, 0);
  }

  50% {
    transform: translate3d(15%, 15%, 0);
  }
}

/* Floating Cube */
.floating-cube {
  position: fixed;
  top: 50%;
  left: 50%;
  --cube-size: clamp(240px, 30vw, 420px);
  --cube-half: calc(var(--cube-size) / 2);
  --cube-rot-x-angle: -18deg;
  --cube-rot-y-angle: 32deg;
  width: var(--cube-size);
  height: var(--cube-size);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0.9;
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.45)) blur(var(--cube-blur, 0px));
  --cube-offset-y: 0px;
  --cube-blur: 0px;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.floating-cube::after {
  content: '';
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 29, 255, 0.25), transparent 65%);
  filter: blur(120px);
  z-index: -1;
}

.floating-cube__core {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate3d(0, var(--cube-offset-y, 0px), 0) rotateX(var(--cube-rot-x-angle, -18deg)) rotateY(var(--cube-rot-y-angle, 32deg));
  animation: cubeIdle 28s linear infinite;
}

.floating-cube__face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(18, 20, 38, 0.92), rgba(8, 8, 16, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.1),
    inset 0 -6px 24px rgba(0, 0, 0, 0.75),
    0 18px 40px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(127, 29, 255, 0.3);
  overflow: hidden;
  transform-style: preserve-3d;
}

.floating-cube__face::before,
.floating-cube__face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.floating-cube__face::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.2), transparent 45%, rgba(0, 0, 0, 0.45));
  opacity: 0.4;
}

.floating-cube__face::after {
  inset: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.25;
}

.floating-cube__face--front {
  transform: translateZ(var(--cube-half));
}

.floating-cube__face--back {
  transform: rotateY(180deg) translateZ(var(--cube-half));
}

.floating-cube__face--right {
  transform: rotateY(90deg) translateZ(var(--cube-half));
}

.floating-cube__face--left {
  transform: rotateY(-90deg) translateZ(var(--cube-half));
}

.floating-cube__face--top {
  transform: rotateX(90deg) translateZ(var(--cube-half));
}

.floating-cube__face--bottom {
  transform: rotateX(-90deg) translateZ(var(--cube-half));
}

.floating-cube__face--front {
  background: linear-gradient(145deg, rgba(30, 24, 70, 0.95), rgba(90, 26, 120, 0.85));
}

.floating-cube__face--back {
  background: linear-gradient(315deg, rgba(15, 15, 30, 0.95), rgba(60, 20, 25, 0.85));
}

.floating-cube__face--right {
  background: linear-gradient(45deg, rgba(12, 18, 35, 0.95), rgba(32, 32, 58, 0.85));
}

.floating-cube__face--left {
  background: linear-gradient(225deg, rgba(32, 20, 58, 0.95), rgba(18, 18, 36, 0.85));
}

.floating-cube__face--top {
  background: linear-gradient(180deg, rgba(20, 20, 40, 0.95), rgba(90, 26, 120, 0.8));
}

.floating-cube__face--bottom {
  background: linear-gradient(0deg, rgba(6, 6, 16, 0.95), rgba(45, 16, 22, 0.85));
}

.floating-cube__label {
  position: absolute;
  inset: 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.4em;
  font-size: clamp(1rem, 1.3vw, 1.5rem);
  color: rgba(248, 248, 255, 0.85);
  text-transform: uppercase;
  filter: drop-shadow(0 0 20px rgba(127, 29, 255, 0.35));
  mix-blend-mode: screen;
  transform: translateZ(24px);
  pointer-events: none;
}

.floating-cube__label--primary {
  font-size: clamp(1rem, 1.6vw, 2.2rem);
  letter-spacing: 0.55em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 6px 25px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(255, 122, 24, 0.4);
}

.floating-cube__label--accent {
  font-size: clamp(1rem, 1.4vw, 1.8rem);
  letter-spacing: 0.65em;
  color: rgba(255, 122, 24, 0.9);
  text-shadow:
    0 0 20px rgba(255, 122, 24, 0.6),
    0 0 40px rgba(127, 29, 255, 0.45);
}

.floating-cube__label--quote {
  text-transform: none;
  font-size: clamp(1rem, 1.3vw, 1.7rem);
  letter-spacing: 0.2em;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.35));
}

.floating-cube__label--initials,
.floating-cube__label--initials-outline {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 4vw, 4.8rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transform: translateZ(28px);
}

.floating-cube__label--initials {
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    2px 2px 0 rgba(255, 122, 24, 0.8),
    -2px -2px 0 rgba(127, 29, 255, 0.7),
    0 0 30px rgba(127, 29, 255, 0.6);
}

.floating-cube__label--initials-outline {
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
  opacity: 0.8;
  filter: blur(1px);
}

.floating-cube__label--monogram {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65em 1.2em;
  font-size: clamp(2rem, 3vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: none;
  background: linear-gradient(135deg, #ffb347, #ff7a18 45%, #7f1dff 90%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 25px rgba(255, 122, 24, 0.45),
    0 0 50px rgba(127, 29, 255, 0.5);
  transform: translateZ(28px) rotateX(-90deg);
  perspective: 1000px;
}

.floating-cube__label--monogram::before,
.floating-cube__label--monogram::after {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  filter: blur(0.5px);
  pointer-events: none;
}

.floating-cube__label--monogram::before {
  box-shadow:
    0 0 25px rgba(255, 122, 24, 0.3),
    0 0 60px rgba(127, 29, 255, 0.35);
  animation: monogramPulse 3.2s ease-in-out infinite;
}

.floating-cube__label--monogram::after {
  inset: -6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  opacity: 0.6;
}

@keyframes monogramPulse {

  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.96);
  }

  40% {
    opacity: 0.9;
    transform: scale(1.05);
  }

  60% {
    opacity: 0.65;
  }
}

@keyframes cubeIdle {
  from {
    transform: translate3d(0, var(--cube-offset-y, 0px), 0) rotateX(var(--cube-rot-x-angle, -18deg)) rotateY(var(--cube-rot-y-angle, 32deg));
  }

  to {
    transform: translate3d(0, var(--cube-offset-y, 0px), 0) rotateX(var(--cube-rot-x-angle, -18deg)) rotateY(calc(var(--cube-rot-y-angle, 32deg) + 360deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-cube {
    display: none;
  }
}


.cube span {
  position: absolute;
  inset: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.55), rgba(127, 29, 255, 0.7));
  opacity: 0.85;
  filter: blur(3px);
}

.stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.stats strong {
  display: block;
  font-size: 2.5rem;
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.panel {
  border: 1px solid var(--border-color);

  .about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: flex-start;
  }

  .about-summary h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .about-summary p {
    color: var(--text-muted);
    line-height: 1.8;
  }

  .about-highlights {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }

  .about-highlights div {
    padding: 1rem 1.2rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }

  .about-highlights strong {
    display: block;
    font-size: 2.2rem;
    color: var(--text-primary);
  }

  .about-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .about-timeline article {
    padding: 1.6rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
  }

  .about-timeline__date {
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .about-timeline h3 {
    margin: 0.3rem 0 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .about-timeline p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
  }

  border-radius: 28px;
  padding: clamp(1.8rem, 4vw, 2.8rem);
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  transition: transform 0.45s ease,
  border-color 0.3s ease;
}

.panel:hover {
  border-color: var(--orange);
  transform: translate3d(0, -12px, 50px) rotateX(3deg) rotateY(-3deg);
}

.project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.project-gallery__card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-gallery__card:hover {
  border-color: var(--orange);
  transform: translateY(-8px);
}

.project-gallery__thumb-stack {
  position: relative;
  width: 100%;
  padding-bottom: 62%;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.2), rgba(10, 10, 10, 0.8));
  overflow: visible;
}

.project-gallery__thumb-stack::before,
.project-gallery__thumb-stack::after {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translate(18px, 12px);
  background: rgba(255, 255, 255, 0.03);
}

.project-gallery__thumb-stack::before {
  inset: 5%;
  transform: translate(10px, 6px);
}

.project-gallery__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.project-gallery__count {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  background: rgba(5, 5, 5, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--white);
  z-index: 1;
}

.project-gallery__body {
  padding: 1.2rem 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.project-gallery__body h3 {
  margin: 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 1rem;
}

.project-gallery__body span {
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero {
  position: relative;
  z-index: 2;
}

.portrait-frame {
  position: relative;
  width: clamp(220px, 32vw, 360px);
  height: clamp(260px, 38vw, 420px);
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(255, 122, 24, 0.25), rgba(5, 5, 5, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: portraitIntro 0.7s ease forwards;
  /* GPU acceleration for smooth animation */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.portrait-frame img {
  position: relative;
  top: 25px;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.08) translateY(24px) translateZ(0);
  opacity: 0;
  animation: portraitReveal 0.8s 0.2s ease forwards;
  filter: saturate(1.1) contrast(1.05);
  /* GPU acceleration */
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.glow-ring {
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  animation: glowPulse 1.2s 0.6s ease forwards;
  pointer-events: none;
  /* GPU acceleration */
  will-change: opacity, box-shadow;
  transform: translateZ(0);
}

.portrait-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.portrait-tags span {
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  animation: tagPop 0.4s ease forwards;
  opacity: 0;
}

.portrait-tags span:nth-child(2) {
  animation-delay: 0.15s;
}

.portrait-tags span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Optimized animations with transform3d for GPU acceleration */
@keyframes portraitIntro {
  from {
    transform: translate3d(0, 40px, 0) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes portraitReveal {
  from {
    opacity: 0;
    transform: scale(1.08) translate3d(0, 24px, 0);
  }

  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

@keyframes glowPulse {
  from {
    opacity: 0;
    box-shadow: 0 0 0 rgba(255, 122, 24, 0);
  }

  to {
    opacity: 1;
    box-shadow: 0 0 60px rgba(255, 122, 24, 0.35);
  }
}

@keyframes tagPop {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.track {
  display: grid;

  .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .service-card {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.8rem;
    background: var(--card-bg);
    min-height: 260px;
  }

  .service-card h3 {
    margin-top: 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

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

  .service-card ul {
    padding-left: 1.2rem;
    margin: 1rem 0 0;
    color: var(--text-muted);
    letter-spacing: 0.05em;
  }

  .service-card li {
    margin-bottom: 0.35rem;
  }

  .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .testimonial-card {
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.8rem;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 220px;
  }

  .testimonial-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.8;
    font-style: italic;
  }

  .testimonial-meta strong {
    display: block;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  .testimonial-meta span {
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
  }

  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.project-card {
  position: relative;
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.45s ease, border-color 0.3s ease;
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

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

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 122, 24, 0.25), rgba(127, 29, 255, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}

.project-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0;
}

.project-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-card:hover {
  border-color: var(--orange);
  transform: translate3d(0, -8px, 60px) rotate3d(1, 1, 0, 6deg);
}

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

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

.skill-category {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--card-bg);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.chip:hover {
  transform: translate3d(0, -6px, 20px);
  border-color: var(--orange);
  color: var(--text-primary);
}

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

.exp-card {
  position: relative;
  padding: 1.8rem;
  border-radius: 22px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  line-height: 1.5;
  overflow: hidden;
}

.exp-card strong {
  display: block;
  color: var(--text-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.exp-card span {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
}

.section-description {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 1.8rem;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

.social-panel {
  margin-bottom: 3rem;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.social-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.8rem;
  border-radius: 22px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.35s ease, border-color 0.3s ease, box-shadow 0.35s ease;
}

.social-card:hover {
  transform: translate3d(0, -8px, 20px);
  border-color: var(--orange);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.45);
}

.social-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.social-card__icon svg {
  width: 48px;
  height: 48px;
}

.social-card__icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}

.social-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.social-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.social-card__title {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.social-card__body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.social-card__cta {
  margin-top: auto;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--orange);
}

.social-card--linkedin {
  background: linear-gradient(135deg, rgba(14, 118, 168, 0.32), rgba(7, 40, 70, 0.85));
  border-color: rgba(14, 118, 168, 0.4);
}

.social-card--linkedin .social-card__icon {
  background: rgba(14, 118, 168, 0.2);
  color: #0A66C2;
}

.social-card--github {
  background: linear-gradient(135deg, rgba(15, 15, 24, 0.9), rgba(68, 68, 90, 0.4));
  border-color: rgba(255, 255, 255, 0.06);
}

.social-card--github .social-card__icon {
  background: rgba(255, 255, 255, 0.09);
  color: #f8f8ff;
}

.contact {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-radius: 32px;
  border: 1px solid var(--border-color);
  background: linear-gradient(160deg, rgba(127, 29, 255, 0.22), rgba(255, 122, 24, 0.15));
  letter-spacing: 0.1em;
}

.contact h2 {
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0;
  color: var(--text-primary);
}

.contact p {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 1.8rem;
  line-height: 1.8;
}

.contact-form {
  max-width: 600px;
  margin: 2rem auto 0;
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-input,
.form-textarea,
select.form-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--bg-secondary);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: inline-block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#contactFeedback {
  min-height: 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

#contactFeedback[data-state="success"] {
  color: #4ade80;
}

#contactFeedback[data-state="error"] {
  color: #ff7a18;
}

#contactFeedback[data-state="pending"] {
  color: var(--text-primary);
}

.project-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.project-modal.is-visible {
  display: flex;
}

.project-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.project-modal__dialog {
  position: relative;
  max-width: min(90vw, 960px);
  width: 100%;
  background: var(--bg-primary);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1;
}

.project-modal__content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.project-modal__content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.project-modal__nav {
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: var(--white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.project-modal__nav:hover {
  background: rgba(255, 122, 24, 0.5);
}

.project-modal__nav[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.project-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

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

}

.project-modal__footer a {
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;

}

footer {
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  position: relative;
  z-index: 100;
  /* Bring footer above 3D cube */
  /* background: var(--bg-primary); */
  background: rgba(0, 0, 0, 0.2);

}

.floating-fragment {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle, rgba(255, 122, 24, 0.3), transparent 70%);
  filter: blur(1px);
  animation: drift 16s ease-in-out infinite;
  opacity: 0.4;
  mix-blend-mode: screen;
  pointer-events: none;
}

.fragment-purple {
  background: radial-gradient(circle, rgba(127, 29, 255, 0.35), transparent 70%);
  animation-duration: 22s;
}

@keyframes drift {
  0% {
    transform: translate3d(-30px, -20px, 0) rotate(0deg);
  }

  50% {
    transform: translate3d(40px, 30px, 0) rotate(12deg);
  }

  100% {
    transform: translate3d(-30px, -10px, 0) rotate(0deg);
  }
}

.scroll-tag {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.45);
}

.parallax-wrap {
  transform-style: preserve-3d;
  perspective: 1200px;
  position: relative;
}

.parallax-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  filter: blur(6px);
  /* Reduced from 14px for better performance */
  transition:
    opacity 0.5s var(--ease-smooth),
    /* Faster from 0.6s */
    transform 0.5s var(--ease-smooth),
    filter 0.5s var(--ease-smooth);
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

[data-reveal="scale"] {
  transform: translate3d(0, 50px, 0) scale(0.95);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

[data-reveal="scale"].is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {

  [data-reveal],
  [data-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* Dust Particles */
.dust-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.dust-particle-wrapper {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dust-particle {
  position: relative;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  animation: floatParticle 20s ease-in-out infinite;
}

@keyframes floatParticle {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(15px, -20px) scale(1.1);
  }

  50% {
    transform: translate(-10px, 15px) scale(0.9);
  }

  75% {
    transform: translate(20px, 10px) scale(1.05);
  }
}

.dust-particle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  filter: blur(1px);
  opacity: 0.8;
}

/* Dark theme particle colors */
.dust-particle--orange {
  background: rgba(255, 122, 24, 0.4);
  box-shadow: 0 0 6px rgba(255, 122, 24, 0.3);
}

.dust-particle--purple {
  background: rgba(127, 29, 255, 0.4);
  box-shadow: 0 0 6px rgba(127, 29, 255, 0.3);
}

.dust-particle--white {
  background: rgba(248, 248, 255, 0.3);
  box-shadow: 0 0 4px rgba(248, 248, 255, 0.2);
}

/* Light theme particle colors */
[data-theme="light"] .dust-particle--orange {
  background: rgba(255, 122, 24, 0.25);
  box-shadow: 0 0 4px rgba(255, 122, 24, 0.2);
}

[data-theme="light"] .dust-particle--purple {
  background: rgba(127, 29, 255, 0.25);
  box-shadow: 0 0 4px rgba(127, 29, 255, 0.2);
}

[data-theme="light"] .dust-particle--white {
  background: rgba(5, 5, 5, 0.15);
  box-shadow: 0 0 3px rgba(5, 5, 5, 0.1);
}

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

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

  .hero-visual {
    order: -1;
    margin-bottom: 1rem;
  }

  nav {
    padding: 1rem 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .theme-toggle {
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}