/* ************************* */
/*           Reset           */
/* ************************* */

/* Box sizing rules */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Set core root defaults */
html,
html:focus-within {
    scroll-behavior: smooth;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ************************* */
/*         Variables         */
/* ************************* */

:root {
    --clr-primary-300: hsl(7, 99%, 70%);
    --clr-primary-400: hsl(51, 100%, 49%);
    --clr-primary-500: hsl(168, 34%, 41%);
    --clr-primary-550: hsl(167, 44%, 70%);
    --clr-primary-600: hsl(167, 40%, 24%);
    --clr-primary-700: hsl(198, 62%, 26%);

    --clr-neutral-000: hsl(0, 0%, 100%);
    --clr-neutral-100: hsl(210, 4%, 67%);
    --clr-neutral-200: hsl(232, 10%, 55%);
    --clr-neutral-400: hsl(213, 9%, 39%);
    --clr-neutral-900: hsl(212, 27%, 19%);

    --ff-1: 'Barlow', sans-serif;
    --ff-2: 'Fraunces', serif;

    --base-size: 18px;

    /* 3:4 <-> 1.125*/
    --scale-90: calc(var(--base-size)*0.624);
    --scale-100: calc(var(--base-size)*0.702);
    --scale-200: calc(var(--base-size)*0.79);
    --scale-300: calc(var(--base-size)*0.889);
    --scale-400: var(--base-size);
    --scale-500: calc(var(--base-size)*1.125);
    --scale-600: calc(var(--base-size)*1.266);
    --scale-700: calc(var(--base-size)*1.424);
    --scale-800: calc(var(--base-size)*1.602);
    --scale-900: calc(var(--base-size)*1.802);
    --scale-1000: calc(var(--base-size)*2.027);
    --scale-1100: calc(var(--base-size)*2.281);
    --scale-1200: calc(var(--base-size)*2.566);
    --scale-1300: calc(var(--base-size)*2.887);
    --scale-1400: calc(var(--base-size)*3.247);
    --scale-1500: calc(var(--base-size)*3.653);
    --scale-1600: calc(var(--base-size)*4.11);

    /* font size */
    --fs-90: var(--scale-90);
    --fs-100: var(--scale-100);
    --fs-200: var(--scale-200);
    --fs-300: var(--scale-300);
    --fs-400: var(--scale-400);
    --fs-500: var(--scale-500);
    --fs-600: var(--scale-600);
    --fs-700: var(--scale-700);
    --fs-800: var(--scale-800);
    --fs-900: var(--scale-900);
    --fs-1000: var(--scale-1000);
    --fs-1100: var(--scale-1100);
    --fs-1200: var(--scale-1200);
    --fs-1300: var(--scale-1300);
    --fs-1400: var(--scale-1400);
    --fs-1500: var(--scale-1500);
    --fs-1600: var(--scale-1600);

    /* font weight */
    --fw-600: 600;
    --fw-700: 700;
    --fw-900: 900;

    /* --br-sm: 36em; */
    /* --br-md: 48em; */
    /* --br-lg: 62em; */
}

/* ************************* */
/*        Composition        */
/* ************************* */

section {
    position: relative;
}

header {
    background: url(images/mobile/image-header.jpg) no-repeat;
    background-size: cover;
    background-position: bottom;
    height: 100vh;
    padding: 2rem 1rem;
}

@media (min-width: 48rem) {
    header {
        background: url(images/desktop/image-header.jpg) no-repeat;
        background-size: cover;

        background-position: top center;

        padding: 2rem;
    }
}

h1 {
    position: absolute;
    top: 10rem;

    letter-spacing: 3px;
    text-align: center;
    width: 100%;
}

@media (min-width: 48rem) {
    h1 {
        letter-spacing: 15px;
    }
}

h2 {
    line-height: 1;
}

button {
    border: none;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

footer {
    color: var(--clr-primary-500);
    background: var(--clr-primary-550);

    padding: 4rem 2rem;

    display: grid;
    gap: 2rem;
    align-items: center;
}

/* ************************* */
/*         Utilities         */
/* ************************* */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.ff-1 {
    font-family: var(--ff-1);
}

.ff-2 {
    font-family: var(--ff-2);
}

.fs-x-sm {
    font-size: var(--fs-100);
}

.fs-sm {
    font-size: var(--fs-300);
}

.fs-m {
    font-size: var(--fs-400);
}

.fs-l {
    font-size: var(--fs-800);
}

.fs-x-l {
    font-size: var(--fs-1000);
}

.fs-xx-l {
    font-size: var(--fs-1200);
}

@media (min-width: 48rem) {
    .fs-xx-l {
        font-size: var(--fs-1300);
    }
}

.fw-normal {
    font-weight: var(--fw-600);
}

.fw-bold {
    font-weight: var(--fw-700);
}

.fw-bolder {
    font-weight: var(--fw-900);
}

.clr-p-300 {
    color: var(--clr-primary-300);
}

.clr-p-400 {
    color: var(--clr-primary-400);
}

.clr-p-500 {
    color: var(--clr-primary-500);
}

.clr-p-600 {
    color: var(--clr-primary-600);
}

.clr-p-700 {
    color: var(--clr-primary-700);
}

.clr-n-000 {
    color: var(--clr-neutral-000);
}

.clr-n-100 {
    color: var(--clr-neutral-100);
}

.clr-n-200 {
    color: var(--clr-neutral-200);
}

.clr-n-400 {
    color: var(--clr-neutral-400);
}

.clr-n-900 {
    color: var(--clr-neutral-900);
}

.bg-clr-p-400 {
    background: var(--clr-primary-400);
}

.red-underline::before {
    background: var(--clr-primary-300);
}

.yellow-underline::before {
    background: var(--clr-primary-400);
}

.uppercase {
    text-transform: uppercase;
}

/* ************************* */
/*          Blocks           */
/* ************************* */

.header-content {
    display: flex;
    justify-content: space-between;

}

@media (min-width: 48rem) {
    .header-content {
        align-items: center;
    }
}

.header-nav-btn {
    display: grid;
    place-content: center;

    background: transparent;
    color: var(--clr-neutral-000);

    transition: color 300ms ease-out;
}

.header-nav-btn[aria-expanded="true"] {
    position: fixed;
    top: 2rem;
    right: 1rem;
    z-index: 1000;

    color: var(--clr-neutral-900);
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .header-nav-btn {
        cursor: pointer;
    }
}

.header-nav-list {
    display: grid;
    gap: 2rem;
    align-items: center;

    position: fixed;
    left: 1rem;
    right: 1rem;
    z-index: 1000;

    margin-top: 4rem;
    padding: 3rem 2rem;
    text-align: center;

    background: var(--clr-neutral-000);
    filter: drop-shadow(0 0 15px var(--clr-neutral-900));
    opacity: 1;

    transition: all 300ms ease-out;
}

.header-nav-list[data-visible="false"] {
    opacity: 0;
    z-index: -1;

    margin-top: 6rem;
}

@media (min-width: 48rem) {
    .header-nav-list {
        display: flex;

        margin: 0;
        padding: 0;

        position: static;

        background: transparent;
        filter: none;
        box-shadow: none;
    }
}

.header-nav-list::after {
    content: '';

    width: 0;
    height: 0;
    border-bottom: 30px solid var(--clr-neutral-000);
    border-left: 30px solid transparent;

    position: absolute;
    top: -30px;
    right: 0;
}

.header-nav-list a {
    color: var(--clr-neutral-200);
    font-size: var(--fs-800);
}

@media (min-width: 48rem) {
    .header-nav-list a {
        color: var(--clr-neutral-000);
        font-size: var(--fs-400);
    }
}

.header-nav-list>:nth-child(4) {
    justify-self: center;

    background: var(--clr-primary-400);
    border-radius: 3rem;
}

@media (min-width: 48rem) {
    .header-nav-list>:nth-child(4) {
        background: var(--clr-neutral-000);
    }
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .header-nav-list>:nth-child(4):hover {
        background: hsl(0, 0%, 100%, 0.3);
    }
}

.header-nav-list>:nth-child(4) a {
    display: block;

    padding: 1rem 2rem;

    color: var(--clr-neutral-900);

    transition: color 200ms ease-out;
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .header-nav-list>:nth-child(4) a:hover {
        color: var(--clr-neutral-000);
    }
}

.icon-arrow-down {
    width: 40px;
    height: 140px;
    position: absolute;
    top: 55%;
    /* 20px is halfwidth of arrow down icon*/
    left: calc(50% - 20px);

    animation: slidein 500ms 1s 6 alternate;

    z-index: 100;
}

@keyframes slidein {
    0% {
        top: 55%
    }

    100% {
        top: 60%
    }
}

@media (min-width: 48rem) {
    .icon-arrow-down {
        width: 30px;
        height: 120px;
        top: 50%;
        /* 20px is halfwidth of arrow down icon*/
        left: calc(50% - 15px);

        animation: slidein2 500ms 1s 6 alternate;
    }

    @keyframes slidein2 {
        0% {
            top: 50%
        }

        100% {
            top: 55%
        }
    }
}

.main-content {
    display: grid;

    /* max-width: 80em; */
    margin-inline: auto;
}

.main-content img {
    height: 100%;
    width: 100%;
}

@media (min-width: 48rem) {
    .main-content {
        max-width: 30em;
    }
}

@media (min-width: 62rem) {
    .main-content {
        grid-template-columns: repeat(2, 1fr);
        max-width: 80em;
    }

    .main-content>:nth-child(1) {
        grid-column: span 2;
        grid-row: 1;

        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content>:nth-child(1)>:nth-child(1) {
        grid-column: 2;
        grid-row: 1;
    }

    .main-content>:nth-child(2) {
        grid-column: span 2;
        grid-row: 2;

        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

.main-content>:nth-child(3)>.section-content,
.main-content>:nth-child(4)>.section-content {
    position: absolute;
    bottom: 0px;

    justify-items: center;
    text-align: center;
}

@media (min-width: 48rem) {

    .main-content>:nth-child(3)>.section-content,
    .main-content>:nth-child(4)>.section-content {
        padding: 1rem;
    }
}

@media (min-width: 62rem) {

    .main-content>:nth-child(3)>.section-content,
    .main-content>:nth-child(4)>.section-content {
        padding: 0 7rem 2rem;
    }
}

.section-content {
    padding: 3rem 1.5rem;

    text-align: center;

    display: grid;
    justify-items: center;
    gap: 2rem;
}

@media (min-width: 48rem) {
    .section-content {
        text-align: left;

        justify-items: flex-start;
        align-content: center;

        padding: 5rem;
    }
}

.section-link {
    display: inline-block;
    padding: 0px 5px;
    position: relative;

    isolation: isolate;
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .section-link:hover::before {
        opacity: 1.0;
    }
}

.section-link::before {
    content: "";

    opacity: 0.5;

    display: block;

    position: absolute;
    bottom: 1px;
    left: 0%;

    z-index: -1;

    width: 100%;
    height: 8px;
    border-radius: 1rem;

    transition: opacity 100ms ease-out;
}

.client-testimonials {
    text-align: center;

    padding: 3rem 1.5rem;
    display: grid;
    gap: 4rem;

    max-width: 70em;
    margin-inline: auto;
}

@media (min-width: 48em) {
    .client-testimonials {
        padding: 8rem 1.5rem;
    }
}

.client-testimonials h2 {
    letter-spacing: 4px;
}

.client-testimonials-list {
    display: grid;
    gap: 4rem;
}

@media (min-width: 48em) {
    .client-testimonials-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.client-testimonials-list-element {
    display: grid;
    justify-items: center;
    gap: 2rem;
}

.client-testimonials-list-element div>*+* {
    margin-top: 0.5rem;
}

.client-testimonials-list-element img {
    border-radius: 50%;
    width: 80px;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 48em) {
    .image-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-nav-list {
    display: flex;
    justify-content: space-between;
}

@media (min-width: 48em) {
    .footer-nav-list {
        justify-content: center;
        gap: 4rem;
    }
}

.footer-nav-list li a {
    transition: color 200ms ease-out;
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .footer-nav-list li a:hover {
        color: var(--clr-neutral-000);
    }
}

.social-links-list {
    display: flex;
    justify-content: center;
    gap: 2.5rem;

    padding-block: 3rem;
}

.social-links-list li a {
    color: var(--clr-primary-600);

    transition: color 200ms ease-out;
}

/* Primary Input is a fine pointer device such as a mouse or stylus */
@media (pointer:fine) {
    .social-links-list li a:hover {
        color: var(--clr-neutral-000);
    }
}

.footer-logo {
    justify-self: center;

    color: var(--clr-primary-600);

    width: 60%;
}

@media (min-width: 48em) {
    .footer-logo {
        width: 15%;
    }
}

.attribution {
    text-align: center;
}

.attribution a {
    text-decoration: underline;
}

/* ************************* */
/*        Exceptions         */
/* ************************* */



.header-nav-btn[data-visible="false"],
.icon-arrow-down[data-visible="false"] {
    display: none;
}