/* Global Styles */
:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #00ff7f;
    /* Spring Green */
    --accent-dim: rgba(0, 255, 127, 0.1);
    --font-mono: 'Fira Code', '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);
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

html {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fff;
}

/* Explicit heading sizes to avoid deprecated UA sizing */
h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.6rem; line-height: 1.3; }
h3 { font-size: 1.3rem; line-height: 1.4; }
h4 { font-size: 1.1rem; line-height: 1.4; }

/* Prevent user-agent special-casing inside sections */
section h1,
section h2,
section h3,
section h4,
section h5,
section h6 { font-size: inherit; line-height: inherit; }

.section-title {
    font-size: 1.5rem;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    display: inline-block;
}

.section-title::before {
    content: "> ";
    color: var(--accent-color);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-color);
    min-height: 44px;
    line-height: 1.2;
}

.btn-solid {
    background-color: var(--accent-color);
    color: #000;
    font-weight: bold;
}

.btn-solid:hover {
    background-color: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-dim);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-dim);
    box-shadow: 0 0 15px var(--accent-dim);
}

/* Header & Nav */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

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

.logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: -1px;
}

@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }
}

.logo span {
    color: var(--accent-color);
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: 0.9rem;
    color: #888;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 100px 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-headline {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.prompt-char {
    color: var(--accent-color);
    margin-right: 10px;
}

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

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-sub {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Latest Posts Section */
.latest-posts {
    padding: 80px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.post-card {
    background-color: #111;
    border: 1px solid #222;
    padding: 25px;
    border-radius: 4px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: #333;
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 15px;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-title a {
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--accent-color);
}

.post-excerpt {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    margin-top: auto;
}

.read-more:hover {
    text-decoration: underline;
}

.view-all-container {
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
}

@media (max-width: 480px) {
    .view-all-container {
        margin-top: 40px;
        padding-top: 15px;
    }
}

/* Topics Section */
.topics {
    padding: 60px 0;
    background-color: #0f0f0f;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 480px) {
    .tags-container {
        gap: 10px;
    }
}

.topic-pill {
    background-color: #1a1a1a;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #ccc;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.topic-pill:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(0, 255, 127, 0.05);
}

/* About Section */
.about-section {
    padding: 80px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-bio p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: #ccc;
}

.about-terminal {
    background-color: #151515;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    font-family: var(--font-mono);
}

.terminal-header {
    background-color: #222;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.terminal-btn.red {
    background-color: #ff5f56;
}

.terminal-btn.yellow {
    background-color: #ffbd2e;
}

.terminal-btn.green {
    background-color: #27c93f;
}

.terminal-title {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.8rem;
    color: #888;
}

.terminal-body {
    padding: 20px;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.command-line {
    margin-bottom: 15px;
}

.prompt {
    color: var(--accent-color);
    margin-right: 10px;
}

.fetch-output pre {
    color: #ccc;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.key {
    color: var(--accent-color);
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    border-top: 1px solid #222;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info p {
    margin-bottom: 15px;
    color: #ccc;
}

.social-links {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.social-links a {
    font-size: 1.5rem;
    color: #666;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.terminal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.terminal-form input,
.terminal-form textarea {
    width: 100%;
    background-color: #111;
    border: 1px solid #333;
    padding: 15px;
    color: #fff;
    font-family: var(--font-mono);
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.terminal-form textarea {
    resize: vertical;
    min-height: 120px;
}

.terminal-form input:focus,
.terminal-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(0, 255, 127, 0.05);
    box-shadow: 0 0 10px rgba(0, 255, 127, 0.1);
}

.socials-wrapper h3 {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.social-links a {
    font-size: 1.1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    padding-left: 10px;
}

.terminal-decor {
    font-size: 0.8rem;
    color: #444;
    border: 1px dashed #333;
    padding: 15px;
}

.terminal-decor p {
    margin-bottom: 5px;
}

/* Footer */
.site-footer {
    padding: 40px 0;
    border-top: 1px dotted #333;
    font-size: 0.85rem;
    color: #666;
}

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

.footer-links {
    display: flex;
    gap: 20px;
}

.burger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    padding: 5px 10px;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
}

.mobile-only {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .desktop-only {
        display: none;
    }

    .burger-menu {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(17, 17, 17, 0.98);
        border-bottom: 1px solid var(--accent-color);
        padding: 20px 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }

    .main-nav.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .main-nav ul li a {
        display: block;
        padding: 12px 20px;
        min-height: 44px;
        line-height: 1.2;
    }

    .mobile-only {
        display: block;
    }

    .hero {
        padding: 60px 0 40px;
        min-height: auto;
    }

    .hero-headline {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-sub {
        font-size: 1rem;
        padding: 0 10px;
    }

    .latest-posts {
        padding: 60px 0;
    }

    .topics {
        padding: 40px 0;
    }

    .about-section {
        padding: 60px 0;
    }

    .contact-section {
        padding: 60px 0;
    }

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

    .social-links a {
        padding: 10px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-links a {
        padding: 10px 15px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 40px 0 30px;
    }

    .hero-headline {
        font-size: 1.4rem;
        line-height: 1.4;
        word-break: break-word;
    }

    .hero-sub {
        font-size: 0.9rem;
        line-height: 1.5;
        padding: 0;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }

    .latest-posts {
        padding: 40px 0;
    }

    .post-card {
        padding: 20px 16px;
    }

    .post-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .post-excerpt {
        font-size: 0.9rem;
    }

    .topic-pill {
        font-size: 0.85rem;
        padding: 10px 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .topics {
        padding: 30px 0;
    }

    .about-section {
        padding: 40px 0;
    }

    .about-bio p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .contact-section {
        padding: 40px 0;
    }

    .terminal-form input,
    .terminal-form textarea {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .terminal-form textarea {
        min-height: 120px;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }

    .modal-content {
        width: 95%;
        margin: 0 10px;
    }

    .modal-body {
        padding: 20px;
    }

    .loader-content {
        width: 90%;
        max-width: 300px;
        padding: 0 15px;
    }

    .loader-text {
        font-size: 0.8rem;
        word-break: break-word;
    }
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 475px) {
    .about-terminal {
        overflow-x: auto;
    }

    .terminal-header {
        padding: 8px 12px;
    }

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

    .terminal-btn {
        width: 10px;
        height: 10px;
        margin-right: 6px;
    }

    .terminal-body {
        padding: 12px;
        font-size: 0.75rem;
        overflow-x: auto;
    }

    .command-line {
        margin-bottom: 10px;
        font-size: 0.75rem;
    }

    .fetch-output pre {
        font-size: 0.7rem;
        line-height: 1.3;
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .about-bio p {
        font-size: 0.95rem;
    }

    .about-section {
        padding: 40px 0 60px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1a1a1a;
    width: 90%;
    max-width: 450px;
    border-radius: 6px;
    border: 1px solid #444;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-body {
    padding: 30px;
}

.modal-title {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.modal-desc {
    color: #888;
    margin-bottom: 25px;
    font-size: 0.9rem;
    min-height: 1.5em;
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

.feedback-msg {
    margin-bottom: 15px;
    font-size: 0.9rem;
    min-height: 1.5em;
}

.feedback-msg.success {
    color: var(--accent-color);
}

.feedback-msg.error {
    color: #ff5f56;
}

.close-modal {
    cursor: pointer;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Fira Code', monospace;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    width: 300px;
    text-align: left;
}

.loader-text {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    min-height: 1.5em;
}

.loader-bar {
    width: 100%;
    height: 2px;
    background-color: #333;
    position: relative;
    overflow: hidden;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.2s ease;
}

body.loading {
    overflow: hidden;
}

/* Page Loading Overlay */
/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, #141414 25%, #1b1b1b 37%, #141414 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.skeleton-line {
    height: 12px;
    margin: 8px 0;
}

.skeleton-title { height: 20px; width: 70%; }
.skeleton-meta { height: 10px; width: 40%; }
.skeleton-excerpt { height: 12px; width: 100%; }

.skeleton-card {
    background-color: #111;
    border: 1px solid #222;
    padding: 25px;
    border-radius: 4px;
}

/* Skeleton pill for topics filter */
.skeleton-pill {
    display: inline-block;
    height: 28px;
    width: 100px;
    border-radius: 999px;
    margin: 6px 8px 0 0;
}