.legal-page {
    overflow-x: clip;
    background: var(--cream);
}

.legal-header {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
}

.legal-header-inner {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.legal-home-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    color: var(--purple-800);
    background: var(--purple-50);
    border: 1px solid var(--purple-100);
    border-radius: 999px;
    font-size: 0.79rem;
    font-weight: 800;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.legal-home-link:hover {
    color: var(--white);
    background: var(--purple-800);
    transform: translateY(-2px);
}

.legal-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(76px, 10vw, 132px) 0 clamp(70px, 8vw, 106px);
    background:
        radial-gradient(circle at 88% 20%, rgba(240, 189, 55, 0.16), transparent 25%),
        linear-gradient(rgba(251, 248, 244, 0.91), rgba(251, 248, 244, 0.96)),
        url("../images/lotus-texture-1536.webp") center / cover;
}

.legal-hero-terms {
    background:
        radial-gradient(circle at 10% 12%, rgba(99, 34, 161, 0.12), transparent 25%),
        linear-gradient(rgba(251, 248, 244, 0.91), rgba(251, 248, 244, 0.96)),
        url("../images/lotus-texture-1536.webp") center / cover;
}

.legal-hero-mark {
    position: absolute;
    right: max(-110px, calc((100vw - var(--container)) / 2 - 100px));
    bottom: -175px;
    z-index: -1;
    width: 620px;
    height: 520px;
    background: url("../images/brand-mark.webp") center / contain no-repeat;
    opacity: 0.04;
    pointer-events: none;
}

.legal-hero-inner {
    position: relative;
    z-index: 1;
}

.legal-hero h1 {
    max-width: 820px;
    margin-bottom: 24px;
    font-size: clamp(3.4rem, 8vw, 7.5rem);
}

.legal-hero h1 em {
    display: inline;
}

.legal-hero-inner > p:not(.eyebrow, .legal-effective) {
    max-width: 720px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.legal-effective {
    display: inline-flex;
    gap: 6px;
    margin: 0;
    padding: 8px 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.72rem;
}

.legal-effective strong {
    color: var(--purple-800);
}

.legal-layout {
    max-width: 900px;
    padding-top: clamp(70px, 9vw, 112px);
    padding-bottom: clamp(80px, 10vw, 126px);
}

.legal-document {
    min-width: 0;
}

.legal-document > section {
    position: relative;
    padding: 0 0 48px 58px;
}

.legal-document > section:not(:last-child) {
    margin-bottom: 48px;
    border-bottom: 1px solid var(--line);
}

.legal-section-number {
    position: absolute;
    top: 2px;
    left: 0;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--purple-800);
    background: var(--gold-100);
    border: 1px solid rgba(220, 162, 14, 0.24);
    border-radius: 50% 50% 10% 50%;
    font-family: var(--font-display);
    font-size: 0.7rem;
}

.legal-document h2 {
    margin-bottom: 19px;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.legal-document p,
.legal-document li {
    color: #625668;
    font-size: 0.94rem;
}

.legal-document p {
    margin-bottom: 16px;
}

.legal-document ul {
    display: grid;
    gap: 9px;
    margin: 4px 0 20px;
    padding-left: 22px;
}

.legal-document a {
    color: var(--purple-700);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: rgba(99, 34, 161, 0.32);
    text-underline-offset: 3px;
}

.legal-document a:hover {
    color: var(--gold-600);
}

.legal-contact-card {
    display: grid;
    max-width: 560px;
    gap: 8px;
    margin: 22px 0;
    padding: 22px 24px;
    background: var(--white);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold-400);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.legal-contact-card strong {
    margin-bottom: 3px;
    color: var(--purple-950);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
}

.legal-footer-main {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(140px, 0.55fr) minmax(240px, 0.95fr);
    gap: 70px;
    align-items: start;
    padding-top: 74px;
    padding-bottom: 38px;
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    padding-top: 18px;
    padding-bottom: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.legal-links a {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.legal-links a:hover,
.legal-links a[aria-current="page"] {
    color: var(--gold-400);
}

.legal-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

@media (max-width: 860px) {
    .legal-footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 56px;
    }

    .legal-footer-main .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .legal-header-inner {
        min-height: 68px;
    }

    .legal-header .brand-lockup {
        width: 96px !important;
        height: 60px !important;
    }

    .legal-home-link {
        padding: 8px 12px;
        font-size: 0.72rem;
    }

    .legal-hero {
        padding: 66px 0 60px;
    }

    .legal-hero h1 {
        font-size: clamp(3rem, 15vw, 4.35rem);
    }

    .legal-hero-mark {
        right: -170px;
        bottom: -145px;
        width: 470px;
        height: 390px;
    }

    .legal-layout {
        padding-top: 58px;
        padding-bottom: 76px;
    }

    .legal-document > section {
        padding: 52px 0 38px;
    }

    .legal-document > section:not(:last-child) {
        margin-bottom: 30px;
    }

    .legal-section-number {
        top: 0;
    }

    .legal-document p,
    .legal-document li {
        font-size: 0.9rem;
    }

    .legal-contact-card {
        padding: 19px;
        overflow-wrap: anywhere;
    }

    .legal-footer-main {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-top: 48px;
    }

    .legal-links {
        gap: 9px 18px;
    }

    .legal-footer-bottom {
        padding-bottom: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legal-home-link {
        transition: none;
    }
}
