/**
 * A24 Aesthetic - Restrained, Cinematic, Unsettling
 * 80% colour / typography / spacing, 20% imagery
 */

/* ======================
   Design System
   ====================== */
:root {
    /* Color Palette - Professional & Modern */
    --color-void: #0A0E17;           /* Deep background */
    --color-void-secondary: #111827; /* Section separation */
    --color-accent: #14B8A6;         /* Teal - CTAs, links, highlights */
    --color-steel: #94A3B8;          /* Steel gray - metadata */
    --color-text: #E2E8F0;           /* Body text */
    --color-text-muted: #94A3B8;     /* Muted text */

    /* Accent variations */
    --accent-soft: rgba(20, 184, 166, 0.08);
    --accent-border: rgba(20, 184, 166, 0.2);
    --accent-glow: rgba(20, 184, 166, 0.15);

    /* Typography - Clean & Modern */
    --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-reading: 'Inter', -apple-system, sans-serif;

    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-24: 6rem;     /* 96px */

    /* Shadows - Subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 16px var(--accent-glow);

    /* Transitions - Smooth but restrained */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius - Minimal */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ======================
   Base Styles
   ====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: 0.2px;
    color: var(--color-text);
    background: var(--color-void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.02"/></svg>');
    pointer-events: none;
    z-index: 1;
}

.site-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* ======================
   Typography
   ====================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-6);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--space-4);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-muted);
}

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

a:hover {
    opacity: 0.8;
}

strong {
    font-weight: 600;
    color: var(--color-text);
}

/* ======================
   Layout
   ====================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
}

.site-main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* ======================
   Header - Minimal
   ====================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 13, 16, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(107, 124, 147, 0.1);
    padding: var(--space-4) 0;
    transition: all var(--transition-base);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.site-header.scrolled {
    padding: var(--space-3) 0;
    background: rgba(11, 13, 16, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
}

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

.site-branding {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.site-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.site-title a {
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.site-title a:hover {
    color: var(--color-accent);
    opacity: 1;
}

.site-tagline {
    display: none;
}

/* ======================
   Navigation - Clean
   ====================== */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-2);
    align-items: center;
}

.nav-menu a {
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 1px;
    background: var(--color-accent);
    transition: transform var(--transition-base);
}

.nav-menu a:hover {
    color: var(--color-text);
    opacity: 1;
}

.nav-menu a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-menu li.active a {
    color: var(--color-text);
}

.btn-subscribe {
    background: var(--color-accent);
    color: white !important;
    padding: var(--space-2) var(--space-6) !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-subscribe:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    opacity: 1;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}

.hamburger,
.hamburger::before,
.hamburger::after {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    display: block;
    transition: all var(--transition-base);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
}

.hamburger::before { transform: translateY(-8px); }
.hamburger::after { transform: translateY(8px); }

/* ======================
   Footer - Minimal
   ====================== */
.site-footer {
    background: var(--color-void-secondary);
    border-top: 1px solid rgba(107, 124, 147, 0.1);
    padding: var(--space-12) 0 var(--space-8);
    margin-top: var(--space-24);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.copyright {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.footer-nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-6);
}

.footer-nav a {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-nav a:hover {
    color: var(--color-text);
    opacity: 1;
}

/* ======================
   Messages
   ====================== */
.message {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-6);
    border-left: 2px solid;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
    color: #6EE7B7;
}

.message-error {
    background: rgba(20, 184, 166, 0.1);
    border-color: var(--color-accent);
    color: #FCA5A5;
}

.message-info {
    background: rgba(107, 124, 147, 0.1);
    border-color: var(--color-steel);
    color: #93C5FD;
}

/* ======================
   Utility Classes
   ====================== */
.text-center { text-align: center; }
.text-blood { color: var(--color-accent); }
.text-steel { color: var(--color-steel); }

/* ======================
   Responsive Design
   ====================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-void-secondary);
        padding: var(--space-4);
        border-top: 1px solid rgba(107, 124, 147, 0.1);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        width: 100%;
        text-align: center;
        padding: var(--space-3);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav ul {
        flex-direction: column;
        gap: var(--space-3);
    }
}

/* ======================
   Reading Mode System
   ====================== */
body.reading-mode-serif {
    font-family: var(--font-reading);
}

body.reading-mode-serif .chapter-content {
    font-family: var(--font-reading);
}

body.reading-size-small { font-size: 14px; }
body.reading-size-medium { font-size: 16px; }
body.reading-size-large { font-size: 18px; }

/* ======================
   Animations - Subtle
   ====================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-base);
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
}

/* Stagger delays */
.stagger-1 { animation-delay: 100ms; }
.stagger-2 { animation-delay: 200ms; }
.stagger-3 { animation-delay: 300ms; }
.stagger-4 { animation-delay: 400ms; }
.stagger-5 { animation-delay: 500ms; }
