/* Terminal Minimalist Styles */
:root {
    --bg-color: #000000;
    --text-color: #FFFFFF;
    --accent-color: #00FF41;
    --border-color: #333333;
    --font-main: 'Courier New', 'Courier', monospace;
}


/* Universal Box Sizing ensures padding doesn't push elements off-screen */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3); /* Subtle green glow */
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 2rem;
    animation: crtFlicker 0.15s infinite;
    /* Optional: a very faint scanline background pattern */
    background-image: linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 100% 3px;
}
/* Update your nav a hover to match directory-list */
nav a, .terminal-window a {
    transition: background-color 0.1s, color 0.1s; /* Snappy transition */
}

nav a:hover, .terminal-window a:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    text-decoration: none;
}
nav {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

nav a {
    color: var(--accent-color);
    text-decoration: none;
    margin-right: 1.5rem;
}

nav a:hover {
    text-decoration: underline;
}

.terminal-window {
    border: 1px solid var(--border-color);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.cursor {
    animation: blink 1s infinite;
}

.directory-list {
    list-style-type: none;
    padding: 0;
}

.directory-list li {
    margin: 10px 0;
}

.directory-list a {
    text-decoration: none;
    color: var(--accent-color);
    font-family: var(--font-main);
    display: block;
    padding: 5px;
}

.directory-list a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}
/* Blog Post specific styles */
.post-content {
    max-width: 800px;
    margin: 40px auto;
    line-height: 1.6;
}

.post-nav {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.post-nav a {
    color: var(--accent-color);
    text-decoration: none;
}

.terminal-window a {
    color: var(--accent-color);
    text-decoration: none;
}
.terminal-window a:hover {
    text-decoration: underline;
    color: var(--text-color);
}

.input-line { display: flex; align-items: center; }
.prompt { color: var(--accent-color); margin-right: 10px; }
#terminal-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-main);
    width: 100%;
    outline: none;
}

/* Make the terminal input look like an actual prompt */
#terminal-input:focus {
    border-bottom: 1px solid var(--accent-color);
}

/* Highlight selection to match theme */
::selection {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Blog Search Bar Styles */
#blogSearch {
    background-color: var(--bg-color);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 10px;
    font-family: var(--font-main);
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    outline: none;
}

#blogSearch:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
}

#blogSearch::placeholder {
    color: var(--border-color);
}

/* Add to style.css */
.glitch {
    position: relative;
    color: #FFFFFF;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(12px, 9999px, 59px, 0); }
    20% { clip: rect(65px, 9999px, 93px, 0); }
    40% { clip: rect(43px, 9999px, 54px, 0); }
    60% { clip: rect(14px, 9999px, 86px, 0); }
    80% { clip: rect(81px, 9999px, 2px, 0); }
    100% { clip: rect(33px, 9999px, 54px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(3px, 9999px, 54px, 0); }
    40% { clip: rect(89px, 9999px, 83px, 0); }
    60% { clip: rect(12px, 9999px, 34px, 0); }
    80% { clip: rect(45px, 9999px, 12px, 0); }
    100% { clip: rect(21px, 9999px, 87px, 0); }
}

/* --- Header & Navigation Layout --- */
.top-bar {
    display: flex;
    justify-content: space-between; /* Pushes logo left, nav right */
    align-items: flex-end; /* Aligns the links with the bottom of the ASCII art */
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.ascii-logo {
    margin: 0;
    color: var(--accent-color);
    font-family: var(--font-main);
    font-size: 0.7rem; /* Keep it small to prevent mobile overflow */
    line-height: 1.1;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.4); /* Optional glow boost */
}

/* Strip the old nav styles since .top-bar handles the border now */
.nav-links {
    display: flex;
    gap: 1.5rem; /* Space between links */
}

.nav-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: background-color 0.1s, color 0.1s;
}

/* Hard-invert hover state for a mechanical feel */
.nav-links a:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    /* Stack the header elements vertically instead of side-by-side */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    /* Allow navigation links to wrap to a new line if they run out of space */
    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Shrink the ASCII art slightly to prevent horizontal scrolling */
    .ascii-logo {
        font-size: 0.55rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Reduce the heavy body padding for smaller screens */
    body {
        padding: 1rem;
    }
}

@keyframes blink {
    50% { opacity: 0; }
}


/* Force long strings and code blocks to respect screen boundaries */
pre, code {
    white-space: pre-wrap;       /* Allows text to wrap to the next line */
    word-break: break-word;      /* Breaks long URLs or commands if necessary */
    max-width: 100%;
}

/* Specifically for code blocks, add a horizontal scrollbar just in case it refuses to break */
pre {
    overflow-x: auto;
}

/* Ensure the main terminal window never exceeds the viewport width */
.terminal-window {
    width: 100%;
    max-width: 800px; 
    overflow-x: hidden;
}