@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --white: hsl(36, 100%, 99%);
    --orange: hsl(35, 77%, 62%);
    --red: hsl(5, 85%, 63%);
    --attribution: hsl(228, 45%, 44%);
    --blue: hsl(236, 13%, 42%);
    --light: hsl(233, 8%, 79%);
    --grey: hsl(0, 0%, 47%);
    --black: hsl(240, 100%, 5%);
}


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

body {
    font-family: "Inter", sans-serif;
    background-color: var(--white);
    padding: clamp(1rem, 4vw, 4rem);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 800;
}

.nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--blue);
}

.nav a:is(:hover, .active) {
    color: var(--orange);
}

.menu__toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu__toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--black);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu__toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu__toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu__toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
}

.feature {
    container-type: inline-size;
}

.feature img {
    width: 100%;
    height: auto;
}

.feature__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    margin-top: 1.5rem;
}

.feature h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.feature__copy {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature__copy p {
    color: var(--grey);
    line-height: 1.6;
}

button {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    color: var(--white);
    background: var(--black);
}

button:hover {
    background: var(--red);
}

.sidebar {
    background: var(--black);
    color: var(--white);
    padding: clamp(1.5rem, 3vw, 2rem);
}

.sidebar h2 {
    color: var(--orange);
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.sidebar article {
    padding: 1rem 0;
    border-bottom: 1px solid var(--grey);
}

.sidebar article:last-child {
    border-bottom: none;
}

.bottom {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    margin-top: clamp(1.5rem, 4vw, 3rem);
}

.card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    align-items: center;
}

.card img {
    width: 100px;
    height: 130px;
    object-fit: cover;
}

.card span {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--red);
    margin-bottom: 0.5rem;
}

.card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--grey);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card:has(img:hover) h4 {
    color: var(--red);
    cursor: pointer;
}

.attribution {
    margin-top: 3rem;
    font-size: 13px;
    text-align: center;
    color: var(--black);
}

.attribution a {
    color: var(--attribution);
}

/* @container (max-width: 900px) {
    .bottom {
        grid-template-columns: 1fr;
    }
} */

@container (max-width: 700px) {
    .bottom {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (max-width: 450px) {
    .bottom {
        grid-template-columns: 1fr;
    }
}

@container (max-width: 350px) {
    .bottom {
        display: flex;
        flex-direction: column;
    }
}

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

    .feature__body {
        grid-template-columns: 1fr;
    }

    .menu__toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        padding: 8rem 2rem 2rem;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    .nav.open {
        right: 0;
    }

    .nav a {
        margin-left: 0;
        margin-bottom: 2rem;
        font-size: 1.2rem;
        font-weight: 500;
    }

    .nav.open::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    } 
}




