/* ============================================
   NEON — Legal pages (Terms / Privacy)
   Style Guide v1
   ============================================ */

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

:root {
    --bg: #000000;
    --surface: #121212;
    --surface-alt: #1A1A1A;
    --text: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.70);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --accent: #007AFF;
    --accent-hover: #0A84FF;
    --neon-cash: #FFD700;
    --neon-cash-subtle: rgba(255, 215, 0, 0.12);
    --border: rgba(255, 255, 255, 0.10);
    --font: 'Roboto Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --danger: #FF3B30;
    --radius-m: 12px;
    --duration-fast: 150ms;
}

/* --- Light theme overrides --- */
[data-theme="light"] {
    --bg: #F2F2F7;
    --surface: #FFFFFF;
    --surface-alt: #E8E8ED;
    --text: #000000;
    --text-secondary: rgba(0, 0, 0, 0.60);
    --text-tertiary: rgba(0, 0, 0, 0.38);
    --accent: #0060D0;
    --accent-hover: #004BA0;
    --neon-cash: #0060D0;
    --neon-cash-subtle: rgba(0, 96, 208, 0.10);
    --border: rgba(0, 0, 0, 0.10);
    --danger: #C12727;
}

/* --- Theme transition --- */
html, body, .nav {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--duration-fast) ease;
}

a:hover {
    color: var(--accent-hover);
}

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

/* --- Nav --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
    background: rgba(242, 242, 247, 0.85);
}

/* --- Theme toggle (legal pages) --- */
.theme-toggle {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast);
    text-decoration: none;
}

.theme-toggle:hover {
    color: var(--neon-cash);
    border-color: var(--neon-cash);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-back {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: color var(--duration-fast);
}

.nav-back:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.nav-back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- Legal content --- */
.legal {
    max-width: 680px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.legal h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.legal .updated {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
}

.legal section {
    margin-bottom: 2.5rem;
}

.legal h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--neon-cash);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.legal h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.legal p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.legal ul {
    list-style: none;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.legal ul li {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 400;
    position: relative;
    padding-left: 1rem;
}

.legal ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neon-cash);
}

.legal a {
    color: var(--accent);
}

/* --- Accessibility --- */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .nav { padding: 1rem 1.2rem; }
    .legal { padding: 5rem 1.2rem 3rem; }
}
