/* ═══════════════════════════════════════════════
   TALES PLAYER — THEME SYSTEM
   Default: dark  |  Toggle: data-theme="light"
═══════════════════════════════════════════════ */

/* ── Brand constants (never change) ── */
:root {
    --pink-neon:    #F50057;
    --cyan-neon:    #00E5FF;
    --deep-purple:  #7C4DFF;
    --error:        #FF5252;
    --success:      #00E676;
    --radius-card:  1.75rem;
    --radius-lg:    2rem;
    --radius-xl:    2.5rem;

    /* ── Dark theme tokens (default) ── */
    --bg:           #0A0A0A;
    --bg-card:      #1A1A1A;
    --bg-hover:     #2A2A2A;
    --bg-nav:       rgba(10,10,10,0.85);
    --surface-glass: rgba(255,255,255,0.035);
    --text-primary: #FFFFFF;
    --text-body:    #B3B3B3;
    --text-muted:   #6B6B6B;
    --border-subtle: rgba(255,255,255,0.06);
    --border-medium: rgba(255,255,255,0.10);
    --shadow-card:  0 20px 50px rgba(0,0,0,0.3);
    --shadow-btn:   0 0 24px rgba(245,0,87,0.3);
    --shadow-btn-h: 0 0 36px rgba(245,0,87,0.45);

    /* theme-toggle icon visibility */
    --icon-sun-opacity:  0;
    --icon-moon-opacity: 1;
}

/* ── Light theme tokens ── */
[data-theme="light"] {
    --bg:           #F5F5F7;
    --bg-card:      #FFFFFF;
    --bg-hover:     #EBEBF0;
    --bg-nav:       rgba(245,245,247,0.9);
    --surface-glass: rgba(255,255,255,0.75);
    --text-primary: #0A0A0A;
    --text-body:    #444444;
    --text-muted:   #888888;
    --border-subtle: rgba(0,0,0,0.07);
    --border-medium: rgba(0,0,0,0.12);
    --shadow-card:  0 8px 32px rgba(0,0,0,0.08);
    --shadow-btn:   0 0 20px rgba(245,0,87,0.2);
    --shadow-btn-h: 0 0 30px rgba(245,0,87,0.35);

    --icon-sun-opacity:  1;
    --icon-moon-opacity: 0;
}

/* ─── Smooth theme transition ─── */
*, *::before, *::after {
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ─── Theme Toggle Button ─── */
.theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.3s ease;
}
.theme-toggle:hover {
    border-color: var(--pink-neon);
    transform: scale(1.08);
}
.theme-toggle .icon-sun {
    position: absolute;
    color: #F59E0B;
    opacity: var(--icon-sun-opacity);
    transition: opacity 0.3s ease;
}
.theme-toggle .icon-moon {
    position: absolute;
    color: var(--cyan-neon);
    opacity: var(--icon-moon-opacity);
    transition: opacity 0.3s ease;
}

/* ─── Typography helpers ─── */
.eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan-neon);
}

.lead {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-body);
}

/* ─── Glass surface ─── */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
}

/* ─── Card ─── */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    border: 1px solid var(--border-subtle);
}

.card:hover,
.glass:hover {
    background-color: var(--bg-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

/* ─── Neon border hover ─── */
.neon-border-hover {
    border: 1px solid var(--border-subtle);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.neon-border-hover:hover {
    border-color: rgba(245,0,87,0.35);
    box-shadow: 0 0 28px rgba(245,0,87,0.1);
    transform: translateY(-3px);
}

/* ─── Text gradient ─── */
.text-gradient {
    background: linear-gradient(135deg, var(--pink-neon) 0%, var(--deep-purple) 45%, var(--cyan-neon) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Buttons ─── */
.btn-primary {
    background-color: var(--pink-neon);
    color: #FFFFFF;
    border-radius: 1rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-btn);
    text-decoration: none;
}
.btn-primary:hover {
    background-color: #d4004d;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn-h);
}

.btn-secondary {
    background-color: transparent;
    color: var(--cyan-neon);
    border: 1.5px solid rgba(0,229,255,0.35);
    border-radius: 1rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn-secondary:hover {
    background-color: rgba(0,229,255,0.06);
    color: var(--cyan-neon);
    transform: translateY(-1px);
}

/* Light mode secondary adjustments */
[data-theme="light"] .btn-secondary {
    border-color: rgba(0,180,200,0.4);
}

/* ─── Section label pill ─── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border-medium);
    background: rgba(0,229,255,0.05);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan-neon);
}

/* ─── Stat chips ─── */
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-body);
    background: var(--surface-glass);
    border: 1px solid var(--border-subtle);
}

/* ─── Feature icon ─── */
.feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── Prose sections (privacy / terms / about) ─── */
.prose-section {
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
}
.prose-section:hover {
    border-color: var(--border-medium);
}
.prose-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.prose-section p,
.prose-section li {
    color: var(--text-body);
    line-height: 1.75;
    font-size: 0.9375rem;
}
.prose-section ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.prose-section ul li {
    padding-left: 1.25rem;
    position: relative;
}
.prose-section ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--pink-neon);
    font-weight: 600;
}
.prose-section a {
    color: var(--cyan-neon);
    text-decoration: none;
}
.prose-section a:hover {
    color: var(--pink-neon);
}

/* ─── Info card (sidebar) ─── */
.info-card {
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
}
.info-card .info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.info-card .info-row:last-child { border-bottom: none; }
.info-card .info-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.info-card .info-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.info-card .info-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Footer ─── */
.footer-inner {
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 1.5rem;
}

/* ─── Nav links ─── */
.nav-link {
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--pink-neon);
    transition: width 0.25s ease;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--text-primary); font-weight: 600; }

/* ─── Global links ─── */
a {
    color: var(--pink-neon);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover, a:focus-visible { color: var(--cyan-neon); }

/* ─── Focus & accessibility ─── */
.skip-link {
    position: absolute;
    left: 1rem;
    top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 9999px;
    transform: translateY(-140%);
    transition: transform 0.2s ease;
    z-index: 60;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-medium);
}
.skip-link:focus-visible { transform: translateY(0); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cyan-neon);
    outline-offset: 2px;
}

/* ─── Headings & text defaults ─── */
h1, h2, h3 { color: var(--text-primary); }
p, span, li, button, input { color: var(--text-body); }
input, button, textarea, select { font: inherit; }

/* ─── Light mode text overrides ─── */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 { color: #0A0A0A; }
[data-theme="light"] .text-white { color: #0A0A0A !important; }
[data-theme="light"] .text-text-secondary { color: #555555 !important; }

/* ─── Cursor glow ─── */
#cursor-dot {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(0,229,255,0.08) 0%, transparent 68%);
    pointer-events: none;
    position: fixed;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* ─── Hero ─── */
.hero-section h1 { max-width: 14ch; }
.hero-section p,
.feature-list p,
.content-section p { color: var(--text-body); }

/* ─── Phone float ─── */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}
.phone-float { animation: float 6s ease-in-out infinite; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .glass, .card, .prose-section {
        padding: 1.5rem;
        border-radius: var(--radius-card);
    }
}

@media (max-width: 640px) {
    html { font-size: 0.9rem; }
    body { line-height: 1.55; }
    .hero-section { padding-top: 3.5rem; }
    .hero-section h1 { font-size: 2.6rem; }
    .glass, .card, .prose-section { padding: 1.125rem; }
    #cursor-dot { width: 220px; height: 220px; }
    .skip-link { left: 0.5rem; top: 0.5rem; padding: 0.5rem 0.75rem; }
}

[x-cloak] { display: none !important; }
CSSEOF
/* ─── Mobile nav link (slide-in menu) ─── */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: rgba(245,0,87,0.08);
    color: var(--pink-neon);
}
.mobile-nav-link svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.mobile-nav-link:hover svg,
.mobile-nav-link:active svg {
    opacity: 1;
}

/* ─── Phone mockup: cap size on tiny screens ─── */
@media (max-width: 400px) {
    .phone-float {
        max-width: 220px !important;
    }
}

/* ─── Screen showcase: fix overflow on small devices ─── */
@media (max-width: 480px) {
    .screen-showcase-phone {
        width: 200px !important;
    }
}

/* ─── Image performance hints ─── */
img {
    content-visibility: auto;
}
