:root {
    --primary-color: #fff;
    --bg-color: #0a0a0a;
    --spacing: 1rem;
    --font-mono: 'Courier New', courier, monospace;
    --black: #000;
    --white: #fff;
    --gray: #1a1a1a;
}

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

body {
    font-family: -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background: var(--bg-color);
}

header {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--black);
    color: var(--white);
    overflow: hidden;
}

header h1 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
    letter-spacing: 0.2em;
}

header p {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ASCII Art Styling */
pre,
.ascii-art {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1;
    margin: 0;
    white-space: pre;
    overflow-x: hidden;
}

header .ascii-art {
    display: inline-block;
    margin: 2rem auto 1rem;
    opacity: 0.8;
    animation: flicker 3s infinite;
    overflow: hidden;
    max-width: 100%;
}

@keyframes flicker {
    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    80% {
        opacity: 0.7;
    }
}

/* About Section - Solarized Dark Terminal */
.about-section {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-color);
}

.terminal-window {
    display: inline-block;
    max-width: 600px;
    width: 100%;
    background: #002b36;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgb(0 0 0 / 60%);
    overflow: hidden;
    text-align: left;
}

.terminal-header {
    background: #073642;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #586e75;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-button.red {
    background: #dc322f;
}

.terminal-button.yellow {
    background: #b58900;
}

.terminal-button.green {
    background: #859900;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #93a1a1;
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #839496;
}

.terminal-line {
    margin-bottom: 0.3rem;
}

.prompt {
    color: #268bd2;
    font-weight: bold;
    margin-right: 0.5rem;
}

.terminal-output {
    color: #2aa198;
    padding-left: 1rem;
}

.terminal-output a {
    color: #268bd2;
    text-decoration: none;
    transition: color 0.3s;
}

.terminal-output a:hover {
    color: #2aa198;
    text-decoration: underline;
}

.cursor {
    animation: terminal-blink 1s infinite;
    background: #839496;
    color: #002b36;
    padding: 0 2px;
}

@keyframes terminal-blink {
    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

@media (width <= 768px) {
    .terminal-window {
        max-width: 95%;
    }

    .terminal-body {
        font-size: 0.8rem;
        padding: 1rem;
    }

    .terminal-header {
        padding: 0.5rem 0.75rem;
    }

    .terminal-button {
        width: 10px;
        height: 10px;
    }
}

@media (width <= 480px) {
    .terminal-body {
        font-size: 0.75rem;
    }

    .terminal-title {
        font-size: 0.65rem;
    }
}

/* Gallery Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing);
    padding: var(--spacing);
    max-width: 1400px;
    margin: 0 auto;
    grid-auto-rows: auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item iframe {
    pointer-events: none;
    width: 100%;
    height: 100%;
    aspect-ratio: 9 / 16;
}

.gallery-item:hover iframe {
    pointer-events: auto;
}

.gallery-item.loading {
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item.loading::before {
    content: 'LOADING...';
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #666;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Lazy loading placeholder */
.lazy {
    background: #1a1a1a;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 95%);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-mono);
    z-index: 10001;
    transition: opacity 0.3s;
}

.lightbox .close:hover {
    opacity: 0.7;
}

/* Footer Links */
.footer-links {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.7;
}

.footer-links .separator {
    margin: 0 1rem;
    opacity: 0.5;
}

/* ASCII divider */
.ascii-divider {
    text-align: center;
    opacity: 0.3;
    font-size: 0.6rem;
    overflow: hidden;
    padding: 2rem 0;
    font-family: var(--font-mono);
}

footer {
    background: var(--black);
    color: var(--white);
    padding: 2rem 1rem;
    margin-top: 2rem;
}

/* Loading screen */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
    color: var(--white);
    font-family: var(--font-mono);
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.loader pre {
    animation: pulse 1s infinite;
}

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

    50% {
        opacity: 0.5;
    }
}

/* Error states with ASCII */
.error-state::before {
    content: '[ERROR 404: IMAGE_NOT_FOUND]';
    display: block;
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #f00;
    font-family: var(--font-mono);
}

/* Random glitch effect */
.glitch {
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-2px);
    }

    40% {
        transform: translateX(2px);
    }

    60% {
        transform: translateX(-1px);
    }

    80% {
        transform: translateX(1px);
    }
}

/* Matrix mode */
.matrix-mode {
    background: #000 !important;
    color: #0f0 !important;
}

/* Mobile responsive */
@media (width <= 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }

    header .ascii-art {
        font-size: 0.5rem;
    }

    .ascii-terminal {
        font-size: 0.7rem;
    }

    .lightbox .close {
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
    }
}

@media (width <= 480px) {
    header .ascii-art {
        font-size: 0.4rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
}
