
/* --- THEME VARIABLES --- */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Light Theme */
    --bg-color: #F8F9FA;
    --text-color: #212529;
    --heading-color: #111;
    --accent-color: #0056b3;
    --accent-hover: #004494;
    --card-bg: #FFFFFF;
    --card-bg-rgb: 255, 255, 255;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.5);
    --border-color: #dee2e6;
    --border-color-rgb: 222, 226, 230;
    --tag-bg: #e9ecef;
    --tag-bg-rgb: 233, 236, 239;
    --tag-color: #495057;
    --footer-text: #6c757d;
}

body.dark-mode {
    /* Dark Theme */
    --bg-color: #121212;
    --text-color: #E0E0E0;
    --heading-color: #FFFFFF;
    --accent-color: #00AFFF;
    --accent-hover: #52C5FF;
    --card-bg: #1E1E1E;
    --card-bg-rgb: 30, 30, 30;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(30, 30, 30, 0.5);
    --border-color: #2F2F2F;
    --border-color-rgb: 47, 47, 47;
    --tag-bg: #2F2F2F;
    --tag-bg-rgb: 47, 47, 47;
    --tag-color: #A0A0A0;
    --footer-text: #A0A0A0;
}

/* --- MODERN CSS RESET --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  color-scheme: light dark;
  height: 100%;
  position: relative; /* For pseudo-element positioning */
  padding-top: 6rem; /* Add space for fixed navbar */
}

body.dark-mode {
    /* Dark Theme */
    --bg-color: #121212;
    --text-color: #E0E0E0;
    --heading-color: #FFFFFF;
    --accent-color: #00AFFF;
    --accent-hover: #52C5FF;
    --card-bg: #1E1E1E;
    --card-bg-rgb: 30, 30, 30;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(30, 30, 30, 0.5);
    --border-color: #2F2F2F;
    --border-color-rgb: 47, 47, 47;
    --tag-bg: #2F2F2F;
    --tag-bg-rgb: 47, 47, 47;
    --tag-color: #A0A0A0;
    --footer-text: #A0A0A0;
}

html.dark-mode {
    background-color: #121212;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 150%;
  z-index: -2; /* Behind particles */
  background: repeating-linear-gradient(to bottom right, #F0F8FF 0%, #66AADD 33%, #A7D9ED 66%, #F0F8FF 100%); /* Light mode gradient: seamless repeating sky-like, consistent blue */
  background-size: 400% 400%; /* Make background much larger for movement */
  animation: gradient-move 30s linear infinite alternate;
}

body.dark-mode::before {
  background: repeating-linear-gradient(to bottom right, #1a2a4a 0%, #2a1a3a 33%, #1a3a3a 66%, #1a2a4a 100%); /* Dark mode repeating gradient */
  background-size: 400% 400%;
  animation: gradient-move 30s linear infinite alternate;
}

@keyframes gradient-move {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    overflow-wrap: break-word;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- BASE STYLES --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

/* --- NAVIGATION --- */
.main-nav {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 0.5rem 0.1rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: var(--nav-bg);
    z-index: 100;
    border: 1px solid rgba(var(--border-color-rgb), 0.7);
    border-radius: 9999px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.main-nav .container {
    display: flex;
    justify-content: center; /* Center content */
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.2rem;
}

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

.nav-links a {
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* --- HERO SECTION --- */
.hero {
    padding: 6rem 0 3rem 0;
    text-align: center;
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-image {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--card-shadow);
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-text .subtitle {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--footer-text);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

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

.hero-socials a {
    color: var(--footer-text);
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem; /* Make them circular */
    height: 2.5rem; /* Make them circular */
    border-radius: 50%;
    background-color: rgba(var(--card-bg-rgb), 0.7);
    border: 1px solid rgba(var(--border-color-rgb), 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hero-socials a i {
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hero-socials a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
    background-color: rgba(var(--tag-bg-rgb), 0.7);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}



.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(var(--card-bg-rgb), 0.7);
    color: var(--footer-text);
    border: 1px solid rgba(var(--border-color-rgb), 0.7);
    border-radius: 9999px;
    display: inline-flex; /* Use inline-flex to allow content to define width */
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem; /* Restore original padding for capsule shape */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}


/* --- PROJECTS SECTION --- */
.projects {
    padding: 2rem 0 4rem 0;
}

.projects h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--heading-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: rgba(var(--card-bg-rgb), 0.7);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(var(--border-color-rgb), 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.project-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--heading-color);
}

.card-content p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: var(--tag-bg);
    color: var(--tag-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- Card Links --- */
.card-links {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.card-links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.card-links a:hover {
    border-bottom-color: var(--accent-color);
}

/* --- FOOTER --- */
.footer {
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    color: var(--footer-text);
}

.footer .social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer .social-links a {
    color: var(--footer-text);
    transition: color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem; /* Make them circular */
    height: 2.5rem; /* Make them circular */
    border-radius: 50%;
    background-color: rgba(var(--card-bg-rgb), 0.7);
    border: 1px solid rgba(var(--border-color-rgb), 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.footer .social-links a i {
    font-size: 1.2rem;
}

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

/* --- THEME TOGGLE (LIGHTSWITCH) --- */
.lightswitch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lightbulb-icon {
    font-size: 1.1rem;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

body.dark-mode .lightbulb-icon {
    color: var(--tag-color);
}

.lightswitch {
    cursor: pointer;
}

.lightswitch-input {
    display: none;
}

.lightswitch-plate {
    width: 26px;
    height: 42px;
    background-color: var(--tag-bg);
    border: 1px solid var(--border-color);
    border-radius: 21px;
    position: relative;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.lightswitch-switch {
    width: 16px;
    height: 16px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    left: 4px;
    transition: transform 0.2s ease-out;
}

.lightswitch-input:checked + .lightswitch-plate .lightswitch-switch {
    transform: translateY(16px);
}

body.dark-mode .lightswitch-plate {
    background-color: #111;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

body.dark-mode .lightswitch-switch {
    background-color: var(--tag-color);
    border-color: #000;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.4rem;
    }
    .main-nav {
        display: none; /* Hide navbar on mobile */
    }
    body::before { /* Target the background pseudo-element */
        height: 150%; /* Make it 150% of the viewport height */
    }
    body {
        padding-top: 0; /* Remove padding when navbar is hidden */
    }
}

@media (min-width: 768px) {
    .hero .container {
        flex-direction: row;
        text-align: left;
        gap: 4rem;
    }
    .hero-text {
        flex: 1;
    }
    .hero-socials,
    .hero-cta {
        justify-content: flex-start;
    }
}

/* --- PARTICLES.JS STYLES --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Ensure it's behind other content */
}

/* --- IMAGE BACKGROUND FIX --- */
.has-white-bg {
    background-color: #FFFFFF;
}
