/* ============================================
   political.quest - Avant-Garde Full-Bleed
   Aurora-Gradient Political Expression
   ============================================ */

/* Color Palette:
   Aurora dark:     #0A0820
   Aurora violet:   #6040C0
   Aurora green:    #30C058
   Manifesto white: #F0EEF0
   Tech amber:      #D0A030
   Collage red:     #D04040
   Circuit gray:    #505068
*/

/* ---- RESET & BASE ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.8;
    color: #F0EEF0;
    background: #0A0820;
    overflow-x: hidden;
}

/* ---- AURORA GRADIENT ANIMATION ---- */
@keyframes auroraShift {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 100%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 0%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drawPath {
    from {
        stroke-dashoffset: 2000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

@keyframes collageFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(3px, -5px) rotate(0.5deg); }
}

/* ---- MANIFESTO WALL ---- */
#manifesto-wall {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg,
        #0A0820 0%,
        #0A0820 20%,
        #6040C0 40%,
        #30C058 60%,
        #6040C0 80%,
        #0A0820 100%
    );
    background-size: 400% 400%;
    animation: auroraShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

#network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.network-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawPath 1200ms ease forwards;
    animation-delay: 400ms;
}

.network-node {
    opacity: 0;
    animation: fadeInUp 600ms ease forwards;
}

.network-node:nth-child(4) { animation-delay: 800ms; }
.network-node:nth-child(5) { animation-delay: 900ms; }
.network-node:nth-child(6) { animation-delay: 1000ms; }
.network-node:nth-child(7) { animation-delay: 1100ms; }
.network-node:nth-child(8) { animation-delay: 1200ms; }
.network-node:nth-child(9) { animation-delay: 1300ms; }
.network-node:nth-child(10) { animation-delay: 1400ms; }
.network-node:nth-child(11) { animation-delay: 1500ms; }

/* ---- COLLAGE ELEMENTS ---- */
.collage-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.collage-piece {
    position: absolute;
    opacity: 0;
    animation: fadeInUp 500ms ease forwards;
}

.torn-paper {
    top: 8%;
    left: 5%;
    width: 200px;
    animation-delay: 100ms;
}

.stamp-mark {
    top: 15%;
    right: 8%;
    width: 100px;
    animation-delay: 200ms;
}

.ink-splash {
    bottom: 20%;
    left: 10%;
    width: 150px;
    animation-delay: 300ms;
}

.tape-strip {
    top: 40%;
    right: 15%;
    width: 180px;
    animation-delay: 400ms;
}

.torn-paper-2 {
    bottom: 12%;
    right: 5%;
    width: 160px;
    animation-delay: 500ms;
}

.collage-piece:hover {
    opacity: 1 !important;
    transition: opacity 300ms ease;
}

/* ---- MANIFESTO TITLE ---- */
#manifesto-title {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 800ms ease forwards;
    animation-delay: 200ms;
}

#manifesto-title h1 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 56px);
    color: #F0EEF0;
    letter-spacing: 0.02em;
    text-shadow: 0 0 40px rgba(96, 64, 192, 0.5), 0 0 80px rgba(48, 192, 88, 0.3);
    margin-bottom: 20px;
}

.manifesto-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 1.2vw, 20px);
    color: #F0EEF0;
    opacity: 0.8;
    letter-spacing: 0.04em;
}

/* ---- FULL-BLEED CHAPTERS ---- */
.full-bleed-chapter {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.chapter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.aurora-bg-1 {
    background: linear-gradient(160deg,
        #0A0820 0%,
        #0A0820 30%,
        #6040C0 60%,
        #0A0820 100%
    );
    background-size: 300% 300%;
    animation: auroraShift 15s ease infinite;
}

.aurora-bg-2 {
    background: linear-gradient(200deg,
        #0A0820 0%,
        #30C058 30%,
        #0A0820 60%,
        #6040C0 100%
    );
    background-size: 300% 300%;
    animation: auroraShift 15s ease infinite;
    animation-delay: -5s;
}

.aurora-bg-3 {
    background: linear-gradient(140deg,
        #0A0820 0%,
        #6040C0 25%,
        #30C058 50%,
        #0A0820 100%
    );
    background-size: 300% 300%;
    animation: auroraShift 15s ease infinite;
    animation-delay: -10s;
}

.aurora-bg-4 {
    background: linear-gradient(180deg,
        #0A0820 0%,
        #30C058 35%,
        #6040C0 65%,
        #0A0820 100%
    );
    background-size: 300% 300%;
    animation: auroraShift 15s ease infinite;
    animation-delay: -3s;
}

.collage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.chapter-torn {
    top: 0;
    left: 0;
    width: 300px;
}

.chapter-stamp {
    bottom: 10%;
    right: 5%;
    width: 120px;
}

.chapter-ink {
    top: 5%;
    right: 10%;
    width: 200px;
}

.chapter-tape {
    top: 10%;
    left: 8%;
    width: 250px;
}

.chapter-torn-2 {
    bottom: 5%;
    right: 10%;
    width: 200px;
}

/* ---- CHAPTER CONTENT ---- */
.chapter-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 30px;
}

.chapter-marker {
    display: block;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(20px, 2.5vw, 36px);
    color: #D0A030;
    margin-bottom: 30px;
}

.chapter-content p {
    color: #F0EEF0;
    margin-bottom: 20px;
}

/* ---- ABSTRACT DIAGRAM (Chapter 1) ---- */
.abstract-diagram {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
}

.diagram-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1s ease;
}

.diagram-line.drawn {
    stroke-dashoffset: 0;
}

.diagram-node {
    transition: filter 300ms ease, r 300ms ease;
}

.diagram-node:hover {
    filter: url(#glow);
}

.diagram-label {
    font-family: 'Libre Baskerville', serif;
    font-size: 12px;
    fill: #F0EEF0;
    text-anchor: middle;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ---- CARD-FLIP GRID ---- */
.card-flip-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1100px;
    width: 90%;
    margin: 50px auto;
    perspective: 1200px;
}

.card-flip-container {
    height: 320px;
    cursor: pointer;
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 500ms ease;
    transform-style: preserve-3d;
}

.card-flip-container:hover .card-flip-inner,
.card-flip-container.flipped .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-container.wobble .card-flip-inner {
    animation: wobble 200ms ease;
}

.card-front, .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 35px;
    border: 1px solid rgba(96, 64, 192, 0.3);
}

.card-front {
    background: linear-gradient(145deg, rgba(10, 8, 32, 0.95), rgba(96, 64, 192, 0.15));
    backdrop-filter: blur(10px);
}

.card-back {
    background: linear-gradient(145deg, rgba(10, 8, 32, 0.95), rgba(48, 192, 88, 0.15));
    backdrop-filter: blur(10px);
    transform: rotateY(180deg);
}

.card-label {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #D0A030;
    margin-bottom: 15px;
}

.card-front h3, .card-back h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    color: #F0EEF0;
    margin-bottom: 15px;
}

.card-front p, .card-back p {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(13px, 0.9vw, 15px);
    line-height: 1.7;
    color: #F0EEF0;
    opacity: 0.85;
}

/* ---- ABSTRACT NETWORK LARGE (Chapter 3) ---- */
.abstract-network-large {
    position: relative;
    z-index: 2;
    width: 95%;
    max-width: 1000px;
    margin: 50px auto;
}

.net-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 1.5s ease;
}

.net-path.drawn {
    stroke-dashoffset: 0;
}

.net-node {
    transition: filter 300ms ease;
}

.net-node:hover {
    filter: url(#node-glow);
}

.net-label {
    font-family: 'Libre Baskerville', serif;
    font-size: 12px;
    fill: #F0EEF0;
    text-anchor: middle;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ---- RESOLUTION / FOOTER ---- */
#resolution {
    position: relative;
    width: 100vw;
    min-height: 40vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resolution-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        #0A0820 0%,
        #6040C0 40%,
        #30C058 70%,
        #0A0820 100%
    );
    background-size: 200% 200%;
    animation: auroraShift 15s ease infinite;
    animation-delay: -7s;
    z-index: 0;
}

.resolution-collage {
    z-index: 1;
}

.resolution-torn {
    bottom: 0;
    left: 0;
    width: 300px;
}

.resolution-stamp {
    top: 15%;
    right: 10%;
    width: 80px;
    opacity: 0.5;
}

.resolution-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

.mixed-media-label {
    display: block;
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #D0A030;
    margin-bottom: 20px;
}

.resolution-domain {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 48px);
    color: #F0EEF0;
    text-shadow: 0 0 30px rgba(96, 64, 192, 0.4);
}

/* ---- FULL-BLEED SECTION HOVER ---- */
.full-bleed-chapter:hover .chapter-bg {
    filter: brightness(1.05);
    transition: filter 400ms ease;
}

.chapter-bg {
    transition: filter 400ms ease;
}

/* ---- SCROLL REVEAL STATES ---- */
.chapter-content {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms ease, transform 600ms ease;
}

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

.card-flip-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.card-flip-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.abstract-diagram,
.abstract-network-large {
    opacity: 0;
    transition: opacity 800ms ease;
}

.abstract-diagram.visible,
.abstract-network-large.visible {
    opacity: 1;
}

/* ---- PARALLAX-LIKE COLLAGE DRIFT ---- */
.collage-overlay .collage-piece {
    opacity: 0.8;
    transition: transform 100ms linear;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .card-flip-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 95%;
    }

    .card-flip-container {
        height: 280px;
    }

    .chapter-content {
        padding: 30px 20px;
    }

    .collage-piece {
        display: none;
    }

    #manifesto-wall .collage-elements .collage-piece {
        display: block;
    }

    .stamp-mark, .tape-strip {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .card-flip-container {
        height: 300px;
    }

    .card-front, .card-back {
        padding: 25px;
    }
}
