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

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #ffffff;
    --accent-color: #ff6600;
    --text-color: #333333;
    --light-bg: #f5f5f5;
    --border-color: #ddd;
    --text-muted: #666;
    --text-muted-light: #999;
    --hero-bg-start: #eef2f3;
    --hero-bg-end: #d6e0f0;
    --cta-hover: #e55a00;
    --read-more-hover: #e55a00;
    --post-card-shadow: rgba(0, 0, 0, 0.08);
    --footer-bg: #1a1a1a;
    --footer-fg: #ffffff;
    --spacing: 1rem;
}

/* Phosphor / CRT palette when Retro Mode is on */
html.retro-mode {
    --primary-color: #39ff14;
    --secondary-color: #0a0c0a;
    --accent-color: #ffcc00;
    --text-color: #c8ffc8;
    --light-bg: #0f140f;
    --border-color: #1e4d1e;
    --text-muted: #7fb87f;
    --text-muted-light: #5c8a5c;
    --hero-bg-start: #0d120d;
    --hero-bg-end: #1a261a;
    --cta-hover: #ffe066;
    --read-more-hover: #ffe066;
    --post-card-shadow: rgba(57, 255, 20, 0.12);
    --footer-bg: #050805;
    --footer-fg: #39ff14;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    transition: background-color 0.35s ease, color 0.35s ease;
}

html.retro-mode body {
    font-family: "IBM Plex Mono", "Consolas", "Courier New", monospace;
}

/* Header & Navigation */
.header {
    position: sticky;
    top: 0;
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.retro-mode-toggle {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-color);
    background: var(--light-bg);
    border: 2px solid var(--accent-color);
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.retro-mode-toggle:hover {
    color: var(--secondary-color);
    background: var(--accent-color);
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.35);
}

html.retro-mode .retro-mode-toggle {
    color: #0a0c0a;
    background: var(--accent-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 14px rgba(57, 255, 20, 0.45);
}

html.retro-mode .retro-mode-toggle:hover {
    color: var(--primary-color);
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* CRT Border and subtle glow */
    background: linear-gradient(135deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
    padding: 2rem;
    border: 4px solid var(--crt-border-color, #34ff8c);
    box-shadow:
        0 0 24px 4px var(--crt-border-glow, #34ff8c),
        0 0 3px 0 #222 inset;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Subtle scanline effect */
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        rgba(0,0,0,0.10) 1.5px,
        transparent 3px
    );
    opacity: 0.25;
    z-index: 1;
    mix-blend-mode: multiply;
}

.hero-content {
    text-align: center;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* CTA Button */
.cta-button {
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: var(--cta-hover);
    transform: translateY(-2px);
}

.cta-button:active {
    transform: translateY(0);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section Title */
.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--primary-color);
    font-weight: 700;
}

/* Posts Section */
.posts {
    padding: 4rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--light-bg);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 4px 12px var(--post-card-shadow);
    transform: translateY(-4px);
}

.post-header {
    margin-bottom: 1rem;
}

.post-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted-light);
}

.post-excerpt {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--read-more-hover);
}

/* About Section */
.about {
    padding: 4rem 0;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Contact Section */
.contact {
    padding: 4rem 0;
    background-color: var(--light-bg);
    margin: 2rem -2rem 0 -2rem;
    padding: 4rem 2rem;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-fg);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .navbar-end {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

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

    .contact {
        margin: 2rem -1rem 0 -1rem;
        padding: 3rem 1rem;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-link {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    main {
        padding: 0 1rem;
    }
}
