@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Staatliches&family=Urbanist:ital,wght@0,100..900;1,100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #edf2f4;
    font-family: 'Urbanist', sans-serif;
}

main {
    flex: 1; /* vyplní prostor nad footerem */
}

/* --- HEADER --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #cfd9de;
    position: relative;
}

.logo img {
    height: 50px;
}

.nav {
    display: flex;
    gap: 0;
    /* anchors inside provide spacing */
    justify-content: center;
    width: 100%;
    max-width: 600px;
    /* keep the centered area from the previous table layout */
    margin: 0 auto;
}

.nav a:hover {
    color: #3d6aff;
}

.nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 20px;
    transition: color 180ms ease-in-out, opacity 160ms ease-in-out;
}

.nav a.active {
    color: #007BFF;
    /* keep same hue as hover but persistent */
}

.nav a[aria-current="page"] {
    color: #007BFF;
}

.nav a.active:after,
.nav a[aria-current="page"]:after {
    width: 100%;
    left: 0;
}

.nav a {
    color: #1a1a1a;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    padding: 12px 14px;
    /* reduced horizontal padding */
    margin: 0 6px;
    /* slight gap between links */
    position: relative;
}

.nav a:after {
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    /* underline thickness */
    left: 50%;
    position: absolute;
    background: #fff;
    transition: width 0.28s ease 0s, left 0.28s ease 0s;
    width: 0;
}

.nav a:hover:after {
    width: 90%;
    /* slightly shorter underline */
    left: 5%;
    /* center the 90% underline */
}

.nav a.active:after,
.nav a[aria-current="page"]:after {
    width: 90%;
    left: 5%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- MENU TOGGLE --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 25px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 4px;
    width: 100%;
    background-color: #007BFF;
    border-radius: 2px;
}

/* --- PORTFOLIO --- */
.portfolio {
    padding: 60px 20px;
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

.portfolio h2 {
    font-family: 'Fjalla One', sans-serif;
    font-size: 36px;
    color: #007BFF;
    margin-bottom: 40px;
}

/* FLEXIBILNÍ GRID: Zobrazí 4 vedle sebe, ale dovolí libovolný počet projektů */
.portfolio-grid {
    display: flex;
    flex-wrap: wrap;          /* zalamování */
    justify-content: center;  /* zarovnání na střed */
    gap: 30px;
}


.project-card {
    flex: 1 1 250px;          /* minimální šířka 250px */
    max-width: 300px;  
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card img {
    width: 100px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.project-card h3 {
    color: #007BFF;
    margin-bottom: 10px;
    font-size: 22px;
}

.project-card p {
    font-size: 16px;
    color: #343434;
    margin-bottom: 15px;
}

.project-link {
    display: inline-block;
    text-decoration: none;
    background-color: #007BFF;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.project-link:hover {
    background-color: #0056b3;
}

/* --- FOOTER --- */
.footer-basic {
    width: 100%;
    padding: 40px 0;
    background-color: #ffffff;
    color: #4b4c4d;
    flex-shrink: 0;
}

.footer-basic ul {
    padding: 0;
    list-style: none;
    text-align: center;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-basic li {
    padding: 0 10px;
}

.footer-basic ul a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
}

.footer-basic ul a:hover {
    opacity: 1;
}

.footer-basic .social {
    text-align: center;
    padding-bottom: 25px;
}

.footer-basic .social > a {
    font-size: 24px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin: 0 8px;
    color: inherit;
    opacity: 0.75;
}

.footer-basic .social > a:hover {
    opacity: 0.9;
}

.footer-basic .copyright {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 0;
}

.footer-basic .footer-logo {
    text-align: center;
    margin-top: 10px;
}

.footer-basic .footer-logo img {
    height: 40px;
    display: inline-block;
}

/* --- BUTTON --- */
.btn2 {
    position: relative;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(45deg, #0004ff, #6670f8, #00eaff);
    padding: 14px 25px;
    border-radius: 10px;
    font-size: 1.25em;
    cursor: pointer;
}

.btn2 span {
    position: relative;
    z-index: 1;
    color: #fff;
}

.btn2::before {
    content: "";
    position: absolute;
    inset: 1px;
    background: #272727;
    border-radius: 9px;
    transition: 0.5s;
}

.btn2:hover::before {
    opacity: 0.7;
}

.btn2::after {
    content: "";
    position: absolute;
    inset: 0px;
    background: linear-gradient(45deg, #0004ff, #6670f8, #00eaff);
    border-radius: 9px;
    transition: 0.5s;
    opacity: 0;
    filter: blur(20px);
}

.btn2:hover:after {
    opacity: 1;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 sloupce na středních obrazovkách */
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr; /* 1 sloupec na mobilu */
    }
    header {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 70px;
        left: -100%;
        flex-direction: column;
        width: 100%;
        background-color: #cfd9de;
        transition: left 0.3s ease-in-out;
        z-index: 999;
    }

    .nav a {
        padding: 15px 20px;
        font-size: 18px;
    }

    /* Hide underline animation on small screens for clarity */
    .nav a::after {
        display: none !important;
    }

    .nav a {
        text-transform: none;
        padding: 12px 14px;
        margin: 6px 0;
    }

    .nav.active {
        left: 0;
    }

    .header-right {
        order: 3;
        width: 100%;
        justify-content: space-between;
        margin-top: 10px;
    }
    .footer-basic {
        padding: 30px 10px;
    }
    .footer-basic .social > a {
        font-size: 20px;
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
}
