:root {
  --bg: #0a0a12;
  --panel: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e8e8f0;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent2: #00e0c6;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
}

#bg3d {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
}

.nav, .hero, .section, .footer { position: relative; z-index: 1; }

/* Nav */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 6vw;
  position: fixed;
  top: 0; left: 0; right: 0;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 18, 0.6);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  letter-spacing: 1px;
}
.logo span { color: var(--accent2); }

.nav ul { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.btn-nav {
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--text) !important;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 6vw;
}

.kicker {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent2);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 70%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.hero-cta { margin-top: 2.4rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), #5a3ee0);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124, 92, 255, 0.4); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

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

.section h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--accent2);
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.8rem;
  backdrop-filter: blur(8px);
  transition: transform 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.card.art:hover { border-color: var(--accent2); }

.card-icon { font-size: 2rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.card p { color: var(--muted); font-size: 0.93rem; line-height: 1.65; }

.stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.stack span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* About */
.about p { max-width: 46rem; color: var(--muted); line-height: 1.8; font-size: 1.05rem; }

.stats {
  display: flex;
  gap: 3rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}
.stats div { display: flex; flex-direction: column; }
.stats strong {
  font-size: 2.2rem;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats span { color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }

/* Footer */
.footer {
  padding: 6rem 6vw 4rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer h2 { font-size: 2.4rem; margin-bottom: 0.8rem; }
.footer p { color: var(--muted); }

.links {
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  margin: 2.4rem 0;
  flex-wrap: wrap;
}
.links a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.links a:hover { color: var(--accent2); border-color: var(--accent2); }

.tiny { font-size: 0.78rem; margin-top: 2rem; opacity: 0.6; }

@media (max-width: 720px) {
  .nav ul { gap: 1.1rem; }
  .btn-nav { display: none; }
}

/* Portfolio gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.tile {
  position: relative;
  display: block;
  height: 220px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s, border-color 0.25s;
}
.tile:hover { transform: translateY(-6px) scale(1.01); border-color: var(--accent2); }

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 200% 200%;
  animation: drift 12s ease infinite;
}

.t1::before { background-image: linear-gradient(120deg, #2a1a5e, #7c5cff, #00e0c6); }
.t2::before { background-image: linear-gradient(120deg, #0d2b45, #00e0c6, #7c5cff); }
.t3::before { background-image: linear-gradient(120deg, #3d0a3a, #ff2e88, #7c5cff); }
.t4::before { background-image: linear-gradient(120deg, #0a3d2e, #00e0c6, #1a5e2a); }
.t5::before { background-image: linear-gradient(120deg, #451a0d, #ff8a2e, #7c5cff); }
.t6::before { background-image: linear-gradient(120deg, #1a1a3d, #4a5cff, #00e0c6); }

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

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,18,0.92) 15%, transparent 60%);
}

.tile-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 1.4rem;
  z-index: 1;
}
.tile-info h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.25rem; }
.tile-info p { color: var(--muted); font-size: 0.85rem; }
