/* ============================================================
   historic.quest - Surrealist Museum of Impossible History
   Design Language: Monochrome with Chromatic Rupture
   ============================================================ */

/* CSS Variables */
:root {
    /* Colors from DESIGN.md */
    --black-deepest: #0A0A0A;
    --black-secondary: #1C1C1E;
    --gray-primary: #3A3A3C;
    --gray-light: #AEAEB2;
    --gray-lighter: #D1D1D6;
    --gray-lightest: #F2F2F7;
    --purple-rupture: #7B2D8E;
    --gray-mid: #636366;

    /* Typography */
    --font-main: 'Recursive', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, serif;

    /* Spacing */
    --spacing-unit: 1rem;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--black-secondary);
    color: var(--gray-lighter);
}

body {
    font-family: var(--font-main);
    background-color: var(--black-secondary);
    color: var(--gray-lighter);
    overflow-x: hidden;
}

/* ============================================================
   SCROLL SPINE - Left Edge Navigation Indicator
   ============================================================ */

.scroll-spine {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 200px;
    background: linear-gradient(to bottom,
        var(--gray-lighter),
        var(--purple-rupture),
        var(--gray-lighter));
    z-index: 1000;
    box-shadow: 0 0 10px rgba(123, 45, 142, 0.3);
}

/* ============================================================
   SPREADS - Main Content Sections
   ============================================================ */

.spread {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.spread-1 {
    background-color: var(--black-deepest);
    background-image:
        radial-gradient(circle at 30% 50%, rgba(123, 45, 142, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(174, 174, 178, 0.03) 0%, transparent 50%);
}

.spread-2 {
    background-color: var(--black-secondary);
}

.spread-3 {
    background-color: var(--black-secondary);
}

.spread-4 {
    background-color: var(--black-deepest);
}

.spread-5 {
    background-color: var(--black-secondary);
    border-top: 1px solid var(--gray-primary);
}

/* ============================================================
   SPREAD 1: HERO SECTION
   ============================================================ */

.crystalline-backdrop {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
    opacity: 0.15;
}

.crystal-icosahedron {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotate-crystal 20s linear infinite;
}

@keyframes rotate-crystal {
    from {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

.crystal-icosahedron::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid var(--gray-lighter);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.crystal-icosahedron::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border: 1px solid var(--gray-lighter);
    clip-path: polygon(50% 0%, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.5;
}

.glassmorphic-card {
    position: relative;
    z-index: 10;
    background: rgba(28, 28, 30, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(174, 174, 178, 0.3);
    padding: 4rem 3rem;
    max-width: 600px;
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    font-variation-settings: "wght" 900, "CASL" 0;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    animation: pulse-weight 8s ease-in-out infinite;
    color: var(--gray-lightest);
}

@keyframes pulse-weight {
    0%, 100% { font-variation-settings: "wght" 300, "CASL" 0; }
    50% { font-variation-settings: "wght" 900, "CASL" 0; }
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--purple-rupture);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.hero-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-light);
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================================
   SPREAD 2-5: CONTENT SPREADS
   ============================================================ */

.spread-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.spread-2 .spread-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.spread-2 .left-column {
    padding-left: 2rem;
    border-left: 3px solid var(--gray-primary);
}

.section-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    font-variation-settings: "wght" 900;
    letter-spacing: -0.01em;
    margin-bottom: 2rem;
    color: var(--gray-lightest);
}

.section-title.centered {
    text-align: center;
    width: 100%;
    border-bottom: 2px solid var(--gray-primary);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.section-text {
    font-size: 1.125rem;
    line-height: 1.9;
    color: var(--gray-light);
    max-width: 500px;
}

.timeline-card {
    position: relative;
    background: rgba(58, 58, 60, 0.5);
    border-left: 4px solid var(--purple-rupture);
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.timeline-year {
    display: block;
    font-size: 0.875rem;
    color: var(--purple-rupture);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--gray-lightest);
    margin-bottom: 1rem;
    font-optical-sizing: auto;
}

.timeline-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-light);
}

/* ============================================================
   CRYSTALLINE ORNAMENTS
   ============================================================ */

.crystal-ornament {
    width: 120px;
    height: 120px;
    position: relative;
    opacity: 0.12;
    margin-bottom: 2rem;
}

.crystal-ornament::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--gray-lighter);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation: float-up 4s ease-in-out infinite;
}

.crystal-ornament::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border: 1px solid var(--gray-lighter);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    left: 10%;
    top: 10%;
    opacity: 0.5;
}

.crystal-left {
    animation: float-up 5s ease-in-out infinite;
}

.crystal-right {
    animation: float-up 6s ease-in-out infinite reverse;
}

@keyframes float-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

/* ============================================================
   SPREAD 3: GALLERY
   ============================================================ */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

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

.gallery-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg,
        rgba(123, 45, 142, 0.1) 0%,
        rgba(58, 58, 60, 0.3) 100%);
    border: 2px solid var(--gray-primary);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image::before {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    border: 2px solid var(--gray-lighter);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.3;
}

.gallery-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--gray-lightest);
    margin-bottom: 0.75rem;
    font-optical-sizing: auto;
}

.gallery-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-light);
}

/* ============================================================
   SPREAD 4: MANIFESTO
   ============================================================ */

.manifesto-box {
    background: rgba(28, 28, 30, 0.8);
    border: 2px solid var(--gray-primary);
    padding: 4rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.manifesto-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--purple-rupture);
}

.manifesto-points {
    margin-top: 3rem;
}

.point {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--gray-primary);
}

.point:last-child {
    border-bottom: none;
}

.point-number {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--purple-rupture);
    font-variation-settings: "wght" 900;
}

.point-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--gray-lighter);
}

/* ============================================================
   SPREAD 5: CLOSING
   ============================================================ */

.closing-card {
    text-align: center;
    max-width: 700px;
}

.closing-text {
    font-size: 1.125rem;
    line-height: 2;
    color: var(--gray-light);
    margin-bottom: 3rem;
}

.closing-statement {
    background: rgba(123, 45, 142, 0.15);
    border-left: 4px solid var(--purple-rupture);
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.closing-emphasis {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--purple-rupture);
    line-height: 1.8;
}

.final-crystal {
    width: 150px;
    height: 150px;
    margin: 3rem auto 0;
    position: relative;
    opacity: 0.25;
}

.final-crystal::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--purple-rupture);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation: pulse-crystal 4s ease-in-out infinite;
}

@keyframes pulse-crystal {
    0%, 100% {
        transform: scale(1);
        opacity: 0.25;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

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

    .spread {
        padding: 2rem 1rem;
    }

    .spread-2 .spread-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .spread-2 .left-column {
        padding-left: 0;
        border-left: none;
        border-top: 3px solid var(--gray-primary);
        padding-top: 2rem;
    }

    .glassmorphic-card {
        padding: 2rem 1.5rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 4rem);
    }

    .manifesto-box {
        padding: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    .section-text {
        font-size: 1rem;
    }

    .point {
        grid-template-columns: 40px 1fr;
        gap: 1rem;
    }

    .point-text {
        font-size: 1rem;
    }
}
