:root {
  --bg: #05070f;
  --card: rgba(18, 25, 48, 0.72);
  --card-soft: rgba(11, 17, 35, 0.82);
  --line: rgba(148, 163, 184, 0.2);
  --text: #e5ecff;
  --muted: #a4b5de;
  --accent-1: #7c3aed;
  --accent-2: #22d3ee;
  --accent-3: #f97316;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-lg: 0 18px 40px rgba(5, 10, 25, 0.34);
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, #181e3f 0%, transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(126, 34, 206, 0.22) 0%, transparent 38%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease-smooth), transform 500ms var(--ease-smooth);
}

body.loaded {
  opacity: 1;
  transform: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #04060d, #0e1130);
  transition: opacity 700ms var(--ease-smooth), visibility 700ms;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-core {
  position: relative;
  width: min(34vw, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(124, 58, 237, 0.35);
  display: grid;
  place-items: center;
}

.loader-core::before,
.loader-core::after {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.4);
  animation: spin 2.8s linear infinite;
}

.loader-core::after {
  inset: -22%;
  border-color: rgba(249, 115, 22, 0.32);
  animation-direction: reverse;
  animation-duration: 3.4s;
}

.loading-label {
  letter-spacing: 0.32rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #b8c8ff;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform-origin: left;
  transform: scaleX(0);
  z-index: 60;
  background: linear-gradient(90deg, #7c3aed, #22d3ee, #f97316);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.55);
}

.bg-orb,
.bg-grid,
.bg-light,
.bg-light-2 {
  position: fixed;
  pointer-events: none;
}

.bg-orb {
  width: 65vmax;
  height: 65vmax;
  top: -30vmax;
  right: -18vmax;
  filter: blur(36px);
  opacity: 0.65;
  background: conic-gradient(from 30deg, rgba(124, 58, 237, 0.48), rgba(34, 211, 238, 0.2), rgba(249, 115, 22, 0.36), rgba(124, 58, 237, 0.5));
  animation: floatOrb 22s ease-in-out infinite alternate;
}

.bg-light,
.bg-light-2 {
  width: 35vmax;
  height: 35vmax;
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
}

.bg-light {
  top: 40%;
  left: -10%;
  background: rgba(34, 211, 238, 0.18);
  animation: drift 18s ease-in-out infinite;
}

.bg-light-2 {
  bottom: -5%;
  right: -8%;
  background: rgba(124, 58, 237, 0.18);
  animation: drift 16s ease-in-out infinite reverse;
}

.bg-grid {
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 95%);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.8;
}

.container {
  width: min(1120px, 92vw);
  margin: 30px auto 72px;
}

.section-spacing {
  margin-top: 88px;
}

.nav {
  position: sticky;
  top: 16px;
  z-index: 25;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  backdrop-filter: blur(14px);
  background: rgba(8, 13, 30, 0.74);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.16rem;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.58rem 0.84rem;
  border-radius: 999px;
  transition: color 320ms var(--ease-smooth), background 320ms var(--ease-smooth), transform 320ms var(--ease-smooth);
}

.nav-link:hover {
  color: #fff;
  background: rgba(124, 58, 237, 0.16);
  transform: translateY(-2px);
}

.hero {
  display: grid;
  gap: 2.6rem;
  grid-template-columns: 1.18fr 0.95fr;
  align-items: center;
}

.hero-copy-wrap {
  display: grid;
  gap: 1.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-2);
  font-size: 0.88rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

h1 {
  font-size: clamp(2.2rem, 4.7vw, 3.95rem);
  margin: 0;
  line-height: 1.08;
}

.grad {
  background: linear-gradient(90deg, #b88cff, #78f6ff 44%, #ffae66 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy,
.section-copy,
.card p,
.project p,
.achievement-list li {
  color: var(--muted);
}

.hero-copy {
  margin: 0;
  max-width: 640px;
  font-size: 1.03rem;
  line-height: 1.8;
}

.hero-chips,
.cta,
.stats,
.grid-3,
.grid-2,
.skills,
.contact-stack {
  display: grid;
  gap: 1rem;
}

.hero-chips {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.chip,
.skill,
.project,
.stat,
.card,
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
}

.chip {
  border-radius: 14px;
  padding: 0.75rem 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 300ms var(--ease-smooth), border-color 300ms;
}

.chip span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.14);
}

.chip:hover,
.skill:hover,
.project:hover,
.stat:hover,
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.5);
}

.cta {
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  justify-content: start;
}

.btn {
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: transform 300ms var(--ease-smooth), box-shadow 300ms var(--ease-smooth), background 300ms;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(120deg, rgba(124, 58, 237, 0.72), rgba(34, 211, 238, 0.56));
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
}

.btn.secondary:hover,
.btn.primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 35px rgba(34, 211, 238, 0.24);
}

.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  border-radius: 18px;
  padding: 1rem;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.stat strong {
  display: block;
  font-size: 1.26rem;
}

.showcase {
  display: grid;
  place-items: center;
}

.profile-stage {
  position: relative;
  width: min(430px, 88vw);
  aspect-ratio: 1;
}

.ring {
  position: absolute;
  inset: 11%;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}

.r2 {
  inset: 22%;
  animation-duration: 19s;
}

.r3 {
  inset: 33%;
  animation-direction: reverse;
  animation-duration: 15s;
}

.pfp-frame {
  position: absolute;
  inset: 28%;
  border-radius: 24px;
  padding: 8px;
  background: linear-gradient(140deg, rgba(124, 58, 237, 0.75), rgba(34, 211, 238, 0.62), rgba(249, 115, 22, 0.72));
  animation: pulseGlow 3s ease-in-out infinite;
  box-shadow: var(--shadow-lg);
}

.pfp-inner {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
}

.pfp-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
}

.floating-card {
  position: absolute;
  max-width: 150px;
  font-size: 0.8rem;
  padding: 0.72rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 31, 0.78);
  box-shadow: var(--shadow-lg);
  animation: bob 5s ease-in-out infinite;
}

.floating-card small {
  display: block;
  color: var(--muted);
  margin-top: 0.24rem;
}

.fc1 { top: 8%; left: -6%; }
.fc2 { top: 10%; right: -6%; animation-delay: -1.5s; }
.fc3 { bottom: 8%; left: 2%; animation-delay: -0.5s; }
.fc4 { bottom: 10%; right: -4%; animation-delay: -2.2s; }

.section {
  display: grid;
  gap: 1.75rem;
}

.section-head {
  display: grid;
  gap: 0.5rem;
  max-width: 740px;
}

.section-head.compact {
  margin-bottom: 0.8rem;
}

.section-kicker {
  margin: 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.13rem;
  color: var(--accent-2);
}

.section-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.section-title.small {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
}

.section-copy {
  margin: 0;
  line-height: 1.8;
}

.compact-copy {
  max-width: 520px;
}

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

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.card {
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: transform 300ms var(--ease-smooth), border-color 300ms, box-shadow 300ms var(--ease-smooth);
  will-change: transform;
  box-shadow: var(--shadow-lg);
}

.card:hover {
  box-shadow: 0 14px 34px rgba(8, 14, 28, 0.44);
}

.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  background: rgba(124, 58, 237, 0.14);
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
}

.feature-grid .card {
  min-height: 245px;
}

.project-list,
.achievement-list {
  display: grid;
  gap: 0.9rem;
}

.project {
  display: grid;
  grid-template-columns: 44px 1fr;
  border-radius: 16px;
  padding: 0.88rem;
  margin: 0;
}

.project-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(124, 58, 237, 0.22);
  font-weight: 700;
}

.project h4 {
  margin: 0 0 0.32rem;
  font-size: 1rem;
}

.achievement-list {
  margin: 0;
  padding-left: 1.1rem;
}

.achievement-list li + li {
  margin-top: 0.6rem;
}

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

.skill {
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
}

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

.contact-stack {
  gap: 1rem;
}

.contact-card {
  display: grid;
  grid-template-columns: 82px 1fr 28px;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(9, 14, 31, 0.82), rgba(7, 10, 24, 0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 14px 34px rgba(0, 0, 0, 0.26);
  text-decoration: none;
  color: var(--text);
  transition:
    transform 320ms var(--ease-smooth),
    border-color 320ms var(--ease-smooth),
    box-shadow 320ms var(--ease-smooth),
    background 320ms var(--ease-smooth);
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(34, 211, 238, 0.06);
}

.contact-icon {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  color: #dbe7ff;
  background: linear-gradient(180deg, rgba(20, 27, 48, 0.95), rgba(14, 19, 35, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 25px rgba(0,0,0,0.24);
}

.contact-copy-block h3 {
  margin: 0 0 0.28rem;
  font-size: 1.28rem;
  line-height: 1.1;
  color: #ffffff;
}

.contact-copy-block p {
  margin: 0;
  color: #7f8fb3;
  font-size: 1rem;
  line-height: 1.4;
}

.contact-arrow {
  text-align: right;
  font-size: 1.4rem;
  color: rgba(132, 147, 180, 0.55);
  transition: transform 320ms var(--ease-smooth), color 320ms var(--ease-smooth);
}

.contact-card:hover .contact-arrow {
  transform: translate(2px, -2px);
  color: rgba(219, 231, 255, 0.85);
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 68px;
  padding: 18px 0 10px;
}

.footer-line {
  width: min(220px, 60%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.55), rgba(34, 211, 238, 0.55), transparent);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.footer-text {
  margin: 0;
  color: rgba(214, 224, 255, 0.72);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  text-shadow: 0 0 10px rgba(124, 58, 237, 0.16);
}

.footer-bolt {
  color: #ffd84d;
  text-shadow: 0 0 14px rgba(255, 216, 77, 0.45);
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 900ms var(--ease-smooth), transform 900ms var(--ease-smooth);
}

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

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

@keyframes floatOrb {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-6vw, 12vh) rotate(36deg); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(3vw, -3vh, 0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.25); }
  50% { box-shadow: 0 0 30px 6px rgba(34, 211, 238, 0.22); }
}

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

@media (max-width: 980px) {
  .container {
    width: min(94vw, 1120px);
  }

  .hero,
  .grid-3,
  .grid-2,
  .stats,
  .skills {
    grid-template-columns: 1fr;
  }

  .section-spacing {
    margin-top: 72px;
  }

  .nav {
    border-radius: 22px;
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .feature-grid .card {
    min-height: auto;
  }

  .contact-card {
    grid-template-columns: 72px 1fr 24px;
    padding: 1rem;
  }

  .contact-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 1.55rem;
  }

  .floating-card {
    font-size: 0.72rem;
    max-width: 120px;
  }
}

@media (max-width: 640px) {
  .container {
    margin: 18px auto 56px;
  }

  .section-spacing {
    margin-top: 58px;
  }

  .hero {
    gap: 2rem;
  }

  .hero-copy-wrap {
    gap: 1.2rem;
  }

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

  .stats {
    gap: 0.8rem;
  }

  .contact-card {
    grid-template-columns: 64px 1fr 18px;
    gap: 0.8rem;
    border-radius: 20px;
  }

  .contact-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .contact-copy-block h3 {
    font-size: 1.05rem;
  }

  .contact-copy-block p {
    font-size: 0.92rem;
  }

  .contact-arrow {
    font-size: 1.1rem;
  }

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

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

  body {
    opacity: 1;
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
