.home-hero {
    padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.home-services { padding-bottom: clamp(3rem, 7vw, 7rem); }
.home-bento { padding-block: clamp(3rem, 7vw, 7rem); }

.home-hero__frame {
    height: clamp(22rem, 58vw, 49.5rem);
    border-radius: clamp(1.5rem, 3vw, 2.5rem);
}

.home-hero__visual {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.home-about {
    padding-bottom: clamp(3rem, 7vw, 6rem);
}

.home-about__layout {
    display: grid;
    gap: clamp(1.75rem, 4vw, 3rem);
}

.home-about__copy {
    min-width: 0;
    text-align: center;
}

.home-about__badge {
    max-width: 100%;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.home-about__title {
    max-width: 14ch;
    margin-inline: auto;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.1;
}

.home-about__description {
    max-width: 48ch;
    margin: 1.5rem auto 0;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.65;
}

.home-about__visuals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 3vw, 2rem);
}

.home-about__rail {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1.5rem;
}

.home-about__rail > :first-child {
    display: block;
    width: 100%;
    height: clamp(10rem, 22vw, 22rem);
    border-radius: 1.5rem;
    object-fit: cover;
}

.home-about__rail > img:last-child {
    display: none;
    width: 72%;
    height: clamp(7rem, 14vw, 12rem);
    border-radius: 1.25rem;
    object-fit: cover;
}

.home-about__rail--right { align-items: flex-end; }
.home-approach__surface { padding-block: clamp(2.5rem, 6vw, 6rem); }

.home-approach__grid,
.home-medical__grid,
.home-posts__grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3.75rem);
}

.home-approach__media > img {
    height: clamp(22rem, 42vw, 36rem);
}

.home-approach__title {
    max-width: 100%;
    white-space: normal;
    font-size: clamp(2rem, 4vw, 3.75rem);
    overflow-wrap: break-word;
}

.home-approach__overlay { gap: 1rem; }
.home-approach__overlay h3 { font-size: clamp(1.125rem, 2vw, 1.75rem); }
.home-medical { padding-block: clamp(3rem, 7vw, 7rem); }
.home-medical h2 { font-size: clamp(1.875rem, 3.5vw, 2.875rem); }
.home-medical__conditions { grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }

.home-medical__media > img {
    height: auto;
    aspect-ratio: 5 / 4;
}

.home-medical__support {
    inset-inline-start: 1rem;
    bottom: 1rem;
    width: min(21rem, calc(100% - 2rem));
    padding: clamp(1rem, 2.5vw, 1.75rem);
}

.home-medical__support h3 { font-size: clamp(1.125rem, 2.5vw, 1.75rem); line-height: 1.25; }
.home-posts__row { align-items: stretch; }
.home-posts__small-image { width: 100%; height: auto; aspect-ratio: 4 / 3; }

@media (min-width: 480px) {
    .home-medical__conditions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
    .home-hero__visual > img { object-position: 65% center; }
    .home-posts__row { flex-direction: column; }
}

@media (min-width: 640px) {
    .home-about__rail > img:last-child { display: block; }
    .home-posts__row { flex-direction: row; align-items: center; gap: 1.25rem; }
    .home-posts__small-image { width: clamp(6rem, 12vw, 9.5rem); height: 7rem; }
}

@media (min-width: 1024px) {
    .home-approach__grid,
    .home-medical__grid,
    .home-posts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1440px) {
    .home-about__layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr);
        align-items: center;
        gap: 2rem;
    }

    .home-about__copy { grid-column: 2; grid-row: 1; }
    .home-about__visuals { display: contents; }
    .home-about__rail--left { grid-column: 1; grid-row: 1; }
    .home-about__rail--right { grid-column: 3; grid-row: 1; padding-top: 2rem; }
}

.hero-service-wheel {
    --hero-wheel-radius: 320px;
    --hero-pill-width: 56px;
    --hero-pill-height: 210px;
    --hero-wheel-offset: 7.5rem;
    /* Keep the animated box itself visible to WebKit; a zero-size pivot below the image can be culled. */
    --hero-wheel-size: calc(var(--hero-wheel-radius) * 2 + var(--hero-pill-height) + var(--hero-pill-width));
    position: absolute;
    left: 50%;
    bottom: calc(-1 * var(--hero-wheel-offset) - var(--hero-wheel-size) / 2);
    width: var(--hero-wheel-size);
    height: var(--hero-wheel-size);
    margin-left: calc(var(--hero-wheel-size) / -2);
    z-index: 20;
    pointer-events: none;
    transform-origin: 50% 50%;
    animation: hero-service-spin 60s linear infinite;
    will-change: transform;
}

@keyframes hero-service-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-service-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--hero-pill-width);
    height: var(--hero-pill-height);
    transform: translate(-50%, -50%) rotate(var(--service-angle)) translateY(calc(-1 * var(--hero-wheel-radius)));
}

@media (hover: hover) and (pointer: fine) {
    .hero-service-wheel:hover,
    .hero-service-wheel:focus-within {
        animation-play-state: paused;
    }
}

@supports selector(:has(:focus-visible)) {
    .hero-service-wheel:has(:focus-visible) {
        animation-play-state: paused;
    }
}

.hero-service-pill {
    display: grid;
    grid-template-rows: 40px minmax(0, 1fr);
    justify-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: 7px;
    border-radius: 999px;
    overflow: hidden;
    pointer-events: auto;
    color: #fff;
    background: rgb(74 45 30 / 90%);
    border: 1px solid rgb(255 255 255 / 55%);
}

.hero-service-pill:hover,
.hero-service-pill:focus-visible {
    background: #4a2d1e;
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.hero-service-pill__avatar {
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
}

.hero-service-pill__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-service-pill__title {
    display: block;
    min-height: 0;
    max-height: 100%;
    height: 100%;
    max-width: 1.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

#service .service-card {
    scroll-margin-top: 8rem;
}

#service .service-card:target {
    outline: 2px solid var(--color-primary-1);
    outline-offset: 4px;
}

.care-bento-heading {
    width: 100%;
    max-width: 52rem;
}

.care-bento {
    display: grid;
    grid-template-areas:
        "results"
        "analysis"
        "experience"
        "tailored"
        "technology";
    gap: 1.25rem;
}

.care-bento > div {
    min-width: 0;
}

.care-bento__results {
    grid-area: results;
    min-height: 440px;
}

.care-bento__analysis {
    grid-area: analysis;
    padding: 1.75rem;
}

.care-bento__experience {
    grid-area: experience;
    min-height: 280px;
}

.care-bento__hand-left {
    bottom: 3rem;
    width: 48%;
}

.care-bento__hand-right {
    bottom: -0.5rem;
    width: 58%;
}

.care-bento__tailored {
    grid-area: tailored;
    min-height: 280px;
}

.care-bento__portraits {
    position: absolute;
    inset: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 165px;
    overflow: hidden;
}

.care-bento__portraits > div {
    flex-shrink: 0;
    top: 170px;
}

.care-bento__technology {
    grid-area: technology;
    min-height: 260px;
}

@media (max-width: 767px) {
    .home-hero__frame {
        height: auto;
    }

    .home-hero__visual {
        position: relative;
        inset: auto;
        width: 100%;
        height: clamp(22rem, 58vw, 49.5rem);
        flex-shrink: 0;
    }

    .home-hero__cta {
        max-width: 100%;
        margin-top: 1rem;
        padding: 0 0.5rem;
        border-radius: 0;
        background: transparent;
        transform: none;
        translate: none;
    }

    .home-hero__cta > img {
        display: none;
    }

    .home-hero__cta > a {
        min-height: 2.75rem;
        justify-content: center;
    }

    .home-hero__cta span {
        padding-bottom: 0;
        font-size: 0.8125rem;
    }

    .hero-service-wheel {
        --hero-wheel-radius: 270px;
        --hero-pill-width: 50px;
        --hero-pill-height: 190px;
    }

    .hero-service-pill {
        grid-template-rows: 34px minmax(0, 1fr);
    }

    .hero-service-pill__avatar {
        width: 34px;
        height: 34px;
    }

    .hero-service-pill__title {
        font-size: 12px;
    }
}

@media (min-width: 768px) {
    .care-bento {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-rows: 280px 280px minmax(280px, auto);
        grid-template-areas:
            "results experience"
            "results tailored"
            "analysis technology";
    }

    .care-bento__results {
        min-height: 0;
    }

    .care-bento__experience,
    .care-bento__tailored,
    .care-bento__technology {
        min-height: 0;
    }
}

@media (min-width: 1024px) {
    .hero-service-wheel {
        --hero-wheel-offset: 5rem;
    }

    .care-bento__experience h3 {
        max-width: 22rem;
    }

    .care-bento__hand-left {
        inset-inline-start: auto;
        inset-inline-end: 260px;
        bottom: 3.5rem;
        width: 240px;
    }

    .care-bento__hand-right {
        width: 290px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-service-wheel,
    .care-bento__portraits .animate-revolve,
    .care-bento__portraits .animate-counter-revolve {
        animation: none;
    }
}
