/* Home "DIY Platform and Tools" section (template-parts/home/diy-platform.php). Fonts and --amh-* colours: home-hero.css. */

.amd-section {
    --amd-navy: #01216a;
    --amd-blue: #0381f8;
    --amd-icon: #1677ee;
    --amd-text: #2b416c;
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 4.4vw, 84px) 0 clamp(64px, 5vw, 96px);
    background:
        radial-gradient(45% 70% at 62% 78%, rgba(206, 228, 251, .8), rgba(206, 228, 251, 0) 70%),
        radial-gradient(35% 60% at 100% 40%, rgba(214, 232, 252, .8), rgba(214, 232, 252, 0) 70%),
        linear-gradient(180deg, #f6fafe 0%, #edf5fd 100%);
    color: var(--amd-text);
}

.amd-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    align-items: center;
    width: min(100% - 64px, 1510px);
    margin-inline: auto;
}

/* Texts and features */
.amd-copy {
    position: relative;
    z-index: 1;
}

.amd-eyebrow {
    margin: 0 0 clamp(8px, .7vw, 12px);
    color: var(--amd-blue);
    font-size: clamp(14px, 1.05vw, 19px);
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.amd-title {
    margin: 0;
    padding: 0;
    color: var(--amd-navy);
    font-family: inherit;
    font-size: clamp(30px, 2.4vw, 48px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.amd-description {
    max-width: 600px;
    margin: clamp(14px, 1vw, 18px) 0 0;
    color: var(--amd-text);
    font-size: clamp(16px, 1.02vw, 20px);
    line-height: 1.45;
}

.amd-features {
    display: grid;
    gap: clamp(16px, 1.4vw, 26px);
    margin: clamp(26px, 1.9vw, 36px) 0 0;
    padding: 0;
    list-style: none;
}

.amd-feature {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(16px, 2.3vw, 44px);
    margin: 0;
    padding: 0;
}

.amd-feature-icon {
    display: grid;
    width: clamp(50px, 3.3vw, 62px);
    height: clamp(50px, 3.3vw, 62px);
    place-items: center;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(1, 33, 106, .08);
    color: var(--amd-icon);
}

.amd-feature-icon svg {
    width: 58%;
    height: 58%;
}

.amd-feature-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.amd-feature-title {
    color: var(--amd-navy);
    font-size: clamp(17px, 1.15vw, 22px);
    font-weight: 800;
    line-height: 1.25;
}

.amd-feature-text {
    color: var(--amd-text);
    font-size: clamp(15px, .98vw, 19px);
    line-height: 1.35;
}

/* Laptop: the base spans the whole visual, starting under the end of the texts as in the design. */
.amd-visual {
    position: relative;
    min-width: 0;
}

.amd-carousel {
    width: 111%;
    margin-left: -11%;
}

.amd-laptop {
    filter: drop-shadow(0 28px 34px rgba(1, 33, 106, .16));
}

.amd-bezel {
    position: relative;
    width: 81.3%;
    margin: 0 auto;
    padding: 3.1% 2.3% 2.9%;
    border-radius: clamp(12px, 1.3vw, 24px) clamp(12px, 1.3vw, 24px) 0 0;
    background: #101318;
    box-shadow: inset 0 0 0 1.5px #3b4049, inset 0 0 0 4px #0b0d11;
}

/* Camera */
.amd-bezel::before {
    position: absolute;
    top: 1.4%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #262a32;
    content: '';
    transform: translateX(-50%);
}

.amd-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: 825 / 503;
    border-radius: 2px;
    background: #022a5c;
}

.amd-slides {
    display: flex;
    height: 100%;
    transition: transform .8s cubic-bezier(.65, 0, .35, 1);
}

.amd-slide {
    flex: 0 0 100%;
    height: 100%;
}

.amd-screen-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
}

.amd-base {
    position: relative;
    height: 0;
    padding-top: 2.4%;
    border-radius: 2px 2px 50% 50% / 2px 2px 100% 100%;
    background: linear-gradient(180deg, #e2e5ea 0%, #c4c9d1 34%, #8e949e 68%, #5d636d 100%);
}

/* Opening notch */
.amd-base::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 13%;
    height: 38%;
    border-radius: 0 0 8px 8px;
    background: #a4aab3;
    content: '';
    transform: translateX(-50%);
}

/* Carousel controls, shown once the script runs. */
.amd-controls {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: clamp(18px, 1.4vw, 26px);
}

.amd-carousel.is-ready .amd-controls {
    display: flex;
}

.amd-toggle,
.amd-dot {
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
}

.amd-toggle {
    display: grid;
    width: 30px;
    height: 30px;
    margin-right: 6px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(1, 33, 106, .12);
    color: var(--amd-navy);
}

.amd-toggle svg {
    width: 14px;
    height: 14px;
}

.amd-icon-play,
.amd-carousel.is-paused .amd-icon-pause {
    display: none;
}

.amd-carousel.is-paused .amd-icon-play {
    display: block;
}

.amd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #b9d0ec;
    transition: background-color .2s ease, transform .2s ease;
}

.amd-dot[aria-current="true"] {
    background: var(--amd-blue);
    transform: scale(1.25);
}

.amd-toggle:focus-visible,
.amd-dot:focus-visible {
    outline: 3px solid var(--amd-blue);
    outline-offset: 3px;
}

/* Handwritten note above the laptop's corner, reaching into the page margin when there is one. */
.amd-note {
    position: absolute;
    z-index: 1;
    top: clamp(-70px, -3.6vw, -30px);
    right: clamp(-110px, calc(779px - 50vw), 0px);
    margin: 0;
    color: #0b2a66;
    font-family: 'Segoe Print', 'Bradley Hand', cursive;
    font-size: clamp(16px, 1.3vw, 25px);
    font-style: italic;
    line-height: 1.38;
    transform: rotate(-12deg);
    transform-origin: right top;
}

.amd-note-arrow {
    position: absolute;
    z-index: 1;
    top: clamp(10px, 2.2vw, 44px);
    right: clamp(-60px, calc(804px - 50vw), 10px);
    width: clamp(48px, 4.4vw, 84px);
    height: auto;
    color: var(--amh-pink);
}

@media (prefers-reduced-motion: reduce) {
    .amd-slides,
    .amd-dot {
        transition: none;
    }
}

/* Without a page margin to sit in, the note goes above the laptop, on one line. */
@media (max-width: 1700px) {
    .amd-note {
        position: static;
        width: max-content;
        max-width: 100%;
        margin: 0 4% clamp(10px, 1vw, 16px) auto;
        transform: rotate(-4deg);
    }

    .amd-note br {
        display: none;
    }

    .amd-note-arrow {
        display: none;
    }
}

/* One column: texts above the laptop. */
@media (max-width: 1180px) {
    .amd-inner {
        grid-template-columns: minmax(0, 1fr);
        row-gap: clamp(36px, 5vw, 56px);
        max-width: 760px;
    }

    .amd-carousel {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 780px) {
    .amd-inner {
        width: min(100% - 36px, 660px);
    }
}

@media (max-width: 520px) {
    .amd-feature {
        gap: 14px;
    }

    .amd-note {
        width: auto;
        margin-right: 0;
        text-align: right;
    }
}

/* Phones: the line breaks typed in the panel would leave a single word on a line ("Everything you / need"); the heading
   wraps on its own, balanced. */
@media (max-width: 520px) {
    .amd-title {
        text-wrap: balance;
    }

    .amd-title br {
        display: none;
    }
}
