/* =========================================
   PALETA KOLORÓW (Nazwy funkcyjne)
   ========================================= */
:root {
    /* 1. TWOJA BAZA KOLORYSTYCZNA */
    --color-vanilla: #F0EAD2;
    --color-cream: #DDE5B6;
    --color-olive: #ADC178;
    --color-copper: #A98467;
    --color-brown: #6C584C;

    /* 2. PRZYPISANIE FUNKCYJNE */
    --bg-color: var(--color-vanilla);
    --text-white: var(--color-cream);
    --text-primary: var(--color-brown);
    --text-secondary: var(--color-copper);
    --accent-primary: var(--color-olive);
    --accent-secondary: var(--color-brown);
    
    /* 3. KONSTRUKCJE POMOCNICZE */
    --card-bg: rgba(255, 255, 255, 0.85); 
    --overlay-bg: rgba(108, 88, 76, 0.7); 
    --overlay-mobile-bg: rgba(108, 88, 76, 0.7); 
    --shadow-color: rgba(108, 88, 76, 0.1);
}

html {
    scroll-behavior: smooth; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* =========================================
   GŁÓWNE TŁO I ZAZNACZANIE TEKSTU
   ========================================= */
body {
    background: linear-gradient(
        -45deg, 
        var(--color-vanilla), 
        var(--color-cream), 
        #F5F0DF, 
        #EBEFDB
    );
    background-size: 400% 400%;
    animation: moveGradient 15s ease infinite;
    color: var(--text-primary);
}

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

::selection {
    background-color: var(--accent-primary); 
    color: var(--bg-color); 
}

::-moz-selection {
    background-color: var(--accent-primary);
    color: var(--bg-color);
}

/* =========================================
   ZMIANA JĘZYKA (Flagi)
   ========================================= */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.lang-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.4; 
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 5px;
}

.lang-btn.active, .lang-btn:hover {
    opacity: 1; 
    transform: scale(1.1);
}

/* =========================================
   SEKCJA HERO (Wprowadzenie pełnoekranowe)
   ========================================= */
.hero {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

.profile-img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 80px;
    margin-top: -20px;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 10px 20px var(--shadow-color);
    transform: scale(1.5); 
}

.name {
    font-size: 42px; 
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.brand-name {
    font-size: 22px;             
    font-weight: 500;
    color: var(--accent-secondary); 
    margin-bottom: 45px;
}

.title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 35px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

.bio {
    font-size: 18px; 
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 600px;
    margin: 0 auto 45px auto;
}

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

.btn {
    text-decoration: none;
    color: var(--text-primary);
    background: var(--accent-primary);
    padding: 14px 32px;
    border-radius: 100px; 
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-secondary);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
    transition: color 0.3s ease, opacity 0.4s ease;
    opacity: 1; 
}

.scroll-down:hover {
    color: var(--accent-primary);
}

.scroll-down.hidden {
    opacity: 0;
    pointer-events: none; 
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* =========================================
   KARTY I UKŁAD (Projekty, Design Lab, Kontakt)
   ========================================= */
.container {
    padding: 0 20px 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.table {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    background-color: var(--accent-primary);
    backdrop-filter: blur(10px); 
    box-shadow: 0 20px 50px rgba(26, 83, 92, 0.08); 
    border-radius: 32px; 
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px); 
    max-width: 900px; 
    width: 100%;
    margin: 0 auto;
    padding: 60px;
    border-radius: 32px; 
    box-shadow: 0 20px 50px rgba(26, 83, 92, 0.08); 
    text-align: center;
}

.section-title {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-weight: 600;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    margin-top: -30px; 
}

/* =========================================
   SEKCJA PROJEKTÓW STRON
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr); 
    gap: 30px;
}

.project-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1; 
    border-radius: 20px;
    overflow: hidden; 
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(26, 83, 92, 0.08);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--accent-primary); 
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    isolation: isolate; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    padding: 20px 20px 30px 20px;
    pointer-events: none; 
}

.project-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background: linear-gradient(
        to bottom, 
        rgba(108, 88, 76, 0) 0%, 
        rgba(108, 88, 76, 0.1) 40%, 
        rgba(108, 88, 76, 0.75) 100%
    );
    
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
    
    z-index: -1; 
    pointer-events: none; 
    opacity: 0; 
    transition: opacity 0.4s ease;
}

.project-overlay .project-title {
    color: var(--bg-color);
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    transform: translateY(20px); 
    opacity: 0; 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; 
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.project-overlay .project-desc {
    color: var(--text-white);
    font-size: 20px;
    font-weight: 500;
    transform: translateY(20px);
    opacity: 0; 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    transition-delay: 0.05s; 
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.project-item::after {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 10; 
    pointer-events: none; 
    opacity: 0;
    transition: opacity 0.4s ease; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay; 
}

.project-item:hover::after { opacity: 0.4; }
.project-item:hover .project-img { transform: scale(1.1); }
.project-item:hover .project-overlay::before { opacity: 1; }
.project-item:hover .project-overlay .project-title,
.project-item:hover .project-overlay .project-desc { transform: translateY(0); opacity: 1; }

/* =========================================
   SEKCJA KONTAKTOWA I STOPKA
   ========================================= */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    margin-top: 30px;
}

.contact-details svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: -3px;
}

.contact-link {
    text-decoration: none;
    color: var(--text-primary);
    padding: 14px 28px;
    background: #ffffff;
    border-radius: 100px;
    border: 2px solid var(--accent-primary); 
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 300px;
    max-width: 450px;
    margin: 10px;
}

.contact-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.contact-label {
    font-weight: 600;
    margin-right: 5px;
    color: var(--text-secondary);
}

.page-footer {
    margin-top: 25px; 
    padding-top: 80px;
    border-top: 2px solid var(--accent-primary); 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* =========================================
   SEKCJA O MNIE (WERSJA SYMETRYCZNA 3x3)
   ========================================= */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    text-align: center;
}

.about-text-wrapper {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary);
}

.about-skills-wrapper {
    width: 100%;
    max-width: 900px; /* Ograniczenie by siatka nie była zbyt rozstrzelona */
    gap: 20px;
}

/* Siatka 5 kolumn (układ 2x5) */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 kolumn */
    gap: 50px 15px; /* Większy odstęp pionowy (50px), mniejszy poziomy (15px) */
    width: 100%;
}

.skill-item {
    display: flex;
    flex-direction: column; /* Tekst pod ikoną */
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.skills-title {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.skill-item:hover {
    transform: translateY(-8px);
}

.skill-icon {
    width: 60px; /* Nieco większe by lepiej pasowały do układu pionowego */
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-vanilla);
    border: 2px solid var(--accent-primary);
    border-radius: 18px;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(108, 88, 76, 0.08);
}

.skill-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skill-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 140px; /* Zapobiega zbyt długim wierszom pod ikoną */
}

/* =========================================
   ANIMACJE FADE-IN
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   RESPONSYWNOŚĆ (Media Queries - Telefony)
   ========================================= */
@media (max-width: 768px) {
    .card { padding: 40px 20px; }
    .name { font-size: 36px; }

    .projects-grid {
        display: grid;
        grid-template-columns: 1fr; 
        gap: 30px;
    }

    .profile-img {
        margin-top: 40px;
    }

    .project-overlay::before {
        opacity: 1 !important; 
    }

    .project-overlay .project-title {
        opacity: 1 !important;
        transform: translateY(0) !important;
        font-size: 24px;
        margin-bottom: 5px;
    }

    .project-overlay .project-desc {
        opacity: 1 !important;
        transform: translateY(0) !important;
        font-size: 16px;
    }

    main.container {
        padding: 0px !important; 
    }

    .project-item::after,
    .project-item:hover::after {
        opacity: 0.3 !important; 
    }

    .about-content {
        flex-direction: column;
        gap: 50px;
    }

    .about-text-wrapper {
        padding: 0 10px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolumny na tabletach */
        gap: 30px 15px;
    }
    
    .skill-item {
        min-width: 180px; /* Nieco ciaśniej na tabletach */
    }

    .about-skills {
        padding: 20px;
    }

    .skills-tags {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* Zostajemy przy 2 kolumnach na telefonach dla symetrii */
    }
    .skill-icon {
        width: 50px;
        height: 50px;
    }
    .skill-name {
        font-size: 13px;
    }
}