@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;600&family=JetBrains+Mono:wght@300&family=Nothing+You+Could+Do&display=swap');

:root {
    --bg: #0a0a0a;
    --text: #ffffff;
    --accent: #d4af37; /* Gold touch */
    --muted: #666666;
    --thread-color: #222222;
    --personal: #888888; /* For marginalia */
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Cinematic Hero */
.hero.cinematic {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: #000;
}

.hero-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/images/background-01.png') no-repeat center center;
    background-size: cover;
    filter: blur(40px) brightness(0.4);
    transform: scale(1.1);
    z-index: 1;
}

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

.pre-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    color: var(--accent);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.hero h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(3.5rem, 12vw, 8rem);
    font-weight: 400;
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.hero-artifacts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.hero-mockup {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    filter: drop-shadow(0 0 100px rgba(0,0,0,0.8));
    opacity: 0.6;
}

.floating-artifact {
    position: absolute;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0.3;
    animation: float-slow 10s ease-in-out infinite;
}

.floating-artifact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
}

.a1 { top: 20%; left: 10%; animation-delay: 0s; }
.a2 { top: 60%; right: 10%; animation-delay: -5s; }

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.scroll-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.arrow-down {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--muted), transparent);
}

/* Editorial Container */
.editorial-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 10vh 2rem;
}

.intro-manifesto {
    max-width: 800px;
    margin: 0 auto 20vh auto;
    text-align: center;
    padding-top: 10vh;
}

.curator-note {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 1.6rem;
    color: var(--muted);
    line-height: 1.4;
}

/* Living Thread */
.timeline-thread {
    position: absolute;
    left: 25%;
    top: 30vh;
    bottom: 0;
    width: 2px;
    background: rgba(255,255,255,0.05); /* Very faint base line */
    z-index: 1;
}

.thread-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
    box-shadow: 0 0 15px var(--accent);
    transition: height 0.1s ease-out;
}

.thread-node.start {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 2rem;
}

.year-node {
    position: absolute;
    left: calc(100% + 4rem - 5px); /* Positioned relative to .sticky-year */
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--bg);
    border: 2px solid var(--muted);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.5s ease;
}

.active .year-node {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transform: translateY(-50%) scale(1.5);
}

/* Marginalia (Personal Side Notes) */
.marginalia {
    position: absolute;
    font-family: 'Nothing You Could Do', cursive;
    font-size: 1.1rem;
    color: var(--personal);
    width: 150px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transform: rotate(-5deg) translateY(10px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.active .marginalia {
    opacity: 0.7;
    transform: rotate(-5deg) translateY(0);
}

.marginalia.left { left: -180px; top: 20px; }
.marginalia.right { right: -180px; top: 40px; }
.marginalia.bottom { bottom: -40px; left: 0; transform: rotate(2deg); width: 250px;}

/* Reveal Animations */
.reveal .sticky-year {
    opacity: 0.1;
    transform: translateX(-20px) translateY(-50%);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal .content-block {
    opacity: 0;
    transform: translateX(30px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.active.reveal .sticky-year {
    opacity: 0.5;
    color: var(--text);
    transform: translateX(0) translateY(-50%);
}

.active.reveal .content-block {
    opacity: 1;
    transform: translateX(0);
}

/* Era Section */
.era-section {
    position: relative;
    display: flex;
    min-height: 120vh;
    margin-bottom: 10vh;
}

.sticky-year {
    position: sticky;
    top: 50vh;
    width: 25%;
    transform: translateY(-50%);
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(4rem, 8vw, 10rem);
    font-weight: 400;
    color: var(--muted);
    padding-right: 6rem;
    text-align: right;
    z-index: 2;
}

.content-block {
    width: 75%;
    padding-left: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.artifact {
    max-width: 600px;
}

.artifact h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.artifact .description {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 480px;
}

.metadata {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

/* Image Wrapper Effects */
.image-wrapper {
    position: relative;
    overflow: hidden;
}

.artifact img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(40%) brightness(0.8);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.artifact:hover img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.02);
}

.scan-line {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.1), transparent);
    pointer-events: none;
    transition: top 2s ease-in-out;
}

.artifact:hover .scan-line {
    top: 100%;
}

/* Variant Styles */
.artifact.side-by-side {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 900px;
}

.artifact.side-by-side .image-wrapper {
    width: 50%;
}

.artifact.large {
    max-width: 1000px;
}

.artifact.large img {
    height: 60vh;
    object-fit: cover;
}

/* Footer */
.editorial-footer {
    padding: 10vh 2rem;
    text-align: center;
    border-top: 1px solid #1a1a1a;
}

.editorial-footer p {
    color: var(--muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

/* Responsive & Mobile Optimization */
@media (max-width: 768px) {
    .hero-bg-blur { filter: blur(20px) brightness(0.3); }
    .hero-mockup { width: 250px; bottom: -50px; }
    .floating-artifact { display: none; }

    .hero h1 {
        font-size: 3.5rem;
        line-height: 1.1;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Adjust Thread Position for Mobile */
    .timeline-thread {
        left: 20px;
        top: 20vh;
    }

    .editorial-container {
        padding: 0 1.5rem 10vh 1.5rem;
    }

    .intro-manifesto {
        margin-bottom: 10vh;
        padding-top: 5vh;
    }

    .curator-note {
        font-size: 1.4rem;
        padding: 0 1rem;
    }

    /* Stacked Layout for Mobile */
    .era-section {
        flex-direction: column;
        min-height: auto;
        margin-bottom: 15vh;
    }

    .sticky-year {
        position: relative; /* Unstick or reposition for mobile flow */
        top: 0;
        width: 100%;
        text-align: left;
        padding-left: 40px; /* Offset from thread */
        font-size: 3.5rem;
        transform: none !important;
        margin-bottom: 2rem;
        opacity: 0.5;
    }

    .year-node {
        left: -25px;
    }

    .content-block {
        width: 100%;
        padding-left: 40px; /* Offset from thread */
    }

    .artifact h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .artifact .description {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    /* Variants */
    .artifact.side-by-side {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .artifact.side-by-side .image-wrapper {
        width: 100%;
    }

    .artifact.large img {
        height: 40vh;
    }

    /* Marginalia - Move to more predictable positions or hide if too cluttered */
    .marginalia {
        position: relative;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        margin-bottom: 1rem;
        display: block;
        width: 100%;
        font-size: 1rem;
    }

    /* Disable hover-only effects for touch */
    .artifact img {
        filter: grayscale(0%) brightness(1);
    }
}

/* Specific Tablet Tweaks */
@media (min-width: 769px) and (max-width: 1024px) {
    .sticky-year {
        width: 20%;
        font-size: 5rem;
    }
    .content-block {
        width: 80%;
    }
    .timeline-thread {
        left: 20%;
    }
}
