/* === RIVER OF BLOOD - Rodok Genealogy === */

/* === CSS VARIABLES === */
:root {
    --color-dark: #0a0a0c;
    --color-dark-soft: #141418;
    --color-river-dark: #1a1a2e;
    --color-river-mid: #16213e;
    --color-river-light: #0f3460;
    --color-blood: #8B0000;
    --color-blood-faded: #4a0000;
    --color-gold: #c9a962;
    --color-cream: #f5f0e8;
    --color-text: #e8e4dc;
    --color-text-muted: #9a9590;
    --color-accent: #e94560;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Crimson Pro', Georgia, serif;

    --ease-fluid: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gold) var(--color-dark);
}

html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: var(--color-dark);
}

html::-webkit-scrollbar-thumb {
    background: var(--color-gold);
    border-radius: 4px;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* === RIVER CANVAS === */
#riverCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === FIXED UI === */
.era-indicator {
    position: fixed;
    top: 50%;
    right: 3rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    mix-blend-mode: difference;
}

.era-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.era-year {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 300;
    color: var(--color-gold);
    line-height: 1;
    min-width: 200px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.generation-counter {
    position: fixed;
    top: 50%;
    left: 3rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    mix-blend-mode: difference;
}

.counter-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.counter-number {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 200;
    color: var(--color-text);
    line-height: 1;
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    z-index: 100;
    mix-blend-mode: difference;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-cream);
    letter-spacing: 0.1em;
}

.nav-cta {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--color-gold);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-gold);
    letter-spacing: 0.05em;
    transition: all 0.3s var(--ease-fluid);
}

.nav-cta:hover {
    background: var(--color-gold);
    color: var(--color-dark);
}

/* === SCROLL PROMPT === */
.scroll-prompt {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    animation: floatPrompt 3s ease-in-out infinite;
}

.scroll-text {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.scroll-arrow {
    font-size: 2rem;
    color: var(--color-gold);
    animation: scrollUp 1.5s ease-in-out infinite;
}

@keyframes floatPrompt {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes scrollUp {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-8px); opacity: 1; }
}

/* === MAIN JOURNEY === */
.journey {
    position: relative;
    z-index: 1;
}

/* === CHAPTERS === */
.chapter {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 20rem 8rem 8rem;
    position: relative;
}

.chapter-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.era-badge {
    font-family: var(--font-display);
    font-size: 0.625rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.chapter-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    color: var(--color-cream);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.chapter-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.chapter-text.big {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-gold);
    margin: 2rem 0;
}

.chapter-hint {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--color-gold);
}

/* === PRESENT CHAPTER === */
.chapter-present {
    text-align: center;
    padding: 8rem 4rem;
}

.chapter-present .chapter-content {
    margin: 0 auto;
}

.chapter-visual {
    margin: 3rem 0;
}

.silhouette {
    width: 200px;
    height: 300px;
    margin: 0 auto;
    background: linear-gradient(180deg,
        rgba(201, 169, 98, 0.3) 0%,
        rgba(201, 169, 98, 0.1) 50%,
        transparent 100%
    );
    clip-path: polygon(
        50% 0%,
        65% 15%,
        70% 35%,
        75% 50%,
        80% 100%,
        20% 100%,
        25% 50%,
        30% 35%,
        35% 15%
    );
    animation: silhouetteGlow 4s ease-in-out infinite;
}

@keyframes silhouetteGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* === MEMORY FLOATS === */
.memory-float {
    position: absolute;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 169, 98, 0.3);
    padding: 1.5rem;
    max-width: 280px;
    cursor: pointer;
    transition: all 0.4s var(--ease-fluid);
    animation: floatMemory 6s ease-in-out infinite;
}

.memory-float:hover {
    transform: scale(1.05);
    border-color: var(--color-gold);
    box-shadow: 0 20px 60px rgba(201, 169, 98, 0.2);
}

.memory-float.left {
    left: 10%;
    animation-delay: -2s;
}

.memory-float.right {
    right: 10%;
    animation-delay: -4s;
}

.memory-float.wide {
    max-width: 400px;
    left: 5%;
}

.memory-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.memory-era {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--color-gold);
    letter-spacing: 0.1em;
}

.memory-text {
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.6;
}

@keyframes floatMemory {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* === MURKY CHAPTERS === */
.chapter.murky {
    opacity: 0.7;
}

.chapter.murky .chapter-title,
.chapter.murky .chapter-text {
    filter: blur(0.5px);
}

.chapter.deep-murky {
    opacity: 0.5;
}

.chapter.deep-murky .chapter-title,
.chapter.deep-murky .chapter-text {
    filter: blur(1px);
}

.chapter.void {
    opacity: 0.3;
}

.chapter.void .chapter-title {
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--color-gold);
}

.question {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-gold);
    margin-top: 2rem;
}

/* === TURN / CTA CHAPTER === */
.chapter.turn {
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(139, 0, 0, 0.1) 50%,
        rgba(10, 10, 12, 0.95) 100%
    );
    padding: 10rem 4rem;
}

.river-cta {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--color-cream);
    margin-bottom: 1.5rem;
}

.cta-subtitle {
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.cta-question {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-gold);
    margin: 2rem 0 3rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
}

.cta-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(135deg, var(--color-blood) 0%, var(--color-blood-faded) 100%);
    border: 1px solid var(--color-gold);
    text-decoration: none;
    transition: all 0.4s var(--ease-fluid);
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 98, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

.cta-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 60px rgba(139, 0, 0, 0.4);
}

.cta-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-cream);
    letter-spacing: 0.05em;
}

.cta-sub {
    font-size: 0.75rem;
    color: var(--color-gold);
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

.cta-services {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.service-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.service-mini:hover {
    opacity: 1;
}

.service-icon {
    font-size: 2rem;
}

.service-name {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* === FOOTER === */
.footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem;
    background: var(--color-dark);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .era-indicator {
        right: 2rem;
    }

    .era-year {
        font-size: 3rem;
        min-width: 150px;
    }

    .generation-counter {
        left: 2rem;
    }

    .counter-number {
        font-size: 4rem;
    }
}

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

    .era-indicator,
    .generation-counter {
        display: none;
    }

    .nav {
        padding: 1rem 1.5rem;
    }

    .nav-logo {
        font-size: 1.25rem;
    }

    .nav-cta {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .memory-float {
        position: relative;
        left: auto !important;
        right: auto !important;
        max-width: 100%;
        margin: 1rem 0;
    }

    .cta-services {
        flex-direction: column;
        gap: 2rem;
    }

    .scroll-prompt {
        display: none;
    }
}

@media (max-width: 480px) {
    .chapter-title {
        font-size: 2rem;
    }

    .era-year {
        font-size: 2.5rem;
    }

    .cta-title {
        font-size: 2rem;
    }
}

/* === UTILITY ANIMATIONS === */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

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

/* === GRAIN OVERLAY === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
