/* Core Design System - Portfolio Website */

:root {
    /* Dark Theme (Default) */
    --bg-color: #0a192f;
    --surface-color: rgba(17, 34, 64, 0.7);
    --accent-color: #64ffda;
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --white: #e6f1ff;
    --glass-border: rgba(100, 255, 218, 0.1);
    --header-bg: rgba(10, 25, 47, 0.85);
    
    --transition-speed: 0.3s;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
    --bg-color: #f4f7f6;
    --surface-color: rgba(255, 255, 255, 0.8);
    --accent-color: #0077b6; /* Professional blue for light mode */
    --text-primary: #1d3557;
    --text-secondary: #457b9d;
    --white: #0a192f;
    --glass-border: rgba(0, 119, 182, 0.2);
    --header-bg: rgba(244, 247, 246, 0.9);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 8vw, 4rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.5rem); border-bottom: 2px solid var(--accent-color); display: inline-block; padding-bottom: 5px; margin-bottom: 2rem;}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-speed);
}

a:hover {
    filter: brightness(1.2);
}

/* Layout Containers */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 100px 0;
}

/* Glassmorphism Components */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
}

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

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent-color);
}

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

.nav-links a {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Space Mono', monospace;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn:hover {
    background: rgba(100, 255, 218, 0.1);
}

/* Theme Switcher Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: color var(--transition-speed);
}

.theme-toggle:hover {
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    min-height: 60vh;
    padding: 150px 0 4rem 0;
    display: flex;
    align-items: center;
}

.hero p.intro {
    color: var(--accent-color);
    font-family: 'Space Mono', monospace;
    margin-bottom: 1rem;
}

.hero p.description {
    max-width: 500px;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.service-tag {
    font-size: 0.7rem;
    font-family: 'Space Mono', monospace;
    color: var(--accent-color);
    background: rgba(100, 255, 218, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Language Switcher */
.lang-toggle {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-family: 'Space Mono', monospace;
    background: var(--surface-color);
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.lang-toggle a {
    color: var(--text-secondary);
    text-decoration: none;
}

.lang-toggle a.active {
    color: var(--accent-color);
    font-weight: 700;
}

.lang-toggle span {
    color: var(--glass-border);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none; 
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%; /* Full width on mobile for better focus */
        background: var(--header-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(25px);
        z-index: 1010;
    }

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

    .menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--surface-color);
        border: 1px solid var(--accent-color);
        border-radius: 8px;
        margin-left: 0.5rem;
    }
    
    .nav-links a {
        font-size: 1.5rem;
        margin: 1rem 0;
    }

    .mobile-only {
        display: block !important;
        margin-top: 1rem;
        text-align: center;
    }

    .desktop-only {
        display: none !important;
    }

    /* Hide language toggle and contact button on very small screens to make room for menu */
    .header-actions .lang-toggle,
    .header-actions .btn {
        display: none !important;
    }
}

.mobile-only {
    display: none;
}

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1011;
    transition: var(--transition-speed);
}

.menu-btn:hover {
    background: rgba(100, 255, 218, 0.1);
}

/* --- Projects Section Enhancements --- */

/* Page Title Semantic Helpers */
.page-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 2rem;
    color: var(--white);
}

/* Projects Grid Layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
    transition: all 0.4s ease;
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Search Bar Styling */
.search-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: var(--surface-color);
    color: var(--white);
    font-family: var(--font-main);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
}

.search-wrapper input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.12);
}

/* Filter Pills Styling */
.filter-pills-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.filter-pill {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Space Mono', monospace;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-pill:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(100, 255, 218, 0.05);
}

.filter-pill.active {
    color: var(--accent-color);
    background: rgba(100, 255, 218, 0.12);
    border-color: var(--accent-color);
    font-weight: 600;
}

/* Dynamic Animation for filtered items */
.projects-grid .glass-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.projects-grid .glass-card.is-hidden {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    margin: 0;
    gap: 0;
}

.projects-grid .glass-card.is-hidden * {
    display: none !important;
}

/* Expandable Description Details */
.card-description-wrapper {
    position: relative;
    max-height: 110px; /* Initial collapsed height */
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-description-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-color)); /* Wait, var(--bg-color) is translucent or matches the theme */
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

[data-theme="light"] .card-description-wrapper::after {
    background: linear-gradient(transparent, #f4f7f6);
}

.card-description-wrapper.no-overflow::after {
    opacity: 0 !important;
    display: none !important;
}

.glass-card.is-expanded .card-description-wrapper {
    max-height: 1000px; /* High enough value to show all content */
}

.glass-card.is-expanded .card-description-wrapper::after {
    opacity: 0;
}

.read-more-btn {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    padding: 0;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: var(--white);
}

.read-more-btn::after {
    content: '↓';
    display: inline-block;
    transition: transform 0.3s ease;
}

.glass-card.is-expanded .read-more-btn::after {
    transform: rotate(180deg);
}

.projects-grid .glass-card .service-tag {
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
}

.tags-container {
    margin-bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
}


