/* ========================================================
   MAHIKARI · DESIGN TOKENS & BASE ARCHITECTURE
   Luxury Minimal Editorial System · Native CSS Custom Properties
======================================================== */

:root {
    /* Surface Hierarchy (Dark Luxury Studio) */
    --surface-0: #05070e;
    --surface-1: rgba(11, 15, 25, 0.82);
    --surface-2: rgba(17, 23, 38, 0.88);
    --surface-3: rgba(23, 31, 52, 0.96);
    --surface-hover: rgba(30, 40, 68, 0.9);
    --track-bg: rgba(255, 255, 255, 0.08);

    /* Text Tones */
    --color-text: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;

    /* Micro Borders */
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-subtle: rgba(255, 255, 255, 0.04);
    --color-border-active: rgba(255, 255, 255, 0.2);

    /* Dynamic Persona Accent Tokens (Updated via JS) */
    --color-accent: #38bdf8;
    --color-accent-secondary: #f43f5e;
    --color-accent-glow: rgba(56, 189, 248, 0.28);

    /* Elevation Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Believable Lighting Shadows */
    --shadow-soft: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-deep: 0 24px 64px -12px rgba(0, 0, 0, 0.82);
    --shadow-accent: 0 8px 24px var(--color-accent-glow);

    /* Typography Hierarchy */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, monospace;

    /* Transitions */
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: 150ms var(--ease-out-quint);
    --transition-normal: 260ms var(--ease-out-quint);
    --transition-smooth: 400ms var(--ease-out-quint);
}

/* Light Mode System (Refined Editorial & Non-Glaring Alabaster) */
body.light-mode {
    --surface-0: #eef2f6;
    --surface-1: rgba(255, 255, 255, 0.86);
    --surface-2: rgba(248, 250, 252, 0.94);
    --surface-3: #ffffff;
    --surface-hover: rgba(241, 245, 249, 0.95);
    --track-bg: rgba(15, 23, 42, 0.12);

    --color-text: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;

    --color-border: rgba(15, 23, 42, 0.11);
    --color-border-subtle: rgba(15, 23, 42, 0.06);
    --color-border-active: rgba(15, 23, 42, 0.22);

    --shadow-soft: 0 6px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-deep: 0 24px 64px -12px rgba(15, 23, 42, 0.16), 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

/* Light mode accent readability adjustments */
body.light-mode .creator-tagline,
body.light-mode .track-category-tag,
body.light-mode .micro-title,
body.light-mode .suite-title,
body.light-mode .time-display span:first-child {
    filter: brightness(0.74) saturate(1.45);
}

/* Global Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    background-color: var(--surface-0);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--surface-0);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    line-height: 1.5;
    position: relative;
}

/* Accessibility: Skip Link */
.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 99999;
    padding: 0.6rem 1rem;
    background: var(--surface-3);
    color: var(--color-text);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}

/* Custom Refined Minimal Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-active);
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}