/* ===== Testimonials: three in a row at every desktop width ===== */

.s-6 {
    height: auto;
    padding-bottom: 80px;
}

.kkkkkkk {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 30px;
    padding: 0 5%;
}

.card-00 {
    flex: 0 1 380px;
    min-width: 0;
    height: auto;
    min-height: 339px;
    padding: 17px 20px;
}

/* ===== Tablet and mobile ===== */

@media (max-width: 1024px) {

    /* Heroes */
    .section1,
    .section1-0 {
        height: 100vh;
        height: 100svh;
        min-height: 600px;
        background-attachment: scroll;
    }

    .section1 { background-position: 72% center; }
    .section1-0 { background-position: 84% center; }

    .text p { margin: 16px 0 20px; }

    .text,
    .text-0 {
        left: 50%;
        width: 90%;
        text-align: center;
    }

    .text h1,
    .text h2,
    .text-0 h1,
    .text-0 h2 {
        width: auto;
        font-size: clamp(30px, 9.5vw, 64px);
        line-height: 125%;
        letter-spacing: 1px;
    }

    .text .button { margin: 0 auto; }

    .text-0 p br { display: none; }
    .text-0 p { max-width: 520px; }

    /* Product cards */
    .sec-2,
    .sec-2-0 {
        height: auto;
        padding: 50px 20px;
        margin-bottom: 40px;
    }

    .sec-2-imgs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        max-width: 660px;
        margin: 20px auto 0;
    }

    .sec-2-container {
        max-width: 660px;
        margin: 0 auto;
    }

    .img-container {
        width: 100%;
        height: auto;
        aspect-ratio: 315 / 451;
    }

    .new,
    .new-0 { width: 100%; }

    .img-container .button { white-space: nowrap; }

    .im {
        height: calc(100% - 130px);
    }

    .i {
        width: 100%;
        left: 0;
    }

    /* Our story: scales with the screen width, like its background shapes */
    .sec-3 {
        height: 141vw;
        margin-bottom: 8vw;
    }

    .story {
        top: -9vw;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        transform: none;
        font-size: 2.4vw;
    }

    .story p {
        width: auto;
        font-size: max(9px, 2.3vw);
        line-height: 160%;
        letter-spacing: 0.02em;
        margin-bottom: 2.5vw;
    }

    .cup-2 {
        width: 112%;
        left: 48%;
        top: 50vw;
        bottom: auto;
    }

    /* Beyond the bean */
    .sec-4 {
        height: auto;
        padding: 80px 20px 60px;
    }

    .cof {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .card { max-width: 900px; }

    .p > div { min-width: 0; }

    .p br,
    .card-00 p br { display: none; }

    /* A little something */
    .s-0 {
        height: 100vw;
        min-height: 420px;
        padding: 12vw 20px 0;
        margin-bottom: 0;
    }

    .s-0 h2 { font-size: clamp(8px, 1.8vw, 14px); }

    .s-0 h3 {
        width: 55%;
        font-size: clamp(20px, 6.2vw, 48px);
    }

    .img-1 {
        width: 66%;
        height: auto;
        left: 0;
        bottom: 0;
    }

    .img-2 {
        width: 48%;
        height: auto;
        top: 6vw;
    }

    .img-3 {
        width: 45%;
        height: auto;
        top: -10vw;
    }

    .s-0 h5 {
        right: 20px;
        bottom: 5vw;
        font-size: clamp(9px, 2.4vw, 20px);
        letter-spacing: 0.1em;
    }

    /* Community photos */
    .s-5 {
        height: auto;
        padding: 70px 20px;
        margin-bottom: 60px;
        position: relative;
        z-index: 2;
    }

    /* Testimonials */
    .s-6 {
        height: auto;
        padding: 0 20px 20px;
    }

    .s-6 .pp { width: auto; }

    .kkkkkkk {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-top: 30px;
        padding: 0;
    }

    .card-00 {
        flex: none;
        align-self: auto;
        width: 100%;
        max-width: 420px;
    }

    .ddd {
        max-width: 60%;
        height: auto;
        top: -100px;
    }

    /* Footer */
    .footer {
        height: auto;
        padding: 60px 20px 110px;
    }
}

/* Tablet only */
@media (min-width: 501px) and (max-width: 1024px) {

    .ppppp {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
        max-width: 760px;
    }

    .uuuu,
    .right-column,
    .bottom-cards { display: contents; }

    .ppppp .card-3 {
        margin: 0;
        aspect-ratio: 4 / 5;
    }

    .ppppp .card-3 > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Mobile only */
@media (max-width: 500px) {

    .sec-2-0 h2 {
        max-width: 7em;
    }

    .sec-2-container > :first-child { min-width: 0; }

    .card { grid-template-columns: minmax(0, 1fr); }

    /* order shown in the reference */
    .card .p:nth-child(2) { order: 1; }
    .card .p:nth-child(4) { order: 2; }

    .sec-2 p br { display: none; }

    .show-more h3,
    .show-more-0 h3 { white-space: nowrap; }

    .footer .div {
        flex-wrap: nowrap;
        width: 100%;
    }

    .footer .div hr { flex: 0 1 60px; }

    .footer .div p { white-space: nowrap; }

    /* footer links stacked */
    .footer .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
}

/* ===== Small tablets and large phones ===== */

@media (max-width: 700px) {

    .card { grid-template-columns: minmax(0, 1fr); }

    .sec-2 p br { display: none; }
}

/* ===== Phones and tablets: readability and spacing ===== */

@media (max-width: 1024px) {

    /* soft shade so hero text stays readable over the photo */
    .section1,
    .section1-0 {
        min-height: 460px;
    }

    .section1::before,
    .section1-0::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.25);
    }

    .text-0 { z-index: 2; }

    /* room for the story text above the curved lettering */
    .sec-2 {
        margin-bottom: 20vw;
        padding-bottom: 20px;
    }

    .story { top: -24vw; }

    .story p { font-size: clamp(9px, 2.2vw, 18px); }

    .sec-3 { margin-bottom: 14vw; }
}

@media (max-width: 380px) {

    .new h4,
    .new-0 h4 {
        font-size: 11px;
        line-height: 130%;
    }

    .img-container .new h3,
    .img-container .new h5,
    .img-container .new h6 {
        height: auto;
        padding: 2px 8px;
    }
}

/* ===== Desktop and laptop ===== */

@media (min-width: 1025px) {

    .text {
        left: max(24px, 2vw);
        transform: translateY(-50%);
    }

    .text-0 { width: 90%; }

    /* always four product cards in one row */
    .sec-2-imgs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        max-width: 1320px;
        margin-inline: auto;
    }

    .sec-2-container {
        max-width: 1320px;
        margin-inline: auto;
    }

    .img-container {
        width: 100%;
        height: auto;
        aspect-ratio: 315 / 451;
    }

    .new,
    .new-0 { width: 100%; }

    .sec-2-0,
    .s-5 { height: auto; }

    .sec-2 { height: auto; min-height: min(990px, 69vw); }
}

/* Laptops: scale the artwork sections with the screen */
@media (min-width: 1025px) and (max-width: 1439px) {

    .sec-3 { height: 104vw; }

    .story {
        right: auto;
        left: 57%;
        transform: translateX(-50%);
        width: 46vw;
        height: auto;
        font-size: 1.85vw;
    }

    .story p { font-size: 1.85vw; }

    .cup-2 { width: 69vw; }

    .p br { display: none; }

    .s-0 {
        height: 54vw;
        padding-top: 13vw;
    }

    .s-0 h3 { font-size: 3.3vw; }

    .img-1 { width: 52%; height: auto; }

    .img-2 { width: 46%; height: auto; }

    .img-3 { width: 36%; height: auto; top: -18vw; }

    .s-0 h5 {
        right: 8vw;
        bottom: 6vw;
        font-size: 2vw;
    }
}

/* ===== Final adjustments ===== */

.show-more h3,
.show-more-0 h3 { white-space: nowrap; }

@media (max-width: 1024px) {
    .sec-2 { margin-bottom: calc(24vw + 10px); }
}

@media (max-width: 380px) {
    .img-container .new h4,
    .img-container .new-0 h4 {
        font-size: 10px;
        padding: 0 6px;
    }
}

@media (min-width: 1025px) and (max-width: 1439px) {
    .card-00 p br { display: none; }
}

/* ===== Buttons ===== */

.button {
    box-sizing: border-box;
    max-width: 100%;
    white-space: nowrap;
    line-height: 1;
}

/* inside product cards: always keep a margin from the card edges */
.img-container a.button {
    width: calc(100% - 24px);
    max-width: 200px;
}

@media (max-width: 1024px) {

    a.button {
        width: 180px;
        height: 44px;
        padding: 0 16px;
        font-size: 13px;
        border-radius: 25px;
    }

    .img-container a.button {
        width: calc(100% - 20px);
        max-width: 180px;
        height: 44px;
        padding: 0 8px;
        font-size: 12px;
    }

    /* comfortable touch targets */
    .footer .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        margin-block: 0;
    }

    .show-more,
    .show-more-0 {
        min-height: 44px;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .img-container a.button {
        width: calc(100% - 14px);
        font-size: 11px;
        padding: 0 4px;
    }
}

@media (max-width: 500px) {
    .sec-2 { margin-bottom: calc(27vw + 24px); }
    .story { top: calc(-26vw - 20px); }
}

/* very narrow phones */
@media (max-width: 380px) {
    .story a.button { width: 150px; }

    .img-container .new,
    .img-container .new-0 {
        top: 2px;
        gap: 1px;
        height: auto;
    }
}

/* tablets: keep the swaying cup clear of the next heading */
@media (min-width: 701px) and (max-width: 1024px) {
    .cup-2 {
        width: 100%;
        top: 52vw;
    }

    .sec-3 { margin-bottom: 20vw; }
}

@media (min-width: 701px) and (max-width: 1024px) {
    .card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card .p { gap: 14px; padding: 18px 16px; }
    .card .p > img { width: 56px; height: auto; flex-shrink: 0; }
}
