:root {
    /* blacks */
    --bg:           #030303;
    --surface:      #080808;
    --surface-2:    #101010;
    --border:       #1c1c1c;
    --border-2:     #282828;

    /* cream */
    --cream:         #F5EFE0;
    --cream-light:   #FAF6ED;
    --cream-bright:  #FDFAF4;

    /* wine / champagne */
    --wine:          #7B2D3E;
    --champ:         #C9955A;
    --champ-light:   #DEBB8A;
    --champ-bright:  #EDD9B0;
    --champ-dim:     rgba(201, 149, 90, 0.09);
    --champ-border:  rgba(201, 149, 90, 0.22);

    /* aliases so existing selectors using --gold still resolve */
    --gold:         var(--champ);
    --gold-light:   var(--champ-light);
    --gold-bright:  var(--champ-bright);
    --gold-dim:     var(--champ-dim);
    --gold-border:  var(--champ-border);

    /* text */
    --text-1:        #F5EFE0;
    --text-2:        #B0A898;
    --text-3:        #6A6258;
    --accent:        var(--gold);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

body {
    background-color: var(--bg);
    color: var(--text-2);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── BACKGROUND ── */
.bg-base {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 0%, rgba(201, 149, 90, 0.03) 0%, transparent 65%),
        linear-gradient(170deg, #0a0a0a 0%, var(--bg) 55%, var(--bg) 100%);
    z-index: -1;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(245, 239, 224, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
    z-index: -1;
}

/* ── LAYOUT ── */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

.eyebrow {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 16px;
    display: block;
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.1;
    margin-bottom: 24px;
}

.last-updated {
    font-size: 13px;
    color: var(--text-3);
    font-style: italic;
}

/* ── CONTENT ── */
.content-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 44px 48px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

section {
    margin-bottom: 44px;
    scroll-margin-top: 24px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--gold-border);
}

p {
    margin-bottom: 16px;
    font-size: 15.5px;
    line-height: 1.75;
}

ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

li {
    margin-bottom: 12px;
    font-size: 15.5px;
    line-height: 1.7;
}

li::marker {
    color: var(--gold);
}

strong {
    color: inherit;
    font-weight: inherit;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13.5px;
    background: rgba(201, 149, 90, 0.12);
    color: var(--gold-light);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--gold-border);
}

/* ── FOOTER ── */
footer {
    text-align: center;
}

.back-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--champ);
    color: #1A0808;
    padding: 12px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    transition: background 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border-accent);
}

.back-link:hover {
    background: var(--champ-light);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    color: #1A0808;
}

.back-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

a[href^="tel"] {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 600px) {
    .container {
        padding: 40px 20px;
    }

    .content-card {
        padding: 24px;
    }

    h1 {
        font-size: 36px;
    }
}

/* ── READING AIDS ── */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--champ);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 200;
    pointer-events: none;
}

.legal-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}

.legal-toc summary {
    list-style: none;
    cursor: default;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 0 12px 12px;
}

.legal-toc summary::-webkit-details-marker {
    display: none;
}

.legal-toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid var(--border);
}

.legal-toc nav a {
    display: block;
    padding: 7px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.legal-toc nav a:hover {
    color: var(--text-1);
}

.legal-toc nav a.active {
    color: var(--gold-light);
    border-left-color: var(--border-accent);
    background: var(--champ-dim);
}

a:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--champ-light);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .legal-toc {
        position: static;
        max-height: none;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.02);
    }

    .legal-toc summary {
        cursor: pointer;
        padding: 14px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .legal-toc summary::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 1.5px solid var(--text-3);
        border-bottom: 1.5px solid var(--text-3);
        transform: rotate(45deg) translateY(-2px);
        transition: transform 0.2s ease;
    }

    .legal-toc details[open] summary::after {
        transform: rotate(-135deg);
    }

    .legal-toc nav {
        border-left: none;
        padding: 0 8px 12px;
    }

    .legal-toc nav a {
        border-left: none;
        border-radius: 3px;
        margin-left: 0;
    }
}

@media print {
    .bg-base,
    .bg-grid,
    .read-progress,
    .legal-toc,
    .back-link {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111;
    }

    .legal-layout {
        display: block;
    }

    .content-card {
        background: none;
        border: none;
        padding: 0;
        backdrop-filter: none;
    }

    h1,
    h2 {
        color: #111;
    }

    h2::before {
        background: #999;
    }

    section {
        break-inside: avoid-page;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ═══════════════════════════════════════════════════
   SOFT UI THEME — matches the portal (dark)
═══════════════════════════════════════════════════ */
:root {
    --bg:            #080707;
    --surface:       #121111;
    --surface-2:     #1b1a1a;
    --surface-3:     #232222;
    --border:        #201f1f;
    --border-2:      #2e2d2d;

    --text-1:        #f5f5f5;
    --text-2:        #a3a3a3;
    --text-3:        #727272;

    --champ:         #e8e8e8;
    --champ-light:   #f2f2f2;
    --champ-bright:  #fafafa;
    --champ-dim:     rgba(255, 255, 255, 0.084);
    --champ-border:  rgba(255, 255, 255, 0.30);

    --btn-solid-bg:  #f5f5f5;
    --btn-solid-fg:  #080707;
}

body {
    background-color: var(--bg);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--champ-light);
    outline-offset: 3px;
}
.bg-base {
    background:
        radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 255, 255, 0.025) 0%, transparent 65%),
        var(--bg);
}

.bg-grid {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

.content-card {
    background: var(--surface);
    border-color: var(--border);
    border-radius: 24px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

h1 {
    font-weight: 500;
}

h2 {
    color: var(--text-1);
}

h2::before {
    background: var(--champ);
}

code {
    border-radius: 6px;
    background: var(--surface-2);
    border-color: var(--border-2);
    color: var(--text-1);
}

.legal-toc nav a {
    border-radius: 0 999px 999px 0;
}

.legal-toc nav a.active {
    color: var(--text-1);
    background: var(--surface-2);
}

@media (max-width: 900px) {
    .legal-toc {
        border-radius: 20px;
        background: var(--surface);
    }

    .legal-toc nav a {
        border-radius: 999px;
    }
}

.back-link {
    background: var(--btn-solid-bg);
    color: var(--btn-solid-fg);
    border: 1px solid var(--btn-solid-bg);
    border-radius: 999px;
}

.back-link:hover {
    background: color-mix(in srgb, var(--btn-solid-bg) 86%, var(--champ));
    border-color: color-mix(in srgb, var(--btn-solid-bg) 86%, var(--border-accent));
    color: var(--btn-solid-fg);
}

.read-progress {
    background: var(--champ);
}

/* Borders use a neutral light grey, not the accent colour */
:root,
html[data-theme="dark"] {
    --border-accent: #8a8a8a;
    --champ-border: rgba(255, 255, 255, 0.16);
    --gold-border: rgba(255, 255, 255, 0.16);
    --focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] {
    --border-accent: #5c5c5c;
    --champ-border: rgba(0, 0, 0, 0.18);
    --gold-border: rgba(0, 0, 0, 0.18);
    --focus-ring: 0 0 0 2px rgba(0, 0, 0, 0.18);
}

/* No outline or glow ring on focused inputs */
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}