/* conc.quest - Concurrent Quest */
/* Colors: #2A3B4D #8A7A6A #EDE7DA #C8B8A0 #7B9DB7 #4A6A8A #F5F0E8 #3D4F5F */
/* Fonts: Share Tech Mono, Cormorant Garamond, Inter */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F5F0E8;
    color: #2A3B4D;
    font-family: "Inter", sans-serif;
    font-weight: 300;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Paper texture overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#paper-noise);
    pointer-events: none;
    z-index: 1000;
    opacity: 1;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Constellation canvas */
#constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}

/* Scroll container */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    position: relative;
    z-index: 2;
}

/* Hide scrollbar */
.scroll-container::-webkit-scrollbar {
    display: none;
}
.scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Thread sections */
.thread-section {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* Z-Layout Grid */
.z-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    height: 100%;
    padding: 4vh 5vw;
    position: relative;
}

/* Z-pattern positions */
.z-top-left {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: start;
}

.z-top-right {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: flex-end;
    align-self: start;
}

.z-center {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.z-content-left {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20vw;
    padding-left: 5vw;
}

.z-bottom-left {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    align-items: flex-end;
    align-self: end;
}

.z-bottom-right {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    align-self: end;
}

/* Thread labels */
.thread-label {
    font-family: "Share Tech Mono", monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: #7B9DB7;
    text-transform: uppercase;
}

.thread-status {
    font-family: "Share Tech Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #C8B8A0;
    text-transform: uppercase;
}

/* Star clusters */
.star-cluster {
    width: 60px;
    height: 60px;
    position: relative;
}

.star-cluster::before,
.star-cluster::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background-color: #C8B8A0;
}

.star-cluster::before {
    width: 3px;
    height: 3px;
    top: 10px;
    right: 15px;
}

.star-cluster::after {
    width: 2px;
    height: 2px;
    top: 30px;
    right: 35px;
    box-shadow:
        8px -12px 0 0 #C8B8A0,
        22px 5px 0 0 #C8B8A0,
        -5px 15px 0 0 #8A7A6A,
        15px 20px 0 -0.5px #8A7A6A;
}

/* Site title - THREAD_00 */
.site-title {
    font-family: "Cormorant Garamond", serif;
    font-size: 6vw;
    font-weight: 300;
    font-style: italic;
    color: #2A3B4D;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s ease-out 0.3s forwards;
}

.site-tagline {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: #8A7A6A;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

/* Section headings */
.section-heading {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    font-style: italic;
    color: #2A3B4D;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.section-body {
    font-family: "Inter", sans-serif;
    font-size: clamp(14px, 1.1vw, 17px);
    font-weight: 300;
    line-height: 1.85;
    color: #3D4F5F;
    max-width: 540px;
}

/* Thread indicators */
.thread-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #C8B8A0;
    transition: all 0.4s ease;
}

.indicator-dot.active {
    background-color: #4A6A8A;
    box-shadow: 0 0 6px rgba(74, 106, 138, 0.3);
}

/* Thread line */
.thread-line {
    width: 40px;
    height: 1px;
    background-color: #C8B8A0;
}

/* Scroll prompt */
.scroll-prompt {
    font-family: "Share Tech Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #8A7A6A;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.8s forwards;
}

.prompt-arrow {
    display: inline-block;
    animation: pulseArrow 2s ease-in-out infinite;
}

/* Resolution section - THREAD_04 */
.resolution-text {
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #8A7A6A;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.resolution-line {
    width: 60px;
    height: 1px;
    background-color: #C8B8A0;
    margin: 0 auto 2rem;
}

.resolution-domain {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    font-style: italic;
    color: #2A3B4D;
    margin-bottom: 1rem;
}

.resolution-sub {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: #8A7A6A;
}

.thread-count {
    font-family: "Share Tech Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #C8B8A0;
}

.return-prompt {
    cursor: pointer;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 100vh;
    background-color: rgba(200, 184, 160, 0.2);
    z-index: 100;
}

.progress-fill {
    width: 100%;
    height: 0%;
    background-color: #4A6A8A;
    transition: height 0.3s ease;
}

/* Thread navigation */
.thread-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #C8B8A0;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.nav-dot:hover {
    border-color: #4A6A8A;
}

.nav-dot.active {
    background-color: #4A6A8A;
    border-color: #4A6A8A;
    transform: scale(1.2);
}

/* Section reveal animations */
.thread-section .z-top-left,
.thread-section .z-content-left,
.thread-section .z-center,
.thread-section .z-bottom-right,
.thread-section .z-bottom-left {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.thread-section.visible .z-top-left {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.thread-section.visible .z-content-left,
.thread-section.visible .z-center {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.thread-section.visible .z-bottom-left {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.thread-section.visible .z-bottom-right {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* Override for THREAD_00 which has its own animations */
#thread-00.visible .z-center {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulseArrow {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(3px); }
}

/* Thin horizontal rule between sections (pseudo-element) */
.thread-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 5vw;
    right: 5vw;
    height: 1px;
    background: linear-gradient(to right, transparent, #C8B8A0, transparent);
    opacity: 0.3;
}

.thread-section:last-child::after {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .z-layout {
        padding: 3vh 4vw;
    }
    .z-content-left {
        padding-right: 4vw;
        padding-left: 0;
    }
    .site-title {
        font-size: 10vw;
    }
    .section-heading {
        font-size: 2rem;
    }
    .thread-nav {
        right: 10px;
        gap: 12px;
    }
}