:root {
    --primary: #002080;
    --primary-light: #e6ecff;
    --accent: #e66e00;
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-page: #f7fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- NAVIGATION --- */
nav {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 5%;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 5px;
}
.nav-btn {
    text-decoration: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s ease;
}
.nav-btn:hover, .nav-btn.active { color: var(--primary); background: var(--primary-light); }

/* --- MAIN CONTENT AREA --- */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 5%;
    width: 100%;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- HOME: HERO SECTION --- */
.hero {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 60px;
    background: var(--bg-card);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.hero-text { flex: 1; }
.hero-text h1 { font-size: 2.8rem; color: var(--primary); margin-bottom: 10px; line-height: 1.2; }
.hero-text h2 { font-size: 1.25rem; color: var(--text-muted); font-weight: 400; margin-bottom: 25px; line-height: 1.4; }
.hero-text p { font-size: 1.05rem; margin-bottom: 30px; text-align: justify; }
.hero-image {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-light);
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover { background: #001555; color: #fff; text-decoration: none; }
/* --- BLOG IMAGES --- */
.blog-image-container { margin: 30px 0; text-align: center; }
.blog-image-container img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.blog-caption { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin-top: 10px; }
/* --- HOME: NEWS SECTION --- */
.section-title { font-size: 1.5rem; color: var(--primary); border-bottom: 2px solid var(--primary-light); padding-bottom: 10px; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 0.5px; }
.news-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.news-item { display: flex; gap: 20px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.news-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.news-date { font-weight: 700; color: var(--primary); min-width: 120px; }

/* --- GRID FORMATTING (RESEARCH & SOFTWARE) --- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border-top: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.06); }
.card i { font-size: 2rem; color: var(--accent); margin-bottom: 20px; }
.card h3 { font-size: 1.2rem; color: var(--primary); margin-bottom: 15px; }
.card p { font-size: 0.95rem; color: var(--text-muted); text-align: justify; }

/* --- CV FORMATTING --- */
.cv-block { background: var(--bg-card); padding: 40px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.cv-entry { margin-bottom: 25px; }
.cv-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.cv-title { font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
.cv-date { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.cv-subtitle { font-style: italic; color: var(--text-muted); margin-bottom: 8px; }

.pub-list { list-style: disc; padding-left: 20px; }
.pub-list li { margin-bottom: 15px; font-size: 0.95rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- BLOG FORMATTING --- */
.article-card { background: var(--bg-card); padding: 40px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.article-title { font-size: 1.6rem; color: var(--primary); margin-bottom: 10px; line-height: 1.3; }
.article-title a { color: var(--primary); text-decoration: none; }
.article-title a:hover { color: var(--accent); }
.article-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 30px; font-weight: 600; }
.article-content h4 { color: var(--text-main); font-size: 1.15rem; margin-top: 30px; margin-bottom: 15px; }
.article-content p { text-align: justify; margin-bottom: 15px; }
.article-content ul { padding-left: 25px; margin-bottom: 20px; }
.article-content li { margin-bottom: 10px; text-align: justify; }
.article-content code { background: #edf2f7; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #d53f8c; font-family: monospace; }

/* --- BLOG EMBEDS & CODE BLOCKS --- */
.code-block { background: #2d3748; color: #e2e8f0; padding: 15px 20px; border-radius: 8px; font-family: Consolas, monospace; font-size: 0.9rem; overflow-x: auto; margin-bottom: 20px; line-height: 1.5; }
.code-block .comment { color: #a0aec0; }
.link-preview { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text-main); overflow: hidden; margin: 20px 0; transition: box-shadow 0.2s; background: #fafbfc; }
.link-preview:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); text-decoration: none; }
.link-preview-img { width: 120px; height: 110px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--primary); flex-shrink: 0; }
.link-preview-text { padding: 15px 20px; flex: 1; }
.link-preview-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 5px; color: var(--primary); }
.link-preview-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* --- FOOTER --- */
footer {
    background: var(--primary);
    color: #ffffff;
    padding: 40px 5%;
    text-align: center;
    margin-top: auto;
}
.social-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #ffffff;
    transition: background 0.2s;
}
.social-links a:hover { background: var(--accent); text-decoration: none; }
.footer-text { font-size: 0.9rem; color: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
    .nav-container { flex-direction: column; height: auto; padding: 15px 0; gap: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .hero { flex-direction: column-reverse; text-align: center; padding: 30px 20px; }
    .hero-text p { text-align: center; }
    .news-item { flex-direction: column; gap: 5px; }
    .cv-header { flex-direction: column; }
}
