/* =========================================================
   GLOBAL RESET & VARIABLES
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-family: "Michroma", sans-serif;
  color: var(--font-color);
}

:root {
  --background: radial-gradient(circle at top, #0f172a, #020617 60%, #000000);
  --font-color: #f9fafb;
  --accent: #22d3ee;
  --accent-strong: #0ea5e9;
  --secondary: #020617;
  --card-glass: rgba(15, 23, 42, 0.75);
  --border-soft: rgba(148, 163, 184, 0.35);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
  --transition-fast: 0.25s ease;
}

body.light-theme {
  --background: linear-gradient(135deg, #f9fafb, #e5e7eb, #ffffff);
  --font-color: #000000;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --secondary: #e5e7eb;
  --card-glass: rgba(255, 255, 255, 0.8);
  --border-soft: rgba(148, 163, 184, 0.6);
  --shadow-soft: 0 18px 40px rgba(148, 163, 184, 0.65);
}

html {
  scroll-behavior: smooth;
  color: var(--font-color);
}

/* Note: background is handled by .animated-bg layer now */
body {
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 10px;
  background: var(--secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

/* =========================================================
   ANIMATED BACKGROUND + PARTICLES
========================================================= */

.animated-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    -45deg,
    #0f172a,
    #020617,
    #0ea5e9,
    #000000
  );
  background-size: 400% 400%;
  animation: gradientMove 16s ease infinite;
}

/* light theme version of bg, still matching your palette */
body.light-theme .animated-bg {
  background: linear-gradient(
    -45deg,
    #f9fafb,
    #e5e7eb,
    #bae6fd,
    #ffffff
  );
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

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

/* =========================================================
   PRELOADER
========================================================= */
#preloader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #020617, #000000);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid rgba(148, 163, 184, 0.2);
  border-top-color: var(--accent);
  border-right-color: var(--accent-strong);
  animation: spin 1s linear infinite,
    glow-ring 1.2s ease-in-out infinite alternate;
}

#preloader span {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #e5e7eb;
  opacity: 0.8;
}

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

@keyframes glow-ring {
  from {
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.3),
      0 0 25px rgba(14, 165, 233, 0.25);
  }
  to {
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.5),
      0 0 35px rgba(14, 165, 233, 0.45);
  }
}

/* =========================================================
   GLASS / NEON / REVEAL HELPERS
========================================================= */
.glass-card {
  background: var(--card-glass);
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Thin neon border halo */
.glass-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(
      120deg,
      rgba(34, 211, 238, 0.9),
      rgba(59, 130, 246, 0.6),
      rgba(236, 72, 153, 0.7)
    )
    border-box;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 3D hover */
.lift-hover {
  transition: transform var(--transition-fast), filter var(--transition-fast);
  transform-style: preserve-3d;
}
.lift-hover:hover { 
  transform: scale(1.02);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.85);
  filter: brightness(1.05);
}

/* =========================================================
   HEADER
========================================================= */
header {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--font-color);
}
.logo span {
  color: var(--accent);
}

.center-section {
  display: flex;
  gap: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.center-section a {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  color: var(--font-color);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.center-section a:hover {
  color: var(--accent);
  opacity: 1;
}

.right-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 6px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

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

.theme-toggle:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--font-color);
}

/* =========================================================
   BUTTONS
========================================================= */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020617;
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.45);
}

.btn-primary:hover {
  box-shadow: 0 18px 55px rgba(34, 211, 238, 0.65);
  transform: translateY(-3px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #020617;
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.45);
  transform: translateY(-3px);
}

/* =========================================================
   HOME
========================================================= */
#home {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}

.home-inner {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1.2fr);
  gap: 40px;
  align-items: center;
}

.text-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.text-section h1 {
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.text-section h2 {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 800;
}

.text-section h2 span {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.6);
}

.text-section h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.text-section p {
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 520px;
  color: var(--font-color);
}

.btn-section {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.home-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.95);
}

.home-avatar {
  justify-self: center;
}

.home-avatar-inner {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  padding: 4px;
  background: radial-gradient(circle at 0 0, #22d3ee, transparent 55%),
    radial-gradient(circle at 100% 100%, #ec4899, transparent 45%),
    radial-gradient(circle at 100% 0, #22c55e, transparent 55%);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
}

.home-avatar-inner img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #020617;
}
.home-avatar:hover{
  border-radius: 50%;
  transform: scale(1.2);
}
.avatar-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px dashed rgba(148, 163, 184, 0.6);
  animation: rotate-slow 18s linear infinite;
}

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

/* =========================================================
   ABOUT
========================================================= */
#about {
  min-height: 100vh;
  padding: 70px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-inner {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1.2fr);
  gap: 50px;
  align-items: center;
}

.about-text-section h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}
.about-text-section h1 span {
  color: var(--accent);
}

.about-text-section p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--font-color);
  margin-bottom: 16px;
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}

.about-pill {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--font-color);
}

.about-social-icons {
  margin-top: 8px;
}

.about-social-icons a i {
  font-size: 1.2rem;
  margin-right: 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 10px;
  transition: transform var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.about-social-icons a i:hover {
  transform: translateY(-3px) scale(1.05);
  background: var(--accent);
  color: #020617;
  border-color: var(--accent);
  box-shadow: 0 14px 35px rgba(34, 211, 238, 0.6);
}

.about-img-section {
  justify-self: center;
}

.about-img-section img {
  width: 320px;
  height: 320px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}
/* =========================================================
   SKILLS
========================================================= */
#skills {
  min-height: 100vh;
  padding: 70px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

#skills > h1 {
  font-size: 2rem;
}

.skill-container {
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
}

.skill-box {
  width: 340px;
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.skill-box h1 {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-box i {
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.7);
}

.skill-progress {
  width: 100%;
  height: 18px;
  background: var(--secondary);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.skill-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
  transition: width 1.1s ease-out;
}

.skill-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #020617;
}

.skill-tags {
  margin-top: 8px;
  font-size: 0.75rem;
  text-align: center;
  color: rgba(148, 163, 184, 0.95);
}

/* =========================================================
   PROJECTS
========================================================= */
#project {
  min-height: 100vh;
  padding: 70px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

#project > h1 {
  font-size: 2rem;
}

.projects-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  padding: 7px 16px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--background);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #020617;
  border-color: transparent;
}

.projects-list {
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.projects-card {
  display: flex;
  gap: 24px;
  padding: 22px;
  align-items: stretch;
}

.projects-card:nth-child(odd) {
  flex-direction: row-reverse;
}

.projectImg {
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
}

.projectImg img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 18px;
  transition: transform 0.3s ease;
}

.projectImg img:hover {
  transform: scale(1.05);
}

.projectText {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.projectText h1 {
  font-size: 1.4rem;
}

.projectText h1 span {
  color: var(--accent);
}

.projectText p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--font-color);
}

/* =========================================================
   CONTACT
========================================================= */
#contact {
  min-height: 80vh;
  padding: 70px 20px 50px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

#contact h1 {
  font-size: 2rem;
}

#contact p {
  font-size: 0.9rem;
  max-width: 480px;
  text-align: center;
  color: var(--font-color);
}

#contact form {
  max-width: 520px;
  width: 100%;
  display: flex;
  padding: 30px;
  flex-direction: column;
  gap: 14px;
}

#contact input,
#contact textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: var(--background);
  color: #f9fafb;
  resize: vertical;
}

#contact input:focus,
#contact textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.6);
}

.submit-btn {
  align-self: flex-start;
}

/* =========================================================
   FOOTER
========================================================= */
footer {
  padding: 18px 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--font-color);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: var(--background);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
  .home-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .home-avatar {
    order: -1;
  }

  .text-section p {
    margin: 0 auto;
  }

  .btn-section {
    justify-content: center;
  }

  .home-stats {
    justify-content: center;
  }

  .about-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .about-img-section {
    order: -1;
  }

  .about-highlights {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0 18px;
  }

  .center-section {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    display: none;
    flex-direction: column;
    border-radius: 0;
    border: none;
    background: rgba(15, 23, 42, 0.98);
    padding: 14px 0 18px;
  }

  .center-section a {
    padding: 6px 0;
    text-align: center;
  }

  .center-section.open {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .home-inner {
    padding-top: 10px;
  }

  #project {
    padding-top: 50px;
  }

  .projects-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .projects-card,
  .projects-card:nth-child(odd) {
    min-width: 80%;
    max-width: 80%;
    flex-direction: column;
    text-align: center;
    scroll-snap-align: center;
  }

  .projectText {
    align-items: center;
  }
}

@media (max-width: 520px) {
  header {
    padding: 0 14px;
  }

  #home {
    padding-inline: 14px;
  }

  #skills,
  #about,
  #project,
  #contact {
    padding-inline: 14px;
  }

  .projects-card {
    min-width: 90%;
    max-width: 90%;
    padding: 18px;
  }

  .skill-box {
    width: 100%;
  }

  .home-avatar-inner {
    width: 220px;
    height: 220px;
  }
}
