/* === concurrent.quest styles === */
/* Colors: #1A1210, #2A2018, #C87840, #D4A060, #8A5A3A, #F0E8D8, #A89888, #FFD080 */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #1A1210;
    color: #F0E8D8;
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
}

/* Noise Overlay */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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");
    background-size: 200px 200px;
}

/* === Quest Gate (Hero) === */
#quest-gate {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #C87840 0%, #2A2018 40%, #1A1210 80%);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.quest-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.title-main {
    display: block;
    background: linear-gradient(90deg, #C87840, #FFD080, #C87840);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.title-main.visible {
    opacity: 1;
    animation: shimmerGold 3s ease-in-out infinite;
}

@keyframes shimmerGold {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.title-quest {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3.6vw, 3rem);
    color: #D4A060;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.title-quest.visible {
    opacity: 1;
}

.hero-tagline {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #A89888;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-tagline.visible {
    opacity: 1;
}

/* === Lens Flares === */
.lens-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-flare {
    z-index: 5;
}

.flare-core {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 208, 128, 0.6) 0%, transparent 70%);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flare-core.bloom {
    transform: translate(-50%, -50%) scale(1);
    animation: pulseFlareSlow 5s ease-in-out infinite;
}

.flare-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flare-ring-1 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 208, 128, 0.15) 0%, transparent 70%);
    transition-delay: 0.2s;
}

.flare-ring-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 208, 128, 0.05) 0%, transparent 70%);
    transition-delay: 0.4s;
}

.flare-ring.bloom {
    transform: translate(-50%, -50%) scale(1);
}

.flare-streak {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 208, 128, 0.08), transparent);
    opacity: 0;
    transition: opacity 0.6s ease 0.5s;
}

.flare-streak.bloom {
    opacity: 1;
}

@keyframes pulseFlareSlow {
    0%, 100% { transform: translate(-50%, -50%) scale(0.95); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* === Thread Navigation (Right Edge) === */
#thread-nav {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(to left, #1A1210 0%, transparent 100%);
    z-index: 90;
}

.nav-item {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 13px;
    color: #A89888;
    text-decoration: none;
    writing-mode: horizontal-tb;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    cursor: pointer;
}

.nav-item.active {
    color: #FFD080;
    text-shadow: 0 0 12px rgba(255, 208, 128, 0.4);
}

/* === Thread Sections === */
.thread-section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 64px 260px 64px 64px;
}

.thread-section.odd {
    min-height: 80vh;
}

.thread-section.even {
    min-height: 60vh;
    background-color: #2A2018;
}

/* Thread Indicator Bar */
.thread-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.thread-indicator.visible {
    transform: scaleY(1);
}

[data-thread="amber"] .thread-indicator { background: #C87840; }
[data-thread="gold"] .thread-indicator { background: #D4A060; }
[data-thread="bronze"] .thread-indicator { background: #8A5A3A; }

/* Thread Progress Dots */
.thread-progress-dots {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-dot.visible {
    opacity: 1;
    transform: scale(1);
}

.dot-amber { background: #C87840; }
.dot-bronze { background: #8A5A3A; }
.dot-gold { background: #D4A060; }

/* === Section Frame === */
.section-frame {
    position: relative;
    padding: 48px;
    max-width: 700px;
    margin-left: 48px;
}

.frame-corner {
    position: absolute;
}

.corner-tl { top: 0; left: 0; }
.corner-tr { top: 0; right: 0; }
.corner-bl { bottom: 0; left: 0; }
.corner-br { bottom: 0; right: 0; }

.ornament-path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    transition: stroke-dashoffset 1s ease;
}

.section-frame.visible .ornament-path {
    stroke-dashoffset: 0;
}

/* Section Content */
.section-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.thread-label {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

[data-thread="amber"] .thread-label { color: #C87840; }
[data-thread="gold"] .thread-label { color: #D4A060; }
[data-thread="bronze"] .thread-label { color: #8A5A3A; }

.section-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    letter-spacing: 0.04em;
    color: #F0E8D8;
    margin-bottom: 24px;
}

.section-content p {
    color: #F0E8D8;
    margin-bottom: 16px;
}

.section-content p:last-child {
    margin-bottom: 0;
}

/* === Flare Separators === */
.flare-separator {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flare-separator .lens-flare {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 60px;
}

.flare-separator .flare-core {
    transform: translate(-50%, -50%) scale(1);
    animation: pulseFlareSlow 5s ease-in-out infinite;
}

.flare-separator .flare-ring {
    transform: translate(-50%, -50%) scale(1);
}

.flare-separator .flare-streak {
    opacity: 1;
}

/* === Progress Bar (Fixed Bottom) === */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    display: flex;
    z-index: 100;
    background: #2A2018;
}

.progress-segment {
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

.progress-segment.leading {
    animation: pulseSegment 1s ease-in-out infinite;
}

@keyframes pulseSegment {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* === Responsive === */
@media (max-width: 900px) {
    #thread-nav {
        display: none;
    }

    .thread-section {
        padding: 48px 24px 48px 48px;
    }

    .section-frame {
        margin-left: 24px;
        padding: 32px;
    }
}

@media (max-width: 600px) {
    .thread-section {
        padding: 32px 16px 32px 32px;
    }

    .section-frame {
        margin-left: 16px;
        padding: 24px;
    }

    .thread-progress-dots {
        left: 12px;
    }
}
