/* --- 1. FONTS & IMPORTS --- */
@import url('https://api.fontshare.com/v2/css?f[]=chillax@600&f[]=synonym@400&display=swap');

/* --- 2. CSS VARIABLES --- */
:root {
    --background-color: #FFFFFF;
    --text-color: #1a1a1a;
    --primary-accent: #0070c0;
    --secondary-accent: #2e8b57;
    --card-background: #f8f8f8;
    --border-color: #e0e0e0;
    --secondary-text: #666666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

    --font-heading: 'Chillax', sans-serif;
    --font-body: 'Synonym', sans-serif;
    
    --tag-bg: #f0f0f0;
    --tag-border: #e0e0e0;
}

/* APPLY DARK MODE TO ROOT (HTML) as well as BODY */
:root.dark-theme, body.dark-theme {
    --background-color: #1a1a1a;
    --text-color: #f0f0f0;
    --primary-accent: #6aa8fc;
    --secondary-accent: #3cb371; 
    --card-background: #282828;
    --border-color: #444444;
    --secondary-text: #b0b0b0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    
    --tag-bg: #2a2a2a;
    --tag-border: #444444;
}

/* --- 3. BASE STYLES --- */
* { box-sizing: border-box; }

/* Make sure html also has background color to prevent flashes */
html {
    background-color: var(--background-color);
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0; padding: 0;
    transition: background-color 0.4s, color 0.4s;
    line-height: 1.6;
    min-height: 100vh;
    display: flex; flex-direction: column;
    overflow-x: hidden;
}

.content-wrapper {
    max-width: 1200px; margin: 0 auto; padding: 20px;
    flex-grow: 1; width: 100%; position: relative; z-index: 10;
}

h1, h2, h3, h4 { 
    font-family: var(--font-heading); 
    font-weight: 600; 
    text-transform: lowercase;
    margin-top: 0; 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 4. HEADER & NAV --- */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 30px 40px;
    border-bottom: 3px solid var(--border-color);
    background-color: var(--background-color);
    position: sticky; top: 0; z-index: 100;
    transition: border-bottom 0.4s, background-color 0.4s;
}

.logo a {
    font-family: var(--font-heading);
    font-weight: 600; font-size: 1.8rem; 
    color: var(--text-color);
    border-bottom: 2px solid transparent; 
}

.logo a:hover, .logo a.active {
    border-bottom-color: var(--primary-accent);
}

nav { display: flex; align-items: center; gap: 20px; }

nav a {
    font-family: var(--font-heading);
    font-weight: 600; font-size: 1.2rem; 
    padding: 5px 0; border-bottom: 2px solid transparent;
}
nav a.active, nav a:hover { border-bottom-color: var(--primary-accent); }

#theme-toggle {
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; color: var(--text-color);
}

/* --- 5. HERO SECTION --- */
.hero-section {
    display: flex; justify-content: space-between; align-items: center;
    gap: 40px; 
    padding: 60px 0; min-height: calc(80vh - 100px);
}
.text-container {
    flex: 1; max-width: 550px;
    font-size: 1.2rem; font-weight: 400; white-space: pre-line;
}
.highlight-link {
    color: var(--secondary-accent);
    text-decoration: underline; text-decoration-thickness: 2px;
    text-underline-offset: 4px; font-family: var(--font-heading);
}

.image-container {
    flex: 1; 
    display: flex; 
    justify-content: center;
}

#flashing-image {
    width: 100%; 
    max-width: 500px;
    height: auto;
    border-radius: 8px; 
}

@media (max-width: 900px) {
    .hero-section { flex-direction: column; text-align: center; }
    .text-container { order: 2; }
    .image-container { order: 1; justify-content: center; margin-bottom: 30px; }
}

/* --- 6. PROJECT CARDS (Grid Layout) --- */
.page-section { padding: 40px 0; max-width: 1000px; margin: 0 auto; }
.page-title {
    font-size: 2.5rem; border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px; margin-bottom: 40px;
}
.page-title-block {
    display: flex; justify-content: space-between; align-items: flex-end;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px; margin-bottom: 30px;
}
.page-title-block h1 { font-size: 2.5rem; margin: 0; }
.page-title-block span { color: var(--secondary-text); font-family: var(--font-heading); }

.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; margin-top: 20px;
}
.project-card {
    background-color: var(--card-background);
    padding: 25px; border-radius: 12px;
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.project-card img {
    width: 100%; 
    height: 250px; 
    object-fit: contain; 
    border-radius: 8px; 
    margin-bottom: 15px;
    background-color: #e0e0e0; 
    border: 1px solid var(--border-color);
}

.project-card h3 {
    font-size: 1.4rem; color: var(--text-color); margin-bottom: 5px;
}
.project-sub {
    font-size: 0.9rem; color: var(--primary-accent); 
    font-family: var(--font-heading); margin-bottom: 10px;
}
.project-card p {
    font-size: 0.95rem; color: var(--secondary-text); 
    margin-bottom: 20px; flex-grow: 1;
}
.project-link {
    display: inline-block; padding: 10px 20px;
    background-color: var(--primary-accent); color: #fff;
    border-radius: 50px; font-family: var(--font-heading);
    font-size: 0.9rem; text-align: center; align-self: flex-start;
}
.project-link:hover { opacity: 0.9; }

/* --- 7. LIST ITEMS --- */
.list-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 30px 0; border-bottom: 1px dashed var(--border-color);
}
.list-item:last-child { border-bottom: none; }
.item-details { max-width: 75%; }
.item-details h3 { font-size: 1.5rem; color: var(--primary-accent); margin-bottom: 5px; }
.sub-header { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-color); display: block; margin-bottom: 8px;}
.item-details p { font-size: 1rem; color: var(--secondary-text); margin: 0; }
.item-meta { text-align: right; font-size: 1rem; color: var(--secondary-text); font-family: var(--font-heading); }

/* --- 8. TAGS & FOOTER --- */
.tag-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.tech-tag {
    padding: 6px 14px; border-radius: 4px;
    background-color: var(--tag-bg); border: 1px solid var(--tag-border);
    font-size: 0.9rem; font-family: var(--font-heading);
}

footer {
    padding: 40px; border-top: 3px solid var(--border-color);
    margin-top: 60px; font-size: 1rem;
    display: flex; flex-direction: column;
}
.copyright { font-family: var(--font-heading); font-size: 1.2rem; }
.love-note { color: var(--secondary-text); }

.scroll-fade-in { opacity: 0; transform: translateY(20px); transition: 0.6s ease-out; }
.scroll-fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- 9. ABOUT PAGE SPECIFICS --- */
.profile-hero { 
    display: grid; grid-template-columns: 1fr; gap: 40px; 
    margin-bottom: 60px; align-items: center; 
}
@media (min-width: 768px) { .profile-hero { grid-template-columns: 2fr 1fr; } }

.professional-photo { 
    width: 250px; height: 250px; margin: 0 auto; 
    border-radius: 50%; 
    overflow: hidden; box-shadow: var(--shadow); 
}
.professional-photo img { width: 100%; height: 100%; object-fit: cover; }

.life-hobby-block { 
    display: grid; grid-template-columns: 1fr; gap: 40px; 
    margin-bottom: 80px; align-items: start; 
}
@media (min-width: 768px) { .life-hobby-block { grid-template-columns: 1fr 1fr; } }

.photo-group { 
    display: flex; gap: 20px; justify-content: center; 
    align-items: flex-start; 
}

.personal-photo { 
    background-color: var(--card-background); 
    box-shadow: var(--shadow); 
    width: 160px; height: 240px; 
    border-radius: 8px; overflow: hidden; 
    transition: transform 0.3s ease;
    display: flex; align-items: center; justify-content: center; 
}
.photo-group .personal-photo:nth-child(2) { margin-top: 40px; }

.personal-photo img { 
    width: 100%; height: 100%; object-fit: cover; 
}

@media (min-width: 768px) { 
    .life-hobby-block.photo-right .about-text-content { order: 1; }
    .life-hobby-block.photo-right .photo-group { order: 2; }
}

/* --- 10. BLOG SPECIFIC STYLES --- */
.blog-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 60px; /* Space between columns */
    margin-top: 20px;
}

@media (max-width: 768px) {
    .blog-container { grid-template-columns: 1fr; gap: 40px; }
}

.blog-column h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-accent);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.article-item {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}
.article-item:last-child { border-bottom: none; }

.article-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 600;
}
.article-title:hover { color: var(--primary-accent); text-decoration: underline; }

.article-meta {
    font-size: 0.9rem;
    color: var(--secondary-text);
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.article-desc {
    font-size: 1rem;
    color: var(--secondary-text);
    line-height: 1.5;
}