/* =====================================================
   political.quest — Aurora Edition
   Avant-garde, full-bleed, serif-classic, mixed-media,
   abstract-tech, card-flip, aurora-gradient.
   ===================================================== */

:root {
    --aurora-dark: #0A0820;
    --aurora-violet: #6040C0;
    --aurora-green: #30C058;
    --manifesto-white: #F0EEF0;
    --tech-amber: #D0A030;
    --collage-red: #D04040;
    --circuit-gray: #505068;

    --serif: 'Libre Baskerville', 'Times New Roman', serif;

    --text-block-w: 680px;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--aurora-dark);
    color: var(--manifesto-white);
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.8;
    font-size: clamp(15px, 1vw, 17px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

a { color: inherit; text-decoration: none; }

p { font-weight: 400; }

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.15;
}

/* ---------- Aurora ambient (whole document, animated) ---------- */
.aurora-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.aurora-band {
    position: absolute;
    width: 140vw;
    height: 140vh;
    left: -20vw;
    top: -20vh;
    border-radius: 50%;
    filter: blur(120px);
    mix-blend-mode: screen;
    opacity: 0.55;
    animation: auroraDrift 22s ease-in-out infinite alternate;
}

.aurora-band.band-violet {
    background: radial-gradient(circle, rgba(96,64,192,0.85) 0%, rgba(96,64,192,0) 60%);
    animation-duration: 22s;
}
.aurora-band.band-green {
    background: radial-gradient(circle, rgba(48,192,88,0.7) 0%, rgba(48,192,88,0) 60%);
    animation-duration: 26s;
    animation-delay: -8s;
}
.aurora-band.band-amber {
    background: radial-gradient(circle, rgba(208,160,48,0.55) 0%, rgba(208,160,48,0) 60%);
    animation-duration: 30s;
    animation-delay: -14s;
}

@keyframes auroraDrift {
    0%   { transform: translate3d(-6%, -8%, 0) scale(1);   }
    25%  { transform: translate3d(8%, -2%, 0)  scale(1.05); }
    50%  { transform: translate3d(4%, 6%, 0)   scale(1.1);  }
    75%  { transform: translate3d(-4%, 2%, 0)  scale(1.02); }
    100% { transform: translate3d(6%, 8%, 0)   scale(1.06); }
}

/* ---------- Chapter framework ---------- */
.chapter {
    position: relative;
    width: 100vw;
    margin: 0;
    padding: 0;
    z-index: 1;
}

.chapter-inner {
    position: relative;
    width: 100%;
    max-width: var(--text-block-w);
    margin: 0 auto;
    padding: clamp(64px, 10vh, 140px) 24px;
    z-index: 4;
}

.overline {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tech-amber);
    opacity: 0.92;
}

.chapter-marker {
    font-family: var(--serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(20px, 2.5vw, 36px);
    color: var(--tech-amber);
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.chapter-title {
    font-size: clamp(28px, 3.5vw, 56px);
    color: var(--manifesto-white);
    margin-bottom: 22px;
    letter-spacing: -0.005em;
}

.chapter-lede {
    font-size: clamp(16px, 1.15vw, 19px);
    line-height: 1.7;
    color: var(--manifesto-white);
    opacity: 0.92;
    margin-bottom: 48px;
}

/* ===========================================================
   1. MANIFESTO WALL
   =========================================================== */
.manifesto-wall {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(96,64,192,0.55) 0%, rgba(10,8,32,0.0) 45%),
        linear-gradient(225deg, rgba(48,192,88,0.4) 0%, rgba(10,8,32,0.0) 50%),
        linear-gradient(180deg, var(--aurora-dark) 0%, #150f30 100%);
}

.network {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.network.is-revealed { opacity: 1; }

.net-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.6s ease;
}

.network.is-revealed .net-path {
    stroke-dashoffset: 0;
}

.node {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.4s ease, filter 0.4s ease;
    cursor: pointer;
}

.node:hover {
    transform: scale(1.6);
    filter: drop-shadow(0 0 12px rgba(208,160,48,0.85));
}

/* Collage layer */
.collage {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.collage-piece {
    position: absolute;
    opacity: 0;
    transform: translateY(8px) rotate(0deg);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.collage-piece.is-revealed {
    opacity: 1;
    transform: translateY(0) rotate(var(--tilt, 0deg));
}

/* Layout of collage pieces on the wall */
.torn-paper-a {
    width: 220px;
    top: 8%;
    left: 4%;
    --tilt: -6deg;
}
.stamp-a {
    width: 150px;
    bottom: 9%;
    right: 6%;
    --tilt: 12deg;
}
.tape-a {
    width: 200px;
    top: 14%;
    right: 10%;
    --tilt: -8deg;
}
.ink-a {
    width: 200px;
    bottom: 8%;
    left: 10%;
    --tilt: 4deg;
}
.torn-paper-b {
    width: 180px;
    top: 60%;
    right: 18%;
    --tilt: 9deg;
}
.tape-b {
    width: 160px;
    top: 36%;
    left: 16%;
    --tilt: -22deg;
}

/* Manifesto content block */
.manifesto-content {
    position: relative;
    z-index: 5;
    text-align: center;
    width: 100%;
    max-width: 880px;
    padding: 0 24px;
}

.manifesto-content .overline {
    display: inline-block;
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.domain-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(48px, 7vw, 112px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--manifesto-white);
    margin-bottom: 28px;
    background: linear-gradient(90deg, var(--manifesto-white) 0%, #efe7ff 50%, var(--manifesto-white) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.9s ease 0.5s, transform 0.9s ease 0.5s;
}

.manifesto-tagline {
    font-size: clamp(16px, 1.4vw, 22px);
    line-height: 1.55;
    color: var(--manifesto-white);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.9s ease 0.9s, transform 0.9s ease 0.9s;
    margin: 0 auto 36px;
    max-width: 640px;
}

.manifesto-meta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tech-amber);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.9s ease 1.2s, transform 0.9s ease 1.2s;
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--tech-amber);
    display: inline-block;
}

.manifesto-wall.is-revealed .manifesto-content .overline,
.manifesto-wall.is-revealed .domain-title,
.manifesto-wall.is-revealed .manifesto-tagline,
.manifesto-wall.is-revealed .manifesto-meta {
    opacity: 1;
    transform: translateY(0);
}
.manifesto-wall.is-revealed .manifesto-tagline {
    opacity: 0.92;
}

/* ===========================================================
   2. CHAPTER I — DIALOGUE (card flip)
   =========================================================== */
.chapter-dialogue {
    background:
        linear-gradient(180deg, rgba(96,64,192,0.0) 0%, rgba(96,64,192,0.18) 50%, rgba(48,192,88,0.16) 100%),
        var(--aurora-dark);
    padding: 0;
}

.chapter-stamp {
    position: absolute;
    width: 130px;
    top: 40px;
    right: 40px;
    opacity: 0.85;
    transform: rotate(8deg);
    z-index: 3;
}

.chapter-dialogue .chapter-inner {
    max-width: 1200px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    width: 100%;
}

/* Card flip mechanics */
.flip-card {
    perspective: 1400px;
    height: 320px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.flip-card.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.flip-card.wobble .flip-inner {
    animation: flipWobble 0.7s ease;
}

@keyframes flipWobble {
    0%   { transform: rotateY(0deg)   rotateZ(0deg); }
    25%  { transform: rotateY(-4deg)  rotateZ(-1deg); }
    60%  { transform: rotateY(3deg)   rotateZ(0.6deg); }
    100% { transform: rotateY(0deg)   rotateZ(0deg); }
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.5, 0.05, 0.2, 1);
}

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

.flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 30px 28px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(240,238,240,0.18);
}

.flip-front {
    background:
        linear-gradient(135deg, rgba(96,64,192,0.32) 0%, rgba(10,8,32,0.7) 100%),
        var(--aurora-dark);
}

.flip-back {
    transform: rotateY(180deg);
    background:
        linear-gradient(135deg, rgba(48,192,88,0.28) 0%, rgba(10,8,32,0.75) 100%),
        var(--aurora-dark);
    border-color: rgba(48,192,88,0.45);
}

.card-tag {
    font-family: var(--serif);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--tech-amber);
}

.flip-back .card-tag { color: var(--aurora-green); }

.card-headline {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(18px, 1.5vw, 24px);
    line-height: 1.25;
    color: var(--manifesto-white);
    margin: 14px 0 12px;
}

.card-body {
    font-size: 15px;
    line-height: 1.65;
    color: var(--manifesto-white);
    opacity: 0.88;
}

.card-cue {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    color: var(--tech-amber);
    letter-spacing: 0.04em;
    margin-top: 16px;
}
.flip-back .card-cue { color: var(--aurora-green); }

/* ===========================================================
   3. CHAPTER II — SPECTRUM
   =========================================================== */
.chapter-spectrum {
    background:
        linear-gradient(180deg, rgba(48,192,88,0.16) 0%, rgba(10,8,32,0.0) 40%, rgba(208,160,48,0.18) 100%),
        var(--aurora-dark);
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.chapter-spectrum .chapter-inner {
    max-width: 920px;
    padding-top: 16vh;
    padding-bottom: 16vh;
}

.network-spectrum {
    z-index: 1;
}

.spectrum-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin-top: 24px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--manifesto-white);
    opacity: 0.85;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.legend-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 12px currentColor;
}

.dot-violet { background: var(--aurora-violet); color: var(--aurora-violet); }
.dot-green  { background: var(--aurora-green);  color: var(--aurora-green); }
.dot-amber  { background: var(--tech-amber);    color: var(--tech-amber); }
.dot-red    { background: var(--collage-red);   color: var(--collage-red); }
.dot-gray   { background: var(--circuit-gray);  color: var(--circuit-gray); }

/* ===========================================================
   4. CHAPTER III — DISPATCHES
   =========================================================== */
.chapter-dispatches {
    background:
        linear-gradient(180deg, rgba(208,160,48,0.18) 0%, rgba(10,8,32,0.0) 40%, rgba(208,64,64,0.16) 100%),
        var(--aurora-dark);
    overflow: hidden;
}

.dispatch-tape {
    position: absolute;
    width: 280px;
    top: 50px;
    left: -30px;
    transform: rotate(-6deg);
    opacity: 0.6;
    z-index: 2;
}

.dispatch-stamp {
    position: absolute;
    width: 140px;
    bottom: 60px;
    right: 60px;
    transform: rotate(-12deg);
    opacity: 0.8;
    z-index: 2;
}

.chapter-dispatches .chapter-inner {
    max-width: 1180px;
}

.dispatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 36px;
    width: 100%;
    margin-top: 16px;
}

.dispatch {
    position: relative;
    padding: 30px 28px;
    background:
        linear-gradient(160deg, rgba(208,160,48,0.06) 0%, rgba(10,8,32,0.55) 100%);
    border-top: 1px solid rgba(208,160,48,0.55);
    border-bottom: 1px solid rgba(208,64,64,0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.dispatch.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.dispatch-tag {
    font-family: var(--serif);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--collage-red);
    margin-bottom: 14px;
}

.dispatch-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(20px, 1.8vw, 28px);
    line-height: 1.2;
    color: var(--manifesto-white);
    margin-bottom: 18px;
}

.dispatch p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--manifesto-white);
    opacity: 0.9;
    margin-bottom: 14px;
}

.dispatch-meta {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--tech-amber);
    opacity: 0.85 !important;
    margin-top: 8px;
}

/* ===========================================================
   5. RESOLUTION
   =========================================================== */
.resolution {
    background:
        linear-gradient(180deg, rgba(208,64,64,0.12) 0%, rgba(96,64,192,0.4) 50%, rgba(48,192,88,0.4) 100%),
        var(--aurora-dark);
    padding: 0;
    overflow: hidden;
    text-align: center;
}

.resolution-fragments {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: 200px;
    z-index: 1;
}

.resolution-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(80px, 14vh, 160px) 24px clamp(60px, 10vh, 120px);
}

.resolution .overline {
    display: inline-block;
    margin-bottom: 24px;
}

.resolution-line {
    font-family: var(--serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(22px, 2.6vw, 38px);
    line-height: 1.3;
    color: var(--manifesto-white);
    margin-bottom: 28px;
}

.resolution-meta {
    font-family: var(--serif);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tech-amber);
    opacity: 0.9;
}

/* ===========================================================
   Reveal-on-scroll utility
   =========================================================== */
.chapter:not(.manifesto-wall):not(.resolution)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(240,238,240,0.06), transparent 60%);
    z-index: 1;
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 760px) {
    .chapter-stamp { width: 90px; top: 24px; right: 18px; }
    .dispatch-stamp { width: 100px; right: 24px; bottom: 24px; }
    .dispatch-tape { width: 220px; left: -40px; top: 30px; }
    .torn-paper-a { width: 160px; }
    .stamp-a { width: 110px; }
    .tape-a { width: 150px; }
    .ink-a { width: 140px; }
    .torn-paper-b { width: 130px; right: 6%; }
    .tape-b { width: 120px; left: 6%; }

    .flip-card { height: 360px; }
    .card-grid, .dispatch-grid { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .aurora-band { animation: none; }
    .net-path { transition: none; stroke-dashoffset: 0; }
    .flip-inner { transition: none; }
    .flip-card.wobble .flip-inner { animation: none; }
}
