/* Modern Theme Variables */
:root {
  /* Default: Cyberpunk Neon */
  --bg-primary: #05000a;
  --bg-secondary: #0b0014;
  --text-primary: #ffffff;
  --text-secondary: #d1d1d1;
  --accent: #d67bff;
  /* Electric Lavender */
  --accent-glow: rgba(214, 123, 255, 0.5);
  --accent-secondary: #05d9e8;
  /* Cyan */
  --card-bg: rgba(20, 0, 30, 0.6);
  --nav-bg: rgba(5, 0, 10, 0.9);

  --font-main: "Inter", sans-serif;
  --font-display: "Orbitron", sans-serif;

  --transition: all 0.3s ease;
}

[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --accent: #3b82f6;
  /* Blue */
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-secondary: #8b5cf6;
  /* Purple */
  --card-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.9);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: hidden;
  /* Prevent vertical scroll on body */
}

main {
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    filter 240ms ease;
}

body.page-transitioning main {
  opacity: 0.35;
  transform: translateY(14px) scale(0.99);
  filter: blur(3px);
}

.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(214, 123, 255, 0.22),
      transparent 35%
    ),
    radial-gradient(
      circle at 80% 25%,
      rgba(5, 217, 232, 0.14),
      transparent 32%
    ),
    linear-gradient(180deg, rgba(3, 3, 8, 0.86), rgba(3, 3, 8, 0.94));
  transition: opacity 240ms ease;
}

.page-transition-overlay.is-visible {
  opacity: 1;
}

/* Zigzag Scroll Container */
.scroll-container {
  display: grid;
  width: 300vw;
  height: 300vh;
  grid-template-columns: 100vw 100vw 100vw;
  grid-template-rows: 100vh 100vh 100vh;
  overflow: hidden; /* Disable native scroll, JS controls it */
}

/* Section Positioning */
#home {
  grid-column: 1;
  grid-row: 1;
}
#about {
  grid-column: 2;
  grid-row: 1;
}
#skills {
  grid-column: 2;
  grid-row: 2;
}
#projects {
  grid-column: 3;
  grid-row: 2;
}
#contact {
  grid-column: 3;
  grid-row: 3;
}

/* Sections Base Styles */
section {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 80px; /* Navbar height */
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

h1 {
  font-size: 3.5rem;
  background: linear-gradient(to right, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px var(--accent-glow);
}

/* Theme Toggle */
#theme-toggle {
  background: none;
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 0 10px var(--accent-glow);
}

#theme-toggle:hover {
  background: var(--accent);
  color: white;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Utility Classes */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background-color: var(--accent);
  color: white;
  border-radius: 50px;
  font-weight: 600;
  border: 1px solid transparent;
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--accent-glow);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--text-secondary);
  box-shadow: none;
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.section-padding {
  padding: 5rem 0;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  /* Pure black for contrast */
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  /* Custom ease */
}

.preloader-hidden {
  transform: translateY(-100%);
}

.preloader-content {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
}

.greeting {
  display: block;
  animation: slideUpText 0.8s ease forwards;
}

@keyframes slideUpText {
  0% {
    transform: translateY(100%);
  }

  100% {
    transform: translateY(0);
  }
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slideUpBlur {
  0% {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Only animate when the parent has the 'loaded' class */
.loaded .hero-animate {
  animation: slideUpBlur 0.8s ease forwards;
}

/* Default state for hero-animate before loading */
.hero-animate {
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.3s;
}

.delay-3 {
  animation-delay: 0.5s;
}

.delay-4 {
  animation-delay: 0.7s;
}

.delay-5 {
  animation-delay: 0.9s;
}

/* Typing Cursor */
.role::after {
  content: "|";
  animation: blink 1s infinite;
}

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

  50% {
    opacity: 0;
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 50px;
  width: 50px;
  box-shadow: 0 0px 50px var(--accent-glow);
}

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

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}

.nav-toggle-button {
  background: none;
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 0 10px var(--accent-glow);
  font: inherit;
  font-size: 0.85rem;
}

.nav-toggle-button:hover {
  background: var(--accent);
  color: white;
}

.nav-toggle-button.is-active {
  background: var(--accent);
  color: white;
}

.nav-toggle-button.requires-interaction {
  animation: pulse 1.2s infinite;
  box-shadow: 0 0 24px rgba(214, 123, 255, 0.35);
}

@keyframes pulse {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
  }
  100% {
    transform: translateY(0);
  }
}

#theme-toggle {
  flex-shrink: 0;
}

/* Hero Section */

.hero-content {
  position: relative;
  right: 12%;
  z-index: 2;
  max-width: 800px;
}

.subtitle {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.role {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.bio-short {
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.cta-group {
  display: flex;
  gap: 1rem;
}

.hero-bg-glow {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: var(--accent);
  filter: blur(150px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: 1;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.stat-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Skills Section */
.bg-secondary {
  background-color: var(--bg-secondary);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.skill-item {
  background: var(--card-bg);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.skill-item:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
}

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

.project-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.1);
}

.project-image {
  height: 200px;
  background: #2a2a2a;
  position: relative;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #2a2a2a, #333);
}

.project-info {
  padding: 1.5rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-tags span {
  font-size: 0.8rem;
  padding: 0.2rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  color: var(--text-secondary);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 600;
}

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

/* Contact Section */
.contact-container {
  text-align: center;
  max-width: 600px;
}

.social-links {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-links a {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

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

/* Footer */
footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .hamburger {
    display: block;
    z-index: 1001;
  }

  /* Hamburger Animation */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

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

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.5s ease;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
  }

  .nav-links.nav-active {
    right: 0;
  }

  .nav-links li {
    margin: 1.5rem 0;
    opacity: 0;
  }

  /* Animate Links In */
  .nav-links.nav-active li {
    animation: navLinkFade 0.5s ease forwards 0.3s;
  }

  @keyframes navLinkFade {
    from {
      opacity: 0;
      transform: translateX(50px);
    }

    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-bg-glow {
    top: 10%;
    right: -20%;
  }
}

/* Refresh layout for the current vertical portfolio structure */
body {
  overflow-y: auto;
}

.scroll-container {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

section {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  padding-top: 0;
}

#home,
#about,
#skills,
#projects,
#contact {
  grid-column: auto;
  grid-row: auto;
}

.hero.section-padding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 84px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: center;
}

.hero-copy h1 {
  max-width: 780px;
  margin-top: 10px;
}

.hero-copy .role {
  min-height: 1.6em;
  margin: 18px 0 0;
  color: var(--accent);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
}

.hero-copy .bio-short {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--text-secondary);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-card {
  padding: 20px;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.04)
  );
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.hero-card .avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.handle {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.status {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.status span {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent-3);
  box-shadow: 0 0 0 6px rgba(163, 230, 53, 0.12);
}

.quick-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.quick-facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.quick-facts strong {
  color: var(--text-primary);
}

.quick-facts span {
  text-align: right;
  color: var(--text-secondary);
  font-weight: 700;
}

.subtitle {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-heading h2 {
  text-align: left;
  margin-top: 12px;
  font-size: clamp(2.3rem, 4.8vw, 4.6rem);
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.panel {
  padding: 30px;
}

.panel h3 {
  font-size: 1.35rem;
}

.panel p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  padding: 22px;
  display: grid;
  gap: 16px;
  min-height: 260px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
}

.project-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.project-card .tag {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.bg-secondary {
  background: transparent;
}

@media (max-width: 980px) {
  .hero-layout,
  .about-grid,
  .projects-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero.section-padding {
    min-height: auto;
    padding: 108px 0 72px;
  }
}

@media (max-width: 768px) {
  .hero-layout {
    gap: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(2.6rem, 14vw, 4.3rem);
  }

  .about-grid,
  .projects-grid {
    gap: 14px;
  }

  .hero-card {
    order: -1;
  }
}

.enter-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.5;
  animation: pulse 2s ease-in-out infinite;
}

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

#preloader {
  cursor: pointer;
}
/* ── Music FAB ── */
.music-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.music-fab:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.music-fab.is-active {
  border-color: rgba(120, 200, 120, 0.5);
  color: #8deba8;
}
.music-fab svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Resume button ── */
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  opacity: 0.85;
}
.btn-resume:hover {
  opacity: 1;
}

/* ── Skills grouped ── */
.skills-category {
  margin-bottom: 2.5rem;
}
.skills-category:last-child {
  margin-bottom: 0;
}
.skills-category-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 0.9rem;
  font-weight: 600;
}
.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ── Project links ── */
.project-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.project-link {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  opacity: 0.6;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.2s;
}
.project-link:hover {
  opacity: 1;
}

/* ── About interests panel ── */
.interest-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.interest-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  opacity: 0.8;
}
.interest-list li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  flex-shrink: 0;
}
