:root {
    /* Deep Dark Mode (Default) */
    --bg-base: #050505;
    --bg-gradient: linear-gradient(-45deg, #0a0515, #1a0b2e, #0d1b2a, #05161e);
    --bg-size: 400% 400%;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #00ffcc; /* Neon Cyan */
    --accent-secondary: #39ff14; /* Lime Green */
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --progress-bg: var(--accent-primary);
}

[data-theme="light"] {
    /* Clean Light Mode */
    --bg-base: #f4f4f6;
    --bg-gradient: linear-gradient(-45deg, #ffdde1, #ee9ca7, #e0c3fc, #8ec5fc);
    --bg-size: 400% 400%;
    --text-primary: #111111;
    --text-secondary: #555555;
    --accent-primary: #0088cc;
    --accent-secondary: #22aa22;
    
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --progress-bg: var(--accent-primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.5s ease, background-image 0.5s ease, border-color 0.5s ease;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    background-image: var(--bg-gradient);
    background-size: var(--bg-size);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    animation: gradientMove 15s ease infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--progress-bg);
    width: 0%;
    z-index: 9999;
    box-shadow: 0 0 10px var(--progress-bg);
    transition: width 0.1s ease-out;
}

/* Background Particles */
#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none; /* Let clicks pass through */
}

/* -------------------------------------
   Phase 1: Pre-loader
   ------------------------------------- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--accent-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
}

.terminal-text {
    margin-bottom: 2rem;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

#glitch-face pre {
    color: var(--accent-primary);
    text-shadow: 2px 0 red, -2px 0 blue;
    animation: glitch 0.2s infinite;
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 1px) }
    40% { transform: translate(-1px, -1px) }
    60% { transform: translate(2px, 1px) }
    80% { transform: translate(1px, -1px) }
    100% { transform: translate(0) }
}

.hidden {
    display: none !important;
}

/* -------------------------------------
   Phase 2: Main Layout
   ------------------------------------- */
#main-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    min-height: 100vh;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    opacity: 0; /* For GSAP fade in */
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Left: Persona */
.col-left {
    align-items: center;
}

.profile-container {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    border: 3px solid var(--accent-primary);
    padding: 5px;
}

.glow-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.3;
    z-index: 1;
    filter: blur(15px);
    animation: pulse 3s infinite alternate;
}

.anti-gravity {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Center: Identity */
.col-center {
    text-align: center;
}

.bold-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.text-glow {
    text-shadow: 0 0 40px rgba(0, 255, 204, 0.3);
}

.pulse-text {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 2px;
    animation: textPulse 2s infinite alternate;
}

@keyframes textPulse {
    from { opacity: 0.7; text-shadow: 0 0 0px transparent; }
    to { opacity: 1; text-shadow: 0 0 10px var(--accent-secondary); }
}

/* Right: Controls & Social */
.col-right {
    align-items: flex-end;
    gap: 3rem;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.control-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Custom Toggle Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border: 1px solid var(--glass-border);
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-primary);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}
input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-primary);
}
input:checked + .slider:before {
    transform: translateX(30px);
    background-color: var(--bg-base);
}
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Language slider text pseudo-elements */
.lang-slider:after {
    content: attr(data-off);
    position: absolute;
    right: 10px;
    top: 7px;
    font-size: 10px;
    font-weight: bold;
    color: var(--text-primary);
    transition: 0.3s;
}
input:checked + .lang-slider:after {
    content: attr(data-on);
    left: 10px;
    color: var(--bg-base);
}


/* Social Hub */
.social-hub {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
}

.social-icon {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.social-icon:hover {
    color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 204, 0.2);
    border-color: var(--accent-primary);
}


/* -------------------------------------
   Media Queries
   ------------------------------------- */
@media (max-width: 1200px) {
    #main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
    }
    
    .col-left, .col-center, .col-right {
        align-items: center;
        text-align: center;
    }
    
    .col-right {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .controls {
        flex-direction: row;
        width: auto;
        gap: 2rem;
    }
    
    .social-hub {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .bold-title {
        font-size: 2.5rem;
    }
    
    .col-right {
        flex-direction: column;
    }
    
    .controls {
        width: 100%;
        justify-content: space-around;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
}
