/* --- 1. CORE THEME & VARIABLES --- */
:root {
    --bg-deep: #0a0f14;
    --arduino-teal: #00979d;      
    --terminal-yellow: #ffcc00;   /* Brighter, more dominant Yellow */
    --panel-blue: #161e26;
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

/* --- Global Reset --- */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    background-color: var(--bg-deep);
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 25px 25px;
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
header {
    background: rgba(10, 15, 20, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--terminal-yellow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--terminal-yellow);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    transition: 0.3s;
}

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

/* --- Hero & Fixed Typewriter --- */
.hero { padding: 80px 0 40px 0; }

.typewriter-wrapper {
    width: fit-content; /* FIX: Prevents cursor from flying to page edge */
    margin: 0;
}

.hero h2 {
    font-size: 2rem;
    color: white;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    border-right: 4px solid var(--terminal-yellow);
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink { 50% { border-color: transparent } }

/* --- AI Terminal --- */
.interactive-demo {
    background: var(--panel-blue);
    border: 1px solid var(--terminal-yellow);
    border-radius: 4px;
    margin: 40px 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#responseContainer {
    height: 380px;
    overflow-y: auto;
    padding: 25px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: #05070a;
}

.input-group {
    display: flex;
    background: var(--panel-blue);
    padding: 15px;
    gap: 15px;
    border-top: 1px solid var(--glass-border);
}

input#userInput {
    flex: 1;
    background: #0a0f14;
    border: 1px solid var(--arduino-teal);
    border-radius: 4px;
    padding: 12px;
    color: var(--terminal-yellow);
    font-family: 'JetBrains Mono', monospace;
    outline: none;
}

#submitBtn {
    background: var(--terminal-yellow);
    color: #000;
    border: none;
    padding: 0 25px;
    border-radius: 4px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: 0.2s;
}

#submitBtn:hover { background: white; }

/* --- Article Cards --- */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.post-item {
    background: var(--panel-blue);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 0; /* Boxy industrial look */
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    border-left: 4px solid var(--glass-border);
}

.post-item:hover {
    border-left-color: var(--terminal-yellow);
    background: #1c2630;
    transform: translateX(5px);
}

.post-item .date {
    font-family: 'JetBrains Mono', monospace;
    color: var(--terminal-yellow);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.post-item h3 { margin: 0 0 15px 0; }

.post-item h3 a {
    color: var(--arduino-teal);
    text-decoration: none;
    font-size: 1.25rem;
}

.post-item p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* Tags Layout Fix */
.tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Better spacing */
}

.tag-badge {
    background: rgba(0, 151, 157, 0.05);
    border: 1px solid var(--arduino-teal);
    color: var(--arduino-teal);
    padding: 5px 12px;
    font-size: 0.7rem;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    transition: 0.2s;
}

.tag-badge:hover {
    background: var(--terminal-yellow);
    border-color: var(--terminal-yellow);
    color: #000;
}