/**
 * StarryStories Web App - Design System
 * Dark-first, sleep-safe UI tokens matching mobile app
 */

:root {
    /* Colors - Background */
    --bg-primary: #0E0F13;
    --bg-surface: #161821;
    --bg-surface-alt: #1A1C27;

    /* Colors - Text */
    --text-primary: #EAEAF0;
    --text-secondary: #9A9CAB;

    /* Colors - Accents */
    --accent-primary: #5B7CFA;
    --accent-primary-hover: #7B9CFF;
    --accent-warning: #F2C94C;
    --accent-gradient: linear-gradient(135deg, #5B7CFA 0%, #8B5CF6 100%);

    /* Colors - Utility */
    --divider: #242633;
    --overlay: rgba(14, 15, 19, 0.6);
    --card-bg: rgba(22, 24, 33, 0.8);
    --card-border: rgba(91, 124, 250, 0.1);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-s: 12px;
    --spacing-m: 16px;
    --spacing-l: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-app-title: 28px;
    --font-size-heading: 22px;
    --font-size-subheading: 18px;
    --font-size-body: 16px;
    --font-size-small: 14px;
    --font-size-caption: 13px;

    --font-weight-bold: 700;
    --font-weight-semibold: 600;
    --font-weight-medium: 500;
    --font-weight-regular: 400;

    --line-height-tight: 1.3;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;

    /* Border Radius */
    --radius-xs: 8px;
    --radius-s: 12px;
    --radius-m: 16px;
    --radius-l: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(91, 124, 250, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Z-Index */
    --z-base: 1;
    --z-sticky: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--font-size-app-title);
}

h2 {
    font-size: var(--font-size-heading);
}

h3 {
    font-size: var(--font-size-subheading);
}

p {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-m);
}

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Selection */
::selection {
    background-color: var(--accent-primary);
    color: white;
}