/* Font declarations */
@font-face {
    font-family: 'OffBit';
    src: url('/fonts/OffBit-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'OffBit';
    src: url('/fonts/OffBit-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'OffBit101';
    src: url('/fonts/OffBit-101.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'OffBit101';
    src: url('/fonts/OffBit-101Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Alagard';
    src: url('/fonts/Alagard.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Dank Mono';
    src: url('/fonts/DankMono-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Dank Mono';
    src: url('/fonts/DankMono-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

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

html, body {
    height: 100%;
    font-family: 'OffBit', 'M PLUS 1 Code', 'Courier New', monospace;
    background: #050505;
    color: #f8f8f2;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    letter-spacing: 1px;
    filter: blur(.3px);
    transform: skewY(-.08deg) skewX(-.05deg) scale(1.004);
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Body overlays and effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background: 
        linear-gradient(90deg, transparent 96%, rgba(255, 255, 255, 0.08) 100%),
        linear-gradient(0deg, transparent 96%, rgba(255, 255, 255, 0.08) 100%);
    background-size: 2px 2px;
    opacity: 0.8;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10000;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.2) 1px,
            rgba(0, 0, 0, 0.2) 3px
        );
    animation: scanlines 0.08s linear infinite;
}

/* Corner glow elements */
.terminal-header::before {
    content: '';
    position: fixed;
    width: 50px;
    height: 50px;
    top: -25px;
    right: -25px;
    background: transparent;
    box-shadow: 0 0 100px 20px rgba(80, 250, 123, 0.1);
    pointer-events: none;
    z-index: 1;
}

.status-bar::after {
    content: '';
    position: fixed;
    width: 50px;
    height: 50px;
    bottom: -25px;
    left: -25px;
    background: transparent;
    box-shadow: 0 0 100px 20px rgba(80, 250, 123, 0.1);
    pointer-events: none;
    z-index: 1;
}

/* Animations */
@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes gradient-flicker {
    0% { opacity: 0.7; }
    25% { opacity: 0.9; }
    50% { opacity: 0.6; }
    75% { opacity: 0.8; }
    100% { opacity: 0.7; }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Terminal header */
.terminal-header {
    background: linear-gradient(to bottom, #050505 80%, rgba(0, 50, 0, 0.1));
    padding: 16px 20px;
    font-size: 12px;
    color: #f8f8f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
    z-index: 99;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);
}

.terminal-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.5), transparent);
    pointer-events: none;
    animation: gradient-flicker 3s ease-in-out infinite;
}

.terminal-header span {
    color: #50fa7b;
}

/* Terminal content */
.terminal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 50%;
    margin: 0 auto;
    padding: 80px 20px 80px 20px; /* Increased padding to account for headers and fades */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.terminal-content::-webkit-scrollbar {
    display: none;
}

/* Status bar */
.status-bar {
    background: linear-gradient(to top, #050505 80%, rgba(0, 50, 0, 0.1));
    padding: 16px 20px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);
    z-index: 99;
}

.status-bar::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(5, 5, 5, 0.5), transparent);
    pointer-events: none;
    animation: gradient-flicker 4s ease-in-out infinite;
}

.status-left {
    display: flex;
    gap: 20px;
    color: #50fa7b;
    font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
}

.status-left span:nth-child(1) {
    color: #50fa7b;
    font-family: 'Alagard', 'M PLUS 1 Code', monospace;
}

.status-left span:nth-child(2) {
    color: #50fa7b;
}

.status-left span:nth-child(3) {
    color: #50fa7b;
}

.status-right {
    color: #50fa7b;
    font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #50fa7b;
    margin: 0 0 16px 0;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
    font-weight: normal;
}

h1 {
    font-size: 18px;
}

h1::before {
    content: "> ";
    color: #50fa7b;
    opacity: 0.8;
}

h2 {
    font-size: 16px;
    color: #50fa7b;
}

h2::before {
    content: "⌁ ";
    color: #50fa7b;
}

h3 {
    font-size: 14px;
    color: #50fa7b;
}

h3::before {
    content: "> ";
    color: #50fa7b;
    opacity: 0.8;
}

p {
    margin: 0 0 16px 0;
    color: #f8f8f2;
}

a {
    color: #50fa7b;
    text-decoration: underline;
}

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

/* Navigation */
.top-nav {
    display: flex;
    gap: 16px;
}

.top-nav a {
    color: #50fa7b;
    text-decoration: none;
    font-size: 12px;
    position: relative;
    font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
}

.top-nav a::first-letter {
    text-decoration: underline dotted;
}

.top-nav a:hover {
    color: #8fff9b;
}

.top-nav a.active {
    color: #8fff9b;
    text-decoration: underline solid;
}

.top-nav a:hover::first-letter {
    text-decoration: underline dotted;
}

.top-nav a.active::first-letter {
    text-decoration: underline solid;
}

/* Code blocks */
pre {
    background: #050505;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
    border-radius: 4px;
    color: #50fa7b;
}

code {
    background: #050505;
    padding: 4px 8px;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
    color: #50fa7b;
    border-radius: 3px;
}

pre code {
    background: none;
    padding: 0;
    border: none;
    color: #50fa7b;
}

/* Text elements */
blockquote {
    border-left: 3px solid #50fa7b;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    p { color: #50fa7b; }
}

ul, ol {
    margin: 0 0 16px 20px;
}

ul {
    list-style: none;
}

ul li::before {
    content: "⦚ ";
    color: #50fa7b;
    margin-right: 8px;
}

li {
    margin: 4px 0;
}

/* Media and images */
.ascii-art {
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
    white-space: pre;
    color: #50fa7b;
    text-align: center;
    margin: 40px 0;
    font-size: 12px;
    line-height: 1.2;
}

img {
    filter: sepia(1) hue-rotate(70deg) saturate(1.5) contrast(1.5);
    margin-bottom: 16px;
}

/* Terminal command interface */
.terminal-command-prompt {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
}

.command-line {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.command-prompt-symbol {
    color: #50fa7b;
    margin-right: 8px;
    font-weight: bold;
}

.command-input {
    background: transparent;
    border: none;
    outline: none;
    color: #f8f8f2;
    font-family: inherit;
    font-size: 14px;
    flex: 1;
    caret-color: #50fa7b;
}

.command-input::placeholder {
    color: #888888;
}

.command-output {
    color: rgba(0, 0, 0, 0);
    font-size: 12px;
    margin-top: 10px;
    line-height: 1.4;
    transition: color 0.2s ease;
    min-height: 20px;
}

.command-output.error {
    color: #ff5555;
}

.command-output.success {
    color: #50fa7b;
}

.command-output.visible {
    color: #50fa7b;
}

/* Command modal */
.command-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.command-modal.active {
    display: block;
}

.command-modal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 600px;
}

.command-modal-header {
    color: #50fa7b;
    font-size: 14px;
    text-align: center;
    font-style: italic;
    margin-bottom: 20px;
}

.command-modal-help {
    color: #888888;
    font-size: 12px;
    margin-top: 15px;
    text-align: center;
}

.command-modal-content {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px;
    width: 100%;
    max-width: none;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
    box-shadow: none;
}

.command-modal .command-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
}

.command-modal .command-input {
    background: transparent;
    border: none;
    outline: none;
    color: #f8f8f2;
    font-family: inherit;
    font-size: 16px;
    width: auto;
    min-width: 200px;
}

.command-modal .command-prompt-symbol {
    color: #50fa7b;
}

.command-modal .command-output {
    text-align: center;
    margin-top: 15px;
}

.command-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #6272a4;
    font-size: 18px;
    cursor: pointer;
    font-family: inherit;
}

.command-modal-close:hover {
    color: #50fa7b;
}

/* Homepage specific styles */
.welcome-text {
    color: #50fa7b;
    font-style: italic;
    margin: 0 0 20px 0;
    animation: pulse 2s ease-in-out infinite;
}

.doom-text {
    font-family: 'Alagard', 'OffBit', monospace;
}

.homepage-terminal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.homepage-terminal::after {
    display: none;
}

.homepage-prompt {
    color: #50fa7b;
    font-style: italic;
    margin-bottom: 20px;
    font-size: 14px;
}

.homepage-command-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'OffBit', 'M PLUS 1 Code', monospace;
}

.homepage-command-line > span:first-child {
    color: #50fa7b;
}

.homepage-cursor {
    color: #50fa7b;
    animation: blink 1s infinite;
}

.homepage-help {
    color: #888888;
    font-size: 12px;
    margin-top: 15px;
    text-align: center;
}

.homepage-output {
    color: #050505;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    height: 20px;
    line-height: 20px;
    transition: color 0.2s ease;
}

.homepage-output.visible {
    color: #50fa7b;
}

.loading-hourglass {
    color: #50fa7b;
    animation: spin 2s linear infinite;
}

/* Terminal prompts */
.terminal-prompt {
    color: #50fa7b;
}

.terminal-prompt::before {
    content: "⌁ ";
    color: #50fa7b;
}

/* Man page styles */
.man-page {
    font-family: 'Dank Mono', 'M PLUS 1 Code', monospace;
    color: #f8f8f2;
    line-height: 1.6;
}

.man-section {
    margin: 20px 0;
}

.man-command {
    display: flex;
    margin: 8px 0;
    padding-left: 20px;
}

.man-command-name {
    color: #50fa7b;
    font-weight: bold;
    min-width: 120px;
    flex-shrink: 0;
}

.man-command-desc {
    color: #f8f8f2;
    margin-left: 20px;
}

/* Mobile styles */
.mobile-nav {
    display: none;
}

.mobile-break {
    display: none;
}

.site-name {
    font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
}

@media (max-width: 768px) {
    .terminal-content {
        padding: 20px;
        max-width: none;
    }
    
    .status-bar {
        flex-direction: row;
        justify-content: space-between;
        gap: 4px;
        text-align: center;
        padding: 12px 20px;
    }
    
    .status-left {
        justify-content: center;
    }
    
    .status-left span:not(#current-time) {
        display: none;
    }
    
    .top-nav {
        display: none;
    }
    
    .ascii-art {
        font-size: 8px;
        margin: 20px 0;
    }
    
    .man-command {
        flex-direction: column;
        padding-left: 10px;
    }
    
    .man-command-name {
        min-width: auto;
        margin-bottom: 4px;
    }
    
    .man-command-desc {
        margin-left: 0;
    }
    
    .homepage-prompt {
        display: block;
        margin-bottom: 30px;
    }
    
    .homepage-command-line {
        display: none;
    }
    
    .homepage-help {
        display: none;
    }
    
    .homepage-output {
        display: none;
    }
    
    .mobile-nav {
        display: flex !important;
    }
    
    .mobile-break {
        display: block;
    }
    
    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 40px;
        padding: 0 20px;
        max-width: 300px;
        width: 100%;
    }
    
    .mobile-nav a {
        color: #50fa7b;
        text-decoration: none;
        font-size: 18px;
        font-family: 'Alagard', 'OffBit', 'M PLUS 1 Code', monospace;
        text-align: center;
        padding: 12px 16px;
        border: 1px dotted rgba(80, 250, 123, 0.7);
        border-radius: 6px;
        transition: all 0.2s ease;
        display: block;
    }
    
    .mobile-nav a:hover,
    .mobile-nav a.active {
        background: #50fa7b;
        color: #050505;
    }
    
    #last-commit {
        display: none;
    }
}
