/* --- BRAND COLOR MATRIX --- */
:root {
    --bg-dusty-black: #141416;
    --accent-orange: #FF5F1F;
    --neon-teal: #00F0FF;
    --text-white: #E4E4E7;
    --text-muted: #A1A1AA;
}

/* --- CSS RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dusty-black);
    color: var(--text-white);
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- CRT / VHS FX ENGINE --- */
/* The Faint Vector Grid Overlap */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center top;
    pointer-events: none;
    z-index: 1;
}

/* --- CUSTOM SELECTION HIGHLIGHT ENGINE --- */
::selection {
    background-color: var(--accent-orange);
    color: var(--bg-dusty-black); /* Swaps text to dusty black for crisp readability against the bright orange */
}

/* Firefox legacy support fallback */
::-moz-selection {
    background-color: var(--accent-orange);
    color: var(--bg-dusty-black);
}

/* Pinned Weathered Vignette */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85), inset 0 0 20px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 10;
}

/* --- VHS-style Rolling Scanline --- */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 240, 255, 0.03); /* Toned down base alpha slightly */
    opacity: 0.7;
    pointer-events: none;
    z-index: 11;
    /* Added a baseline blur to defeat the sharp vector edge */
    filter: blur(0.5px); 
    animation: 
        scan 6s linear infinite, 
        vhs-jitter 5s linear infinite;
}

@keyframes scan {
    0% { top: -5%; }
    100% { top: 105%; }
}

/* Softer tracking error emulation */
@keyframes vhs-jitter {
    0%, 91%, 100% {
        transform: translateY(0) scaleY(1);
        filter: blur(0.5px);
        opacity: 0.7;
        background: rgba(0, 240, 255, 0.03);
    }
    /* 92% to 97%: The tracking twitch window (calibrated 30% softer) */
    92% {
        /* Max displacement dropped from 12px to 8px, scale from 2.5 to 1.8 */
        transform: translateY(-8px) scaleY(1.8);
        /* Sharp brightness spike dropped to a gentle bloom */
        background: rgba(0, 240, 255, 0.14); 
        filter: blur(1.2px); /* Soft defocus */
        opacity: 0.9;
    }
    93% {
        transform: translateY(5px) scaleY(1.1);
        filter: blur(1px);
    }
    94% {
        /* Peak spike dropped from 18px to 12px, scale from 3.5 to 2.2 */
        transform: translateY(-12px) scaleY(2.2);
        background: rgba(0, 240, 255, 0.18);
        filter: blur(1.8px); /* Maximum softening at peak displacement */
    }
    95% {
        transform: translateY(3px) scaleY(0.9);
        filter: blur(0.8px);
    }
    96% {
        transform: translateY(-1px) scaleY(1.3);
        filter: blur(1px);
    }
}

/* --- LAYOUT & CONTAINERS --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

/* --- HERO SECTION --- */
header {
    text-align: center;
    margin-bottom: 5rem;
}

.logo-wrapper {
    margin-bottom: 2.5rem;
    display: inline-block;
}

/* Image configuration for your shiny teal-chrome logo */
.logo-img {
    max-width: 280px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.2));
}

header h1 {
    font-size: 3rem;           /* Restores the punchy, larger scale */
    font-weight: 700;
    letter-spacing: -0.03em;
    max-width: 650px;
    margin: 0 auto 1.5rem auto; /* Centers the container block and adds bottom spacing */
    text-align: center;        /* CRUCIAL: Snaps the text and cursor to the absolute center */
    line-height: 1.2;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
    min-height: 3.8rem;        /* Prevents the layout from jumping if the line is cleared */
}

/* The solid, unblinking base cursor */
.terminal-cursor {
    display: inline-block;
    min-width: 0.58em;
    text-align: center;
    vertical-align: baseline;
    background-color: var(--neon-teal);
    color: var(--bg-dusty-black);
}

/* This class gets appended ONLY when the terminal is actively focused */
.terminal-cursor.blinking {
    animation: blink-block 1s step-end infinite;
}

@keyframes blink-block {
    0%, 100% {
        background-color: var(--neon-teal);
        color: var(--bg-dusty-black);
    }
    50% {
        background-color: transparent;
        color: inherit;
    }
}

.header-intro {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.15rem;
    line-height: 1.6;
    text-align: left;
}

/* --- PROJECT GRID --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2.5rem;
    margin-bottom: 6rem;
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background-color: rgba(20, 20, 22, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 2.5rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(2px);
}

.project-card:hover {
    border-color: var(--neon-teal);
    transform: translateY(-2px);
}

.project-tag {
    font-family: 'Share Tech Mono', monospace;
    color: var(--accent-orange);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.project-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.project-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

/* --- PROJECT CARD MEDIA ENGINE --- */
.mobile-double-preview {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.mobile-double-preview img {
    width: calc(50% - 0.5rem); /* Perfectly splits the flex container space */
    aspect-ratio: 9 / 16;     /* Hard locks a vertical phone aspect ratio */
    object-fit: cover;        /* Prevents distortion if your asset sizes slightly vary */
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.15); /* Soft neon teal border */
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.game-landscape-preview {
    margin-bottom: 1.75rem;
}

.game-landscape-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;     /* Hard locks standard widescreen display format */
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 95, 31, 0.2); /* Soft orange border */
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

/* MICRO-INTERACTION GLOW UP */
.project-card:hover .mobile-double-preview img {
    border-color: var(--neon-teal);
    transform: scale(1.01);
}

.project-card:hover .game-landscape-preview img {
    border-color: var(--accent-orange);
    transform: scale(1.01);
}

/* --- INTERACTIVE BUTTONS --- */
.cta-btn {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--accent-orange);
    color: var(--bg-dusty-black);
    text-decoration: none;
    font-weight: 700;
    padding: 0.85rem 1.75rem;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--accent-orange);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cta-btn:hover {
    background-color: transparent;
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    cursor: pointer;
}

.cta-btn.secondary {
    background-color: transparent;
    color: var(--text-white);
    border-color: rgba(234, 234, 231, 0.3);
    pointer-events: none;
}

/* --- NEWSLETTER TRANSMISSION --- */
.newsletter-section {
    border-top: 1px dashed rgba(228, 228, 231, 0.15);
    padding-top: 5rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-section h2 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.25rem;
    color: var(--neon-teal);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.newsletter-section p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(228, 228, 231, 0.2);
    padding: 0.25rem;
    border-radius: 4px;
}

/* Turnstile renders a fixed-size iframe; reserve its height to avoid layout
   shift and center it under the input row. */
.cf-turnstile {
    min-height: 65px;
}

.form-group:focus-within {
    border-color: var(--neon-teal);
}

.email-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-white);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
}

.email-input:focus {
    outline: none;
}

.submit-btn {
    background-color: var(--accent-orange);
    color: var(--bg-dusty-black);
    border: none;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0 1.5rem;
    border-radius: 2px;
    transition: opacity 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.9;
    cursor: pointer;
}

/* Keeps the input active for typing/focus, but completely invisible */
#ghost-input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 0;
    height: 0;
    border: none;
    padding: 0;
    margin: 0;
    z-index: -1;
    pointer-events: none;
}

/* Tighten page gutters on small screens so the 300px Turnstile widget fits
   without clipping against the body's overflow-x guard. */
@media (max-width: 480px) {
    .container {
        padding: 3rem 1.25rem;
    }
}

/* --- FOOTER --- */
footer {
    margin-top: 6rem;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: rgba(228, 228, 231, 0.3);
    letter-spacing: 0.05em;
}
