/* ===== CSS Custom Properties ===== */
:root {
    /* Burgundy-Cream Palette */
    --color-burgundy-deep: #3D0C1E;
    --color-burgundy-mid: #5A1A30;
    --color-cream-primary: #F5E6D8;
    --color-cream-muted: #E8D4C8;
    --color-cream-faint: #D4BFB0;
    --color-accent-gold: #C4A265;
    --color-shadow: #1A0610;
    --color-panel-fill: #3D0C1E;
    
    /* Typography */
    --font-display: 'Cormorant', serif;
    --font-body: 'Libre Baskerville', serif;
    --font-code: 'DM Sans', sans-serif;
    
    /* Sizing */
    --panel-max-width: 400px;
    --viewport-coverage: 40%;
    --gutter: 40px;
    
    /* Timing */
    --transition-default: 0.4s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-burgundy-deep);
    color: var(--color-cream-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ===== Cross-Hair Targeting Grid ===== */
.crosshair {
    position: fixed;
    background-color: var(--color-cream-primary);
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
}

.crosshair-h {
    top: 50vh;
    left: 0;
    width: 100vw;
    height: 1px;
    box-shadow: 0 0 12px rgba(245, 230, 216, 0.06);
}

.crosshair-v {
    top: 0;
    left: 50vw;
    width: 1px;
    height: 100vh;
    box-shadow: 0 0 12px rgba(245, 230, 216, 0.06);
}

@media (max-width: 768px) {
    .crosshair {
        display: none;
    }
}

/* ===== The Void Opening ===== */
.void-opening {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--color-burgundy-deep);
    padding: var(--gutter);
    position: relative;
    overflow: hidden;
}

.void-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.void-opening h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-cream-primary);
    text-shadow: 
        0 0 20px rgba(245, 230, 216, 0.15),
        0 0 40px rgba(245, 230, 216, 0.08);
    line-height: 1.1;
}

/* ===== Kinetic Typography Animation ===== */
@keyframes char-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kinetic-text span {
    display: inline-block;
    opacity: 0;
    animation: char-in 0.3s ease-out forwards;
}

/* ===== Scroll Container ===== */
.scroll-container {
    position: relative;
    width: 100%;
}

/* ===== Panel Sections ===== */
.panel-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
    position: relative;
    background-color: var(--color-burgundy-deep);
    transition: background-color var(--transition-default);
}

.panel-section[data-depth="1"] {
    --depth-opacity: 1;
    --depth-blur: 0;
}

.panel-section[data-depth="2"] {
    --depth-opacity: 0.7;
    --depth-blur: 3px;
}

.panel-section[data-depth="3"] {
    --depth-opacity: 0.4;
    --depth-blur: 3px;
}

/* Focused layer styling */
.panel-section.focused {
    --depth-opacity: 1;
    --depth-blur: 0;
}

/* ===== HUD Panels ===== */
.hud-panel {
    max-width: var(--panel-max-width);
    background-color: var(--color-panel-fill);
    border: 1px solid var(--color-cream-primary);
    padding: var(--gutter);
    position: relative;
    transition: 
        filter var(--transition-default),
        opacity var(--transition-default);
    opacity: var(--depth-opacity);
    filter: blur(var(--depth-blur));
    box-shadow: 
        0 0 12px rgba(245, 230, 216, 0.06),
        inset 0 0 12px rgba(245, 230, 216, 0.03);
}

.hud-panel.focused {
    opacity: 1;
    filter: blur(0);
}

/* Panel positioning variants */
.panel-1 {
    margin-right: auto;
    margin-left: 0;
}

.panel-2 {
    margin-left: auto;
    margin-right: 0;
}

.panel-3 {
    margin: 0 auto;
}

.panel-4 {
    margin-left: 0;
    margin-right: auto;
}

.panel-5 {
    margin-right: auto;
    margin-left: 0;
}

.panel-6 {
    margin: 0 auto;
}

/* ===== Panel Labels (HUD) ===== */
.panel-label {
    font-family: var(--font-code);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cream-muted);
    opacity: 0.6;
    margin-bottom: 16px;
    display: block;
}

/* ===== Headings ===== */
.hud-panel h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: var(--color-cream-primary);
    text-shadow: 
        0 0 20px rgba(245, 230, 216, 0.15),
        0 0 40px rgba(245, 230, 216, 0.08);
    margin-bottom: 16px;
}

/* ===== Panel Paragraphs ===== */
.hud-panel p {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-cream-primary);
    opacity: 0.9;
}

/* ===== Void Closing ===== */
.void-closing {
    text-align: center;
}

.void-closing h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 24px;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
    .panel-1, .panel-2, .panel-4, .panel-5 {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hud-panel {
        max-width: 90vw;
    }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
    :root {
        --panel-max-width: 100%;
        --gutter: 24px;
    }
    
    .panel-section {
        min-height: auto;
        padding: 60px var(--gutter);
        display: block;
    }
    
    .hud-panel {
        max-width: 100%;
        margin-bottom: 40vh;
    }
    
    .void-opening h1 {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }
    
    .hud-panel h2 {
        font-size: clamp(1.25rem, 3vw, 1.75rem);
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== Print Styles ===== */
@media print {
    .crosshair {
        display: none;
    }
    
    .panel-section {
        page-break-inside: avoid;
        min-height: auto;
    }
    
    .hud-panel {
        border: 1px solid var(--color-cream-muted);
        box-shadow: none;
    }
}

/* ===== Utility Classes ===== */
.focused {
    filter: blur(0) !important;
    opacity: 1 !important;
}

.blurred {
    filter: blur(3px);
    opacity: 0.4;
}
