:root {
    /* Color Palette - Dark & Vibrant */
    --bg-color: #050505;
    --surface-color: #121212;
    --surface-hover: #1e1e1e;
    --primary-color: #a855f7;
    /* Purple */
    --secondary-color: #22c55e;
    /* Green for "retro/console" vibe */
    --accent-color: #ec4899;
    /* Pink */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #27272a;
    --hero-overlay: rgba(5, 5, 5, 0.8);

    /* Typography */
    --font-heading: 'VT323', monospace;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
}

html.light-mode body {
    --bg-color: #f0f2f5;
    --surface-color: #ffffff;
    --surface-hover: #e4e6eb;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #d1d5db;
    --hero-overlay: rgba(240, 242, 245, 0.85);
}

/* Page Transitions */
body {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.2s ease;
}

body.loaded {
    opacity: 1;
    transform: translateY(0);
}

body.exiting {
    opacity: 0;
    transform: translateY(-20px);
}

/* Toggles */
.header-toggles {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
    position: relative;
    z-index: 1002;
    /* Ensure it's above other elements */
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
    /* Fixed dimensions to prevent layout shift */
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    /* Optional: nice touch for hover effects */
}

.icon-btn:hover {
    color: var(--primary-color);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    /* Transition is handled in the Page Transitions block above, merged here for clarity if needed, but keeping separate blocks is fine. 
       Let's ensure we don't override it. */
    /* transition: background-color 0.3s ease, color 0.3s ease; REMOVED to avoid conflict */
}

/* Global Resets */
a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--bg-color);
    /* Updated for Theme Support */
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo-bracket {
    color: var(--secondary-color);
}

.logo-slash {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    position: relative;
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* Footer */
#footer {
    padding: 3rem 0;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Hero Section */
#hero {
    position: relative;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: calc(var(--header-height) + 2rem);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--hero-overlay), var(--hero-overlay)),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
    background-size: cover;
    z-index: -1;
    transition: background-image 0.3s ease;
}

.page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* Glitch Effect - Transparent Friendly */
.glitch {
    font-size: 5rem;
    font-weight: 700;
    position: relative;
    color: var(--text-primary);
    letter-spacing: -2px;
    margin-bottom: 2rem;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-color);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(27px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(69px, 9999px, 12px, 0);
    }

    40% {
        clip: rect(6px, 9999px, 60px, 0);
    }

    60% {
        clip: rect(66px, 9999px, 14px, 0);
    }

    80% {
        clip: rect(31px, 9999px, 78px, 0);
    }

    100% {
        clip: rect(8px, 9999px, 20px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(39px, 9999px, 83px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 10px, 0);
    }

    40% {
        clip: rect(93px, 9999px, 44px, 0);
    }

    60% {
        clip: rect(17px, 9999px, 57px, 0);
    }

    80% {
        clip: rect(54px, 9999px, 27px, 0);
    }

    100% {
        clip: rect(9px, 9999px, 97px, 0);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(0deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

.hero-subtitle {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.highlight {
    color: var(--primary-color);
}

/* Buttons */
.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 5rem;
    /* Added bottom spacing */
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 160px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 35px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    display: flex;
    justify-content: center;
}

.scroll-indicator span {
    width: 4px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 2px;
    margin-top: 5px;
    animation: scroll-anim 1.5s infinite;
}

@keyframes scroll-anim {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}





/* General Section Styles */
.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.skills-wrapper h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    list-style: none;
}

.skills-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.skills-list li i {
    color: var(--primary-color);
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-profile-img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    background-color: var(--surface-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Simple soft shadow */
    transition: transform 0.3s ease;
    image-rendering: pixelated;
}

.about-profile-img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.2);
    /* Soft purple glow on hover */
}

/* Projects Section */
.bg-surface {
    background-color: transparent;
    /* Slightly lighter than bg-color */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}


.project-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.project-image {
    height: 200px;
    background-color: var(--surface-hover);
    overflow: hidden;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    /* Gradient placeholder */
}

.color-1 {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
}

.color-2 {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

.color-3 {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin-bottom: 1.5rem;
}

.project-tags li {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.project-links a:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* Art Gallery */
.section-subtitle {
    margin-top: -2rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    gap: 1.5rem;
    grid-auto-flow: dense;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff5555;
    cursor: pointer;
    transition: color 0.3s ease;
}

.delete-btn:hover {
    color: #ff0000;
}

.copy-btn {
    background: none;
    border: none;
    color: #50fa7b;
    cursor: pointer;
    margin-right: 10px;
    transition: color 0.3s ease;
}

.copy-btn:hover {
    color: #00ff00;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Gallery Overlay & Interactions */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-label {
    color: white;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-download-btn {
    align-self: flex-start;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.gallery-item:hover .gallery-label,
.gallery-item:hover .gallery-download-btn {
    transform: translateY(0);
    opacity: 1;
}

.gallery-download-btn:hover {
    background-color: white;
    color: var(--primary-color);
}



/* Contact Section */
.contact-container {
    text-align: center;
    max-width: 600px;
}

.contact-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.big-btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
}

/* Animations & Polish */
.hidden-el {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.show-el {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 {
    transition-delay: 100ms;
}

.stagger-2 {
    transition-delay: 200ms;
}

.stagger-3 {
    transition-delay: 300ms;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .about-grid {
        gap: 2rem;
    }

    .about-profile-img {
        width: 250px;
        height: 250px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Hero */
    .glitch {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero-description {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .hero-btns {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn {
        width: 80%;
        max-width: 280px;
    }

    /* Nav */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 2.5rem;
        text-align: center;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1003;
    }

    .header-toggles {
        margin-left: 0;
        margin-top: 1.5rem;
    }

    /* General Sections */
    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-profile-img {
        width: 200px;
        height: 200px;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery */
    .gallery-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Footer */
    .footer-content p {
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .glitch {
        font-size: 2.2rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
}

/* --- Enhanced Search Bar Styles --- */
.search-container {
    margin: 2rem 0 3rem;
    max-width: 650px;
    width: 100%;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.search-bar {
    width: 100%;
    padding: 1.1rem 1.5rem 1.1rem 3.8rem;
    /* Space for icon */
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--surface-hover);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15), 0 10px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.search-bar:focus+.search-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.search-bar::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Highlighting Search Results */
.search-highlight {
    color: var(--primary-color);
    font-weight: 700;
    background: rgba(168, 85, 247, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

/* No Results State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.no-results i {
    font-size: 3rem;
    opacity: 0.2;
    color: var(--primary-color);
}

/* Light Mode Overrides for Search */
html.light-mode .search-bar {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html.light-mode .search-bar:focus {
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1), 0 10px 20px rgba(0, 0, 0, 0.1);
}