/* ================================================================
    TESSALIO STUDIO — LEGAL PORTAL STYLES
    Standalone stylesheet for legal.html only.
    Reskinned to match the main site's dark / champagne-gold theme.
    Does not affect index.html.
================================================================ */

:root {
    --bg: #0a0a0b;
    --bg-elevated: #111113;
    --card-grad: linear-gradient(155deg, #1a1a1c 0%, #0f0f11 100%);
    --text-main: #f5f5f5;
    --text-sub: #9a9a9a;
    --text-dim: #6a6a6a;
    --accent: #E1CA96;
    --accent-dim: rgba(225, 202, 150, 0.12);
    --border-color: rgba(225, 202, 150, 0.12);

    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-outfit: 'Outfit', sans-serif;
    --font-display: 'Bebas Neue', sans-serif;
}

/* ----------------------------------------------------------------
   RESET & BASE
---------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* Soft fixed vignette, echoes the shared backdrop used across the main site */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 0%, #1c1c1e 0%, #0a0a0b 60%);
    pointer-events: none;
}

/* ----------------------------------------------------------------
   LAYOUT — two-column grid
---------------------------------------------------------------- */
#legal-wrapper {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100svh;
}

/* ----------------------------------------------------------------
   SIDEBAR — fixed left column
---------------------------------------------------------------- */
.legal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 100svh;
    padding: 6rem 4rem;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-color);
    z-index: 10;
    box-sizing: border-box;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Brand back-link */
.brand-signature {
    font-family: var(--font-outfit);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 4rem;
    display: block;
    transition: color 0.3s ease;
}

.brand-signature:hover {
    color: var(--accent);
}

/* Title area — fixed height so switcher never shifts position */
.legal-header {
    height: 320px;
    display: flex;
    align-items: flex-start;
}

.legal-header h1 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 5.5vw, 8rem);
    line-height: 0.82;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Section switcher */
.legal-switcher {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.switch-btn {
    position: relative;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: color 0.35s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.switch-btn:hover {
    color: var(--text-sub);
}

.switch-btn.active {
    color: var(--accent);
    transform: translateX(18px);
}

.switch-btn.active::before {
    content: '▸';
    position: absolute;
    left: -22px;
    color: var(--accent);
    font-style: normal;
}

/* ----------------------------------------------------------------
   MAIN CONTENT — right column
---------------------------------------------------------------- */
.legal-content {
    grid-column: 2;
    padding: 6rem 8% 6rem 6rem;
    background: transparent;
    min-height: 100svh;
}

/* ----------------------------------------------------------------
   LEGAL SECTIONS — premium island cards, matching Origin/Info/Output
---------------------------------------------------------------- */
.legal-section {
    margin-bottom: 2.5rem;
    max-width: 720px;
    background: var(--card-grad);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem 3rem;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.legal-section:hover {
    border-color: rgba(225, 202, 150, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--accent);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.5rem;
}

.legal-section h2 {
    font-family: var(--font-main);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.8rem;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--text-main);
}

.legal-section p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-sub);
    margin-bottom: 1.2rem;
}

.legal-section p strong {
    color: var(--accent);
    font-weight: 600;
}

/* ----------------------------------------------------------------
   FOOTER
---------------------------------------------------------------- */
.legal-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-dim);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ----------------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------------- */
@media (max-width: 1100px) {
    #legal-wrapper {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 4rem 2rem 3rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .legal-header {
        height: auto;
        margin-bottom: 2rem;
    }

    .legal-content {
        grid-column: 1;
        padding: 4rem 2rem 6rem;
    }
}

@media (max-width: 600px) {
    .legal-header h1 {
        font-size: clamp(3rem, 12vw, 4.5rem);
    }

    .legal-section {
        margin-bottom: 1.5rem;
        padding: 2.2rem 1.8rem;
    }

    .legal-section h2 {
        font-size: 1.5rem;
    }
}