:root {
    --bg-color: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-purple: #b026ff;
    --accent-yellow: #f4d03f;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
    --easing: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Glow */
.background-glow {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at 50% 50%, rgba(176, 38, 255, 0.05) 0%, rgba(10, 10, 10, 0) 60%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
.logo,
.btn-primary,
.btn-small,
.badge,
.ticker-item {
    font-family: var(--font-heading);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    padding-top: 80px;
    /* Offset for nav */
    text-align: left;
}

.hero-content {
    max-width: 800px;
    width: 100%;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #a0a0a0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.typing-container {
    font-size: 1.2rem;
    color: var(--accent-purple);
    margin-bottom: 1.5rem;
    min-height: 1.5em;
    display: flex;
    align-items: center;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--text-primary);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: transform 0.2s var(--easing), box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Project Cards */
.projects-container {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-radius: 12px;
    overflow: hidden;
}

.project-visuals {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Project Gallery (Carousel) */
.project-gallery {
    display: flex;
    overflow: hidden;
    width: 100%;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.gallery-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: scroll 20s linear infinite;
}

.gallery-track:hover {
    animation-play-state: paused;
}

.project-card.reverse .gallery-track {
    animation-direction: reverse;
}

.project-gallery img {
    height: 250px;
    width: auto;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.project-gallery img:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.project-gallery::-webkit-scrollbar {
    display: none;
}

.project-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-header {
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.client-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent-yellow);
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    background: rgba(176, 38, 255, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(176, 38, 255, 0.2);
    border-radius: 4px;
}

/* Tech Ticker */
.tech-ticker {
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 2rem 0;
    margin: 4rem 0;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-wrap {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    margin: 0 2rem;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Contact Form */
.contact-section {
    padding: 4rem 1.5rem;
    display: flex;
    justify-content: center;
}

.glass-form-container {
    width: 100%;
    max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 12px;
}

.glass-form-container h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 16px rgba(176, 38, 255, 0.1);
}

.full-width {
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
}

.footer-bottom {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px rgba(176, 38, 255, 0.3);
    border-radius: 4px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--accent-purple);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 1rem 0.8rem;
    cursor: pointer;
    z-index: 2001;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s ease;
    user-select: none;
}

.lightbox-nav:hover {
    background: var(--accent-purple);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.5);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* --- OVERHAULED CASE STUDY MODAL --- */

.btn-secondary {
    display: inline-block;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: rgba(176, 38, 255, 0.1);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.2);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: center; /* Mobile: slides from bottom */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #0f0f0f;
    /* DESKTOP DEFAULTS */
    width: 90%; 
    max-width: 1200px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.9);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0; 
    position: relative;
    flex-direction: column;
    /* REMOVED overflow-y: auto; from here */
	
	max-height: 85vh;       /* Stop it from touching screen edges */
    height: 100%;           /* Try to fill that 85vh */
    display: flex;
    overflow: hidden;       /* Vital: Clips anything that tries to stick out */
    border-radius: 12px;
}
/* ADD THIS NEW RULE */
#modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* Ensures the scrollbar stays inside */
}


.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Close Button */
.sticky-header {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.modal-title-group h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1;
}

.modal-title-group span {
    font-size: 0.8rem;
    color: var(--accent-purple);
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.close-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* Content Layout */
.cs-scroll-content {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    flex: 1; /* ADD THIS: Tells it to grow and fill available space */
    overflow-y: auto; /* ADD THIS: Makes THIS element scrollable */
	scrollbar-width: none;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.cs-scroll-content::-webkit-scrollbar {
    display: none;
}

.cs-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3rds text, 1/3rd Technical Stats */
    gap: 3rem;
    margin-bottom: 3rem;
}

.cs-full-width {
    grid-column: 1 / -1;
    margin-bottom: 3rem;
}

.cs-section h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent-yellow);
    padding-left: 1rem;
    display: flex;
    align-items: center;
}

.cs-text {
    color: #cccccc;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Technical Artifacts */
.tech-card {
    background: #161616;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tech-card h4 {
    font-family: var(--font-heading);
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid #222;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-label { color: #666; }
.stat-value { color: var(--accent-purple); font-family: var(--font-heading); }

/* Code & Terminal (Visual Polish) */
.code-window {
    background: #0d1117; /* Github Dark Dimmed */
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.window-bar {
    background: #161b22;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #30363d;
    display: flex;
    gap: 6px;
    align-items: center;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }

.window-title {
    margin-left: auto;
    margin-right: auto;
    color: #8b949e;
    font-size: 0.8rem;
}

.code-content {
    padding: 1.5rem;
    overflow-x: auto;
    color: #c9d1d9;
    font-size: 0.85rem;
    line-height: 1.5;
}

.token-blue { color: #79c0ff; }
.token-green { color: #7ee787; }
.token-purple { color: #d2a8ff; }
.token-comment { color: #8b949e; font-style: italic; }

/* --- RESPONSIVE STYLES --- */

/* Desktop First */
@media (min-width: 900px) {
    .project-card {
        flex-direction: row;
        align-items: center;
        gap: 4rem;
        padding: 2rem;
    }

    .project-card.reverse {
        flex-direction: row-reverse;
    }

    .project-visuals,
    .project-info {
        flex: 1;
        width: 50%;
    }

    .hero-content h1 {
        font-size: 4rem;
    }
}

/* Mobile Specific Fixes */
@media (max-width: 900px) {
    .project-gallery img {
        height: 180px;
    }
	.projects-container {
        gap: 10rem; /* Increased from 6rem. Push this to 10rem if you want even more space */
    }

    .modal-content {
        width: 100%;
        height: 100vh;        /* Fill the whole screen height */
        max-height: 100vh;    /* Override the 85vh limit from the desktop styles */
        max-width: none;
        border-radius: 0;
        border: none;         /* Remove the border so it sits perfectly flush with the screen edges */
    }
    
    .cs-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .cs-scroll-content {
        padding: 1.5rem;
    }

    .modal-title-group h2 {
        font-size: 1.2rem;
    }
}

/* Add this to your CSS */
.ascii-art {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #a0a0a0;
    white-space: pre; /* CRITICAL: Preserves the ASCII spacing */
    overflow-x: auto;
    background: #111;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #333;
}

/* Make the grid look better on desktop */
@media (min-width: 900px) {
    .cs-grid {
        grid-template-columns: 1.5fr 1fr; /* Narrative takes 60%, Artifacts take 40% */
    }
}
.cs-text ul {
    list-style-type: none;
    padding-left: 1rem;
    margin-top: 1rem;
}

.cs-text li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.cs-text li::before {
    content: '»';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-purple);
    font-weight: 700;
}

.cs-text strong, .cs-text b {
    color: var(--accent-yellow);
    font-weight: 600;
}

.cs-text code {
    background: rgba(176, 38, 255, 0.1);
    color: var(--accent-purple);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: var(--font-heading);
}