/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS & MODES
   ═══════════════════════════════════════════════════════════════ */
:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --accent-1: #8b5cf6;
    --accent-2: #ec4899;
    --accent-3: #06b6d4;
    --glow: rgba(139, 92, 246, 0.5);
    --grain-opacity: 0.03;
    --transition-speed: 0.6s;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --radius-card: 24px;
    --radius-pill: 999px;
}

/* Ghostmode — Ethereal Light (fully black text) */
[data-mode="ghost"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #000000;              /* FIXED: was #0a0a0a — now fully black */
    --text-secondary: rgba(0, 0, 0, 0.65); /* FIXED: was 0.5 alpha — stronger readability */
    --accent-1: #6d28d9;
    --accent-2: #be123c;
    --accent-3: #0e7490;
    --glow: rgba(109, 40, 217, 0.2);
    --grain-opacity: 0.015;
}

/* Godmode — Full Spectrum */
[data-mode="god"] {
    --accent-1: #ff006e;
    --accent-2: #fb5607;
    --accent-3: #ffbe0b;
    --glow: rgba(255, 0, 110, 0.6);
    --grain-opacity: 0.05;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, 
                color var(--transition-speed) ease;
    line-height: 1.7;
    min-height: 100vh;
}

::selection {
    background: var(--accent-1);
    color: var(--bg-primary);
}

a {
    color: var(--accent-1);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}


@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-speed), backdrop-filter var(--transition-speed);
}

.nav.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo span {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
    padding: 0.5rem 0;
}

/* FIXED: directional underline sweep — matches homepage & privacy page */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-links a.active {
    color: var(--text-primary);
}

/* Mode Switcher */
.theme-switcher-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 1025px) {
    .theme-label { display: block; }
}

.mode-switcher {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-glass);
    padding: 0.4rem;
    border-radius: 100px;
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
}

/* FIXED: position: relative added — the active ring was anchoring
   to the fixed navbar and rendering as a huge ellipse across it */
.mode-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: transparent;
    overflow: hidden;
    cursor: pointer;
}

.mode-btn:hover { transform: scale(1.15); }
.mode-btn.active { box-shadow: 0 0 15px var(--glow); color: var(--text-primary); }

.mode-btn[data-mode="default"] { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.mode-btn[data-mode="ghost"] { background: linear-gradient(135deg, #e2e8f0, #f8fafc); border: 1px solid rgba(0,0,0,0.1); }
.mode-btn[data-mode="god"] { background: linear-gradient(135deg, #ff006e, #fb5607, #ffbe0b); }

.mode-btn.active::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 2px solid var(--text-primary);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    z-index: 102;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
    .nav { padding: 1rem 1.5rem; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 4rem 2rem;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-left: 1px solid var(--border-glass);
        z-index: 100;
        box-shadow: -10px 0 40px rgba(0,0,0,0.3);
    }
    .nav-links.open { right: 0; }
    .nav-links li { 
        margin: 1.5rem 0; 
        opacity: 0; 
        transform: translateX(20px);
        transition: all 0.4s ease;
    }
    .nav-links.open li {
        opacity: 1;
        transform: translateX(0);
    }
    .nav-links.open li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.open li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.open li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.open li:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.open li:nth-child(5) { transition-delay: 0.5s; }
    .nav-links.open li:nth-child(6) { transition-delay: 0.6s; }
    .nav-links a { font-size: 1.5rem; font-weight: 500; }
    .mobile-toggle { display: flex; }
    .mode-switcher { margin-top: 2rem; }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(6px);
        z-index: 99;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TERMS CONTENT
   ═══════════════════════════════════════════════════════════════ */
.terms-wrapper {
    padding: 10rem 2rem 4rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.terms-header {
    margin-bottom: 4rem;
    text-align: center;
}

.terms-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-1);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    margin-bottom: 1.5rem;
}

.terms-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.terms-title .gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.terms-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.terms-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.terms-meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.terms-version {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Table of Contents */
.terms-toc {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 2rem 2.5rem;
    margin-bottom: 3rem;
}

.terms-toc h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.terms-toc ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
    padding: 0;
}

.terms-toc li {
    font-size: 0.9rem;
}

.terms-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.terms-toc a:hover {
    color: var(--accent-1);
    text-decoration: none;
}

/* FIXED: numbers now follow text color — white in dark themes,
   black in light. Removed opacity (white at 0.6 reads as grey). */
.terms-toc .toc-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 24px;
}

@media (max-width: 640px) {
    .terms-toc ul {
        grid-template-columns: 1fr;
    }
    .terms-toc {
        padding: 1.5rem;
    }
}

/* Terms Sections */
.terms-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.terms-section h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* FIXED: section numbers follow text color — white in dark, black in light */
.terms-section h2 .section-num {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.terms-section h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.terms-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.terms-section ul, .terms-section ol {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* FIXED: style for the now correctly-nested list in Section 6.2 */
.terms-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.terms-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.terms-section li strong {
    color: var(--text-primary);
}

/* Highlight Box */
.terms-highlight {
    background: var(--bg-glass);
    border-left: 3px solid var(--accent-1);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    margin: 1.5rem 0;
}

.terms-highlight p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.terms-highlight strong {
    color: var(--text-primary);
}

/* Contact Section */
.terms-contact {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-card);
    padding: 2.5rem;
    text-align: center;
    margin-top: 2rem;
}

.terms-contact h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.terms-contact p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.terms-email-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white !important;
    border-radius: 100px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 8px 30px var(--glow);
}

.terms-email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--glow);
    text-decoration: none !important;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--accent-1);
    box-shadow: 0 0 30px var(--glow);
    transform: translateY(-4px);
}

/* Responsive */
@media (max-width: 768px) {
    .terms-wrapper {
        padding: 8rem 1.5rem 3rem;
    }
    .terms-meta {
        gap: 1rem;
        font-size: 0.8rem;
        flex-direction: column;
        align-items: center;
    }
    .terms-section h2 {
        font-size: 1.3rem;
    }
    .terms-contact {
        padding: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER – MATCH HOMEPAGE
   ═══════════════════════════════════════════════════════════════ */

.footer {
    border-top: 1px solid var(--border-glass);
    padding: 2.5rem 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    position: relative;
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    min-height: 40px;
}

.footer-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.footer-privacy,
.footer-terms,
.footer-cookie {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.875rem;
    white-space: nowrap;
}

.footer-privacy:hover,
.footer-terms:hover,
.footer-cookie:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.footer-copyright {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
    text-align: center;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        justify-content: center;
        min-height: auto;
        gap: 0.75rem;
    }
    .footer-left {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        flex-direction: column;
        gap: 0.5rem;
        order: 2;
    }
    .footer-copyright {
        order: 1;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2rem 1rem;
    }
    .footer-privacy,
    .footer-terms,
    .footer-cookie,
    .footer-copyright {
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   GHOST MODE — slightly larger reading sizes
   (nav / footer / buttons keep their sizes so layout doesn't stretch)
   ═══════════════════════════════════════════════════════════════ */
[data-mode="ghost"] .terms-section p,
[data-mode="ghost"] .terms-section li {
    font-size: 1.0625rem;   /* 1rem → 17px */
}

[data-mode="ghost"] .terms-section h2 {
    font-size: 1.7rem;      /* 1.6rem → 1.7rem */
}

[data-mode="ghost"] .terms-section h3 {
    font-size: 1.25rem;     /* 1.2rem → 1.25rem */
}

[data-mode="ghost"] .terms-toc li {
    font-size: 0.95rem;     /* 0.9rem → 0.95rem */
}

[data-mode="ghost"] .terms-highlight p {
    font-size: 1rem;        /* 0.95rem → 1rem */
}

/* ── UNIVERSAL NOSCRIPT FALLBACK (All Screen Sizes) ── */
.noscript-fallback {
  display: flex; /* Always visible when JS is off */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari/iOS support */
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.noscript-fallback__content {
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 24px;
  max-width: 500px; /* Slightly larger for desktop readability */
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.4s ease;
}

.noscript-fallback__title {
  font-size: 24px; /* Slightly larger for desktop */
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: #000000;
  margin-bottom: 16px;
  line-height: 1.3;
}

.noscript-fallback__text {
  font-size: 17px; /* Slightly larger for desktop */
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  color: #333333;
  margin-bottom: 0;
}

/* ── RESPONSIVE: Optimize for smaller screens ── */
@media (max-width: 768px) {
  .noscript-fallback__content {
    padding: 30px 20px;
    max-width: 400px;
  }
  .noscript-fallback__title {
    font-size: 20px;
  }
  .noscript-fallback__text {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .noscript-fallback__content {
    padding: 24px 16px;
    max-width: 340px;
  }
  .noscript-fallback__title {
    font-size: 18px;
  }
  .noscript-fallback__text {
    font-size: 14px;
  }
}