@font-face {
    font-family: Montserrat;
    src: url("../assets/fonts/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Montserrat;
    src: url("../assets/fonts/Montserrat-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: Montserrat;
    src: url("../assets/fonts/Montserrat-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;
    --page: #f5f4f0;
    --surface: #ffffff;
    --surface-soft: #eceae3;
    --ink: #181d36;
    --muted: #686d7b;
    --line: rgba(24, 29, 54, 0.12);
    --header: rgba(245, 244, 240, 0.9);
    --accent: #f2910b;
    --accent-dark: #9a5900;
    --accent-soft: rgba(242, 145, 11, 0.12);
    --shadow: 0 28px 70px rgba(24, 29, 54, 0.1);
}

.dark {
    color-scheme: dark;
    --page: #11151c;
    --surface: #181d26;
    --surface-soft: #202631;
    --ink: #f5f6f8;
    --muted: #a9afbb;
    --line: rgba(255, 255, 255, 0.11);
    --header: rgba(17, 21, 28, 0.9);
    --accent: #f4a124;
    --accent-dark: #ffc166;
    --accent-soft: rgba(242, 145, 11, 0.15);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Montserrat, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    transition: background-color 220ms ease, color 220ms ease;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 200;
    top: 12px;
    left: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--page);
    font-size: 13px;
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: none;
}

.logo-dark {
    display: none !important;
}

.dark .logo-light {
    display: none !important;
}

.dark .logo-dark {
    display: block !important;
}

.legal-hero {
    position: relative;
    overflow: hidden;
    padding: 74px 0 72px;
    border-bottom: 1px solid var(--line);
}

.legal-hero::before {
    content: "";
    position: absolute;
    width: min(52vw, 720px);
    aspect-ratio: 1;
    top: -55%;
    right: -9%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0, transparent 68%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    width: min(100% - 40px, 1180px);
    margin-inline: auto;
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-kicker::before {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
}

.legal-hero h1 {
    max-width: 1040px;
    margin: 0;
    font-size: clamp(2.25rem, 5.5vw, 5.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    hyphens: auto;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.hero-subtitle {
    max-width: 820px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.55;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.meta-chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.meta-chip svg {
    width: 15px;
    height: 15px;
    color: var(--accent-dark);
}

.approval {
    max-width: 520px;
    margin-top: 24px;
    padding-left: 16px;
    border-left: 2px solid var(--accent);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}

.approval span:not(:last-child)::after {
    content: " · ";
    color: var(--accent-dark);
}

.legal-shell {
    width: min(100% - 40px, 1180px);
    margin-inline: auto;
    padding: 64px 0 112px;
    display: grid;
    grid-template-columns: 248px minmax(0, 800px);
    gap: clamp(48px, 7vw, 104px);
    align-items: start;
}

.toc {
    position: sticky;
    top: 32px;
}

.toc-label {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.toc-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-list a {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
    padding: 10px 8px;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    text-decoration: none;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.toc-list a:hover,
.toc-list a[aria-current="location"] {
    border-left-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.toc-number {
    color: var(--accent-dark);
    font-weight: 700;
}

.mobile-toc {
    display: none;
}

.legal-document {
    min-width: 0;
    padding: clamp(24px, 4vw, 54px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.document-lead {
    margin: 0 0 34px !important;
    padding: 22px 24px;
    border-left: 3px solid var(--accent);
    border-radius: 0 14px 14px 0;
    background: var(--accent-soft);
    color: var(--ink) !important;
    font-weight: 500;
}

.legal-document h2 {
    margin: 64px 0 24px;
    padding-top: 8px;
    color: var(--ink);
    font-size: clamp(1.45rem, 3vw, 2rem);
    hyphens: auto;
    line-height: 1.2;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.legal-document h2:first-child {
    margin-top: 0;
}

.legal-document p,
.legal-document li {
    overflow-wrap: anywhere;
    color: color-mix(in srgb, var(--ink) 88%, var(--muted));
    font-size: 15px;
    line-height: 1.85;
}

.legal-document p {
    margin: 0 0 18px;
}

.legal-document ul,
.legal-document ol {
    margin: 8px 0 24px;
    padding-left: 24px;
}

.legal-document li {
    padding-left: 6px;
    margin-bottom: 10px;
}

.legal-document li::marker {
    color: var(--accent-dark);
}

.legal-document strong {
    color: var(--ink);
    font-weight: 700;
}

.legal-document em {
    color: var(--ink);
}

.legal-document a {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.legal-document a:hover {
    text-decoration-thickness: 2px;
}

.document-end {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 54px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-end::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--accent);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 44%, transparent);
}

.footer-inner {
    width: min(100% - 40px, 1180px);
    margin-inline: auto;
    padding: 56px 0 32px;
}

.footer-top {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    align-items: start;
}

.footer-brand img {
    width: 118px;
    height: auto;
}

.footer-brand p {
    max-width: 210px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

.footer-legal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
}

.footer-legal a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease;
}

.footer-legal a:hover,
.footer-legal a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--ink);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 38px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 900px) {
    .legal-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 32px;
    }

    .toc {
        display: none;
    }

    .mobile-toc {
        display: block;
        position: sticky;
        z-index: 20;
        top: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--surface);
        box-shadow: 0 12px 30px rgba(24, 29, 54, 0.08);
    }

    .mobile-toc summary {
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px 16px;
        cursor: pointer;
        color: var(--ink);
        font-size: 12px;
        font-weight: 700;
        list-style: none;
    }

    .mobile-toc summary::-webkit-details-marker {
        display: none;
    }

    .mobile-toc summary::after {
        content: "+";
        color: var(--accent-dark);
        font-size: 20px;
        font-weight: 400;
    }

    .mobile-toc[open] summary::after {
        content: "−";
    }

    .mobile-toc .toc-list {
        max-height: min(58vh, 480px);
        overflow: auto;
        padding: 0 10px 12px;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 640px) {
    .legal-hero {
        padding: 54px 0 50px;
    }

    .hero-inner,
    .legal-shell,
    .footer-inner {
        width: min(100% - 28px, 1180px);
    }

    .legal-hero h1 {
        font-size: clamp(2rem, 11vw, 3.4rem);
        line-height: 1.02;
    }

    .hero-meta {
        gap: 8px;
    }

    .meta-chip {
        width: 100%;
        border-radius: 12px;
    }

    .approval span {
        display: block;
    }

    .approval span:not(:last-child)::after {
        content: "";
    }

    .legal-shell {
        padding-bottom: 72px;
    }

    .mobile-toc {
        top: 84px;
    }

    .legal-document {
        padding: 24px 18px 30px;
        border-radius: 20px;
    }

    .document-lead {
        padding: 18px;
    }

    .legal-document h2 {
        margin-top: 48px;
    }

    .legal-document p,
    .legal-document li {
        font-size: 14px;
        line-height: 1.8;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    :root,
    .dark {
        --page: #ffffff;
        --surface: #ffffff;
        --ink: #000000;
        --muted: #333333;
        --line: #dddddd;
        --accent-dark: #7a4700;
    }

    .toc,
    .mobile-toc,
    .site-footer,
    .skip-link {
        display: none !important;
    }

    .legal-hero {
        padding: 24px 0 30px;
    }

    .legal-hero h1 {
        font-size: 34px;
    }

    .legal-shell {
        width: 100%;
        display: block;
        padding: 24px 0;
    }

    .legal-document {
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .legal-document h2 {
        break-after: avoid;
    }

    .legal-document p,
    .legal-document li {
        orphans: 3;
        widows: 3;
    }

    .legal-document a::after {
        content: " (" attr(href) ")";
        font-size: 10px;
        font-weight: 400;
    }
}
