/* ==========================================================================
   MyCarePal - layout
   Header, mobile menu, footer, page sections, grids and the call-to-action band.
   ========================================================================== */

/* Header ------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgb(251 250 247 / 0.86);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
}

@supports (animation-timeline: scroll()) {
    .site-header {
        animation: header-lift linear both;
        animation-timeline: scroll();
        animation-range: 0 120px;
    }
}

@keyframes header-lift {
    from {
        border-bottom-color: transparent;
        box-shadow: none;
    }

    to {
        border-bottom-color: var(--line);
        box-shadow: 0 10px 30px -18px rgb(15 31 61 / 0.25);
    }
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand__mark {
    display: grid;
    place-items: end center;
    width: 2.75rem;
    height: 2.75rem;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--blue-100), var(--peach-100));
    box-shadow: inset 0 0 0 1px rgb(80 139 237 / 0.2);
}

.brand__mark img {
    width: 2.5rem;
    height: 2.5rem;
}

.brand__name span {
    color: var(--blue-700);
}

.brand--light,
.brand--light:hover {
    color: #fff;
}

.brand--light .brand__name span {
    color: var(--blue-300);
}

.site-nav {
    display: none;
}

.site-nav a {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.96875rem;
    font-weight: 550;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
    background: rgb(15 31 61 / 0.05);
    color: var(--ink);
}

.site-nav a[aria-current="page"] {
    background: var(--blue-50);
    color: var(--blue-800);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-inline-start: auto;
}

.header-phone {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding-inline: 0.5rem;
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.header-phone .icon {
    color: var(--blue-600);
}

.header-cta {
    display: none;
}

.menu-toggle,
.menu-close {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.menu-toggle .icon,
.menu-close .icon {
    width: 1.4rem;
    height: 1.4rem;
}

@media (min-width: 520px) {
    .header-cta {
        display: inline-flex;
    }
}

@media (min-width: 960px) {
    .site-nav {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        margin-inline-start: auto;
    }

    .site-header__actions {
        margin-inline-start: 0.5rem;
    }

    .menu-toggle {
        display: none;
    }
}

@media (min-width: 1180px) {
    .header-phone {
        display: inline-flex;
    }
}

/* Mobile menu (uses the Popover API, so it needs no JavaScript) ------------- */

.mobile-menu {
    inset: calc(var(--header-height) - 0.25rem) 0.75rem auto;
    width: auto;
    max-width: 28rem;
    max-height: calc(100dvh - var(--header-height) - 1rem);
    margin: 0 0 0 auto;
    padding: 0.75rem;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.mobile-menu:popover-open {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu::backdrop {
    background: rgb(10 22 48 / 0.35);
}

.mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0.25rem 0.75rem;
}

.mobile-menu__title {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mobile-menu nav {
    display: grid;
    gap: 0.125rem;
}

.mobile-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.75rem;
    border-radius: 12px;
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-menu__link .icon {
    color: var(--muted);
}

.mobile-menu__link:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.mobile-menu__link[aria-current="page"] {
    background: var(--blue-50);
    color: var(--blue-800);
}

.mobile-menu__actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.75rem 0.25rem 0.25rem;
    border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: no-preference) {
    .mobile-menu {
        opacity: 0;
        transform: translateY(-0.5rem) scale(0.98);
        transform-origin: top right;
        transition: opacity 0.2s ease, transform 0.2s ease, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
    }

    .mobile-menu:popover-open {
        opacity: 1;
        transform: none;
    }

    @starting-style {
        .mobile-menu:popover-open {
            opacity: 0;
            transform: translateY(-0.5rem) scale(0.98);
        }
    }
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
    padding-block: 4.5rem 2rem;
    background: var(--navy-950);
    color: #b7c3da;
    font-size: var(--text-sm);
}

.site-footer a {
    color: #dce5f5;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 2.5rem;
}

.site-footer__about {
    grid-column: 1 / -1;
    max-width: 26rem;
}

.site-footer__about p {
    margin: 1.25rem 0;
    line-height: 1.7;
}

.site-footer__heading {
    margin: 0 0 1rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-footer ul {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer .footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-badges li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 999px;
    color: #dce5f5;
    font-size: 0.8125rem;
}

.footer-badges .icon {
    width: 1rem;
    height: 1rem;
    color: var(--blue-300);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-contact .icon {
    color: var(--blue-300);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.1);
    color: #93a2bf;
    font-size: 0.875rem;
}

.site-footer__bottom p {
    margin: 0;
}

@media (min-width: 900px) {
    .site-footer__grid {
        grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
        gap: 3rem;
    }

    .site-footer__about {
        grid-column: auto;
    }
}

/* Sections ------------------------------------------------------------------ */

.section {
    padding-block: var(--section-space);
}

.section--soft {
    background: var(--surface-soft);
}

.section--warm {
    background: var(--surface-warm);
}

.section--white {
    background: var(--surface);
}

.section--navy {
    background:
        radial-gradient(70% 60% at 100% 0%, rgb(80 139 237 / 0.25), transparent 60%),
        radial-gradient(50% 50% at 0% 100%, rgb(238 212 114 / 0.08), transparent 60%),
        var(--navy-900);
    color: #c2cde2;
}

.section--navy h2,
.section--navy h3 {
    color: #fff;
}

.section--navy .eyebrow {
    color: var(--blue-300);
}

.section--navy .lead {
    color: #b3c0d8;
}

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head > :last-child {
    margin-bottom: 0;
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 1.5rem);
}

@media (min-width: 620px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

.split {
    display: grid;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.split__content > :last-child {
    margin-bottom: 0;
}

.split__media {
    position: relative;
    min-width: 0;
}

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

    .split--reverse .split__media {
        order: -1;
    }
}

/* Inner page hero ------------------------------------------------------------ */

.page-hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(45% 90% at 95% 0%, rgb(80 139 237 / 0.16), transparent 70%),
        radial-gradient(35% 70% at 0% 100%, rgb(238 212 114 / 0.2), transparent 70%),
        var(--bg);
}

.page-hero__inner > * {
    max-width: 48rem;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.5rem);
}

.page-hero__lead {
    margin-bottom: 0;
}

.page-hero__inner > .btn-row,
.page-hero__inner > .jump-links {
    margin-top: 2rem;
}

/* Call-to-action band ------------------------------------------------------- */

.cta-band {
    padding-block: var(--section-space);
}

.cta-band__card {
    position: relative;
    display: grid;
    gap: 2rem;
    overflow: hidden;
    padding: clamp(2.25rem, 5vw, 4rem);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(60% 90% at 100% 100%, rgb(238 212 114 / 0.28), transparent 60%),
        radial-gradient(60% 80% at 0% 0%, rgb(106 154 240 / 0.45), transparent 60%),
        linear-gradient(135deg, var(--blue-700), var(--navy-900));
    color: #dbe5f7;
    box-shadow: var(--shadow-lg);
}

.cta-band h2 {
    max-width: 36rem;
    color: #fff;
}

.cta-band__text {
    max-width: 34rem;
    color: #d6e1f5;
    font-size: var(--text-lg);
}

.cta-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.cta-band__art {
    display: none;
}

@media (min-width: 860px) {
    .cta-band__card {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-bottom: 0;
    }

    .cta-band__content {
        padding-bottom: clamp(2.25rem, 5vw, 4rem);
    }

    .cta-band__art {
        position: relative;
        display: grid;
        place-items: end center;
        align-self: stretch;
        width: 16rem;
    }

    .cta-band__art::before {
        content: "";
        position: absolute;
        bottom: -5rem;
        left: 50%;
        width: 16rem;
        height: 16rem;
        border-radius: 50%;
        background: radial-gradient(circle, rgb(255 255 255 / 0.95) 0 58%, rgb(255 255 255 / 0.18) 59% 100%);
        transform: translateX(-50%);
    }

    .cta-band__art img {
        position: relative;
        width: 192px;
        height: 192px;
        margin-bottom: -20px;
    }
}
