
* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --border: #e5e7eb;
    --border-hover: #dbe3ef;

    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eff6ff;

    --radius: 14px;
    --content-width: 900px;
}

/* =========================
   BASE
========================= */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;

    background: var(--bg);
    color: var(--text);

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.7;
    -webkit-font-smoothing: antialiased;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

a {
    color: var(--blue);
    text-decoration: none;
    overflow-wrap: anywhere;
}

a:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
    border-radius: 3px;
}

::selection {
    background: #dbeafe;
    color: #1e3a8a;
}

/* =========================
   HEADER
========================= */

.legal-header {
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.legal-header-content {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    margin: 0 auto;
    padding: 32px 0 34px;

    display: flex;
    flex-direction: column;
    gap: 28px;
}

.legal-logo {
    display: inline-flex;
    width: fit-content;
}

.legal-logo img {
    display: block;
    width: 135px;
    height: auto;
}

.legal-heading {
    max-width: 720px;
}

.legal-label {
    display: inline-block;
    margin-bottom: 10px;

    color: var(--blue);

    font-family:
        "IBM Plex Mono",
        monospace;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-heading h1 {
    margin: 0;
    color: var(--text);

    font-size: clamp(30px, 5vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.legal-heading p {
    margin: 14px 0 0;
    color: var(--text-secondary);

    font-size: 16px;
    line-height: 1.65;
}

/* =========================
   CONTENT
========================= */

.legal-content {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    margin: 32px auto 64px;
}

.legal-content section {
    position: relative;

    margin-bottom: 16px;
    padding: 28px 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03);

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.legal-content section:last-child {
    margin-bottom: 0;
}

.legal-content section:hover {
    border-color: var(--border-hover);
}

.legal-content h2 {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin: 0 0 14px;

    color: var(--text);

    font-size: 19px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.legal-content h2::before {
    content: "";

    flex: 0 0 3px;

    width: 3px;
    min-height: 24px;

    margin-top: 2px;

    background: var(--blue);
    border-radius: 999px;
}

.legal-content p {
    margin: 0 0 14px;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.75;

    overflow-wrap: anywhere;
}

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

.legal-content ul,
.legal-content ol {
    margin: 12px 0 0;
    padding-left: 22px;

    color: var(--text-secondary);

    font-size: 15px;
    line-height: 1.75;
}

.legal-content li {
    margin-bottom: 7px;
    overflow-wrap: anywhere;
}

.legal-content li:last-child {
    margin-bottom: 0;
}

.legal-content strong {
    color: var(--text);
    font-weight: 600;
}

/* =========================
   FOOTER
========================= */

.legal-footer {
    width: 100%;

    background: var(--surface);

    border-top: 1px solid var(--border);
}

.legal-footer-content {
    width: min(
        calc(100% - 40px),
        var(--content-width)
    );

    margin: 0 auto;
    padding: 30px 0 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-logo {
    display: inline-flex;
}

.footer-logo img {
    display: block;
    width: 105px;
    height: auto;
}

.legal-footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
}

.legal-footer-links a {
    color: var(--text-muted);

    font-size: 13px;
    font-weight: 500;

    transition: color 0.18s ease;
}

.legal-footer-links a:hover {
    color: var(--blue);
    text-decoration: none;
}

/* =========================
   TABLET
========================= */

@media (max-width: 700px) {
    .legal-header-content {
        width: min(
            calc(100% - 32px),
            var(--content-width)
        );

        padding: 26px 0 30px;
        gap: 24px;
    }

    .legal-content {
        width: min(
            calc(100% - 32px),
            var(--content-width)
        );

        margin-top: 24px;
        margin-bottom: 40px;
    }

    .legal-content section {
        padding: 22px 20px;
        margin-bottom: 12px;
    }

    .legal-content h2 {
        font-size: 18px;
    }

    .legal-footer-content {
        width: min(
            calc(100% - 32px),
            var(--content-width)
        );

        flex-direction: column;
        align-items: flex-start;
        padding: 26px 0 30px;
    }

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

/* =========================
   MOBILE
========================= */

@media (max-width: 430px) {
    .legal-header-content,
    .legal-content,
    .legal-footer-content {
        width: calc(100% - 28px);
    }

    .legal-heading h1 {
        font-size: 30px;
    }

    .legal-heading p {
        font-size: 15px;
    }

    .legal-content section {
        padding: 20px 17px;
        border-radius: 12px;
    }

    .legal-content h2 {
        font-size: 17px;
    }

    .legal-content p,
    .legal-content ul,
    .legal-content ol {
        font-size: 14px;
    }

    .legal-footer-links {
        gap: 12px 16px;
    }
}

/* =========================
   ACCESSIBILITY
========================= */

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

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* =========================================================
   DARK THEME
========================================================= */

[data-theme="dark"] {
    --bg: #202124;
    --surface: #292a2d;
    --surface-soft: #252629;

    --border: #3c4043;
    --border-hover: #5f6368;

    --text: #e8eaed;
    --text-secondary: #bdc1c6;
    --text-muted: #9aa0a6;

    --blue: #8ab4f8;
    --blue-dark: #aecbfa;
    --blue-soft: rgba(138, 180, 248, 0.12);
}

[data-theme="dark"] ::selection {
    background: rgba(138, 180, 248, 0.25);
    color: #f8f9fa;
}

[data-theme="dark"] .legal-content section {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.30);
}
