/* causality.club - Brutalist Debate Arena / Collision Diagram */
/* Colors: #F2F0EB #FFFFFF #1A1A1A #D64045 #2D5BFF #8B8680 #FFE066 #1A1A1A */

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

body {
    background: #F2F0EB;
    color: #1A1A1A;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* ===== Disruption Lines ===== */
#disruption-lines {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 5000px;
    pointer-events: none;
    z-index: 1;
}

/* ===== Highlight Marker ===== */
.highlight {
    background-image: linear-gradient(transparent 60%, #FFE066 60%);
    padding: 0 2px;
}

.highlight-inverted {
    background-image: linear-gradient(transparent 60%, rgba(255,224,102,0.3) 60%);
    padding: 0 2px;
}

/* ==========================================
   HERO: IMPACT ZONE
   ========================================== */

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #F2F0EB;
}

#bisect-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 10vw;
    height: 4px;
    background: #1A1A1A;
    transition: width 0.5s ease 1.2s;
    z-index: 2;
}

#bisect-line.extended {
    width: 100vw;
}

#if-label,
#then-label {
    position: absolute;
    left: 5vw;
    font-family: 'Anton', sans-serif;
    font-size: 3rem;
    color: #1A1A1A;
    text-transform: uppercase;
    line-height: 0.9;
    z-index: 3;
}

#if-label {
    top: calc(50% - 60px);
}

#then-label {
    top: calc(50% + 20px);
}

#collision-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    overflow: visible;
    white-space: nowrap;
}

#cause-word,
#effect-word {
    font-family: 'Anton', sans-serif;
    font-size: clamp(5rem, 15vw, 12rem);
    text-transform: uppercase;
    color: #1A1A1A;
    line-height: 0.9;
    display: inline-block;
    position: relative;
}

#cause-word {
    transform: translateX(-100vw);
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    margin-right: -0.06em;
}

#effect-word {
    transform: translateX(100vw);
    transition: transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
    margin-left: -0.06em;
}

#cause-word.collided {
    transform: translateX(0);
}

#effect-word.collided {
    transform: translateX(0);
}

/* Red flash on collision overlap */
#cause-word.collided::after {
    content: 'E';
    position: absolute;
    right: 0;
    top: 0;
    color: #D64045;
    pointer-events: none;
}

#effect-word.collided::first-letter {
    color: #D64045;
}

#domain-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #D64045;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
    white-space: nowrap;
}

#domain-label.visible {
    opacity: 1;
}

/* Screen shake */
@keyframes screen-shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 1px); }
    50% { transform: translate(-1px, -2px); }
    75% { transform: translate(1px, 2px); }
    100% { transform: translate(0, 0); }
}

body.shaking {
    animation: screen-shake 0.1s ease;
}

/* ==========================================
   ARENA: DEBATE GRID
   ========================================== */

#arena {
    position: relative;
    padding: 6rem 4vw;
    min-height: 100vh;
}

#debate-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.argument-card {
    background: #FFFFFF;
    border: 3px solid #1A1A1A;
    padding: 2rem;
    position: relative;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.argument-card.visible {
    opacity: 1;
}

/* Broken-grid offsets */
.argument-card:nth-child(1) { margin-top: -20px; }
.argument-card:nth-child(2) { margin-left: -30px; margin-top: 40px; }
.argument-card:nth-child(3) { margin-right: -20px; }
.argument-card:nth-child(4) { margin-left: 20px; margin-top: -30px; }
.argument-card:nth-child(5) { margin-top: 20px; margin-right: -40px; }
.argument-card:nth-child(6) { margin-left: -20px; margin-top: -10px; }

.card-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #D64045;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card-tag.accent-blue {
    color: #2D5BFF;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: 0.01em;
    color: #1A1A1A;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.card-body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    color: #1A1A1A;
    margin-bottom: 1rem;
}

.card-citation {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #8B8680;
    display: block;
}

.card-citation em {
    font-style: italic;
}

/* ===== Arrow Connections SVG ===== */
#arrow-connections {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.arrow-path {
    transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease, stroke-opacity 0.3s ease;
}

.arrow-path.drawn {
    stroke-dashoffset: 0 !important;
    stroke: #D64045;
    stroke-opacity: 1;
}

.arrow-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.2s ease 0.6s;
}

.arrow-label.visible {
    opacity: 1;
}

.blue-label.visible {
    fill: #2D5BFF;
}

/* ==========================================
   EVIDENCE WALL
   ========================================== */

#evidence-wall {
    position: relative;
    background: #1A1A1A;
    padding: 6rem 4vw;
    min-height: 80vh;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.8s ease;
    z-index: 5;
}

#evidence-wall.revealed {
    clip-path: inset(0 0 0 0);
}

.wall-title {
    font-family: 'Anton', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #D64045;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 0.9;
}

.evidence-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.evidence-card {
    background: #FFFFFF;
    border: 2px solid #8B8680;
    padding: 2rem 1.5rem 1.5rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.evidence-card.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation, 0deg));
}

/* Overlapping offsets */
.evidence-card:nth-child(1) { margin-top: 20px; }
.evidence-card:nth-child(2) { margin-top: -10px; margin-left: -15px; }
.evidence-card:nth-child(3) { margin-top: 30px; }
.evidence-card:nth-child(4) { margin-left: 10px; }
.evidence-card:nth-child(5) { margin-top: -20px; }
.evidence-card:nth-child(6) { margin-left: -10px; margin-top: 15px; }

.pushpin {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 10px;
    height: 10px;
    background: #D64045;
    border: 2px solid #1A1A1A;
    border-radius: 50%;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
    z-index: 2;
}

.evidence-card.visible .pushpin {
    transform: translateX(-50%) scale(1);
    transition-delay: 0.4s;
}

.evidence-card blockquote {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1A1A1A;
    margin-bottom: 0.75rem;
}

.evidence-card cite {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #8B8680;
    letter-spacing: 0.05em;
    font-style: normal;
}

/* ==========================================
   VERDICT FOOTER
   ========================================== */

#verdict {
    position: relative;
    padding: 8rem 5vw 6rem;
    background: #F2F0EB;
    z-index: 5;
}

#therefore-word {
    font-family: 'Anton', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    text-transform: uppercase;
    color: #1A1A1A;
    line-height: 0.9;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

#therefore-word.visible {
    opacity: 1;
    transform: translateY(0);
}

#conclusion {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    line-height: 1.75;
    color: #1A1A1A;
    margin-top: 2rem;
    max-width: 800px;
    min-height: 2rem;
}

.verdict-meta {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.meta-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #8B8680;
    text-transform: uppercase;
}

.meta-sep {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #D64045;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 900px) {
    #debate-grid {
        grid-template-columns: 1fr 1fr;
    }

    .argument-card:nth-child(n) {
        margin: 0 !important;
    }

    .evidence-cards {
        grid-template-columns: 1fr 1fr;
    }

    #arrow-connections {
        display: none;
    }
}

@media (max-width: 600px) {
    #debate-grid {
        grid-template-columns: 1fr;
    }

    .evidence-cards {
        grid-template-columns: 1fr;
    }

    #cause-word,
    #effect-word {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    #if-label,
    #then-label {
        font-size: 2rem;
    }

    #arena {
        padding: 3rem 2vw;
    }

    #verdict {
        padding: 4rem 3vw 4rem;
    }
}
