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

:root {
    --bg-color: #0c0c0c;
    --text-color: #00ff41; /* Hacker Green */
    --font-mono: 'VT323', 'Courier New', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
    display: flex;
    padding: 20px;
    font-size: 24px; /* VT323 font naturally renders smaller, so bumping size */
    line-height: 1.2;
    text-shadow: 0 0 2px rgba(0, 255, 65, 0.8);
    
    /* Disable anti-aliasing for raw pixel look */
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#terminal-screen {
    width: 100%;
    height: 100%;
    position: relative;
}

/* CRT Screen Effect - Increased scale for bigger 'pixels' */
.crt::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.45) 50%), linear-gradient(90deg, rgba(0, 255, 65, 0.04), rgba(0, 0, 0, 0.1), rgba(0, 255, 65, 0.04));
    z-index: 2;
    background-size: 100% 4px, 6px 100%; /* Doubled from previous to make scanlines/pixels chunkier */
    pointer-events: none;
}

#code-output {
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 5px;
    text-transform: uppercase; /* Makes it look even blockier */
}

.blinking-cursor {
    display: inline-block;
    width: 12px;
    height: 20px;
    background-color: var(--text-color);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

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

.hidden {
    display: none !important;
}

/* Hero Section */
#hero-section {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    animation: fadeIn 1s step-end; /* Snappy, non-smooth fade for retro feel */
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 0 0 30%;
    padding-left: 5%;
}

.hero-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    flex: 0 0 65%;
    padding-right: 5%;
}

.folder {
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    user-select: none;
}

.folder:hover {
    color: var(--text-color);
    text-shadow: 0 0 10px var(--text-color), 0 0 20px var(--text-color);
    transform: scale(1.05);
}

.folder pre {
    font-family: var(--font-mono);
    margin: 0;
    line-height: 1.2;
    font-size: 1.8rem;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.portfolio-label {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 4px;
    margin-bottom: 0px;
}

h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: 10px;
    opacity: 0.9;
}

.prompt {
    margin-top: 20px;
    font-size: 1.5rem;
}

.terminal-logo {
    font-family: var(--font-mono);
    font-size: clamp(2px, 0.45vw, 4px);
    line-height: 1.05;
    margin-bottom: 6px;
    white-space: pre;
    opacity: 0.9;
    user-select: none;
    position: relative;
    display: inline-block;
}

.logo-top {
    color: var(--text-color); /* Bright hacker green */
    text-shadow: 0 0 3px var(--text-color);
}

.logo-bottom {
    color: #009924; /* Authentic low-intensity phosphor green */
    text-shadow: 0 0 3px #009924;
}

/* Glitch effect for the ASCII logo */
.glitch-logo {
    position: relative;
}

.glitch-logo::before,
.glitch-logo::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    white-space: pre;
    pointer-events: none;
}

.glitch-logo::before {
    left: 2px;
    text-shadow: -2px 0 #00661a; /* Darker forest green shadow */
    clip-path: inset(10% 0 70% 0);
    animation: glitch-logo-anim-1 3s infinite linear alternate-reverse;
}

.glitch-logo::after {
    left: -2px;
    text-shadow: 2px 0 var(--text-color); /* Bright hacker green shadow */
    clip-path: inset(60% 0 10% 0);
    animation: glitch-logo-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-logo-anim-1 {
    0% { clip-path: inset(20% 0 75% 0); }
    10% { clip-path: inset(5% 0 85% 0); }
    20% { clip-path: inset(40% 0 45% 0); }
    30% { clip-path: inset(70% 0 25% 0); }
    40% { clip-path: inset(15% 0 70% 0); }
    50% { clip-path: inset(55% 0 35% 0); }
    60% { clip-path: inset(5% 0 90% 0); }
    70% { clip-path: inset(80% 0 10% 0); }
    80% { clip-path: inset(30% 0 60% 0); }
    90% { clip-path: inset(65% 0 20% 0); }
    100% { clip-path: inset(10% 0 80% 0); }
}

@keyframes glitch-logo-anim-2 {
    0% { clip-path: inset(60% 0 35% 0); }
    10% { clip-path: inset(85% 0 5% 0); }
    20% { clip-path: inset(20% 0 70% 0); }
    30% { clip-path: inset(10% 0 85% 0); }
    40% { clip-path: inset(50% 0 45% 0); }
    50% { clip-path: inset(75% 0 15% 0); }
    60% { clip-path: inset(30% 0 65% 0); }
    70% { clip-path: inset(5% 0 90% 0); }
    80% { clip-path: inset(90% 0 2% 0); }
    90% { clip-path: inset(45% 0 50% 0); }
    100% { clip-path: inset(70% 0 25% 0); }
}

.logo-admin-label {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    letter-spacing: 3px;
    opacity: 0.7;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.logo-association-label {
    font-size: clamp(0.7rem, 1.8vw, 1.1rem);
    letter-spacing: 2px;
    opacity: 0.7;
    margin-top: 5px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Random Screen Glitch Effect */
.glitching {
    animation: randomGlitch 0.2s infinite, fontGlitch 0.15s infinite steps(1);
}

.glitching .terminal-logo,
.glitching .folder pre,
.glitching .close-popup,
.glitching .terminal-form,
.glitching .terminal-input {
    animation: fontGlitch 0.15s infinite steps(1);
}

@keyframes randomGlitch {
    0% { transform: translate(0) skew(0); filter: none; }
    20% { transform: translate(-4px, 2px) skew(-2deg); filter: hue-rotate(90deg) contrast(150%); }
    40% { transform: translate(4px, -2px) skew(2deg); filter: none; }
    60% { transform: translate(-2px, -4px) skew(0); filter: invert(0.2); }
    80% { transform: translate(2px, 4px) skew(-1deg); filter: none; }
    100% { transform: translate(0) skew(0); filter: none; }
}

@keyframes fontGlitch {
    0% { font-family: 'Times New Roman', Times, serif; letter-spacing: -1px; }
    20% { font-family: 'Impact', Charcoal, sans-serif; letter-spacing: 4px; }
    40% { font-family: 'Comic Sans MS', cursive, sans-serif; letter-spacing: 1px; }
    60% { font-family: 'Georgia', serif; letter-spacing: -2px; }
    80% { font-family: 'Courier New', Courier, monospace; letter-spacing: 3px; }
    100% { font-family: 'Times New Roman', Times, serif; letter-spacing: -1px; }
}

/* Text Glitch Effect for H1 */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #00661a; /* Darker forest green shadow */
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 var(--text-color); /* Bright hacker green shadow */
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    5% { clip: rect(12px, 9999px, 59px, 0); }
    10% { clip: rect(48px, 9999px, 29px, 0); }
    15% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(63px, 9999px, 27px, 0); }
    25% { clip: rect(34px, 9999px, 55px, 0); }
    30% { clip: rect(86px, 9999px, 73px, 0); }
    35% { clip: rect(20px, 9999px, 20px, 0); }
    40% { clip: rect(26px, 9999px, 60px, 0); }
    45% { clip: rect(25px, 9999px, 66px, 0); }
    50% { clip: rect(57px, 9999px, 98px, 0); }
    55% { clip: rect(5px, 9999px, 46px, 0); }
    60% { clip: rect(82px, 9999px, 31px, 0); }
    65% { clip: rect(54px, 9999px, 27px, 0); }
    70% { clip: rect(28px, 9999px, 99px, 0); }
    75% { clip: rect(45px, 9999px, 69px, 0); }
    80% { clip: rect(23px, 9999px, 85px, 0); }
    85% { clip: rect(54px, 9999px, 84px, 0); }
    90% { clip: rect(45px, 9999px, 47px, 0); }
    95% { clip: rect(37px, 9999px, 20px, 0); }
    100% { clip: rect(4px, 9999px, 91px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

/* Mini Terminal Popup */
#popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Let clicks pass through */
    z-index: 100;
}

.popup-window {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-color);
    border: 4px solid var(--text-color); /* Thicker blocky border */
    box-shadow: 10px 10px 0px rgba(0, 255, 65, 0.3); /* Hard pixelated shadow */
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* Enable interaction for the window */
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: var(--text-color);
    color: var(--bg-color);
    font-weight: bold;
    font-size: 1.2rem;
    cursor: grab; /* Indicate it's draggable */
    user-select: none;
}

.popup-header:active {
    cursor: grabbing;
}

.close-popup {
    background: none;
    border: none;
    color: var(--bg-color);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
}

.close-popup:hover {
    color: var(--text-color);
    background: var(--bg-color);
    box-shadow: 0 0 8px var(--text-color);
}

.popup-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 1.5rem;
    line-height: 1.4;
}

.popup-text {
    display: inline;
    white-space: pre-wrap;
}

/* Ghost Outline for dragging */
.ghost-window {
    position: absolute;
    border: 2px dashed var(--text-color);
    pointer-events: none;
    z-index: 101;
}

/* Green Selection Highlight */
::selection {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-shadow: none;
}

/* Retro Terminal Scrollbar for Popup Content */
.popup-content::-webkit-scrollbar {
    width: 20px; /* Thicker, chunkier scrollbar */
}

.popup-content::-webkit-scrollbar-track {
    background-color: #050d05;
    /* Dotted/checkered classic retro pattern */
    background-image: repeating-conic-gradient(#0a1f0a 0% 25%, transparent 0% 50%);
    background-size: 8px 8px;
    border-left: 4px solid var(--text-color); /* Thicker blocky divider */
}

.popup-content::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border: 3px solid #050d05; /* Inset gap effect */
    box-shadow: inset 1.5px 1.5px 0px var(--text-color), inset -1.5px -1.5px 0px #000000; /* Green & black 3D border */
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
    box-shadow: inset 1.5px 1.5px 0px var(--text-color), inset -1.5px -1.5px 0px #000000, 0 0 8px var(--text-color); /* Add glow on hover */
}

.popup-content::-webkit-scrollbar-thumb:active {
    box-shadow: inset 1.5px 1.5px 0px #000000, inset -1.5px -1.5px 0px var(--text-color); /* Pressed 3D effect */
}

/* Clickable terminal links */
.terminal-link {
    color: var(--text-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}

.terminal-link:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 0 5px var(--text-color);
}

/* Terminal Style Input Form */
.terminal-form-container {
    margin-top: 10px;
    padding-top: 0;
    width: 100%;
}

.terminal-form {
    font-family: var(--font-mono);
    color: var(--text-color);
    font-size: 1.2rem;
    line-height: 1.6;
}

.terminal-active-line {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 10px;
    width: 100%;
}

.terminal-prompt-label {
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
}

.terminal-input-wrapper {
    position: relative;
    flex: 1;
    display: inline-flex;
    align-items: center;
    cursor: text;
}

.terminal-input-mirror {
    color: var(--text-color);
    word-break: break-all;
    white-space: pre-wrap;
}

.terminal-hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: transparent;
    border: none;
    outline: none;
    color: transparent;
    caret-color: transparent;
    font-family: var(--font-mono);
    font-size: 1.2rem;
}

.terminal-history-line {
    margin-bottom: 10px;
    word-break: break-all;
}

.terminal-error-line {
    border: 2px dashed var(--text-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 10px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
    animation: glitch-blink 0.5s infinite alternate;
}

.terminal-success-box {
    border: 2px dashed var(--text-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 12px;
    margin: 20px 0;
    text-align: center;
    font-weight: bold;
}

@keyframes glitch-blink {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.interactive-history {
    cursor: pointer;
    transition: text-shadow 0.1s ease;
}

.interactive-history:hover {
    text-shadow: 0 0 8px var(--text-color);
    text-decoration: underline;
}

/* Mobile Responsive Optimization */
@media (max-width: 768px) {
    body {
        font-size: 18px; /* Slightly smaller typography for small screens */
        padding: 10px;
        overflow: hidden;
    }
    
    #hero-section {
        flex-direction: column-reverse; /* Folders at the bottom, name at the top */
        justify-content: center;
        gap: 15px;
        padding: 5px 0;
        overflow-y: auto;
    }
    
    .hero-left {
        flex: none;
        width: 100%;
        padding-left: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .hero-right {
        flex: none;
        width: 100%;
        align-items: center;
        text-align: center;
        padding-right: 0;
    }
    
    h1 {
        margin-bottom: 10px;
    }

    .subtitle {
        margin-bottom: 5px;
    }

    .logo-admin-label {
        font-size: clamp(0.85rem, 2.2vw, 1.1rem);
        margin-top: 10px;
        margin-bottom: 2px;
        letter-spacing: 2px;
    }

    .logo-association-label {
        font-size: clamp(0.65rem, 1.6vw, 0.85rem);
        margin-top: 2px;
        margin-bottom: 12px;
        letter-spacing: 1.5px;
    }
    
    .terminal-logo {
        font-size: clamp(2px, 1vw, 4px);
        margin-bottom: 4px;
    }
    
    .folder pre {
        font-size: 1.1rem; /* Scale down ASCII art folders */
    }
    
    .popup-window {
        top: 2% !important;
        left: 2% !important;
        width: 96% !important;
        height: 96% !important;
        max-width: 96vw !important;
        max-height: 96vh !important;
        box-shadow: 6px 6px 0px rgba(0, 255, 65, 0.3) !important;
    }
    
    .popup-content {
        padding: 12px;
        font-size: 1.1rem; /* Slightly smaller popup text to avoid overflow */
    }
    
    .crt::before {
        opacity: 0.75; /* Slightly less intense scanlines on mobile for better text clarity */
    }
    
    .close-popup {
        padding: 4px 10px;
        font-size: 1.3rem;
    }
}



