:root {
    --legal-deep: #030711;
    --legal-ink: #111722;
    --legal-blue: #2f6bff;
    --legal-navy: #1e55c9;
    --legal-mist: #f2f5fa;
    --legal-line: #dce4ef;
    --legal-muted: #617084;
    --legal-radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

a,
button,
summary {
    outline-offset: 4px;
}

:focus-visible {
    outline: 3px solid #75a1ff;
    outline-offset: 4px;
}

.legal-body {
    min-width: 320px;
    background:
        radial-gradient(circle at 12% 6%, rgba(47, 107, 255, 0.18), transparent 24rem),
        var(--legal-deep);
    color: var(--legal-ink);
    font-family: Manrope, sans-serif;
}

.legal-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    color: var(--legal-deep);
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform 180ms ease;
}

.legal-skip-link:focus {
    transform: translateY(0);
}

.legal-shell {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 34px 24px;
}

.legal-document {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--legal-radius);
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.legal-header {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--legal-line);
    padding: 14px clamp(20px, 4vw, 46px);
}

.legal-brand {
    display: block;
    width: 150px;
    height: 84px;
    overflow: hidden;
    border-radius: 12px;
}

.legal-brand img {
    width: 150px;
    max-width: none;
    height: 150px;
    object-fit: cover;
    transform: translateY(-36px);
}

.legal-close-button {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    background: #f4f6f9;
    color: #273449;
    cursor: pointer;
    transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.legal-close-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.legal-close-button:hover {
    border-color: rgba(47, 107, 255, 0.45);
    background: rgba(47, 107, 255, 0.09);
    color: var(--legal-blue);
    transform: translateY(-1px);
}

.legal-close-button:active {
    transform: translateY(0);
}

.legal-hero {
    padding: clamp(42px, 7vw, 82px) clamp(22px, 7vw, 84px) 40px;
}

.legal-eyebrow,
.legal-section-number {
    margin: 0;
    color: var(--legal-navy);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.legal-hero h1 {
    max-width: 820px;
    margin: 12px 0 0;
    color: #020617;
    font-family: Poppins, sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.legal-intro {
    max-width: 820px;
    margin: 22px 0 0;
    color: var(--legal-muted);
    font-size: clamp(1.02rem, 2vw, 1.16rem);
    line-height: 1.75;
}

.legal-meta {
    display: grid;
    max-width: 820px;
    margin: 34px 0 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--legal-line);
    border-radius: 18px;
    background: #f8fafc;
}

.legal-meta div {
    padding: 18px 20px;
}

.legal-meta div + div {
    border-left: 1px solid var(--legal-line);
}

.legal-meta dt {
    color: #718096;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legal-meta dd {
    margin: 6px 0 0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
}

.legal-layout {
    display: grid;
    align-items: start;
    gap: clamp(32px, 6vw, 76px);
    grid-template-columns: 230px minmax(0, 820px);
    border-top: 1px solid var(--legal-line);
    padding: 48px clamp(22px, 7vw, 84px) 72px;
}

.legal-toc {
    position: sticky;
    top: 24px;
    border: 1px solid var(--legal-line);
    border-radius: 20px;
    padding: 20px;
    background: #f8fafc;
}

.legal-toc > p {
    margin: 0 0 14px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legal-toc ol,
.legal-toc-mobile ol {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 5px;
    list-style: none;
}

.legal-toc a,
.legal-toc-mobile a {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-radius: 10px;
    padding: 8px;
    color: #566477;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease;
}

.legal-toc a span,
.legal-toc-mobile a span {
    color: var(--legal-blue);
    font-size: 11px;
    font-weight: 800;
}

.legal-toc a:hover,
.legal-toc-mobile a:hover {
    background: rgba(47, 107, 255, 0.08);
    color: var(--legal-navy);
}

.legal-toc-mobile {
    display: none;
    margin: 0 22px 34px;
    border: 1px solid var(--legal-line);
    border-radius: 16px;
    padding: 15px 17px;
    background: #f8fafc;
}

.legal-toc-mobile summary {
    cursor: pointer;
    color: #1e293b;
    font-weight: 800;
}

.legal-toc-mobile ol {
    margin-top: 12px;
}

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

.legal-section {
    scroll-margin-top: 100px;
    padding-bottom: 42px;
}

.legal-section + .legal-section {
    border-top: 1px solid var(--legal-line);
    padding-top: 42px;
}

.legal-section h2 {
    max-width: 760px;
    margin: 8px 0 0;
    color: #0f172a;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.legal-section > p:not(.legal-section-number),
.legal-callout p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #4f5e72;
    font-size: 17px;
    line-height: 1.78;
}

.legal-subheading {
    max-width: 760px;
    margin: 30px 0 0;
    color: #172033;
    font-family: Poppins, sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
}

.payment-milestones {
    display: grid;
    max-width: 760px;
    margin-top: 26px;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-milestone {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--legal-line);
    border-radius: 18px;
    padding: 20px;
    background: linear-gradient(160deg, #fff, #f7f9fc);
    box-shadow: 0 12px 28px rgba(3, 7, 17, 0.06);
}

.payment-milestone::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--legal-blue);
    content: "";
}

.payment-milestone-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.payment-milestone-top strong {
    color: var(--legal-navy);
    font-family: Poppins, sans-serif;
    font-size: 1.7rem;
}

.payment-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: rgba(47, 107, 255, 0.1);
    color: var(--legal-blue);
}

.payment-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.payment-label {
    margin: 18px 0 0 !important;
    color: var(--legal-blue) !important;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.4 !important;
    text-transform: uppercase;
}

.payment-milestone h3 {
    margin: 8px 0 0;
    color: #172033;
    font-family: Poppins, sans-serif;
    font-size: 0.98rem;
    line-height: 1.4;
}

.payment-milestone > p:not(.payment-label) {
    margin: 10px 0 0;
    color: #5b687a;
    font-size: 13px;
    line-height: 1.65;
}

.payment-milestone .legal-list {
    margin-top: 14px;
    gap: 8px;
}

.payment-milestone .legal-list li {
    gap: 8px;
    font-size: 12px;
}

.payment-milestone .list-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
}

.payment-milestone .list-icon-bullet::before {
    width: 6px;
    height: 6px;
}

.legal-section a,
.legal-callout a {
    color: var(--legal-navy);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.legal-list {
    display: grid;
    max-width: 760px;
    margin: 22px 0 0;
    padding: 0;
    gap: 12px;
    list-style: none;
}

.legal-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #4f5e72;
    font-size: 16px;
    line-height: 1.65;
}

.list-icon {
    display: inline-flex;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.list-icon-bullet::before {
    width: 8px;
    height: 8px;
    border: 2px solid rgba(47, 107, 255, 0.24);
    border-radius: 3px;
    background: var(--legal-blue);
    content: "";
    transform: rotate(45deg);
}

.list-icon-check {
    border-radius: 50%;
    background: var(--legal-blue);
    box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.09);
}

.list-icon-check svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.legal-callout {
    display: flex;
    max-width: 760px;
    margin-top: 26px;
    gap: 15px;
    border: 1px solid rgba(47, 107, 255, 0.18);
    border-left: 4px solid var(--legal-blue);
    border-radius: 16px;
    padding: 20px;
    background: rgba(47, 107, 255, 0.07);
}

.callout-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--legal-blue);
}

.callout-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.legal-callout h3 {
    margin: 1px 0 0;
    color: #172033;
    font-family: Poppins, sans-serif;
    font-size: 17px;
    font-weight: 650;
}

.legal-callout p {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.65;
}

.legal-table-wrap {
    max-width: 760px;
    margin-top: 24px;
    overflow-x: auto;
    border: 1px solid var(--legal-line);
    border-radius: 16px;
}

.legal-table-wrap table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.55;
}

.legal-table-wrap th,
.legal-table-wrap td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--legal-line);
    text-align: left;
    vertical-align: top;
}

.legal-table-wrap th {
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-table-wrap td {
    color: #566477;
}

.legal-table-wrap tr:last-child td {
    border-bottom: 0;
}

.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-top: 1px solid var(--legal-line);
    padding: 24px clamp(22px, 7vw, 84px);
    background: #f8fafc;
    color: #718096;
    font-size: 13px;
}

.legal-footer p {
    margin: 0;
}

.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 18px;
}

.legal-footer a,
.legal-noscript a {
    color: #526071;
    font-weight: 700;
    text-decoration: none;
}

.legal-footer a:hover {
    color: var(--legal-navy);
}

.legal-noscript {
    margin: 0;
    padding: 0 22px 22px;
    text-align: center;
}

.reveal-item {
    opacity: 1;
    transform: none;
}

.js .reveal-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 540ms ease-out, transform 540ms ease-out;
    transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal-item.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 900px) {
    .legal-layout {
        display: block;
        padding-top: 28px;
    }

    .legal-toc {
        display: none;
    }

    .legal-toc-mobile {
        display: block;
    }
}

@media (max-width: 760px) {
    .payment-milestones {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .legal-shell {
        padding: 14px 12px;
    }

    .legal-document {
        border-radius: 20px;
    }

    .legal-header {
        min-height: 78px;
        padding: 8px 16px;
    }

    .legal-brand {
        width: 125px;
        height: 72px;
    }

    .legal-brand img {
        width: 125px;
        height: 125px;
        transform: translateY(-29px);
    }

    .legal-hero {
        padding: 36px 20px 30px;
    }

    .legal-meta {
        grid-template-columns: 1fr;
    }

    .legal-meta div + div {
        border-top: 1px solid var(--legal-line);
        border-left: 0;
    }

    .legal-layout {
        padding: 30px 20px 50px;
    }

    .legal-toc-mobile {
        margin-inline: 20px;
    }

    .legal-section > p:not(.legal-section-number) {
        font-size: 16px;
    }

    .legal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-footer nav {
        justify-content: flex-start;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .js .reveal-item,
    .reveal-item {
        opacity: 1 !important;
        transform: none !important;
    }
}

:root[data-theme="dark"] {
    --legal-background: var(--theme-bg);
    --legal-surface: var(--theme-surface);
    --legal-text: var(--theme-text);
    --legal-muted: var(--theme-muted);
    --legal-line: var(--theme-border);
}
:root[data-theme="dark"] .legal-document,
:root[data-theme="dark"] .legal-section,
:root[data-theme="dark"] .legal-meta,
:root[data-theme="dark"] .legal-toc-mobile { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
:root[data-theme="dark"] .legal-section p,
:root[data-theme="dark"] .legal-meta dd { color: var(--theme-muted); }
.legal-header .theme-toggle { margin-left: auto; margin-right: .6rem; }
