:root {
    /* Color Palette */
    --color-bg: #0a0a0a;
    --color-primary: #00ff00;
    /* Phosphor Green */
    --color-secondary: #00ffff;
    /* Cyan */
    --color-accent: #ff00ff;
    /* Magenta */
    --color-highlight: #00ff00;
    /* Bright Yellow */
    --color-text-main: #e0e0e0;
    --color-text-dim: #888888;

    /* Typography */
    --font-retro: 'VT323', monospace;
    --font-pixel: 'Press Start 2P', cursive;
    --font-modern: 'Inter', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    /* UI */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    --border-width: 2px;
    --crt-curvature: 0px;
    /* Can implement curvature later if desired */
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-modern);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-pixel);
    line-height: 1.4;
    text-transform: uppercase;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Utilities */
.text-retro {
    font-family: var(--font-retro);
}

.text-pixel {
    font-family: var(--font-pixel);
}

.text-modern {
    font-family: var(--font-modern);
}

.text-neon-green {
    color: var(--color-primary);
    text-shadow: 0 0 5px var(--color-primary);
}

.text-neon-cyan {
    color: var(--color-secondary);
    text-shadow: 0 0 5px var(--color-secondary);
}

.text-neon-magenta {
    color: var(--color-accent);
    text-shadow: 0 0 5px var(--color-accent);
}

/* CRT Overlay Container - Minimal setup */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.45) 100%), linear-gradient(rgba(18, 16, 16, 0.1) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(5px);
    border-bottom: 2px solid var(--color-text-dim);
}

.logo {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
}

.nav-links a {
    font-size: 1.5rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-secondary);
    text-shadow: 0 0 8px var(--color-secondary);
}

.nav-links a::before {
    content: '[';
    margin-right: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-links a::after {
    content: ']';
    margin-left: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-links a:hover::before,
.nav-links a:hover::after,
.nav-links a.active::before,
.nav-links a.active::after {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 10;
    max-width: 60%;
}

.hero-greeting {
    font-size: 1.5rem;
    color: var(--color-highlight);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 2px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

.hero-terminal {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-text-dim);
    padding: var(--spacing-md);
    font-family: var(--font-retro);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xl);
    width: fit-content;
    min-width: 300px;
}

.prompt {
    color: var(--color-primary);
    margin-right: 8px;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* CTA Button */
.cta-button {
    background: transparent;
    border: 4px solid var(--color-primary);
    color: var(--color-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    box-shadow: 4px 4px 0 var(--color-accent);
    transition: all 0.2s;
    text-transform: uppercase;
}

.cta-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--color-accent);
    background: rgba(0, 255, 0, 0.1);
}

.cta-button:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* Retro Grid Background - Simple CSS implementation */
.video-overlay {
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            #ff0000 2px,
            #ff0000 4px);
    opacity: 0.1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Base section spacing */
section {
    padding: var(--spacing-xl);
    min-height: 100vh;
    border-bottom: 1px dashed var(--color-text-dim);
    scroll-margin-top: 100px;
    /* Offset for sticky header */
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .main-nav {
        padding: var(--spacing-sm);
    }

    .nav-links {
        display: none;
        /* Implement hamburger later */
    }
}

/* About Section */
.section-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--color-text-dim);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
}

.retro-window {
    border: 2px solid var(--color-text-main);
    background: rgba(20, 20, 20, 0.9);
    box-shadow: 8px 8px 0 var(--color-text-dim);
    max-width: 1000px;
    margin: 0 auto;
}

.window-header {
    background: var(--color-text-main);
    color: var(--color-bg);
    padding: var(--spacing-xs) var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-retro);
    font-weight: bold;
    letter-spacing: 1px;
}

.window-controls {
    display: flex;
    gap: var(--spacing-sm);
}

.window-content {
    padding: var(--spacing-lg);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.profile-pic-placeholder {
    border: 2px dashed var(--color-text-dim);
    padding: var(--spacing-md);
    text-align: center;
    margin-bottom: var(--spacing-md);
    background: rgba(0, 0, 0, 0.3);
}

.ascii-art {
    font-size: 0.8rem;
    line-height: 1;
    color: var(--color-primary);
}

.stats-list {
    list-style: none;
    font-size: 1.2rem;
    line-height: 1.8;
}

.about-narrative h3 {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.narrative-text {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    font-size: 1.1rem;
    color: #cccccc;
}

.skill-tags {
    margin-top: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.tag {
    background: var(--color-text-dim);
    color: var(--color-bg);
    padding: 2px 8px;
    font-size: 1rem;
}

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

    .section-title {
        font-size: 2rem;
    }
}

/* Validation Override - High specificity to beat Tailwind */
nav a.nav-link.active-link,
a.nav-link.active-link {
    color: #39ff14 !important;
    font-weight: bold !important;
    text-shadow:
        0 0 2px #39ff14,
        0 0 8px #39ff14,
        0 0 18px #39ff14,
        0 0 40px rgba(57, 255, 20, 0.9),
        0 0 80px rgba(57, 255, 20, 0.6),
        0 0 140px rgba(57, 255, 20, 0.3) !important;
    filter: brightness(1.2) saturate(1.2) !important;
    transform: scale(1.1);
    display: inline-block;
    animation: neonPulse 1.5s ease-in-out infinite alternate;
    transition: text-shadow 0.3s ease, filter 0.3s ease, transform 0.2s ease;
}

@keyframes neonPulse {
    from {
        text-shadow:
            0 0 2px #39ff14,
            0 0 8px #39ff14,
            0 0 18px #39ff14,
            0 0 40px rgba(57, 255, 20, 0.9),
            0 0 80px rgba(57, 255, 20, 0.6),
            0 0 140px rgba(57, 255, 20, 0.3);
        filter: brightness(1.2) saturate(1.2);
    }

    to {
        text-shadow:
            0 0 4px #39ff14,
            0 0 14px #39ff14,
            0 0 30px #39ff14,
            0 0 60px #39ff14,
            0 0 110px rgba(57, 255, 20, 1),
            0 0 170px rgba(57, 255, 20, 0.8),
            0 0 220px rgba(57, 255, 20, 0.5);
        filter: brightness(1.5) saturate(1.5);
    }
}

/* Journey Section */
.journey-section {
    background-image:
        linear-gradient(rgba(10, 10, 10, 0.9), rgba(10, 10, 10, 0.9)),
        repeating-linear-gradient(45deg, #1a1a1a 0, #1a1a1a 1px, transparent 0, transparent 50%);
    background-size: 20px 20px;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl) 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--color-text-dim);
    z-index: 1;
}

.timeline-level {
    display: flex;
    justify-content: flex-end;
    /* Default Left Side */
    padding-right: 50%;
    position: relative;
    margin-bottom: var(--spacing-xl);
    width: 100%;
}

.timeline-level.right {
    justify-content: flex-start;
    /* Right Side */
    padding-right: 0;
    padding-left: 50%;
}

.level-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    padding: 4px 8px;
    z-index: 2;
    top: 0;
    font-size: 0.8rem;
    color: var(--color-primary);
}

.level-card {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--color-secondary);
    padding: var(--spacing-md);
    width: 90%;
    margin-left: auto;
    /* For left side alignment */
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.timeline-level.right .level-card {
    margin-left: 0;
    margin-right: auto;
    border-color: var(--color-accent);
}

.level-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    z-index: 10;
}

.timeline-level.right .level-card:hover {
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--color-text-dim);
    border-bottom: 1px dashed var(--color-text-dim);
    padding-bottom: 4px;
}

.level-card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.timeline-end {
    text-align: center;
    margin-top: var(--spacing-xl);
    color: var(--color-highlight);
    animation: blink 2s infinite;
    position: relative;
    z-index: 2;
    background: var(--color-bg);
    display: inline-block;
    padding: 0 var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }

    .timeline-level,
    .timeline-level.right {
        padding: 0 0 0 60px;
        justify-content: flex-start;
    }

    .level-marker {
        left: 20px;
    }

    .level-card {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
    }
}

/* Personal Section */
.personal-section {
    padding-bottom: 0;
}

.personal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.subsection-title {
    color: var(--color-text-dim);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px dashed var(--color-text-dim);
    display: inline-block;
}

/* Retro Monitors / Bookshelf */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.retro-monitor {
    background: #222;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 10px #000;
    border: 1px solid #444;
}

.screen {
    background: #050505;
    border-radius: 40px / 10px;
    /* Slight curve */
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    text-shadow: 0 0 2px var(--color-primary);
    text-align: center;
    padding: var(--spacing-sm);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

.screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.screen h4 {
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--color-secondary);
}

.screen .icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.screen p {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Contact Terminal */
.terminal-window {
    background: #000;
    border: 2px solid var(--color-text-dim);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: var(--color-text-dim);
    color: #000;
    padding: 2px 5px;
    font-size: 0.8rem;
    font-weight: bold;
}

.terminal-body {
    padding: var(--spacing-md);
    flex-grow: 1;
}

.form-group {
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--color-primary);
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-primary);
    color: var(--color-text-main);
    font-family: var(--font-retro);
    font-size: 1.1rem;
    padding: 5px;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(0, 255, 0, 0.1);
}

.submit-btn {
    background: var(--color-primary);
    color: #000;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: var(--spacing-sm);
}

.submit-btn:hover {
    background: var(--color-highlight);
}

.main-footer {
    text-align: center;
    padding: var(--spacing-lg);
    border-top: 2px solid var(--color-text-dim);
    margin-top: var(--spacing-xl);
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

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

/* =====================================================
   ZX SPECTRUM / CRT – PREMIUM MICRO ENHANCEMENTS
   (Non-destructive, safe to append)
   ===================================================== */

/* Subtle CRT flicker (very light, non intrusive) */
body {
    animation: crtFlicker 0.12s infinite;
}

@keyframes crtFlicker {
    0% {
        opacity: 0.985;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.99;
    }
}

/* Pixel-perfect rendering for retro feel */
img {
    image-rendering: pixelated;
}

/* ZX-style focus glow (keyboard / accessibility friendly) */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
}

/* Cassette tape loading illusion (optional utility) */
.loading-bar {
    height: 6px;
    background: repeating-linear-gradient(90deg,
            var(--color-primary),
            var(--color-primary) 10px,
            transparent 10px,
            transparent 20px);
    animation: tapeLoad 1s linear infinite;
}

@keyframes tapeLoad {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 40px 0;
    }
}