:root {
    /* Colors */
    --primary-color: #ffffff;
    --secondary-color: rgba(255, 255, 255, 0.65);
    --accent-color: #4a89dc;
    --progress-color: #a0a0a0;
    --success-color: #66bb6a;
    --warning-color: #ffa726;
    --info-color: #42a5f5;
    --danger-color: #ef5350;

    /* Backgrounds - all boxes at 40% */
    --background-overlay: rgba(0, 0, 0, 0.4);
    --card-bg: rgba(0, 0, 0, 0.4);
    --card-background: rgba(0, 0, 0, 0.4);
    --card-hover-bg: rgba(0, 0, 0, 0.5);
    --hover-background: rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-main: 'Segoe UI', Tahoma, Arial, sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;

    /* Shadows */
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: var(--font-main);
    background: #000000 url("../assets/background.jpg") center/cover fixed;
    color: var(--primary-color);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: var(--background-overlay);
    padding: 20px 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-normal);
}

header a:hover {
    background: var(--hover-background);
}

/* Sections - all at 40% */
section {
    background: var(--background-overlay);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
}

/* Buttons */
.button {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
}

.button:hover {
    background: var(--primary-color);
    color: #000000;
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Cards - all at 40% */
.service-card, .project-card, .domain-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 25px;
    transition: transform var(--transition-normal), background var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.service-card:hover, .project-card:hover, .domain-card:hover {
    transform: translateY(-3px);
    background: var(--card-hover-bg);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Progress Bar */
.progress-bar {
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: var(--progress-color);
    transition: width var(--transition-normal);
}

/* Skills */
.skill-tag {
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    margin: 5px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

/* Contact Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: var(--primary-color);
    font-family: var(--font-main);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.5);
}

/* Footer */
footer {
    background: var(--background-overlay);
    padding: 40px 20px;
    margin-top: 50px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.social-icon {
    color: var(--primary-color);
    font-size: 1.5em;
    margin: 0 10px;
    transition: color var(--transition-normal);
}

.social-icon:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    section {
        padding: 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-content > * {
        margin: 10px 0;
    }
}

/* Grids */
.services-grid, .projects-grid, .domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Profile Image */
.profile-image img {
    max-width: 200px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-normal);
}

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

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Project Filters */
.project-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-button {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-button:hover {
    background: var(--hover-background);
    color: var(--primary-color);
}

.filter-button.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* Service Icons */
.service-icon {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--accent-color);
}

/* Domain Links */
.domain-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.domain-link {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-normal);
}

.domain-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Image Loading */
.image-placeholder {
    background: var(--card-bg);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

picture {
    display: block;
    position: relative;
}

picture img {
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

picture.loading img {
    opacity: 0;
    transform: scale(0.9);
}

picture.loaded img {
    opacity: 1;
    transform: scale(1);
}

/* Background Wrapper */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bg-wrapper.loaded {
    opacity: 1;
}

@supports (background-image: -webkit-image-set(url("test.webp") 1x)) {
    .bg-wrapper {
        background-image: -webkit-image-set(
            url('../assets/background.webp') 1x
        );
        background-position: center;
        background-size: cover;
        background-attachment: fixed;
    }
}

@supports (background-image: image-set(url("test.webp") 1x)) {
    .bg-wrapper {
        background-image: image-set(
            url('../assets/background.webp') 1x
        );
        background-position: center;
        background-size: cover;
        background-attachment: fixed;
    }
}

/* Blur-up Loading Effect */
.blur-load {
    background-size: cover;
    background-position: center;
    position: relative;
}

.blur-load::before {
    content: '';
    position: absolute;
    inset: 0;
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% { background-color: rgba(255, 255, 255, 0.02); }
    50% { background-color: rgba(255, 255, 255, 0.06); }
    100% { background-color: rgba(255, 255, 255, 0.02); }
}

/* ===== Scroll Reveal Animations ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.scrolled {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children for cards */
.scroll-reveal.scrolled .service-card,
.scroll-reveal.scrolled .domain-card,
.scroll-reveal.scrolled .project-card {
    animation: fadeSlideUp 0.4s ease-out both;
}

.scroll-reveal.scrolled .service-card:nth-child(1),
.scroll-reveal.scrolled .domain-card:nth-child(1) { animation-delay: 0.05s; }
.scroll-reveal.scrolled .service-card:nth-child(2),
.scroll-reveal.scrolled .domain-card:nth-child(2) { animation-delay: 0.1s; }
.scroll-reveal.scrolled .service-card:nth-child(3),
.scroll-reveal.scrolled .domain-card:nth-child(3) { animation-delay: 0.15s; }
.scroll-reveal.scrolled .service-card:nth-child(4),
.scroll-reveal.scrolled .domain-card:nth-child(4) { animation-delay: 0.2s; }
.scroll-reveal.scrolled .service-card:nth-child(5),
.scroll-reveal.scrolled .domain-card:nth-child(5) { animation-delay: 0.25s; }
.scroll-reveal.scrolled .service-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Mobile Hamburger Menu ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--hover-background);
}

.menu-toggle.active i::before {
    content: "\f00d"; /* fa-times */
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    header {
        position: sticky;
        top: 0;
    }

    nav {
        position: relative;
        padding: 0 15px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
        gap: 2px;
    }

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

    .nav-links a {
        padding: 12px 15px;
        border-radius: var(--border-radius-sm);
        text-align: center;
    }

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

/* ===== Hero section improvements ===== */
#hero {
    text-align: center;
    padding: 60px 40px;
}

#hero .logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4a89dc, #6db3f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

#hero h1 {
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

#hero .subtitle {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== About section layout ===== */
.about-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.profile-image {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #hero {
        padding: 40px 20px;
    }

    #hero .logo {
        font-size: 2rem;
    }

    #hero h1 {
        font-size: 1.2rem;
    }
}

/* ===== Contact container layout ===== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

/* ===== Smooth section heading ===== */
section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(74, 137, 220, 0.3);
    display: inline-block;
}
