:root {
  --bg: #0a0a0f;
  --bg-2: #0f0f17;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-dim: #a0a0ad;
  --text-soft: #6b6b78;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff5cb4;
  --grad: linear-gradient(135deg, #7c5cff 0%, #00d4ff 50%, #ff5cb4 100%);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --radius: 16px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #ffffff;
  --surface: rgba(0, 0, 0, 0.03);
  --surface-strong: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.08);
  --text: #0f0f17;
  --text-dim: #4a4a55;
  --text-soft: #8a8a95;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background effects */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 92, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -2;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.bg-glow {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.15) 0%, transparent 60%);
  z-index: -1;
  filter: blur(40px);
  pointer-events: none;
}

[data-theme="light"] .bg-glow {
  background: radial-gradient(circle, rgba(124, 92, 255, 0.12) 0%, transparent 60%);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(250, 250, 250, 0.7);
}

.nav__logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav__logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

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

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad);
  transition: width 0.3s;
}

.nav__links a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--surface-strong);
  transform: rotate(20deg);
}

/* Hero */
.hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--surface);
  margin-bottom: 1.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 12px #00ff88;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn--primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(124, 92, 255, 0.5);
}

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

.btn--ghost:hover {
  background: var(--surface-strong);
  transform: translateY(-2px);
}

.hero__socials {
  display: flex;
  gap: 1rem;
}

.hero__socials a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.25s;
}

.hero__socials a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.25);
}

/* Hero visual - 3D cube */
.hero__visual {
  position: relative;
  height: 480px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.orb {
  position: absolute;
  width: 300px;
  height: 300px;
  background: var(--grad);
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
}

.cube {
  width: 200px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotateX(-20deg) rotateY(0); }
  to { transform: rotateX(-20deg) rotateY(360deg); }
}

.cube__face {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(0, 212, 255, 0.05));
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 40px rgba(124, 92, 255, 0.15);
}

.cube__face--front  { transform: rotateY(0deg)   translateZ(100px); }
.cube__face--back   { transform: rotateY(180deg) translateZ(100px); }
.cube__face--right  { transform: rotateY(90deg)  translateZ(100px); }
.cube__face--left   { transform: rotateY(-90deg) translateZ(100px); }
.cube__face--top    { transform: rotateX(90deg)  translateZ(100px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(100px); }

/* Sections */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2.5rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.section__num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--text-soft);
  font-weight: 500;
}

.section__head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section__lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  max-width: 700px;
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about__text p {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

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

.stat {
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}

.stat:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
}

.stat__num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.about__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.about__card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.info-list {
  list-style: none;
  position: relative;
  z-index: 1;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list span {
  color: var(--text-soft);
}

.info-list strong {
  color: var(--text);
  font-weight: 500;
}

.status {
  color: #00ff88 !important;
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 16px 40px rgba(124, 92, 255, 0.15);
}

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

.skill-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(0, 212, 255, 0.1));
  display: grid;
  place-items: center;
  color: var(--accent);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.skill-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.skill-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.tags span {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
}

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

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.project__cover {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}

.project__cover--1 {
  background:
    radial-gradient(circle at 30% 30%, rgba(124, 92, 255, 0.5), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0, 212, 255, 0.4), transparent 50%),
    linear-gradient(135deg, #1a1a2e, #16213e);
}

.project__cover--2 {
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 92, 180, 0.5), transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(124, 92, 255, 0.4), transparent 50%),
    linear-gradient(135deg, #2d1b3d, #1a1a2e);
}

.project__cover--3 {
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 212, 255, 0.4), transparent 50%),
    radial-gradient(circle at 50% 70%, rgba(124, 92, 255, 0.4), transparent 50%),
    linear-gradient(135deg, #0d2538, #1a1a2e);
}

.project__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  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: 24px 24px;
}

.project__type {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.75rem;
  color: white;
  z-index: 2;
}

.project__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project__body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.project__body p {
  color: var(--text-dim);
  font-size: 0.92rem;
  flex: 1;
  margin-bottom: 1rem;
}

.project__cta {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s;
}

.project:hover .project__cta {
  transform: translateX(4px);
}

/* Contact */
.section--contact {
  padding: 4rem 2.5rem 6rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card .section__num {
  display: block;
  margin-bottom: 0.5rem;
}

.contact-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.contact-card > p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.contact-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.contact-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: var(--accent);
}

/* Footer */
.footer {
  padding: 2rem 2.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 900px) {
  .nav { padding: 1rem 1.25rem; }
  .nav__links { display: none; }

  .hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 4rem;
    text-align: left;
    gap: 2rem;
  }

  .hero__visual { height: 320px; }
  .cube { width: 140px; height: 140px; }
  .cube__face { width: 140px; height: 140px; }
  .cube__face--front  { transform: rotateY(0deg)   translateZ(70px); }
  .cube__face--back   { transform: rotateY(180deg) translateZ(70px); }
  .cube__face--right  { transform: rotateY(90deg)  translateZ(70px); }
  .cube__face--left   { transform: rotateY(-90deg) translateZ(70px); }
  .cube__face--top    { transform: rotateX(90deg)  translateZ(70px); }
  .cube__face--bottom { transform: rotateX(-90deg) translateZ(70px); }

  .section { padding: 4rem 1.25rem; }
  .about { grid-template-columns: 1fr; }
  .contact-card { padding: 2.5rem 1.5rem; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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