/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #64ffda;
    --secondary-color: #8892b0;
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --accent-color: #64ffda;
    --nav-bg: rgba(10, 25, 47, 0.85);
    --card-bg: #112240;
    --shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
    --shadow-lg: 0 20px 30px -15px rgba(2, 12, 27, 0.7);
    --font-mono: 'Fira Code', monospace;
    --font-sans: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

.hero {
    padding-top: 180px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
    z-index: 1000;
    height: 80px;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-num {
    color: var(--primary-color);
    margin-right: 5px;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: transparent;
    margin-top: 0;
    padding-top: 100px;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    text-align: left;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: var(--text-primary);
}

.highlight {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    min-height: 1.6em; /* Prevent layout shift */
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
    max-width: 540px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    margin-bottom: 2.5rem;
}

.btn {
    padding: 14px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-block;
    cursor: pointer;
}

.btn-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: rgba(100, 255, 218, 0.1);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.social-links {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    filter: grayscale(100%);
    transition: all 0.3s ease;
    z-index: 2;
}

.hero-image img:hover {
    filter: none;
    transform: scale(1.02);
}

.hero-image::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    transition: all 0.3s ease;
}

.hero-image:hover::after {
    top: 10px;
    left: 52%;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 300px;
    height: 1px;
    background-color: var(--text-secondary);
    margin-left: 20px;
    opacity: 0.3;
}

.section-num {
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 10px;
    font-weight: 400;
}

/* About Section */
.about {
    background-color: var(--bg-primary);
}

.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.highlight-text {
    color: var(--primary-color);
}

.terminal-window {
    background-color: #112240;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    font-family: var(--font-mono);
    overflow: hidden;
    border: 1px solid #233554;
}

.terminal-header {
    background-color: #1d2d50;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #233554;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.terminal-title {
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.terminal-body {
    padding: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.code-line {
    margin-bottom: 5px;
}

.indent { padding-left: 20px; }
.double-indent { padding-left: 40px; }

.keyword { color: #c792ea; }
.variable { color: #82aaff; }
.property { color: #addb67; }
.string { color: #ecc48d; }
.boolean { color: #ff5874; }
.function { color: #82aaff; }

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.stat p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-category {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 4px;
    transition: transform 0.3s;
    border: 1px solid transparent;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category h3::before {
    content: '>';
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(100, 255, 218, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

/* Experience Section */
.experience {
    background-color: var(--bg-primary);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #233554;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 40px;
}

.timeline-dot {
    position: absolute;
    left: -4px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.timeline-content {
    background-color: transparent;
    padding: 0;
}

.timeline-content h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--primary-color);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.timeline-date {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 2rem 1.5rem;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-7px);
    border-color: var(--primary-color);
}

.project-image {
    display: none; /* Hiding images for a cleaner dev look, focusing on content */
}

.project-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.folder-icon {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.project-links a:hover {
    color: var(--primary-color);
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s;
}

.project-card:hover h3 {
    color: var(--primary-color);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: transparent;
    padding: 0;
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.education-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.education-card:hover {
    border-color: var(--primary-color);
}

.education-icon {
    font-size: 2rem;
    color: var(--primary-color);
    background: rgba(100, 255, 218, 0.1);
    padding: 15px;
    border-radius: 50%;
}

.education-info h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.education-info h4 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.university {
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.year {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.cert-list {
    list-style: none;
    margin-top: 10px;
}

.cert-list li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cert-list li::before {
    content: '▹';
    color: var(--primary-color);
    font-weight: bold;
}

/* Contact Section */
.contact {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content {
    display: block;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-info h3 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.contact-items {
    display: none; /* Simplifying for the "Get In Touch" button look */
}

.contact-form {
    display: none; /* Removing form for a cleaner "mailto" approach common in dev portfolios */
}

/* Footer */
.footer {
    background-color: var(--bg-primary);
    padding: 2rem 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.loader-content {
    text-align: center;
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: bold;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background-color: var(--bg-secondary);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    animation: load 2s ease-in-out forwards;
}

@keyframes load {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation Utility Classes */
.hidden {
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) translateX(0) !important;
}

.fade-up {
    transform: translateY(30px);
}

.fade-down {
    transform: translateY(-30px);
}

.fade-left {
    transform: translateX(-30px);
}

.fade-right {
    transform: translateX(30px);
}

/* Staggered Delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }

/* Hover Effects for Cards */
.project-card, .education-card, .skill-category {
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow 0.3s ease;
}

.project-card:hover, .education-card:hover {
    transform: translateY(-10px) !important; /* Override the show transform if needed, but usually show sets to 0 */
}

/* Ensure hover works after animation */
.project-card.show:hover, .education-card.show:hover {
    transform: translateY(-10px) !important;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
    color: var(--primary-color);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip-path: inset(0 0 50% 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip-path: inset(50% 0 0 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 0); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 0); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 0); }
    100% { clip-path: inset(30% 0 20% 0); transform: translate(2px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(2px, 0); }
    20% { clip-path: inset(30% 0 20% 0); transform: translate(-2px, 0); }
    40% { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
    60% { clip-path: inset(20% 0 50% 0); transform: translate(-2px, 0); }
    80% { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); }
    100% { clip-path: inset(0% 0 80% 0); transform: translate(-2px, 0); }
}

/* Custom Cursor */
body {
    cursor: none;
}

.cursor-follower {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 4px; /* Square with slight rounded corners */
    transform: translate(-50%, -50%) rotate(45deg); /* Diamond shape */
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s, width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}

.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 0; /* Square dot */
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
}

/* Hover state for cursor */
.cursor-hover {
    width: 50px;
    height: 50px;
    background-color: rgba(100, 255, 218, 0.1);
    border-color: var(--primary-color);
    transform: translate(-50%, -50%) rotate(0deg); /* Rotate back to square on hover */
}

/* 3D Tilt Effect */
.project-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-content {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-wrapper {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .terminal-window {
        margin-bottom: 30px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        height: 100vh;
        background-color: #112240;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: -10px 0px 30px -15px rgba(2, 12, 27, 0.7);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    .section-title::after {
        width: 100px;
    }
}

/* CRT Cinematic Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
    background: 
        /* Scanlines */
        linear-gradient(
            rgba(18, 16, 16, 0) 50%, 
            rgba(0, 0, 0, 0.1) 50%
        ),
        /* Vignette */
        radial-gradient(
            circle at center, 
            transparent 60%, 
            rgba(0, 0, 0, 0.4) 100%
        );
    background-size: 100% 4px, 100% 100%;
}

/* Moving Scanner Line */
.crt-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        to bottom, 
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 255, 255, 0.05) 50%, 
        rgba(18, 16, 16, 0) 50%
    );
    background-size: 100% 8px;
    animation: scanline 10s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Button Shine Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Text Glow */
h1, h2, h3, .nav-brand {
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.15);
}

