/* ═══════════════════════════════════════════════════════════════
   THORNEVERSE - BASE STYLES
   CSS Variables, Reset, Typography, Utilities
   ═══════════════════════════════════════════════════════════════ */

/* CSS Custom Properties - Dark Theme (Default) */
:root {
    /* Brand Colors */
    --gold-bright: #d4a020;
    --gold-shine: #e8b830;
    --gold-dark: #8b6914;
    --crimson: #8b1020;
    --crimson-light: #c41a3a;
    --blood-glow: #c41a3a;
    --purple-smoke: #6a2c7a;
    --purple-bright: #9932CC;
    --purple-deep: #6a2c7a;

    /* Backgrounds */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0f;
    --bg-card: rgba(0, 0, 0, 0.65);
    --bg-card-solid: rgba(10, 6, 8, 0.97);
    --bg-overlay: rgba(0, 0, 0, 0.97);

    /* Text Colors */
    --text-bright: #f0e8ec;
    --text-soft: #c8b8c0;
    --text-dim: #8a7a82;
    --text-muted: #666666;

    /* Reader-specific */
    --reader-accent: #a78bfa;
    --reader-danger: #dc2626;
    --reader-bg: #0a0a0f;

    /* Borders */
    --border-gold: rgba(201, 169, 89, 0.5);
    --border-crimson: rgba(139, 16, 32, 0.35);
    --border-purple: rgba(128, 0, 255, 0.3);

    /* Shadows */
    --shadow-gold: rgba(212, 160, 32, 0.4);
    --shadow-dark: rgba(0, 0, 0, 0.9);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --z-background: 0;
    --z-content: 10;
    --z-header: 50;
    --z-drawer: 50;
    --z-overlay: 80;
    --z-panel: 90;
    --z-fixed: 100;
    --z-modal: 1000;
    --z-stealth: 9999;
}

/* ═══════════════════════════════════════════════════════════════
   CSS RESET
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-primary);
    color: var(--text-bright);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

/* Font Families */
.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-bebas {
    font-family: 'Bebas Neue', sans-serif;
}

.font-cormorant {
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.font-crimson {
    font-family: 'Crimson Text', Georgia, serif;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-bright);
}

h1 {
    font-size: clamp(2rem, 7vw, 4rem);
    letter-spacing: 0.25em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    letter-spacing: 0.1em;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    letter-spacing: 0.08em;
}

/* Text utilities */
.text-gold { color: var(--gold-bright); }
.text-crimson { color: var(--crimson-light); }
.text-purple { color: var(--purple-smoke); }
.text-bright { color: var(--text-bright); }
.text-soft { color: var(--text-soft); }
.text-dim { color: var(--text-dim); }

.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }
.text-italic { font-style: italic; }

.letter-spacing-wide { letter-spacing: 0.15em; }
.letter-spacing-wider { letter-spacing: 0.25em; }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flexbox */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* Spacing */
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width */
.w-full { width: 100%; }
.max-w-sm { max-width: 500px; }
.max-w-md { max-width: 700px; }
.max-w-lg { max-width: 1100px; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow-y: auto; }

/* Scrollbar hiding */
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Transitions */
.transition { transition: var(--transition-normal); }
.transition-fast { transition: var(--transition-fast); }
.transition-slow { transition: var(--transition-slow); }

/* ═══════════════════════════════════════════════════════════════
   BACKGROUND IMAGES
   ═══════════════════════════════════════════════════════════════ */

.bg-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background-size: cover;
    background-position: center;
}

.bg-thorneverse { background-image: url(../thorneverse-bg.png); background-position: center 40%; }
.bg-ruin-series { background-image: url(../ruin-series-bg.png); }
.bg-let-go { background-image: url(../let-go-bg.png); }
.bg-thorne-heights { background-image: url(../thorne-heights-bg.png); }

/* ═══════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-card {
    height: 150px;
    border-radius: 12px;
}

.skeleton-circle {
    border-radius: 50%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   FOCUS STATES (Accessibility)
   ═══════════════════════════════════════════════════════════════ */

:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

/* Skip to main content link (screen readers) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gold-bright);
    color: var(--bg-primary);
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}
