/* CSS Variables & Design System */
:root {
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.03);

    --primary: #00ff88;
    --secondary: #00d4ff;
    --accent: #ff0055;

    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;

    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.8s ease;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-neon: 0 0 20px rgba(0, 255, 136, 0.15);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-heading);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-soft);
    border-radius: var(--border-radius-lg);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    border: none;
    box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(0, 255, 136, 0.1);
    color: #fff;
}

/* Animations - Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

.fade-in {
    animation: fadeIn 0.8s forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1s;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-medium);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    /* Offset for fixed nav */
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    z-index: 10;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}

.hero-title {
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
}

.hero-typewriter {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    min-height: 1.5em;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--primary);
}

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

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: var(--spacing-md);
}

.profile-card {
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.profile-image-container {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-neon);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.profile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    width: 100%;
    height: 100%;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bounce {
    animation: float 2s infinite ease-in-out;
}

/* Particles Canvas */
#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* About Section */
.about-section {
    background: radial-gradient(circle at top right, rgba(0, 255, 136, 0.05), transparent 40%);
}

.about-text-container {
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 2rem;
}

.highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.skill-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    width: 0;
    /* JS will animate width */
    transition: width 1s ease-out;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 255, 136, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    color: var(--primary);
    width: 32px;
    height: 32px;
}

.project-links a {
    color: var(--text-secondary);
    margin-left: 1rem;
}

.project-links a:hover {
    color: var(--primary);
}

.project-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: var(--font-mono);
    color: var(--secondary);
}

/* Experience (Timeline) Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    /* Adjust for responsiveness later */
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--text-secondary);
    z-index: 2;
    transition: all 0.3s;
}

.timeline-dot.current {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.timeline-item:hover .timeline-dot {
    border-color: var(--primary);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-content {
    padding: 1.5rem;
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-content .company {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Games Section */
.games-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.game-container {
    height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Quiz Game Styles */
.quiz-container {
    padding: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.btn.c-option {
    margin: 0.5rem 0;
    display: block;
    width: 100%;
}

.btn.c-option.correct {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.btn.c-option.wrong {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Terminal Game Styles */
.terminal-header {
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
}

.terminal-buttons {
    display: flex;
    gap: 6px;
    margin-right: 1rem;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.close {
    background: #ff5f56;
}

.minimize {
    background: #ffbd2e;
}

.maximize {
    background: #27c93f;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #888;
    margin: 0 auto;
}

.terminal-body {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    overflow-y: auto;
    color: #e0e0e0;
}

.terminal-line {
    margin-bottom: 0.5rem;
}

.cmd {
    color: var(--primary);
}

.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: var(--primary);
    margin-right: 0.5rem;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}

/* Contact Section */
.contact-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    width: 280px;
    text-align: center;
    color: var(--text-primary);
}

.contact-card i {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-card:hover i {
    color: var(--secondary);
}

/* Modal Styling */
.modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-dark);
    margin: 10% auto;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 900px;
    box-shadow: var(--shadow-soft);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-secondary);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
    text-decoration: none;
}

.modal-body {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.modal-image-container {
    flex: 0 0 250px;
}

.modal-image-container img {
    width: 100%;
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-info {
    flex: 1;
}

.modal-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-info h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.modal-info p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-isbn {
    font-family: var(--font-mono);
    font-size: 0.9rem !important;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    display: inline-block;
}

#modal-link {
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .modal-image-container {
        flex: 0 0 auto;
        width: 200px;
    }
}

/* --- New Additions --- */
/* Profile Image */
.profile-img {
    height: 100%;
    object-fit: cover;
    transform: scale(2) translateY(25%);
}

/* About Layout */
.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.about-image-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
}

.about-img {
    width: 100%;
    max-width: 500px;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-neon);
}

.about-text-container {
    flex: 2;
    min-width: 300px;
}

.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-logo {
    height: 24px;
    width: auto;
}

/* Carousels */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    margin: 2rem 0;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
    scroll-behavior: smooth;
    width: 100%;
}

.carousel::-webkit-scrollbar {
    display: none;
    /* WebKit */
}

.carousel-item {
    flex: 0 0 auto;
    width: 250px;
    scroll-snap-align: start;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-medium);
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(5px);
}

.carousel-caption h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.published {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary);
}

.badge.production {
    background: rgba(255, 212, 0, 0.2);
    color: #ffd400;
}

.book-hover-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity var(--transition-fast);
    backdrop-filter: blur(4px);
    z-index: 5;
}

.interactive-book {
    cursor: pointer;
}

.carousel-item:hover .book-hover-title {
    opacity: 1;
}

.carousel-item.in-production {
    filter: grayscale(100%);
    pointer-events: none;
}

.production-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.production-overlay span {
    transform: rotate(-30deg);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    border: 3px solid #fff;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.carousel-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.carousel-btn:hover {
    background: var(--primary);
    color: #000;
}

.prev-btn {
    margin-right: -20px;
}

.next-btn {
    margin-left: -20px;
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
    }

    .carousel-item {
        width: 200px;
    }

    .carousel-btn {
        display: none;
        /* Hide buttons on mobile, allow touch scroll */
    }
}

/* Footer */
.glass-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fff;
}

.footer-container p {
    margin: 0;
    font-size: 0.9rem;
}

.heart-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
    display: inline-block;
    vertical-align: text-bottom;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-typewriter {
        margin: 0 auto var(--spacing-md);
    }

    .hero-actions {
        justify-content: center;
    }

    .profile-card {
        margin-top: 2rem;
    }

    .games-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .about-text-container {
        padding: 1.5rem;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-dot {
        left: 1px;
    }

    .contact-cards {
        flex-direction: column;
        align-items: center;
    }
}

/* Mobile Menu Overlay Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.4s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.mobile-link:active {
    color: var(--primary);
}