* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
}

html,
body {
    background-color: #000;
    color: #fff;
    font-size: 18px;
    font-family: "Instrument Sans", sans-serif;
    overflow-x: hidden;
    width: 100%;
}

header {
    width: 90vw;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 50px;
    align-items: center;
    z-index: 3;
    padding-top: 2rem;

    & h1 {
        font-family: "Iceberg", sans-serif;
        font-size: 4rem;
    }

    & .navbar {

        & ul {
            display: grid;
            grid-template-columns: repeat(3, 200px);
            /* PADDING PARA AFASTAR MENU DA DIREITA*/
            padding-right: 4rem;

            & li a {
                color: #fff;
                font-weight: bold;
                transition: 0.3s;
            }

            & li a:hover {
                color: #beff1b;
                font-size: 1.1em;
            }
        }
    }
}

.hero-section {
    background-image: radial-gradient(#7f3d9e, #6d00d9);
    height: 100vh;
    position: relative;

    & .list {
        width: 70vw;
        height: 100%;
        margin: auto;
        position: relative;

        & .item {
            position: absolute;
            inset: 0;

            & .car-image {
                position: absolute;
                top: 50%;
                transform: translateY(-50%);
                width: 70%;

                & img {
                    width: 100%;
                    transform: rotate(-25deg);
                }
            }

            & .content {
                position: absolute;
                right: 70px;
                width: 70%;
                height: 100%;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: end;
                gap: 20px;

                & .car-information {
                    font-weight: bold;
                }

                & h2 {
                    font-family: "Iceberg", sans-serif;
                    font-size: 6rem;
                    line-height: 1em;
                }

                & .description {
                    color: #ececec;
                    font-size: 16px;
                    text-align: right;
                    max-width: 450px;
                }

                & .btn {
                    border-radius: 10px;
                    height: 40px;
                    width: 120px;
                    text-transform: uppercase;
                    border: 2px solid #beff1b;
                    background-color: #beff1b;
                    color: #000;
                    cursor: pointer;
                    font-weight: bold;
                }
            }
        }

        &::before {
            content: '';
            position: absolute;
            height: 200px;
            width: 98%;
            top: 50%;
            border-top: 1px solid #fff;
            transform: translatex(1px);
        }

    }


    & .arrows {
        width: 70vw;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -25px);
        display: flex;
        justify-content: space-between;

        /* ROTACIONA O BOTÃO "SETA" PARA QUE APONTE PARA O OUTRO LADO*/
        & button:nth-child(1) {
            transform: scale(-1);
        }

        & button {
            top: 60%;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            transition: 0.2s ease-in-out;

            & img {
                width: 30px;
                margin-top: 4px;
                cursor: pointer;
            }
        }

        & button:hover {
            transition: 0.2s ease-in-out;
            background-color: #beff1b;
        }
    }
}

& .indicators {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    height: 200px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 15px;

    & .number {
        font-size: 5em;
        font-family: "Iceberg", sans-serif;
    }

    & ul {
        display: flex;
        gap: 10px;

        & li {
            width: 50px;
            height: 10px;
            background-color: #fff;
            transition: 0.5s;
        }

        & .active {
            background-color: #beff1b;
            height: 20px;
        }
    }
}

.hero-section {

    & .list {
        --calculation: 1;

        & .item {
            transform: translateX(calc(100vw * var(--calculation)));
            transition: 0.5s;
            opacity: 0;

            & .car-image {

                & img {
                    transform: rotate(0);
                    transition: 0.5s;
                    transition-delay: 0.4s;
                }

            }

            & .content {

                & .car-information,
                h2,
                .description,
                .btn {
                    transform: translateX(calc(200px) * var(--calculation));
                    opacity: 0;
                    transition: 0.7s;
                    transition-delay: 0.4s;
                }

                & h2 {
                    transition-delay: 0.5s;
                }

                & .description {
                    transition-delay: 0.6s;
                }

                & .btn {
                    transition-delay: 0.7s;
                }
            }
        }

        & .active {
            transform: translateX(0);
            transition: 0.5s;
            opacity: 1;

            & .car-image {

                & img {
                    transform: rotate(-25deg);
                }

            }

            & .content {

                & .car-information,
                h2,
                .description,
                .btn {
                    transform: translateX(0);
                    opacity: 1;
                }
            }
        }
    }
}

/* DIV DE SCROLL INFINITO*/
.infinite-scroll {
    padding: 40px auto;
    height: 230px;
    width: 100%;
    /*border: 5px solid red; /*apenas para saber até onde vai a div*/
    display: flex;
    background-color: #BEFF1B;

    & .infinite-scroll::-webkit-scrollbar {
        display: none;
        /*esconde a barra de rolagem*/
    }

    & .group {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6em;
        animation: spin 5s infinite linear;
        padding-right: 1em;

        & .card img {
            font-family: "Iceberg", sans-serif;
            flex: 0 0 5em;
            width: 3em;
            height: 3em;
            margin-right: 6em;
            /*background: cornflowerblue;*/
            font-size: 4.8rem;
            border-radius: 0.2em;
            text-align: center;
            align-content: center;
            width: 40%;
            height: 40%;
        }
    }
}

@keyframes spin {
    from {
        translate: 0;
    }

    to {
        translate: -100%;
    }
}

/* 2º SEÇÃO - CARROS*/
.cars-section {
    position: relative;
    padding: 3rem;
    background-image: radial-gradient(#7f3d9e, #6d00d9);
    /*border: 5px solid red;*/

    & .porsche {
        /*border: 5px solid blue;*/
        display: flex;
        width: 80%;
        justify-content: left;
        align-items: left;
        padding: 2rem;
        margin: auto;
        margin-bottom: 40px;

    }

    & .ferrari {
        /*border: 5px solid green;*/
        display: flex;
        width: 80%;
        justify-content: end;
        align-items: end;
        padding: 2rem;
        margin: auto;
        margin-bottom: 40px;
    }

    & .lamborghini {
        /*border: 5px solid yellow;*/
        display: flex;
        width: 80%;
        justify-content: left;
        align-items: left;
        padding: 2rem;
        margin: auto;
    }

    & .car-content-ferrari {
        background-color: #beff1b;
        border-radius: 10px;
        padding: 2rem;
        width: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;

        & h3 {
            color: #000;
            font-family: "Iceberg", sans-serif;
            font-size: 2rem;
            margin-top: 1rem;
        }

        & iframe {
            border-radius: 10px;
            width: 500px;
        }

        p {
            text-align: justify;
            color: #000;
            margin-top: 1rem;
            width: 500px;
        }
    }

    & .car-content {
        background-color: #beff1b;
        border-radius: 10px;
        padding: 2rem;
        width: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;

        & h3 {
            color: #000;
            font-family: "Iceberg", sans-serif;
            font-size: 2rem;
            margin-top: 1rem;
        }

        & iframe {
            border-radius: 10px;
            width: 500px;
        }

        p {
            text-align: justify;
            color: #000;
            margin-top: 1rem;
            width: 500px;
        }
    }
}

.cars-section .connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cars-section .porsche,
.cars-section .ferrari,
.cars-section .lamborghini {
    position: relative;
    z-index: 1;
}

/* gatilhos invisíveis */
.cars-section .line-trigger {
    height: 1px;
}

/* paths */
.cars-section .connector {
    fill: none;
    stroke: #beff1b;
    stroke-width: 100;
    stroke-linecap: square;
    stroke-linejoin: round;

    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

/* animação ao disparar */
.cars-section .connector.is-playing {
    animation: drawLine 800ms ease forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/*3º SECTION CONTATOS*/

.contact-section {
    height: 620px;
    background-color: #beff1b;
    padding: 2rem;
    border: none;

    & .contact-content {
        height: 100%;
        display: flex;
        gap: 3rem;
        padding: 2rem;


        & .text {
            width: 40%;
            padding: 2rem;

            & h2 {
                font-size: 4rem;
                color: #000;
                font-family: "Iceberg", sans-serif;
                margin-bottom: 30px;
            }

            & p {
                color: #000;
                font-size: 16px;
                font-weight: 500;
                line-height: 1.5;
                text-align: justify;
                width: 600px;
            }
        }

        & .forms {
            width: 60%;
            height: 100%;
            padding: 2rem;
            background-image: radial-gradient(#7f3d9e, #6d00d9);
            border-radius: 20px;

            & h3 {
                font-family: "Iceberg", sans-serif;
                font-size: 2rem;
                margin-bottom: 0.8rem;
            }

            & form {
                display: grid;
                grid-template-columns: 1;

                & label,
                input,
                textarea {
                    display: block;
                    width: 100%;
                    font-size: 16px;
                }

                & input,
                textarea {
                    font: inherit;
                    font-size: 16px;
                    padding: 0.8rem;
                    margin-bottom: 1rem;
                    border: 1px solid transparent;
                    border-radius: 10px;
                }

                & textarea {
                    height: 100px;
                }

                & button {
                    background-color: #beff1b;
                    border-radius: 10px;
                    border: 1px solid transparent;
                    margin-top: 0.4rem;
                    width: 10%;
                    padding: 10px 10px;
                }
            }
        }
    }
}

/*RESPONSIVIDADE PARA ATÉ 600PX*/

@media screen and (max-width: 600px) {

  /* evita arrasto lateral e ajuda no touch */
  html, body{
    overflow-x: hidden;
  }
  body{
    touch-action: pan-y;
  }

  /* HEADER + MENU */
  header{
    width: 92vw;
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 1.25rem;
    justify-items: center;
    text-align: center;
  }

  header h1{
    font-size: 2.2rem;
    line-height: 1;
  }

  header .navbar ul{
    display: flex;
    gap: 16px;
    padding-right: 0;
    justify-content: center;
    flex-wrap: nowrap;
  }

  header .navbar ul li a{
    font-size: 0.95rem;
  }

  /* HERO SECTION */
  .hero-section{
    position: relative;
    height: 650px;
  }

  .hero-section .list{
    width: 92vw;
    padding-bottom: 110px; /* espaço para controles */
  }

  .hero-section .list::before{
    display: none;
  }

  .hero-section .list .item{
    position: absolute;
    inset: 0;
  }

  .hero-section .list .item .car-image{
    position: relative;
    top: auto;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 110px;
  }

  .hero-section .list .item .car-image img{
    transform: rotate(0);
    width: min(520px, 92%);
    max-width: 100%;
  }

  .hero-section .list .item .content{
    position: relative;
    right: auto;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 16px 10px 0;
  }

  .hero-section .list .item .content h2{
    font-size: 2.8rem;
    line-height: 1.05;
  }

  .hero-section .list .item .content .description{
    text-align: center;
    max-width: 36ch;
  }

  /* CONTROLES DO CARROSSEL: setas laterais, número + dots no meio */
  .hero-section .arrows{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    top: auto;
    width: 92vw;

    display: flex;
    justify-content: space-between;
    align-items: center;

    z-index: 6;
    pointer-events: none;
  }

  .hero-section .arrows button{
    pointer-events: auto;
    width: 44px;
    height: 44px;
  }

  .hero-section .arrows button img{
    width: 26px;
    margin-top: 3px;
  }

  .indicators{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    top: auto;

    width: 92vw;
    height: auto;

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;

    z-index: 7;
    pointer-events: none;
  }

  .indicators .number{
    font-size: 2.8em;
    line-height: 1;
    pointer-events: none;
  }

  .indicators ul{
    display: flex;
    gap: 10px;
    pointer-events: auto;
  }

  .indicators ul li{
    width: 26px;
    height: 8px;
  }

  .indicators ul .active{
    height: 14px;
  }

  /* INFINITE SCROLL (sem SCSS) */
  .infinite-scroll{
    height: 170px;
  }

  .infinite-scroll .group{
    gap: 3em;
  }

  .infinite-scroll .group .card img{
    width: 120px;
    height: 120px;
    margin-right: 1em;
  }

  /* CARS SECTION: centralizado no mobile */
  .cars-section{
    padding: 1.25rem;
    position: relative;
  }

  /* garante que o SVG não trave scroll por toque */
  .cars-section .connectors{
    pointer-events: none;
  }

  .cars-section .porsche,
  .cars-section .ferrari,
  .cars-section .lamborghini{
    width: 100%;
    padding: 0;
    margin: 0 auto 28px;
    justify-content: center;
    align-items: center;
  }

  .cars-section .car-content,
  .cars-section .car-content-ferrari{
    width: 100%;
    max-width: 520px;
    padding: 1.25rem;
    box-sizing: border-box;
  }

  .cars-section .car-content iframe,
  .cars-section .car-content-ferrari iframe{
    width: 100%;
    height: 220px;
    max-width: 100%;
  }

  .cars-section .car-content p,
  .cars-section .car-content-ferrari p{
    width: 100%;
  }

  /* linha do SVG no mobile: não use 30 com square, fica “bruta” e evidencia frestas */
  .cars-section .connector{
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
  }

  /* CONTACT SECTION: texto antes do formulário no mobile */
  .contact-section{
    height: auto;
    padding: 1.25rem;
  }

  .contact-section .contact-content{
    flex-direction: column;
    gap: 18px;
    padding: 0;
  }

  .contact-section .contact-content .text{
    order: 1;
    width: 100%;
    padding: 0;
    text-align: center;
  }

  .contact-section .contact-content .text p{
    width: 100%;
  }

  .contact-section .contact-content .forms{
    order: 2;
    width: 100%;
    padding: 1.25rem;
    box-sizing: border-box;
  }

  .contact-section .contact-content .forms form{
    display: grid;
    gap: 12px;
  }

  .contact-section .contact-content .forms form button{
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }
}