#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 28%, rgba(8, 9, 13, 0.6), transparent 65%),
    rgba(8, 9, 13, 0.4);
}

body {
  overflow-x: hidden;
}

/* ---------- Music toggle ---------- */
.music-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(23, 26, 33, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.music-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.music-bars i {
  display: block;
  width: 2.5px;
  background: var(--accent);
  border-radius: 2px;
  height: 4px;
  animation: musicBar 0.9s ease-in-out infinite;
  animation-play-state: paused;
}

.music-toggle[aria-pressed="true"] .music-bars i {
  animation-play-state: running;
}

.music-bars i:nth-child(1) { animation-delay: -0.6s; }
.music-bars i:nth-child(2) { animation-delay: -0.3s; }
.music-bars i:nth-child(3) { animation-delay: 0s; }

@keyframes musicBar {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

@media (max-width: 720px) {
  .music-toggle { bottom: 16px; right: 16px; padding: 9px 12px; }
  .music-label { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
}

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

.hero-avatar-ring {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 22px;
  border-radius: 50%;
}

.hero-avatar-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #5eead4, #818cf8, #f472b6, #fbbf24, #34d399, #5eead4);
  box-shadow: 0 0 40px rgba(94, 234, 212, 0.35), 0 0 70px rgba(129, 140, 248, 0.2);
  animation: avatarSpin 6s linear infinite;
  z-index: 0;
}

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

.hero-avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #0f1115;
  background: #0f1115;
}

.hero-eyebrow {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 14px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 20px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

.hero-bio {
  color: #c4c9d4;
  font-size: 17px;
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto 34px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.hero-btn {
  width: auto;
}

.hero-socials {
  display: flex;
  gap: 22px;
  justify-content: center;
}

.hero-socials a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.scroll-hint span {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

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

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 24px;
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  margin: 0 0 44px;
  text-align: center;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-text {
  color: #c4c9d4;
  font-size: 16px;
  line-height: 1.8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  background: rgba(23, 26, 33, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 12px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.stat-num,
.stat-num-text {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
}

.stat-suffix {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.stat-num-text { font-size: 22px; }

.stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .skills-grid { grid-template-columns: 1fr; }
}

.skill-group {
  background: rgba(23, 26, 33, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(6px);
}

.skill-group h3 {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text);
}

.skill-bar {
  margin-bottom: 16px;
}

.skill-name {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.project-card {
  background: rgba(23, 26, 33, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(6px);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: rgba(94, 234, 212, 0.4);
  box-shadow: 0 18px 40px -18px rgba(94, 234, 212, 0.25);
}

.project-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.project-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.project-card-highlight {
  border-color: rgba(94, 234, 212, 0.5);
  background: linear-gradient(160deg, rgba(94, 234, 212, 0.08), rgba(23, 26, 33, 0.6));
}

/* ---------- Contact ---------- */
.contact-section {
  text-align: center;
}

.contact-sub {
  color: #c4c9d4;
  margin: -24px 0 40px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.contact-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(23, 26, 33, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 28px;
  text-decoration: none;
  min-width: 180px;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.contact-card strong {
  color: var(--text);
  font-size: 15px;
}

.contact-card span {
  color: var(--muted);
  font-size: 13px;
}

.footer {
  position: relative;
  z-index: 1;
}

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

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
