/* --- GLOBAL STYLES & VARIABLES --- */
:root {
  --primary-color: #d000ff; /* Electric Magenta */
  --secondary-color: #5900ff; /* Deep Violet */
  --accent-color: #00f0ff; /* Sharp Cyan */
  --dark-bg: #010105; /* Near Black */
  --light-bg: #10101a;
  --text-color: #e0e5f0;
  --text-muted: #808590;
  --card-border: rgba(208, 0, 255, 0.2);
  --card-bg: rgba(16, 16, 26, 0.6);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --primary-shadow-color: rgba(208, 0, 255, 0.3);
  --font-heading: "Teko", sans-serif;
  --font-body: "Roboto Mono", monospace;
}

/* --- LIGHT THEME VARIABLES --- */
body.light-theme {
    --primary-color: #6a00c9;
    --secondary-color: #4a008c;
    --accent-color: #007bff;
    --dark-bg: #f4f6f8;
    --light-bg: #ffffff;
    --text-color: #10101a;
    --text-muted: #5a5f68;
    --card-border: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --primary-shadow-color: rgba(106, 0, 201, 0.2);
}

/* --- BASE STYLES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--dark-bg);
  color: var(--text-color);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 25px; }

/* --- BACKGROUND EFFECTS --- */
#particle-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; }
.grid-overlay {
  position: fixed; inset: 0; z-index: -2;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 35px 35px;
}
body.light-theme .grid-overlay { opacity: 0.5; background-image: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px); }

/* --- NAVIGATION --- */
nav {
  padding: 16px 0; position: fixed; width: 100%; top: 0; left: 0; z-index: 1000;
  background: rgba(1, 1, 5, 0.65);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
body.light-theme nav { background: rgba(255, 255, 255, 0.65); border-bottom: 1px solid var(--card-border); }
nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-color); font-family: var(--font-heading); font-size: 28px; letter-spacing: 2px; }
.nav-logo img { height: 38px; transition: transform 0.5s ease-in-out; }
.nav-logo:hover img { transform: rotate(360deg); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 700; font-size: 15px; transition: color 0.25s ease; position: relative; }
.nav-links a:hover { color: var(--primary-color); }
.nav-links a.active { color: var(--primary-color); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; margin: auto; bottom: -8px; width: 100%; height: 2px; background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }

/* --- THEME TOGGLE & MENU --- */
.theme-toggle, .menu-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; transition: color 0.3s ease; }
.theme-toggle:hover, .menu-toggle:hover { color: var(--primary-color); }
.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: block; }
body.light-theme .theme-toggle .fa-sun { display: block; }
body.light-theme .theme-toggle .fa-moon { display: none; }
.menu-toggle { display: none; }

/* --- HERO SECTION --- */
#hero { min-height: 100vh; display: flex; align-items: center; text-align: left; padding: 150px 20px 90px; }
#hero h1 { font-family: var(--font-heading); font-size: clamp(3.5rem, 8vw, 6rem); line-height: 1; margin-bottom: 18px; color: var(--text-color); letter-spacing: 2px; }
#hero p { max-width: 600px; margin-bottom: 30px; font-size: 1.1rem; line-height: 1.7; color: var(--text-muted); }
.hero-buttons { display: flex; gap: 18px; flex-wrap: wrap; }

/* --- BUTTONS --- */
.btn {
  padding: 14px 28px; text-decoration: none; font-weight: 700; font-family: var(--font-body);
  transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
  border: 2px solid transparent; position: relative; display: inline-flex; align-items: center; gap: 10px;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}
.btn-primary { background-color: var(--primary-color); color: #fff; box-shadow: 0 0 25px var(--primary-shadow-color); }
body.light-theme .btn-primary { color: #fff; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 35px var(--primary-shadow-color); background-color: var(--secondary-color); }
.btn-secondary { border-color: var(--primary-color); color: var(--primary-color); background: transparent; }
.btn-secondary:hover { background-color: var(--primary-color); color: #fff; transform: translateY(-3px); box-shadow: 0 0 25px var(--primary-shadow-color); }
body.light-theme .btn-secondary:hover { color: #fff; }

/* --- SHARED SECTION STYLES --- */
section { padding: 120px 20px; position: relative; z-index: 2; }
.section-title { font-family: var(--font-heading); font-size: clamp(2.4rem, 5.2vw, 3.2rem); text-align: center; margin-bottom: 60px; letter-spacing: 1px; }

/* --- DYNAMIC SECTION BACKGROUND (NEW) --- */
.interactive-section-bg {
    position: relative;
    background: rgba(16, 16, 26, 0.5);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.3s ease;
}
body.light-theme .interactive-section-bg {
    background: rgba(255, 255, 255, 0.6);
}
.interactive-section-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(800px circle at var(--mouse-x-section) 50%, var(--primary-shadow-color), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.interactive-section-bg:hover::before {
    opacity: 1;
}

/* --- ABOUT SECTION --- */
#about .about-item { display: flex; align-items: center; gap: 50px; }
.about-text { flex: 1; }
.about-text h2 { font-family: var(--font-heading); font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 20px; letter-spacing: 1px; }
.about-text p { margin-bottom: 18px; color: var(--text-muted); line-height: 1.7; }
.about-image { flex: 1; }
.about-image img { width: 100%; height: auto; box-shadow: 0 16px 42px var(--shadow-color); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%); }

/* --- HIGH-GRAPHIC SKILL CHART --- */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}
.skill-card {
    background: var(--dark-bg);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    position: relative;
    border: 1px solid var(--card-border);
    transition: background-color 0.3s ease;
}
body.light-theme .skill-card { background: var(--light-bg); }
.skill-circle { width: 120px; height: 120px; margin: 0 auto; }
.skill-circle-bg { fill: none; stroke: var(--light-bg); stroke-width: 8; transition: stroke 0.3s ease; }
body.light-theme .skill-circle-bg { stroke: var(--dark-bg); }
.skill-circle-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 1, 0.5, 1), stroke 0.3s ease;
}
.skill-grid.in-view .skill-circle-progress {
    stroke-dashoffset: calc(283 - (283 * var(--level)) / 100);
}
.skill-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: -10px;
}
.skill-percent {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--text-color);
}
.skill-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: -5px;
}

/* --- INTERACTIVE "LIQUID METAL" CARDS --- */
#projects { max-width: 800px; margin: 0 auto; }
.project-list { display: flex; flex-direction: column; gap: 30px; }
.interactive-card {
    position: relative;
    padding: 1px;
    border-radius: 15px;
    background: var(--card-border);
    transition: transform 0.3s ease;
}
.interactive-card:hover {
    transform: translateY(-5px) scale(1.02);
}
.card-content {
    background: var(--dark-bg);
    padding: 30px;
    border-radius: 14px;
    position: relative;
    z-index: 2;
    transition: background-color 0.3s ease;
}
body.light-theme .card-content { background: var(--light-bg); }
.interactive-card::before, .interactive-card::after {
    content: ''; position: absolute; inset: 0; border-radius: 15px; z-index: 1;
    opacity: 0; transition: opacity 0.4s ease;
}
.interactive-card::before { background: radial-gradient(300px circle at var(--mouse-x) var(--mouse-y), var(--primary-shadow-color), transparent 80%); }
.interactive-card::after { background: radial-gradient(500px circle at var(--mouse-x) var(--mouse-y), var(--primary-color), transparent 80%); animation: pulse-border 3s linear infinite; }
.interactive-card:hover::before, .interactive-card:hover::after { opacity: 1; }
@keyframes pulse-border { 0% { filter: brightness(0.8) contrast(1.2); } 50% { filter: brightness(1.2) contrast(1.0); } 100% { filter: brightness(0.8) contrast(1.2); } }

.card-content h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 15px; color: var(--primary-color); display: flex; align-items: center; gap: 12px; }
.card-content p { color: var(--text-muted); line-height: 1.7; margin-bottom: 25px; }
.btn-link { color: var(--accent-color); text-decoration: none; font-weight: 700; transition: color 0.25s ease, letter-spacing 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-link:hover { color: var(--text-color); letter-spacing: 1px; }
body.light-theme .btn-link:hover { color: var(--secondary-color); }

/* --- CONTACT SECTION --- */
#contact { text-align: center; }
.contact-content { position: relative; z-index: 2; } /* Ensure content is above the aurora */
#contact h2 { margin-bottom: 20px; }
#contact p { max-width: 660px; margin: 0 auto 25px; line-height: 1.7; }
.contact-info { margin-bottom: 25px; font-size: 1.1rem; }

/* --- FOOTER & SCROLL-TOP --- */
footer { padding: 40px 20px; text-align: center; background: var(--dark-bg); border-top: 1px solid var(--card-border); transition: background-color 0.3s ease, border-color 0.3s ease; }
footer p { color: var(--text-muted); margin-bottom: 8px; font-size: 1rem; }
.scroll-top {
  position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px;
  background: var(--card-bg); border: 1px solid var(--card-border); backdrop-filter: blur(10px);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px var(--shadow-color);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all 0.25s ease; z-index: 999; color: var(--text-color);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* --- RESPONSIVENESS --- */
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; border: 1px solid var(--card-border); border-radius: 5px; padding: 8px 10px; }
  .nav-links { position: absolute; top: 70px; right: 20px; flex-direction: column; background: var(--light-bg); padding: 20px; border-radius: 14px; border: 1px solid var(--card-border); display: none; box-shadow: 0 16px 42px var(--shadow-color); width: calc(100% - 40px); gap: 15px; }
  .nav-links.active { display: flex; }
  .nav-links a.active::after { display: none; }
  .theme-toggle { order: -1; }
  #hero { text-align: center; }
  #hero h1 { font-size: clamp(3rem, 12vw, 4rem); }
  .about-item { flex-direction: column; text-align: center; gap: 30px; }
  .skill-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .skill-circle { width: 100px; height: 100px; }
  .skill-percent { font-size: 1.5rem; }
}