*,
*::before,
*::after {
    box-sizing: border-box;
}
:root {
    color-scheme: light dark;
    --bgc: light-dark(hsl(0, 0%, 87%), hsl(0, 0%, 13%));
    --section: light-dark(hsl(0, 0%, 81%), hsl(0, 0%, 16%));
    --c: light-dark(hsl(0, 0%, 13%), hsl(0, 0%, 87%));
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Raleway, sans-serif;
}

.wrapper {
    display: grid;
    grid-template-columns: 1fr repeat(12, minmax(auto, 100px)) 1fr;
    /* grid-template-columns: repeat(14, 1fr); */
    grid-auto-rows: minmax(100px, auto);
    width: 100%;
    background-color: var(--bgc) ;
    color: var(--c);
}

.layout-list {
    position: fixed;
    height: 100vb;
    top: 0;
    left: 0;
    z-index: 10;
    display: grid;
    align-items: center;
    text-align: right;
    margin: 0;
    padding: 3em;
    translate: -100% 0;
    transition: translate .3s ease-in-out,
                background-color .4s 0.5s ease-in-out;
    background-color: #444;
    box-shadow: none;
    
    & ul {
        list-style-type: none;
        display: flex;
        flex-direction: column;
        gap: 4vb;
        margin: 0;
        padding: 0;
    }
    & a:focus {
        text-decoration: underline;
    }
}
.open {
    translate: 0;
    background-color: #802602;
    box-shadow: 4px 0 4px hsla(0, 52%, 25%, 0.467);
}
#layout-btn {
    position: fixed;
    top: 4em;
    right: 1em;
    z-index: 101;
    /* display: none; */
}
#dark-mode-btn {
    background-color: hsl(208, 97%, 25%);
    font-weight: 400;
    
    &:hover {
        background-color: hsl(208, 97%, 45%);
        box-shadow: 3px 3px 3px #0007;
    }
    &:active {
        background-color: hsl(208, 97%, 45%);
        box-shadow: 2px 2px 2px #000a;
        translate: 1px 1px;
    }
}
.dark {
    color-scheme: dark;
} 
.light {
    color-scheme: light;
} 

img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 1em;
    filter: grayscale(100);
    transition: all .3s ease-in-out;
    animation: color linear both;
    animation-timeline: view(70vb 2vb);

    &:hover {
        filter: grayscale(0);
    }
    &:active {
        scale: 1.1;
    }
}

@keyframes color {
    to {
        filter: grayscale(0);
    }
}
h2 {
    margin-bottom: 0.5rem;
    text-wrap: balance;
    
    & + p {
        margin-top: 0;
    }
}
p {
    text-wrap: balance;
    opacity: .6;
    line-height: 1.5;
}
a {
    color: #eee;
}
svg {
    fill: light-dark(#555,#888);
    display: block;
}

.btn {
    all: unset;
    background-color: #777;
    color: #ccc;
    text-transform: uppercase;
    padding: .5em 1em;
    border-radius: .5em;
    cursor: pointer;
    transition: all .3s ease-in-out;

    &:hover {
        background-color: #999;
        color: #fff;
    }
}

section {
    padding: 4em 2em;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    column-gap: 1em;
 
    &:nth-child(even) {
    background-color: var(--section);
}
}
#s-01 {
    align-items: center;

    & .content {
        grid-column: 8 / -2;
        padding: 4em;
    }

    & img {
        grid-column: 2 / 8;
    }
}

#s-02 {
    & .content {
        grid-column: span 4;
        padding: 4em 1em;
        grid-row: 1 / -1;
        text-align: center;
        /* align-self: center; */
    }
    & .c1 {
        grid-column: 2 / 6;
    }
    & img {
        width: auto;
    }
}

#s-03 {
    & .content {
        grid-column: 5 / -5;
        padding: 4em 1em;
        /* grid-row: 1 / -1; */
        text-align: center;
        /* align-self: center; */
    }

    & img {
        width: auto;
    }
}

#s-04 {
    /* visibility: hidden; */
}

#s-05 {
    /* grid-template-areas: 
    ". . . heading heading heading heading heading heading . . ."
    " one one one . image image image image . two two two"
    " three three three . image image image image . four four four"
    " . . . . five five five . . . . "
    ; */
    h2 {
        grid-area: heading;
        grid-column: 6 / -6;
        grid-row: 1 / 2;
    }
    & > * {
        /* grid-column: span 4; */
        text-align: center;
    }

    & img {
        grid-column: 5 / -5;
        grid-row: 2 / 4;
        width: auto;
        text-align: center;
        margin: 1em auto;
    }
    & svg {
        margin: .5em auto;
        width: 50px;
    }
    .one {
        /* grid-area: one; */
        grid-column: 2 / 5;
        grid-row: 2 / 3;
    }
    .two {
        grid-area: two;
        grid-column: -5 / -2;
        grid-row: 2 / 3;
    }
    .three {
        grid-area: three;
        grid-column: 2 / 5;
        grid-row: 3 / 4;
    }
    .four {
        grid-area: four;
        grid-column: -5 / -2;
        grid-row: 3 / 4;
    }
    .five {
        grid-area: five;
        grid-column: 6 / -6;
        grid-row: 4 / 5;
    }
    p:has(.btn) {
        grid-column: 6 / -6;
        grid-row: 5 / 6;
    }
}

#s-06 {
    & .content {
        grid-column: 8 / -2;
        align-self: center;
        /* padding: 4em 1em; */
        padding: 1em;
        grid-row: 1 / -1;
        /* align-self: center; */
    }
    & ul {
        margin-block: 0;
    }
    & img {
        grid-column: 2 / 8;
        grid-row: 1 / -1;
        width: auto;
        justify-self: end;
    }
}

#s-07 {
    height: 200px;
}

#s-08 {
    grid-template-rows: 1fr 1fr;
    align-content: center;
    row-gap: 4em;

    & .block-1 {
        grid-column:  2 / 8;
        grid-row: 1 / 2;
        align-self: end;
    }
    & .block-2 {
        grid-column:  2 / 5;
        grid-row: 2 / 3;
    }
    & .block-3 {
        grid-column:  5 / 8;
        grid-row: 2 / 3;
    }
    & img {
        grid-column: 8 / -2;
        grid-row: span 2;

        width: auto;
    } 
    & h2 {
        margin-top: 0.25rem;
    }

    & svg {
        /* margin: .5em auto; */
        height: 50px;
    }
    }

    #s-09 {
        align-content: center;

        & img {
            grid-column: 2 / 8;
            grid-row: 1 / -1;
            width: auto;
        }

        & h2 {
            grid-column: 7 / -2;
            grid-row: 1 / 2;
            margin-left: 2rem;
            font-size: 2.5em;
        }
        & h3 {
            font-size: 1rem;
        }
        & .btn {
            font-size: 0.75em;
        }

        & .content {
            display: grid;
            grid-template-columns: subgrid;
            grid-column: 7 / -2;
            align-self: center;
            padding: 1em;
            grid-row: 1 / -1;
        }

        & .sub-c {
            grid-column: span 3;
        }

        & .c2, .c4 {
            padding-left: 1em;
        }

        & .c1, .c3 {
            padding-inline: 1em;
        }

        & .c1, .c2 {
            margin-bottom: 2em;
        }
    }

    #s-10 {
        row-gap: 2em;
        & h2 {
            grid-column: 2 / -2;
            font-size: 2em;
        }
        & h3 {
            margin: 0;
        }
        & p {
            margin: .5em 0 0;
        }
        & img {
            grid-column: 5 / 8;
            /* width: auto; */
            /* grid-row: 2 / -1 */
        }

        & img:nth-of-type(2) {
            grid-column: 2 /5;
            grid-row: 3 / 4;
        }
        & .sub-c {
            grid-column: 8 / 12;
            align-self: center;
            padding-left: 1em;
        }

        & .sub-c:nth-of-type(2) {
            grid-column: 5 / 9;
            /* grid-row: 2 / 3; */
        }
    }

    #s-11 {
        & .content {
            height: 30vb;
            border-radius: 2em;
            padding: 2rem;
        }
        & .c1 {
            grid-column: 2 / 8;
            grid-row: 1 / -1;
            background-color: orange;
        }
        & .c2 {
            grid-column: 8 / 11;
            grid-row: 1 / -1;
            background-color: var(--section);
        }   
        & .c3 {
            grid-column: 11 / -2;
            grid-row: 1 / -1;
            background-color: orange;
        }
        & h2 {
            margin: 0;
        }   
    }