/* --- 1. Core Variables & Blueprint Theme --- */
:root {
    --bg-color: #f4f4f2;
    --grid-line-color: rgba(0, 84, 166, 0.1);
    --primary-text-color: #002b5c;
    --secondary-text-color: #5a7da0; 
    --accent-color: #0054a6;
    --highlight-color: #d90429;
    --border-color: #cdd8e4;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto Mono', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-primary);
    color: var(--primary-text-color);
    background-color: var(--bg-color);
    /* A subtle noise texture using an embedded SVG */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.7" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.07"/></svg>');
}
@keyframes pan-grid { from { background-position: 0 0; } to { background-position: 1200px 1200px; } }
.container { max-width: 1200px; margin: 0 auto; padding: 0 30px; }
section { padding: 100px 0; }
h2 {
    font-size: 1.5rem;
    font-family: var(--font-secondary);
    color: var(--accent-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 10px;
}
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--highlight-color);
    transform: scaleX(0);
    transform-origin: left;
    animation: draw-line 1.5s forwards;
    animation-delay: 0.5s;
}
@keyframes draw-line { to { transform: scaleX(1); } }
h3 { font-size: 2.5rem; font-weight: 600; color: var(--primary-text-color); margin-bottom: 40px; }
p { color: var(--secondary-text-color); line-height: 1.8; max-width: 700px; }

/* --- 2. Header, Navigation, Preloader, Arc Reactor --- */
.header { padding: 30px 0; border-bottom: 2px solid var(--border-color); background-color: rgba(244, 244, 242, 0.9); backdrop-filter: blur(5px); position: sticky; top: 0; z-index: 100; }
.navbar { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-secondary); font-weight: 500; font-size: 1.2rem; color: var(--primary-text-color); text-transform: uppercase; text-decoration: none; }
.nav-menu { display: flex; list-style: none; gap: 40px; }
.nav-link { font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--accent-color); position: relative; padding-bottom: 5px; }
.nav-link:after { content: ''; position: absolute; width: 100%; transform: scaleX(0); height: 2px; bottom: 0; left: 0; background-color: var(--highlight-color); transform-origin: bottom right; transition: transform 0.25s ease-out; }
.nav-link:hover:after { transform: scaleX(1); transform-origin: bottom left; }
.logo-cursor { display: inline-block; background-color: var(--primary-text-color); width: 10px; height: 1.2rem; animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.75s ease; }
#preloader-text { font-family: var(--font-secondary); color: var(--primary-text-color); font-size: 1.2rem; text-align: center; }
#arc-reactor-btn { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background-color: #00e1ff; border: 3px solid #fff; border-radius: 50%; cursor: pointer; display: none; z-index: 100; box-shadow: 0 0 15px #00e1ff, 0 0 25px #00e1ff, inset 0 0 10px #fff; transition: opacity 0.3s, transform 0.3s; opacity: 0; }
#arc-reactor-btn .arc-core { width: 20px; height: 20px; background-color: #fff; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 10px #00e1ff; }

/* --- 3. Page-Specific Sections --- */
.hero { text-align: center; }
.hero h1 { font-family: var(--font-primary); font-size: 4.5rem; font-weight: 700; color: var(--primary-text-color); margin-bottom: 20px; }
.hero .subtitle { font-size: 1.2rem; color: var(--secondary-text-color); max-width: 600px; margin: 0 auto 40px auto; }
.btn { display: inline-block; font-family: var(--font-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; color: var(--highlight-color); border: 2px solid var(--highlight-color); padding: 14px 35px; text-decoration: none; transition: all 0.3s ease; }
.btn:hover { background-color: var(--highlight-color); color: #fff; }
.project { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; margin-bottom: 100px; position: relative; }
.project:nth-child(even) .project-image { order: 2; }
.project-image { border: 2px solid var(--border-color); padding: 15px; background-color: #fff; position: relative; }
.project-image img { width: 100%; height: auto; display: block; }
.project-description h2 { font-size: 1.2rem; }
.project-description h3 { font-size: 2rem; margin-bottom: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tag { font-family: var(--font-secondary); font-size: 0.8rem; background-color: rgba(0, 84, 166, 0.1); color: var(--accent-color); padding: 5px 10px; border-radius: 3px; }
.footer { text-align: center; padding: 50px 0; border-top: 2px solid var(--border-color); font-family: var(--font-secondary); color: var(--secondary-text-color); }
.schematic-container { display: flex; justify-content: center; align-items: center; }
.schematic-svg { width: 60%; stroke: var(--accent-color); fill: none; animation: pulse-glow 4s ease-in-out infinite; }
@keyframes pulse-glow { 0% { stroke: var(--accent-color); filter: drop-shadow(0 0 1px var(--accent-color)); } 50% { stroke: #fff; filter: drop-shadow(0 0 10px var(--highlight-color)); } 100% { stroke: var(--accent-color); filter: drop-shadow(0 0 1px var(--accent-color)); } }

/* --- 4. Blog Styles --- */
.page-title { text-align: center; margin-bottom: 60px; }
.page-title h3 { margin-bottom: 0; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.post-card { border: 2px solid var(--border-color); background-color: #fff; padding: 30px; text-decoration: none; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.post-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 43, 92, 0.1); border-color: var(--accent-color); }
.post-date { font-family: var(--font-secondary); font-size: 0.8rem; color: var(--secondary-text-color); margin-bottom: 10px; }
.post-card h4 { font-size: 1.5rem; color: var(--primary-text-color); margin-bottom: 15px; }
.post-excerpt { color: var(--secondary-text-color); font-size: 1rem; line-height: 1.6; }
.read-more { display: inline-block; margin-top: 20px; font-family: var(--font-secondary); font-weight: 500; color: var(--highlight-color); }
.blog-post .container { max-width: 800px; }
.post-header { text-align: center; padding-bottom: 30px; margin-bottom: 40px; border-bottom: 2px solid var(--border-color); }
.post-header h1 { font-size: 3rem; margin-bottom: 15px; }
.post-meta { font-family: var(--font-secondary); color: var(--secondary-text-color); }
.post-content { font-size: 1.1rem; line-height: 1.8; }
.post-content h2 { font-size: 1.8rem; margin-top: 40px; margin-bottom: 20px; }
.post-content pre { background-color: #eef2f7; padding: 20px; margin: 30px 0; white-space: pre-wrap; font-family: var(--font-secondary); border: 1px solid var(--border-color); color: var(--primary-text-color); }
.back-link { display: inline-block; margin-top: 40px; font-weight: 600; text-decoration: none; color: var(--accent-color); }

/* --- 5. Responsive & Mobile Readability --- */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 20px; }
    .hero h1 { font-size: 3rem; }
    .project { grid-template-columns: 1fr; }
    .project:nth-child(even) .project-image { order: 1; }
    .hero .subtitle, .project-description p, .post-excerpt, .post-content {
        color: var(--primary-text-color);
        font-size: 1.1rem;
    }
}