/* ---------------------------------------------------------
   ARAVEIL LEGAL PAGES
   Shared stylesheet for all pages under /legal.
   Design tokens mirror the primary site (index.html) so the
   legal experience stays visually consistent with the brand.

   1. DESIGN TOKENS
   2. GLOBAL RESET
   3. HEADER / NAV
   4. LEGAL LAYOUT (hero + sidebar + prose)
   5. FOOTER
   6. RESPONSIVE
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   1. DESIGN TOKENS (Sand & Soft Charcoal)
   --------------------------------------------------------- */
:root {
    --bg-body: #F7F5F2;
    --bg-surface: #FFFFFF;
    --bg-subtle: #EBE8E4;

    --text-main: #1A1918;
    --text-muted: #66625E;

    --primary: #D97706;
    --primary-hover: #B45309;
    --primary-glow: rgba(217, 119, 6, 0.15);

    --border: #E6E2DE;
    --shadow-soft: 0 4px 20px -4px rgba(42, 39, 35, 0.05);
    --shadow-hover: 0 10px 30px -5px rgba(42, 39, 35, 0.1);

    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    --radius-btn: 12px;

    --nav-border: rgba(26, 25, 24, 0.42);
}

[data-theme="dark"] {
    --bg-body: #18181B;
    --bg-surface: #27272A;
    --bg-subtle: #3F3F46;

    --text-main: #F4F4F5;
    --text-muted: #A1A1AA;

    --primary: #D97706;
    --primary-hover: #F59E0B;
    --primary-glow: rgba(217, 119, 6, 0.18);

    --border: #3F3F46;
    --shadow-soft: 0 4px 20px -4px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 40px -5px rgba(0, 0, 0, 0.4);

    --nav-border: rgba(244, 244, 245, 0.16);
}

/* ---------------------------------------------------------
   2. GLOBAL RESET
   --------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul, ol { list-style: none; }

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

.container {
    width: 90%;
    max-width: 1120px;
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 1100;
    padding: 0.75rem 1.25rem;
    background: var(--text-main);
    color: var(--bg-body);
    border-radius: var(--radius-btn);
    font-size: 0.9rem;
    font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------------------------------------------------------
   3. HEADER / NAV
   --------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--bg-body);
    transition: background 0.3s ease;
}

.navbar {
    width: 90%; max-width: 1120px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.7rem 0; border-bottom: 1px solid var(--nav-border);
}

.nav-logo { display: inline-flex; align-items: center; }
.nav-logo-img { height: 26px; width: auto; display: block; }
.nav-logo-img.dark, [data-theme="dark"] .nav-logo-img.light { display: none; }
[data-theme="dark"] .nav-logo-img.dark { display: block; }

.nav-links { display: flex; gap: 2rem; margin-left: auto; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.nav-links a:hover { color: var(--text-main); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: 2rem; }

.theme-toggle {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text-main); border-color: var(--text-main); }

.mobile-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); padding: 0; }

.mobile-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1999;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease; backdrop-filter: blur(4px);
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
    position: fixed; top: 0; right: -320px; width: 300px; max-width: 85vw; height: 100vh;
    background: var(--bg-surface); border-left: 1px solid var(--border);
    padding: 2.5rem; display: flex; flex-direction: column; gap: 2rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2); z-index: 2000;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open { right: 0; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
.logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
    font-size: 1.15rem; letter-spacing: -0.03em; color: var(--text-main);
}
.close-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 5px; display: inline-flex; }
.mobile-links { display: flex; flex-direction: column; gap: 1.5rem; }
.mobile-links a { font-size: 1.1rem; font-weight: 600; color: var(--text-main); border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.mobile-links a:hover { color: var(--primary); }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions { margin-left: auto; }
    .mobile-btn { display: block; }
}

/* ---------------------------------------------------------
   4. LEGAL LAYOUT
   --------------------------------------------------------- */
.legal-hero {
    padding: 4.5rem 0 3rem;
    border-bottom: 1px solid var(--border);
}
.legal-hero h1 {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    max-width: 22ch;
}
.legal-lede {
    color: var(--text-muted); font-size: 1.1rem; line-height: 1.6;
    max-width: 60ch;
}
.legal-meta {
    margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
    font-size: 0.85rem; color: var(--text-muted);
}
.legal-meta strong { color: var(--text-main); font-weight: 600; }

.legal-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 4rem;
    padding: 3.5rem 0 5rem;
    align-items: start;
}

/* Sticky table of contents */
.legal-toc {
    position: sticky; top: 5.5rem;
    font-size: 0.9rem;
}
.legal-toc h2 {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--text-muted); font-weight: 700; margin-bottom: 1rem;
}
.legal-toc ul { display: flex; flex-direction: column; gap: 0.15rem; }
.legal-toc a {
    display: block; padding: 0.45rem 0.75rem; border-radius: 8px;
    color: var(--text-muted); line-height: 1.35;
}
.legal-toc a:hover { color: var(--text-main); background: var(--bg-subtle); }
.legal-toc a.active {
    color: var(--text-main); font-weight: 600; background: var(--bg-subtle);
}

/* Prose */
.legal-prose { max-width: 68ch; }
.legal-prose section { scroll-margin-top: 5.5rem; }
.legal-prose section + section { margin-top: 3rem; }

.legal-prose h2 {
    font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 1rem;
}
.legal-prose h3 {
    font-size: 1.1rem; font-weight: 600; margin: 1.75rem 0 0.6rem;
}
.legal-prose p {
    color: var(--text-muted); font-size: 1rem; line-height: 1.7; margin-bottom: 1.1rem;
}
.legal-prose a:not(.btn) { color: var(--primary); font-weight: 500; }
.legal-prose a:not(.btn):hover { color: var(--primary-hover); text-decoration: underline; }
.legal-prose strong { color: var(--text-main); font-weight: 600; }

.legal-prose ul {
    margin: 0 0 1.1rem; padding-left: 0; display: flex; flex-direction: column; gap: 0.55rem;
}
.legal-prose li {
    position: relative; padding-left: 1.5rem;
    color: var(--text-muted); font-size: 1rem; line-height: 1.65;
}
.legal-prose ul > li::before {
    content: ""; position: absolute; left: 0.15rem; top: 0.65rem;
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.legal-prose li strong { color: var(--text-main); }

/* Callout for important notices */
.legal-callout {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
    box-shadow: var(--shadow-soft);
}
.legal-callout p { margin-bottom: 0; font-size: 0.95rem; }
.legal-callout p + p { margin-top: 0.75rem; }

/* Definition list (e.g. sub-processors, cookie table) */
.legal-table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius-md); border: 1px solid var(--border); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 460px; }
.legal-table caption { text-align: left; padding: 0 0 0.75rem; color: var(--text-muted); font-size: 0.85rem; }
.legal-table th, .legal-table td { text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-table thead th {
    background: var(--bg-subtle); color: var(--text-main); font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.82rem;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table td { color: var(--text-muted); }
.legal-table td strong { color: var(--text-main); }

.legal-updated-note {
    margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
    font-size: 0.9rem; color: var(--text-muted);
}

/* ---------------------------------------------------------
   5. FOOTER (shared with the main site)
   --------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-btn); font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; font-size: 0.9rem; border: 1px solid transparent;
    font-family: 'Plus Jakarta Sans', sans-serif; gap: 8px;
}
.btn-primary { background-color: var(--text-main); color: var(--bg-body); }
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }

.site-footer { position: relative; margin-top: 4rem; padding-bottom: 2.5rem; overflow: hidden; }
.footer-watermark {
    font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(6rem, 19vw, 17rem);
    line-height: 0.8; letter-spacing: -0.04em; text-align: center; white-space: nowrap;
    user-select: none; pointer-events: none; margin: 0 0 -0.06em;
    background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-body) 82%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; padding: 3rem 0 3.5rem; }
.footer-logo { display: inline-block; margin-bottom: 1.5rem; }
.footer-logo-img { height: 32px; width: auto; display: block; }
.footer-logo-img.dark, [data-theme="dark"] .footer-logo-img.light { display: none; }
[data-theme="dark"] .footer-logo-img.dark { display: block; }
.footer-tagline { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; max-width: 30rem; margin-bottom: 1.75rem; }
.footer-socials { display: flex; gap: 0.75rem; }
.footer-social {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.2s;
}
.footer-social:hover { color: var(--primary); border-color: var(--primary); }
.footer-cta { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.footer-cta-title { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.15; letter-spacing: -0.02em; color: var(--text-main); margin-bottom: 1.75rem; max-width: 28rem; }
.footer-cta .btn { margin-bottom: 1.75rem; }
.footer-badges { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.footer-badge {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0.45rem 0.95rem; white-space: nowrap;
}
.footer-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.5rem; padding: 3rem 0; border-top: 1px solid var(--border); }
.footer-col h4 { font-size: 0.75rem; text-transform: uppercase; margin-bottom: 1.4rem; color: var(--text-muted); letter-spacing: 0.08em; font-weight: 600; }
.footer-col a { display: block; margin-bottom: 0.9rem; color: var(--text-main); font-size: 0.92rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    border-top: 1px solid var(--border); padding-top: 2rem; color: var(--text-muted);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
}
@media (max-width: 900px) {
    .footer-top { grid-template-columns: 1fr; gap: 2.5rem; padding: 2.5rem 0 3rem; }
    .footer-links { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}
@media (max-width: 640px) {
    .footer-links { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1.25rem; padding: 2.5rem 0; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
@media (max-width: 380px) {
    .footer-links { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   6. RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 900px) {
    .legal-body { grid-template-columns: 1fr; gap: 2rem; }
    .legal-toc {
        position: static; border: 1px solid var(--border);
        border-radius: var(--radius-md); padding: 1.25rem 1.5rem; background: var(--bg-surface);
    }
    .legal-toc ul { gap: 0; }
    .legal-prose { max-width: none; }
}

@media (max-width: 560px) {
    .legal-hero { padding: 3rem 0 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
