/* Terms of Service and Privacy Policy: a header, a short summary card, then
   the sections, with a contents list beside them on a wide screen. Plain
   reading text first: one column of at most ~70 characters a line. */

.legal {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 0 40px;
}

/* ---------- header ---------- */
.legal-head {
    max-width: 760px;
    margin-bottom: 28px;
}

.legal-eyebrow {
    color: #4fc3ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.legal-head h1 {
    color: #fff;
    font-size: clamp(2.1rem, 5vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-wrap: balance;
}

.legal-meta {
    margin-top: 12px;
    color: #9fb8c4;
    font-size: 0.9rem;
}

.legal-lead {
    margin-top: 18px;
    color: #c9d6de;
    font-size: 1.1rem;
    line-height: 1.65;
    text-wrap: pretty;
}

/* ---------- the short version ---------- */
.legal-summary {
    background: linear-gradient(145deg, rgba(79, 195, 255, 0.1), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(79, 195, 255, 0.25);
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 44px;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
}

.legal-summary h2 {
    color: #4fc3ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.legal-summary ul {
    list-style: none;
    display: grid;
    gap: 12px;
}

.legal-summary li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #e3ebf0;
    font-size: 1rem;
    line-height: 1.55;
}

.legal-summary li i {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(79, 195, 255, 0.16);
    color: #4fc3ff;
    font-size: 0.7rem;
}

/* ---------- contents + sections ---------- */
.legal-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 32px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-toc__title {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.legal-toc ol {
    list-style: none;
    display: grid;
    gap: 2px;
    counter-reset: toc;
}

.legal-toc li {
    counter-increment: toc;
}

.legal-toc a {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    color: #9fb8c4;
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-toc a::before {
    content: counter(toc);
    min-width: 1.2em;
    color: rgba(79, 195, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

@media (hover: hover) {
    .legal-toc a:hover {
        color: #fff;
    }
}

.legal-body {
    max-width: 760px;
}

.legal-body section {
    padding: 26px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    /* a contents link doesn't put the heading at the very top edge */
    scroll-margin-top: 24px;
}

.legal-body section:first-child {
    border-top: 0;
    padding-top: 0;
}

.legal-body h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
}

.legal-num {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(79, 195, 255, 0.14);
    border: 1px solid rgba(79, 195, 255, 0.35);
    color: #4fc3ff;
    font-size: 0.85rem;
    font-weight: 700;
}

.legal-body h3 {
    color: #e8edf2;
    font-size: 1.02rem;
    font-weight: 700;
    margin: 18px 0 10px;
}

.legal-body p,
.legal-body li {
    color: #c3cfd8;
    font-size: 1.02rem;
    line-height: 1.7;
    text-wrap: pretty;
}

.legal-body p {
    margin-bottom: 14px;
}

.legal-body p:last-child {
    margin-bottom: 0;
}

.legal-body ul {
    margin: 0 0 16px 1.25rem;
}

.legal-body ul:last-child {
    margin-bottom: 0;
}

.legal-body li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.legal-body li::marker {
    color: #4fc3ff;
}

.legal-body strong {
    color: #eef3f6;
}

/* the one thing in the terms worth stopping on */
.legal-callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(242, 201, 76, 0.08);
    border: 1px solid rgba(242, 201, 76, 0.3);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.legal-callout i {
    color: #f2c94c;
    margin-top: 5px;
}

.legal-body .legal-callout p {
    color: #f3e6bd;
    margin: 0;
}

.legal .btn-back {
    margin-top: 44px;
}

/* ---------- narrower screens: one column, no contents list ---------- */
@media (max-width: 960px) {
    .legal-layout {
        display: block;
    }

    .legal-toc {
        display: none;
    }

    .legal-body {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .legal {
        padding-top: 32px;
    }

    .legal-summary {
        padding: 20px;
        margin-bottom: 32px;
    }

    .legal-body h2 {
        font-size: 1.15rem;
    }

    .legal-body p,
    .legal-body li {
        font-size: 1rem;
    }
}
