@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --fallout-green: #1aff80;
    --fallout-green-faded: rgba(26, 255, 128, 0.2);
    --fallout-bg: #050505;
    --crt-curve: 5px;
}

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

body {
    background-color: var(--fallout-bg);
    color: var(--fallout-green);
    font-family: 'VT323', monospace;
    font-size: 20px;
    height: 100vh;
    overflow: hidden;
    text-shadow: 0 0 8px var(--fallout-green);
    animation: text-flicker 0.01s infinite;
}

@keyframes text-flicker {
    0% { opacity: 0.99; }
    100% { opacity: 1; }
}

@media (max-width: 600px) {
    .terminal-container {
        padding: 10px;
        margin: 5px;
    }
    .terminal-nav {
        flex-wrap: wrap;
    }
    .header-right, .footer-right {
        display: none;
    }
}

/* CRT Effects */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 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, 255, 0, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 100;
    animation: flicker 0.15s infinite;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(26, 255, 128, 0) 0%,
        rgba(26, 255, 128, 0.1) 50%,
        rgba(26, 255, 128, 0) 100%
    );
    background-size: 100% 100px;
    animation: scanline 10s linear infinite;
    pointer-events: none;
    z-index: 99;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.terminal-scratches {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('terminal_scratches.png');
    background-size: cover;
    mix-blend-mode: screen;
    opacity: 0.08; /* Very subtle for realism */
    pointer-events: none;
    z-index: 101; /* Above scanlines and CRT overlay */
}

@keyframes flicker {
    0% { opacity: 0.97; }
    5% { opacity: 0.95; }
    10% { opacity: 0.9; }
    15% { opacity: 0.95; }
    20% { opacity: 0.98; }
    25% { opacity: 0.95; }
    30% { opacity: 0.9; }
    35% { opacity: 0.95; }
    40% { opacity: 0.98; }
    45% { opacity: 0.95; }
    50% { opacity: 0.9; }
    55% { opacity: 0.95; }
    60% { opacity: 0.98; }
    65% { opacity: 0.95; }
    70% { opacity: 0.9; }
    75% { opacity: 0.95; }
    80% { opacity: 0.98; }
    85% { opacity: 0.95; }
    90% { opacity: 0.9; }
    95% { opacity: 0.95; }
    100% { opacity: 0.98; }
}

.terminal-container {
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    padding: 30px;
    border: 4px solid var(--fallout-green);
    margin: 20px;
    border-radius: 20px;
    position: relative;
    background: radial-gradient(circle at center, rgba(26, 255, 128, 0.1) 0%, transparent 100%), #050505;
    box-shadow: inset 0 0 50px rgba(26, 255, 128, 0.2), 0 0 20px rgba(26, 255, 128, 0.2);
    overflow: hidden;
}

/* Glassmorphism effect in terminal */
.terminal-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 255, 0, 0.03));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.terminal-header, .terminal-footer {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 2px solid var(--fallout-green);
    margin-bottom: 20px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-link {
    background: transparent;
    border: none;
    color: var(--fallout-green);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
}

.sub-link {
    background: transparent;
    border: none;
    color: var(--fallout-green);
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-weight: bold;
}

.sub-link:hover, .ctf-link:hover {
    background: var(--fallout-green);
    color: var(--fallout-bg);
}

.ctf-link {
    color: var(--fallout-green);
    text-decoration: underline;
    cursor: pointer;
}

.terminal-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--fallout-green);
    color: var(--fallout-green);
    padding: 5px 15px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    mix-blend-mode: screen;
}

.nav-btn:hover, .nav-btn.active {
    background: var(--fallout-green);
    color: var(--fallout-bg);
    box-shadow: 0 0 15px var(--fallout-green);
}

.nav-btn:hover .nav-icon, .nav-btn.active .nav-icon {
    filter: brightness(0); /* Black icons on green background when active */
}

.terminal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.home-banner {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--fallout-green-faded);
    padding-bottom: 20px;
}

.profile-img {
    width: 200px;
    height: 250px;
    object-fit: cover;
    border: 3px solid var(--fallout-green);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(26, 255, 128, 0.4);
    /* No heavy sepia filter to maintain professional cinematic color grading */
    margin-right: 10px;
}

.main-title {
    font-size: 3.5rem;
    margin: 0;
    line-height: 1;
    letter-spacing: 2px;
}

.sub-title {
    font-size: 1.5rem;
    opacity: 0.8;
}

.typing-container {
    white-space: pre-wrap;
    line-height: 1.4;
    position: relative;
    font-size: 1.2rem;
}

/* Make the first few lines of boot text (the banner) stand out if we used CSS but we used text stars */
/* We can add a glow effect to specific terms if we want, but sticking to text stars for now */

.cursor {
    display: inline-block;
    width: 10px;
    background-color: var(--fallout-green);
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    border: 1px solid var(--fallout-green);
    padding: 10px;
    background: rgba(26, 255, 128, 0.05);
    text-align: center;
}

.gallery-item img {
    width: 100%;
    filter: sepia(100%) hue-rotate(90deg) brightness(1.2) contrast(1.2);
    border-bottom: 1px solid var(--fallout-green);
    margin-bottom: 5px;
}

.gallery-item p {
    font-size: 0.9rem;
    margin: 0;
}
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--fallout-bg);
}
.resume-header {
    background-color: var(--fallout-green);
    color: var(--fallout-bg);
    padding: 2px 10px;
    margin: 15px 0 5px 0;
    font-weight: bold;
    display: inline-block;
    text-shadow: none;
}
::-webkit-scrollbar-thumb {
    background: var(--fallout-green);
}
.log-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.log-img {
    max-width: 150px; /* Force thumbnails in logs */
    height: auto;
    display: inline-block;
    border: 1px solid var(--fallout-green);
    filter: sepia(100%) hue-rotate(90deg) brightness(1.1) contrast(1.1);
    box-shadow: 0 0 5px var(--fallout-green-faded);
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item img {
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.log-img:hover, .gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--fallout-green);
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--fallout-bg);
    border: 3px solid var(--fallout-green);
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 0 30px var(--fallout-green-faded);
    position: relative;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    overflow-y: auto;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    border: 1px solid var(--fallout-green);
    /* Reduced filter for readability in modal */
    filter: sepia(50%) hue-rotate(90deg) brightness(1.2);
}

.modal-body .typing-container {
    width: 100%;
    border-top: 1px solid var(--fallout-green-faded);
    padding-top: 15px;
}

.terminal-underlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.layer-dirt {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('terminal_scratches.png');
    background-size: cover;
    opacity: 0.12;
    mix-blend-mode: screen;
}

.layer-data-stream {
    position: absolute;
    top: 0;
    right: 5%;
    width: 300px;
    height: 100%;
    color: var(--fallout-green);
    font-size: 0.8rem;
    opacity: 0.08;
    overflow: hidden;
    white-space: pre;
    line-height: 1.2;
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

.data-scroll {
    animation: stream-scroll 60s linear infinite;
}

@keyframes stream-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.layer-watermark {
    position: absolute;
    bottom: 15%;
    right: 20%;
    width: 400px;
    height: 400px;
    background: url('robco_watermark.png') no-repeat center;
    background-size: contain;
    opacity: 0.06;
    mix-blend-mode: screen;
}

/* Ensure foreground content is above underlays */
.terminal-header, .terminal-nav, .terminal-content, .terminal-footer {
    position: relative;
    z-index: 5;
}
