/* Terminal/Retro Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --terminal-bg: #0a0a0a;
    --terminal-fg: #00ff00;
    --terminal-secondary: #00cc00;
    --terminal-dim: #008800;
    --terminal-border: #00ff00;
    --terminal-prompt: #00ffff;
    --terminal-command: #ffff00;
    --terminal-link: #00ff00;
    --terminal-link-hover: #00ffff;
    --window-bg: rgba(0, 20, 0, 0.95);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: var(--terminal-bg);
    color: var(--terminal-fg);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* CRT Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9998;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 9997;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--terminal-bg);
    z-index: -1;
}

/* Terminal Window Header */
.terminal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 30, 0, 0.95);
    border-bottom: 2px solid var(--terminal-border);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 999;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--terminal-border);
}

.btn-close {
    background: rgba(255, 0, 0, 0.3);
}

.btn-minimize {
    background: rgba(255, 255, 0, 0.3);
}

.btn-maximize {
    background: rgba(0, 255, 0, 0.3);
}

.terminal-title {
    color: var(--terminal-fg);
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    background: rgba(0, 20, 0, 0.98);
    backdrop-filter: blur(5px);
    z-index: 998;
    border-bottom: 1px solid var(--terminal-dim);
    padding: 0.75rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.2rem;
    color: var(--terminal-prompt);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--terminal-prompt);
}

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

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--terminal-fg);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

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

.nav-link::before {
    content: '> ';
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-link:hover::before {
    opacity: 1;
}

.hamburger {
    display: none;
    color: var(--terminal-fg);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Sections */
section {
    padding: 6rem 2rem 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero {
    padding-top: 120px;
}

.terminal-window {
    background: var(--window-bg);
    border: 2px solid var(--terminal-border);
    border-radius: 4px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    max-width: 900px;
    margin: 0 auto;
}

.terminal-header-text {
    color: var(--terminal-secondary);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.terminal-output {
    font-size: 1rem;
    line-height: 1.8;
}

.terminal-output p {
    margin: 0.25rem 0;
}

.command {
    color: var(--terminal-command);
}

.output {
    color: var(--terminal-secondary);
    padding-left: 0;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--terminal-fg);
}

/* ASCII Art */
.ascii-art {
    color: var(--terminal-secondary);
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.ascii-box {
    color: var(--terminal-secondary);
    line-height: 1.4;
}

.ascii-download pre {
    color: var(--terminal-secondary);
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ascii-icon {
    color: var(--terminal-secondary);
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

/* Links */
a {
    color: var(--terminal-link);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

a:hover {
    color: var(--terminal-link-hover);
    text-shadow: 0 0 5px var(--terminal-link-hover);
}

.terminal-links a {
    margin-right: 1rem;
    display: inline-block;
}

.inline-link {
    text-decoration: underline;
}

/* Blog List */
.blog-list {
    color: var(--terminal-secondary);
}

.blog-item {
    margin: 1rem 0;
    padding: 1rem;
    border-left: 2px solid var(--terminal-dim);
    padding-left: 1rem;
    transition: all 0.2s;
}

.blog-item:hover {
    border-left-color: var(--terminal-link-hover);
    background: rgba(0, 255, 0, 0.05);
}

.blog-title {
    color: var(--terminal-fg);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.blog-meta {
    color: var(--terminal-dim);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.blog-excerpt {
    color: var(--terminal-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.loading-text {
    animation: loading 1.5s ease-in-out infinite;
}

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

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.contact-item {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--terminal-dim);
    transition: all 0.2s;
}

.contact-item:hover {
    border-color: var(--terminal-link-hover);
    background: rgba(0, 255, 0, 0.05);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

/* Footer */
.footer {
    background: rgba(0, 20, 0, 0.95);
    border-top: 2px solid var(--terminal-border);
    padding: 2rem 0;
    text-align: center;
}

.footer-art {
    color: var(--terminal-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.heart {
    color: var(--terminal-link-hover);
}

/* Text Effects */
.glow {
    text-shadow: 0 0 5px var(--terminal-fg), 0 0 10px var(--terminal-fg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 90px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: rgba(0, 20, 0, 0.98);
        padding: 2rem;
        gap: 1.5rem;
        transition: left 0.3s;
        border: 1px solid var(--terminal-border);
        border-left: none;
        border-right: none;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: block;
    }

    .terminal-window {
        padding: 1rem;
        font-size: 0.9rem;
    }

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

    section {
        padding: 4rem 1rem 2rem;
        min-height: auto;
    }

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

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .terminal-title {
        font-size: 0.7rem;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    .terminal-output {
        font-size: 0.85rem;
    }

    .terminal-links a {
        display: block;
        margin: 0.5rem 0;
    }
}

/* Selection */
::selection {
    background: var(--terminal-fg);
    color: var(--terminal-bg);
}

::-moz-selection {
    background: var(--terminal-fg);
    color: var(--terminal-bg);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--terminal-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--terminal-dim);
    border: 1px solid var(--terminal-border);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--terminal-secondary);
}

/* Text Glow on Hover */
.terminal-output a:hover,
.blog-item:hover .blog-title {
    text-shadow: 0 0 5px currentColor;
}

/* Typing animation */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--terminal-fg);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Flicker effect */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

body {
    animation: flicker 0.15s infinite;
}

/* Button styling */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--terminal-border);
    color: var(--terminal-fg);
    text-decoration: none;
    transition: all 0.2s;
    background: transparent;
}

.btn:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transform: translateX(2px);
}

/* Smooth reveal animations */
.terminal-window {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
