:root {
  --bg: #07090f;
  --panel: rgba(17, 24, 39, 0.7);
  --panel-strong: rgba(20, 28, 45, 0.94);
  --text: #f8fafc;
  --muted: #a8b3c7;
  --line: rgba(255, 255, 255, 0.12);
  --cyan: #31d6d3;
  --lime: #b9f35d;
  --rose: #ff6f91;
  --amber: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, rgba(49, 214, 211, 0.16), transparent 32rem),
    radial-gradient(circle at 84% 12%, rgba(255, 111, 145, 0.14), transparent 28rem),
    radial-gradient(circle at 78% 80%, rgba(185, 243, 93, 0.1), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 11;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(49, 214, 211, 0.75);
  box-shadow: 0 0 28px rgba(49, 214, 211, 0.9), 0 0 70px rgba(185, 243, 93, 0.34);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease;
  mix-blend-mode: screen;
}

.cursor-glow.active {
  opacity: 0.75;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 12;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--rose));
  box-shadow: 0 0 18px rgba(49, 214, 211, 0.7);
}

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

#spaceCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  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: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background: #07090f;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

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

.loader p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.loader-cube {
  position: relative;
  width: 58px;
  height: 58px;
  transform-style: preserve-3d;
  animation: spinCube 1.4s linear infinite;
}

.loader-cube span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--cyan);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(49, 214, 211, 0.4);
}

.loader-cube span:nth-child(2) {
  transform: rotateY(60deg);
  border-color: var(--lime);
}

.loader-cube span:nth-child(3) {
  transform: rotateX(60deg);
  border-color: var(--rose);
}

@keyframes spinCube {
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10;
  width: min(1120px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  transition: top 0.25s ease, width 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  top: 10px;
  width: min(940px, calc(100% - 32px));
  background: rgba(7, 9, 15, 0.9);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.brand {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #071014;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

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

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 52px;
  padding-top: 130px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 900;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.6rem, 10vw, 8.6rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.name-word {
  display: block;
  transform: translateY(110%);
  opacity: 0;
  animation: riseName 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.name-word:nth-child(2) {
  animation-delay: 0.15s;
}

.name-word:nth-child(3) {
  animation-delay: 0.3s;
}

.accent-letter {
  color: var(--lime);
}

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

.tagline {
  max-width: 670px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.4vw, 1.45rem);
  line-height: 1.65;
}

.hero-copy {
  position: relative;
}

.hero-copy::after {
  content: "<build />";
  position: absolute;
  right: 6%;
  bottom: -56px;
  color: rgba(185, 243, 93, 0.42);
  font-weight: 900;
  animation: codePulse 2.8s ease-in-out infinite;
}

@keyframes codePulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-8px);
  }
}

.hero-actions,
.project-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:active {
  transform: translateY(2px) scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #071014;
  box-shadow: 0 16px 36px rgba(49, 214, 211, 0.22);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.btn.small {
  min-height: 40px;
  padding: 0 15px;
  font-size: 0.88rem;
}

a[aria-disabled="true"] {
  opacity: 0.62;
  cursor: not-allowed;
}

.hero-visual {
  perspective: 1000px;
}

.orbit-stage {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  animation: floatStage 6s ease-in-out infinite;
}

@keyframes floatStage {
  0%,
  100% {
    transform: translateY(0) rotateX(0deg) rotateY(-5deg);
  }
  50% {
    transform: translateY(-16px) rotateX(4deg) rotateY(6deg);
  }
}

.portrait-card {
  position: relative;
  width: min(380px, 86vw);
  aspect-ratio: 0.78;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  transform: rotateY(-10deg) rotateX(7deg);
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

.portrait-glow {
  position: absolute;
  inset: 14%;
  filter: blur(50px);
  background: linear-gradient(135deg, rgba(49, 214, 211, 0.7), rgba(255, 111, 145, 0.45));
  opacity: 0.65;
}

.portrait-frame {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(7, 9, 15, 0.15), rgba(7, 9, 15, 0.85)),
    url("profile.jpg") center top / cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 10%, rgba(255, 255, 255, 0.16), transparent 38%);
  transform: translateX(-120%);
  animation: photoShine 4.5s ease-in-out infinite;
}

@keyframes photoShine {
  0%,
  46% {
    transform: translateX(-120%);
  }
  68%,
  100% {
    transform: translateX(120%);
  }
}

.avatar-placeholder {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(49, 214, 211, 0.28), transparent 15rem),
    linear-gradient(150deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
}

.portrait-frame.has-photo .avatar-placeholder {
  display: none;
}

.avatar-placeholder span {
  width: 146px;
  height: 146px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--rose));
  color: #061018;
  font-size: 3.4rem;
  font-weight: 900;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.avatar-placeholder small {
  color: var(--muted);
  font-weight: 800;
}

.role-chip {
  position: absolute;
  right: -10px;
  bottom: 42px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 900;
}

.orbit {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  animation: orbitSpin 16s linear infinite;
  transform-style: preserve-3d;
}

.orbit-two {
  inset: 0;
  animation-duration: 22s;
  animation-direction: reverse;
  transform: rotateX(64deg) rotateZ(20deg);
}

.orbit-one {
  transform: rotateX(66deg) rotateZ(-14deg);
}

.orbit span {
  position: absolute;
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.orbit span:nth-child(1) {
  top: 0;
  left: 50%;
}

.orbit span:nth-child(2) {
  right: 0;
  top: 62%;
}

.orbit span:nth-child(3) {
  left: 2%;
  bottom: 18%;
}

.code-float {
  position: absolute;
  z-index: 2;
  width: 150px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(7, 9, 15, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  transform-style: preserve-3d;
  animation: floatPanel 5s ease-in-out infinite;
}

.code-float strong {
  display: block;
  color: var(--lime);
  font-size: 0.78rem;
  margin-bottom: 5px;
}

.code-float span {
  color: #dce6f5;
  font-size: 0.82rem;
  font-weight: 800;
}

.float-one {
  left: 0;
  top: 18%;
}

.float-two {
  right: 0;
  top: 8%;
  animation-delay: 0.8s;
}

.float-three {
  right: 2%;
  bottom: 8%;
  animation-delay: 1.5s;
}

@keyframes floatPanel {
  0%,
  100% {
    transform: translate3d(0, 0, 42px) rotateZ(-2deg);
  }
  50% {
    transform: translate3d(0, -18px, 72px) rotateZ(2deg);
  }
}

@keyframes orbitSpin {
  to {
    rotate: 360deg;
  }
}

.section-heading {
  max-width: 740px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 42px;
  align-items: start;
}

.about-text {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: #dbe5f6;
  line-height: 1.9;
  font-size: 1.08rem;
}

.skill-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
}

.skill-card,
.project-card,
.coding-panel,
.contact-box {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.skill-card {
  padding: 24px;
  min-height: 172px;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.skill-card:hover {
  transform: translateY(-8px) rotateX(3deg);
  border-color: rgba(185, 243, 93, 0.4);
  background: rgba(26, 35, 52, 0.82);
}

.skill-card h3,
.project-card h3 {
  margin: 0 0 18px;
  font-size: 1.18rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-list span {
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dfe8f7;
  font-weight: 800;
  font-size: 0.86rem;
  animation: pillFloat 4.2s ease-in-out infinite;
}

.pill-list span:nth-child(2n) {
  animation-delay: 0.7s;
}

.pill-list span:nth-child(3n) {
  animation-delay: 1.3s;
}

@keyframes pillFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.project-card {
  position: relative;
  min-height: 330px;
  padding: 24px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  transform-style: preserve-3d;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(49, 214, 211, 0.22), transparent 18rem);
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.project-card:hover {
  transform: translateY(-10px) rotateX(3deg);
  border-color: rgba(49, 214, 211, 0.42);
}

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

.project-card.featured {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(49, 214, 211, 0.16), rgba(255, 255, 255, 0.04)),
    var(--panel);
}

.project-topline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.project-topline span {
  padding: 8px 10px;
  border-radius: 999px;
  color: #061018;
  background: var(--amber);
  font-weight: 900;
  font-size: 0.76rem;
}

.project-card p,
.project-card li {
  color: var(--muted);
  line-height: 1.7;
}

.project-card ul {
  margin: 18px 0 0;
  padding-left: 20px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 26px;
  align-items: stretch;
}

.timeline {
  margin-top: 34px;
  display: grid;
  gap: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #061018;
  background: var(--lime);
  font-weight: 900;
}

.timeline p {
  margin: 0;
  color: #dce6f5;
  font-weight: 800;
}

.coding-panel {
  padding: 28px;
}

.profile-link {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 900;
}

.profile-link span {
  color: var(--muted);
  font-weight: 700;
}

.contact {
  padding-bottom: 60px;
}

.contact-box {
  padding: clamp(26px, 6vw, 60px);
  background:
    linear-gradient(135deg, rgba(49, 214, 211, 0.18), rgba(255, 111, 145, 0.11)),
    var(--panel);
}

.contact-links a {
  min-width: 140px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.contact-links a:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.14);
}

footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 44px;
  color: var(--muted);
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.skill-card,
.project-card,
.timeline article,
.profile-link {
  animation: breatheGlow 5.8s ease-in-out infinite;
}

@keyframes breatheGlow {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow: 0 24px 80px rgba(49, 214, 211, 0.13);
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 66px;
    right: 0;
    width: min(280px, calc(100vw - 32px));
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(7, 9, 15, 0.94);
  }

  .nav-links.open {
    display: flex;
  }

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

  .hero {
    gap: 18px;
    padding-top: 118px;
  }

  .orbit-stage {
    min-height: 390px;
  }

  .code-float {
    width: 124px;
    padding: 11px;
  }

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

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

  .section {
    padding: 76px 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
  }

  .hero-actions,
  .project-actions,
  .contact-links {
    flex-direction: column;
  }

  .btn,
  .contact-links a {
    width: 100%;
  }

  .portrait-card {
    width: min(310px, 86vw);
  }

  .orbit {
    inset: 3%;
  }

  .code-float {
    display: none;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }
}

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