/* ==========================================================================
   RETRO PHYSICAL ELECTRONICS THEME - "VOLTAGE V4 FIXED"
   Restoring Dark Theme & Styles
   ========================================================================== */

:root {
    /* Core Palette */
    --bg-color: #08080a;
    --bg-panel: rgba(25, 25, 30, 0.8); /* More translucent */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888899;
    
    /* Accents */
    --accent-primary: #9b59b6; /* Purple */
    --accent-glow: rgba(155, 89, 182, 0.4);
    
    --border-color: #33333a;
    
    /* Fonts */
    --font-main: 'Courier New', Courier, monospace;
    --font-display: 'Consolas', 'Monaco', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-color);
}

/* Custom Cursor - White Crosshair */
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
    cursor: crosshair;
}

/* Background Pattern */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

#circuit-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    color: #fff;
}

a {
    text-decoration: none;
    color: var(--accent-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}
a:hover { color: #fff; text-shadow: 0 0 8px var(--accent-primary); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

/* Section Headers */
.section { 
    margin-bottom: 120px; 
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 50px; border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}
.section-header h2 { font-size: 2.2rem; color: var(--accent-primary); }
.section-marker {
    width: 15px; height: 15px; background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

/* ==========================================================================
   INDEX NAVIGATION
   ========================================================================== */
.index-nav {
    position: fixed;
    right: 40px; top: 50%;
    transform: translateY(-50%);
    display: flex; flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 100;
    padding: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0; 
    /* Initial offset handled by JS/CSS load class */
}
body.loaded .index-nav {
    opacity: 1; 
}

.index-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.1s ease-out;
    transform-origin: right center;
    padding: 5px 10px;
    border-right: 2px solid transparent;
    white-space: nowrap;
}
.index-item:hover, .index-item.active {
    color: var(--accent-primary);
    border-right-color: var(--accent-primary);
}
@media (max-width: 1100px) { .index-nav { display: none; } }

/* ==========================================================================
   GALLERY (TEXT FOCUSED)
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.gallery-item {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    cursor: pointer;
    height: 140px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.gallery-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px rgba(155, 89, 182, 0.2);
    height: 320px;
    background: rgba(30, 30, 35, 0.9);
    transform: translateY(-5px);
}

.gallery-header { margin-bottom: 15px; }
.gallery-cat {
    color: var(--accent-primary);
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}
.gallery-title { font-size: 1.2rem; color: #fff; margin: 0; }

.gallery-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.1s;
    flex: 1;
    overflow-y: hidden;
}
.gallery-item:hover .gallery-desc {
    opacity: 1;
    transform: translateY(0);
}

.gallery-action {
    margin-top: 15px;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.gallery-item:hover .gallery-action {
    opacity: 1;
    transform: translateX(0);
}

.gallery-item.full-width { grid-column: 1 / -1; }

/* ==========================================================================
   HERO & COMPONENTS
   ========================================================================== */
.hero {
    min-height: 85vh;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 50px; align-items: center;
    padding: 80px 0;
}
.hero-left > * { opacity: 0; } /* For animation */

.hero-name {
    font-size: clamp(3.5rem, 7vw, 6rem);
    line-height: 1;
    border-left: 6px solid var(--accent-primary);
    padding-left: 30px;
    margin-bottom: 15px;
    text-shadow: 0 0 25px rgba(155, 89, 182, 0.2);
}
.hero-tagline { font-size: 1.4rem; color: var(--text-secondary); margin-bottom: 30px; }

.bio-grid {
    display: grid; grid-template-columns: auto 1fr;
    gap: 15px 30px;
    background: rgba(30, 30, 35, 0.5);
    padding: 25px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    border-radius: 4px;
}
.bio-label { color: var(--accent-primary); font-weight: bold; }
.bio-val { color: #fff; }

.hero-right {
    position: relative; height: 500px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; /* For animation */
}
#holo-canvas { width: 100%; height: 100%; }

/* Generic Content Box (Tech, Certs) */
.tech-box {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 35px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.tech-box:hover {
    background: rgba(30, 30, 35, 0.8);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.2);
    transform: translateY(-5px);
}
.tech-box::before, .tech-box::after {
    content: ''; position: absolute; top: 15px; width: 6px; height: 6px;
    background: #444; border-radius: 50%; box-shadow: inset 1px 1px 2px #000;
}
.tech-box::before { left: 15px; }
.tech-box::after { right: 15px; }

.tag-label {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
}

/* Academics */
.academic-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}
.academic-card {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 35px;
    transition: all 0.3s ease;
}
.academic-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.2);
}
.academic-score-big {
    font-size: 4rem;
    color: var(--accent-primary);
    margin: 15px 0 25px;
    text-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}
.grade-row {
    display: flex; justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
}
.grade-row span:first-child { color: var(--text-secondary); }
.grade-row span:last-child { color: #fff; font-weight: bold; }

/* Skills */
.skills-grid { display: flex; flex-wrap: wrap; gap: 15px; }
.skill-tag {
    background: #1a1a20;
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 20px;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: default;
}
.skill-tag:hover {
    border-color: var(--accent-primary);
    background: rgba(155, 89, 182, 0.15);
}

/* Timeline */
.timeline { padding-left: 40px; border-left: 3px solid var(--border-color); }
.timeline-item { margin-bottom: 50px; position: relative; }
.timeline-dot {
    position: absolute; left: -48px; top: 8px;
    width: 16px; height: 16px;
    background: var(--bg-color);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
}
.timeline-content {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 30px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.timeline-content:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.2);
}
.timeline-date {
    color: var(--accent-primary);
    font-size: 0.9rem; margin-bottom: 8px; display: block;
}

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.98); z-index: 1000;
    align-items: center; justify-content: center;
}
.modal-content {
    display: flex; width: 95%; max-width: 1400px; height: 90vh;
    border: 1px solid var(--accent-primary);
    background: #0a0a0c;
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.2);
}
.modal-media {
    flex: 2.5; background: #000;
    display: flex; align-items: center; justify-content: center;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}
.modal-media iframe { width: 100%; height: 100%; border: none; }
.modal-media img, .modal-media video { max-width: 100%; max-height: 100%; }
.modal-details {
    flex: 1; padding: 40px; overflow-y: auto;
    background: #111;
}
.close-btn {
    position: absolute; top: 25px; right: 35px;
    font-size: 3.5rem; color: #fff; cursor: pointer; z-index: 1001;
    text-shadow: 0 0 10px var(--accent-primary);
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Load States */
body.loaded .hero-left > * {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
body.loaded .hero-left h1 { animation-delay: 0.2s; }
body.loaded .hero-left p { animation-delay: 0.4s; }
body.loaded .bio-grid { animation-delay: 0.6s; }
body.loaded .hero-right { 
    animation: slideInRight 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; 
    animation-delay: 0.8s; 
}

/* Responsive */
@media (max-width: 768px) {
    .hero { grid-template-columns: 1fr; height: auto; }
    .hero-right { height: 350px; order: -1; }
    .modal-content { flex-direction: column; height: auto; max-height: 95vh; }
    .modal-media { height: 40vh; flex: none; border-right: none; border-bottom: 1px solid var(--border-color); }
}
