/* ── Variables ── */
:root {
  --bg: #050508;
  --text: #f0f0f0;
  --text-muted: #a0a0b0;
  --accent: #a855f7;
  --accent-hover: #c084fc;
  --accent-dark: #7e22ce;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(168, 85, 247, 0.1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Mouse Spotlight ── */
.mouse-spotlight {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 0.1s ease-out, top 0.1s ease-out;
}

/* ── Page Loader ── */
body.loading {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Scroll Progress ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 200;
  transition: width 0.05s linear;
}

/* ── Particle Canvas ── */
.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Background Orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.15s ease-out;
}

.orb-1 {
  top: 10%;
  left: 5%;
  width: 500px;
  height: 500px;
  background: var(--accent);
}

.orb-2 {
  top: 40%;
  right: 0;
  width: 400px;
  height: 400px;
  background: #6366f1;
  animation-delay: 7s;
}

.orb-3 {
  bottom: 5%;
  left: 30%;
  width: 350px;
  height: 350px;
  background: var(--accent-dark);
  animation-delay: 3s;
}

/* float animation removed — orbs now use scroll parallax */

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  transition: all 0.3s;
}

.navbar.scrolled {
  padding: 0.75rem 2rem;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}

/* Live Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #e53e3e;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

.nav-links a.active {
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 2rem;
}

/* Hero Avatar */
.hero-avatar {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
  border: 3px solid rgba(168, 85, 247, 0.25);
  overflow: hidden;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  max-width: 700px;
}

.hero-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 100px;
  padding: 0.4rem 1.25rem;
  margin-bottom: 1rem;
}

/* Typewriter cursor */
.typewriter-cursor {
  color: var(--accent);
  animation: blink 0.7s step-end infinite;
  font-weight: 300;
}

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

.hero-title {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, #6366f1 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
}

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

.hero-bio {
  margin-top: 1rem;
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-socials a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.hero-socials a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.35);
}

/* ── Stats Bar ── */
.stats-bar {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-plus {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Sections ── */
.section {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-title i {
  color: var(--accent);
}

/* ── Glass Cards ── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s;
}

/* ── Twitch Embed ── */
.twitch-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
}

.twitch-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Skills Grid ── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.3s;
}

.skill-tag i {
  color: var(--accent);
  font-size: 1rem;
}

.skill-tag:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--glass-hover);
  transform: translateY(-2px);
}

/* Skill Tooltips */
.skill-tag {
  position: relative;
}

.skill-tag[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.35rem 0.75rem;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}

.skill-tag[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Work Cards Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.work-card {
  padding: 2rem;
  text-align: center;
}

/* Center the last card when it's alone on a new row */
.card-grid .work-card:last-child:nth-child(3n + 1) {
  grid-column: 2;
}

.work-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.12);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--accent);
  margin: 0 auto 1.25rem;
}

.work-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-org {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-org a {
  font-weight: 600;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Projects Grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.12);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.project-header > i {
  font-size: 2rem;
  color: var(--accent);
}

.project-links a {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.2s;
}

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

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-card > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.project-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(168, 85, 247, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

/* ── Discord Section ── */
.discord-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.discord-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

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

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: #5865F2;
  color: #fff !important;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  transition: all 0.3s;
}

.btn-discord:hover {
  background: #4752c4;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.35);
}

.discord-widget {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.discord-widget iframe {
  display: block;
}

/* ── Contact Grid ── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.contact-card {
  text-align: center;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text) !important;
}

.contact-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.12);
}

.contact-card i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
}

.contact-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

/* ── Spotify Embed ── */
.spotify-card {
  padding: 0;
  overflow: hidden;
}

.spotify-card iframe {
  display: block;
  border-radius: 16px;
}

/* ── Wave Divider ── */
.wave-divider {
  position: relative;
  z-index: 1;
  line-height: 0;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 30px;
}

.wave-flip {
  transform: scaleY(-1);
}

/* ── Status Widget ── */
.status-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-dot-green {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--glass-border);
}

.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: var(--glass);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
}

.btn-kofi:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3);
}

.footer-copy {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
}

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

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

/* Stagger cards */
.card-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.card-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.card-grid .reveal:nth-child(4) { transition-delay: 0.3s; }

.projects-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .reveal:nth-child(3) { transition-delay: 0.2s; }

.contact-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.contact-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.contact-grid .reveal:nth-child(4) { transition-delay: 0.3s; }

.skills-grid .reveal:nth-child(2)  { transition-delay: 0.03s; }
.skills-grid .reveal:nth-child(3)  { transition-delay: 0.06s; }
.skills-grid .reveal:nth-child(4)  { transition-delay: 0.09s; }
.skills-grid .reveal:nth-child(5)  { transition-delay: 0.12s; }
.skills-grid .reveal:nth-child(6)  { transition-delay: 0.15s; }
.skills-grid .reveal:nth-child(7)  { transition-delay: 0.18s; }
.skills-grid .reveal:nth-child(8)  { transition-delay: 0.21s; }
.skills-grid .reveal:nth-child(9)  { transition-delay: 0.24s; }
.skills-grid .reveal:nth-child(10) { transition-delay: 0.27s; }
.skills-grid .reveal:nth-child(11) { transition-delay: 0.30s; }
.skills-grid .reveal:nth-child(12) { transition-delay: 0.33s; }

.stats-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.stats-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.stats-grid .reveal:nth-child(4) { transition-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .card-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-card {
    text-align: left;
  }

  .card-icon {
    margin: 0 0 1rem;
  }

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

  .discord-section {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
  }

  .nav-links a.active::after {
    display: none;
  }

  .mouse-spotlight {
    display: none;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 4.5rem 1.25rem 2rem;
  }

  .hero-bio {
    font-size: 1rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .glass-card {
    padding: 1.25rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .card-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

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