/* ============================================================
   DESIGN SYSTEM: historical.quest
   ============================================================ */

/* Color Palette */
:root {
    --color-bg-primary: #1E1F23;
    --color-bg-alt: #2B2D31;
    --color-surface-glass: #F0ECE6;
    --color-text-primary: #E8E4DE;
    --color-text-secondary: #9B978F;
    --color-text-tertiary: #6E6B65;
    --color-accent-warm: #C4B99A;
    --color-accent-cool: #7A8B7A;
    --color-divider: #3A3B3F;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Spacing */
    --diagonal-angle: -7deg;
    --diagonal-counter: 7deg;
}

/* ============================================================
   RESET AND BASE STYLES
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ============================================================
   VIEWPORT AND LAYOUT
   ============================================================ */

.viewport-wrapper {
    position: relative;
    width: 100vw;
    overflow: hidden;
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    right: 0;
    top: 0;
    width: 1px;
    height: 0;
    background-color: rgba(122, 139, 122, 0.6);
    z-index: 1000;
    will-change: height;
}

/* ============================================================
   DIAGONAL BAND SYSTEM
   ============================================================ */

.diagonal-band {
    position: relative;
    width: 100%;
    overflow: hidden;
    transform: skewY(var(--diagonal-angle));
    will-change: transform;
}

.band-inner {
    position: relative;
    transform: skewY(var(--diagonal-counter));
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

/* Band sizing */
.band-hero {
    height: 100vh;
    background-color: var(--color-bg-primary);
}

.band-hero .band-inner {
    min-height: 100vh;
}

.band-wide {
    min-height: 100vh;
    background-color: var(--color-bg-primary);
}

.band-wide .band-inner {
    min-height: 100vh;
}

.band-narrow {
    height: 40vh;
    background-color: var(--color-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.band-narrow .band-inner {
    min-height: 40vh;
}

.band-alt {
    background-color: var(--color-bg-alt);
}

.band-terminal {
    height: 60vh;
    background-color: var(--color-bg-primary);
    transform: skewY(0deg);
}

.band-terminal .band-inner {
    transform: skewY(0deg);
    height: 100%;
}

/* ============================================================
   GLASSMORPHIC CARDS
   ============================================================ */

.glassmorphic-card {
    position: relative;
    background: rgba(240, 236, 230, 0.08);
    backdrop-filter: blur(24px) saturate(0.8);
    border: 1px solid rgba(240, 236, 230, 0.12);
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(240, 236, 230, 0.06);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    transform: translateY(40px);
}

.glassmorphic-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Card sizes */
.card-hero {
    width: 100%;
    max-width: 600px;
    padding: 4rem;
    text-align: center;
}

.card-plaque {
    width: 100%;
    max-width: 800px;
    padding: 2rem 3rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-dossier {
    width: 100%;
    max-width: 560px;
    padding: 3rem;
    min-height: auto;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2 {
    font-family: var(--font-heading);
    letter-spacing: -0.04em;
    line-height: 0.95;
    font-weight: 500;
}

.title-primary {
    font-size: clamp(48px, 10vw, 112px);
    color: var(--color-text-primary);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.95;
    word-spacing: 0.3em;
}

.title-primary .char {
    display: inline-block;
    opacity: 0;
    animation: char-reveal 0.8s ease-out forwards;
}

.title-primary .char:nth-child(1) { animation-delay: 0.0s; }
.title-primary .char:nth-child(2) { animation-delay: 0.08s; }
.title-primary .char:nth-child(3) { animation-delay: 0.16s; }
.title-primary .char:nth-child(4) { animation-delay: 0.24s; }
.title-primary .char:nth-child(5) { animation-delay: 0.32s; }
.title-primary .char:nth-child(6) { animation-delay: 0.40s; }
.title-primary .char:nth-child(7) { animation-delay: 0.48s; }
.title-primary .char:nth-child(8) { animation-delay: 0.56s; }
.title-primary .char:nth-child(9) { animation-delay: 0.64s; }
.title-primary .char:nth-child(10) { animation-delay: 0.72s; }
.title-primary .char:nth-child(11) { animation-delay: 0.80s; }
.title-primary .char:nth-child(12) { animation-delay: 0.88s; }
.title-primary .char:nth-child(13) { animation-delay: 0.96s; }
.title-primary .char:nth-child(14) { animation-delay: 1.04s; }
.title-primary .char:nth-child(15) { animation-delay: 1.12s; }
.title-primary .char:nth-child(16) { animation-delay: 1.20s; }

@keyframes char-reveal {
    from {
        opacity: 0;
        color: var(--color-text-tertiary);
    }
    to {
        opacity: 1;
        color: var(--color-text-primary);
    }
}

.heading-secondary {
    font-size: 28px;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: text-reveal 0.8s ease-out 0.2s forwards;
}

@keyframes text-reveal {
    from {
        opacity: 0;
        color: var(--color-text-tertiary);
    }
    to {
        opacity: 1;
        color: var(--color-text-primary);
    }
}

.body-text {
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    max-width: 52ch;
    opacity: 0;
    animation: text-reveal 0.8s ease-out 0.35s forwards;
}

.caption-primary {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    opacity: 0;
    animation: text-reveal 0.8s ease-out 0.15s forwards;
}

.caption-secondary {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    opacity: 0;
    animation: text-reveal 0.8s ease-out 0.15s forwards;
}

.timestamp {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: rgba(232, 228, 222, 0.4);
    text-align: center;
}

/* Pull quotes */
.pull-quote {
    font-family: var(--font-body);
    font-size: 28px;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: var(--color-accent-warm);
    line-height: 1.4;
}

/* ============================================================
   DIVIDERS AND DECORATIVE ELEMENTS
   ============================================================ */

.divider {
    width: 80%;
    height: 1px;
    background-color: var(--color-divider);
    margin: 1.5rem 0;
    transform: skewX(-7deg);
}

.dot-cluster {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-start;
}

.dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--color-text-tertiary);
    opacity: 0.3;
}

/* ============================================================
   ORGANIC BLOBS
   ============================================================ */

.organic-blob {
    position: absolute;
    pointer-events: none;
    opacity: 0.02;
    will-change: transform;
}

.blob-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    left: 5%;
    animation: blob-drift-1 45s ease-in-out infinite;
}

.blob-2 {
    width: 350px;
    height: 350px;
    top: -10%;
    right: 10%;
    animation: blob-drift-2 50s ease-in-out infinite;
}

.blob-3 {
    width: 500px;
    height: 500px;
    top: 20%;
    left: -10%;
    animation: blob-drift-3 55s ease-in-out infinite;
}

.blob-4 {
    width: 380px;
    height: 380px;
    bottom: 5%;
    right: 15%;
    animation: blob-drift-4 48s ease-in-out infinite;
}

.blob-5 {
    width: 450px;
    height: 450px;
    top: 15%;
    left: 20%;
    animation: blob-drift-5 52s ease-in-out infinite;
}

.blob-6 {
    width: 400px;
    height: 400px;
    bottom: 10%;
    left: 10%;
    animation: blob-drift-6 46s ease-in-out infinite;
}

@keyframes blob-drift-1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(50px, -60px) rotate(90deg) scale(1.05);
    }
    50% {
        transform: translate(100px, 40px) rotate(180deg) scale(0.95);
    }
    75% {
        transform: translate(30px, 80px) rotate(270deg) scale(1.02);
    }
}

@keyframes blob-drift-2 {
    0%, 100% {
        transform: translate(0, 0) rotate(45deg) scale(0.95);
    }
    25% {
        transform: translate(-40px, 50px) rotate(135deg) scale(1.02);
    }
    50% {
        transform: translate(-80px, -30px) rotate(225deg) scale(1);
    }
    75% {
        transform: translate(-20px, -70px) rotate(315deg) scale(0.98);
    }
}

@keyframes blob-drift-3 {
    0%, 100% {
        transform: translate(0, 0) rotate(-30deg) scale(1);
    }
    25% {
        transform: translate(60px, 40px) rotate(60deg) scale(1.03);
    }
    50% {
        transform: translate(120px, -50px) rotate(150deg) scale(0.97);
    }
    75% {
        transform: translate(40px, -90px) rotate(240deg) scale(1.01);
    }
}

@keyframes blob-drift-4 {
    0%, 100% {
        transform: translate(0, 0) rotate(20deg) scale(1);
    }
    25% {
        transform: translate(-50px, -40px) rotate(110deg) scale(1.02);
    }
    50% {
        transform: translate(-100px, 60px) rotate(200deg) scale(0.98);
    }
    75% {
        transform: translate(-30px, 80px) rotate(290deg) scale(1.03);
    }
}

@keyframes blob-drift-5 {
    0%, 100% {
        transform: translate(0, 0) rotate(-60deg) scale(0.98);
    }
    25% {
        transform: translate(70px, -50px) rotate(30deg) scale(1.04);
    }
    50% {
        transform: translate(130px, 70px) rotate(120deg) scale(0.96);
    }
    75% {
        transform: translate(50px, 100px) rotate(210deg) scale(1.02);
    }
}

@keyframes blob-drift-6 {
    0%, 100% {
        transform: translate(0, 0) rotate(15deg) scale(1.01);
    }
    25% {
        transform: translate(-60px, 50px) rotate(105deg) scale(0.99);
    }
    50% {
        transform: translate(-110px, -40px) rotate(195deg) scale(1.03);
    }
    75% {
        transform: translate(-40px, -80px) rotate(285deg) scale(0.97);
    }
}

/* ============================================================
   FOG LAYERS
   ============================================================ */

.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(30, 31, 35, 0.3) 50%,
        transparent 100%
    );
    pointer-events: none;
    animation: fog-drift 20s ease-in-out infinite;
}

@keyframes fog-drift {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-20px);
    }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .band-inner {
        padding: 2rem;
    }

    .title-primary {
        font-size: clamp(32px, 8vw, 56px);
    }

    .card-hero {
        padding: 2rem;
    }

    .card-dossier {
        padding: 2rem;
    }

    .body-text {
        font-size: 15px;
    }

    .organic-blob {
        opacity: 0.01;
    }

    .band-narrow {
        height: 30vh;
    }

    .band-narrow .band-inner {
        min-height: 30vh;
    }
}

@media (max-width: 480px) {
    .band-inner {
        padding: 1.5rem;
    }

    .title-primary {
        font-size: clamp(24px, 6vw, 40px);
        word-spacing: 0.1em;
    }

    .card-hero {
        padding: 1.5rem;
    }

    .card-plaque {
        padding: 1.5rem;
    }

    .card-dossier {
        padding: 1.5rem;
    }

    .heading-secondary {
        font-size: 20px;
    }

    .body-text {
        font-size: 14px;
    }

    .band-narrow {
        height: 25vh;
    }

    .band-narrow .band-inner {
        min-height: 25vh;
    }
}

/* ============================================================
   ANIMATION STATE CLASSES
   ============================================================ */

.band-revealed {
    opacity: 1;
}

.blob-visible {
    opacity: 0.06;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .scroll-progress {
        display: none;
    }

    .organic-blob {
        display: none;
    }

    .fog-layer {
        display: none;
    }
}
