:root {
    /* Default Light Theme */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --accent-color: #2563eb;
    /* Vibrant Blue */
    --secondary-accent: #7c3aed;
    /* Violet */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);

    /* Typography */
    --font-main: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    /* Creative Display Font */
    --font-mono: 'Fira Code', monospace;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 5rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Theme Override */
[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #3b82f6;
    --secondary-accent: #8b5cf6;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #111111;
    --nav-bg: rgba(10, 10, 10, 0.8);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Auto Theme Detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #0a0a0a;
        --text-color: #e0e0e0;
        --text-muted: #a0a0a0;
        --accent-color: #3b82f6;
        --secondary-accent: #8b5cf6;
        --glass-bg: rgba(20, 20, 20, 0.7);
        --glass-border: rgba(255, 255, 255, 0.1);
        --card-bg: #111111;
        --nav-bg: rgba(10, 10, 10, 0.8);
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    }
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography Refinements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    color: var(--text-color);
}

p {
    font-weight: 300;
    color: var(--text-muted);
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: 1000px;
    /* Slightly narrower for better readability */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: 7rem 0 5rem 0;
}

/* Creative Navbar */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    z-index: 1000;
}

nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.nav-avatar:hover {
    transform: scale(1.1);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.nav-links a {
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.nav-links a.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    /* Cutout effect simulation using box-shadow if needed, but pill shape is cleaner here */
}

.nav-links a:hover:not(.active) {
    background-color: var(--glass-border);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background-color: var(--glass-border);
}

/* Mobile Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.burger-bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-title-wrapper {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.hero-title {
    font-size: 6rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Creative Text Effect: Mask Image */
    mask-image: linear-gradient(black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(black 70%, transparent 100%);
    animation: reveal 1.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--text-color);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Blog Vertical List */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.blog-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--glass-border);
    align-items: baseline;
    transition: transform 0.2s;
}

.blog-item:hover {
    transform: translateX(10px);
}

.blog-date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.blog-content h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.blog-content p {
    margin-bottom: 1rem;
}

/* Blog Post Detail Styles */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.blog-header {
    margin-bottom: 3rem;
    text-align: center;
}

.blog-header h1 {
    margin-bottom: 1rem;
}

.blog-header .blog-date {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: block;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.blog-tag {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
}

.blog-tag:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content h1 {
    font-size: 2.2rem;
    /* Significantly smaller than main title (3.5rem) */
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.blog-post-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.blog-post-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content pre {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: 500;
    opacity: 0.7;
}

.back-link:hover {
    opacity: 1;
    transform: translateX(-5px);
}

/* Creative Link Styling in Blog Posts */
.blog-post-content a {
    color: var(--text-color);
    text-decoration: none;
    background-image: linear-gradient(120deg, var(--glass-border) 0%, var(--glass-border) 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    transition: background-size 0.25s ease-in;
    font-weight: 500;
    padding-bottom: 2px;
}

.blog-post-content a:hover {
    background-size: 100% 88%;
    color: var(--text-color);
    /* Keep text color readable */
}

/* Dark mode adjustment for the link background if needed */
[data-theme="dark"] .blog-post-content a {
    background-image: linear-gradient(120deg, var(--accent-color) 0%, var(--secondary-accent) 100%);
    background-size: 100% 2px;
    /* Thinner line in dark mode for elegance */
}

[data-theme="dark"] .blog-post-content a:hover {
    background-size: 100% 100%;
    color: white;
}

/* Contact Icons */
.contact-icons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.contact-icon {
    color: var(--text-muted);
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon:hover {
    color: var(--bg-color);
    background: var(--text-color);
    transform: translateY(-3px);
    border-color: var(--text-color);
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

/* Footer */
footer {
    text-align: center;
    font-size: 0.75rem;
    padding: 1rem 0 2rem 0;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: auto;
}

/* CV Print Optimization */
@media print {

    header,
    footer,
    .theme-toggle,
    .scroll-indicator,
    .hero::before,
    .hero::after {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }

    .section {
        padding: 1rem 0;
    }

    h1 {
        font-size: 24pt;
        color: black;
        -webkit-text-fill-color: black;
    }

    h2 {
        font-size: 18pt;
        color: black;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
    }

    h3 {
        font-size: 14pt;
        color: black;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .cv-grid {
        display: block;
        /* Stack for print if needed, or keep grid if it fits */
    }

    .cv-sidebar {
        border: none;
        margin-bottom: 1rem;
    }
}

/* CV Styles */
.cv-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.cv-sidebar {
    border-right: 1px solid var(--glass-border);
    padding-right: var(--spacing-lg);
}

.cv-item {
    margin-bottom: var(--spacing-lg);
}

.cv-date {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 0.2rem;
    font-family: var(--font-mono);
}

.cv-role {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.cv-company {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.cv-details {
    font-size: 0.95rem;
    line-height: 1.6;
}

.cv-details ul {
    list-style: disc;
    margin-left: 1.2rem;
    margin-top: 0.5rem;
}

.cv-details li {
    margin-bottom: 0.3rem;
}

/* Blog Search Styles */
.search-container {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

#search-input {
    width: 100%;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

@media (max-width: 768px) {
    .cv-grid {
        grid-template-columns: 1fr;
    }

    .cv-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: var(--spacing-lg);
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    header {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        padding: 1rem;
    }

    nav {
        width: 100%;
        border-radius: 0;
        justify-content: space-between;
        background: var(--bg-color);
        /* Solid bg for mobile menu */
        padding: 1rem;
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1rem;
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .burger-menu {
        display: flex;
    }

    h1 {
        font-size: 3rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .blog-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}