/* ============================================
   political.wiki — styles.css
   Glitched transmission from the archive
   ============================================ */

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

:root {
    --midnight: #0a0a12;
    --deep-indigo: #1a1a2e;
    --mid-indigo: #2d2b55;
    --indigo-bright: #3366ff;
    --indigo-vivid: #6366f1;
    --teal: #00d4aa;
    --glitch-red: #ff3366;
    --ghost: #d8d4e3;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--midnight);
    color: var(--ghost);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Grain Canvas Overlay --- */
#grain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    opacity: 1;
}

/* --- Hero: Signal Acquisition --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--midnight) 0%, var(--deep-indigo) 100%);
}

.hero-inner {
    text-align: center;
    max-width: 900px;
    padding: 2rem;
    position: relative;
}

.hero-overline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.redacted-line {
    display: inline-block;
    width: 60px;
    height: 2px;
    background: var(--indigo-bright);
    opacity: 0.4;
}

.mono-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal);
    opacity: 0.7;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 1.05;
    color: var(--ghost);
    position: relative;
    letter-spacing: -0.02em;
}

.hero-title::before,
.hero-title::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.hero-title::before {
    color: var(--glitch-red);
    z-index: -1;
}

.hero-title::after {
    color: var(--teal);
    z-index: -1;
}

.hero-title.glitch::before {
    opacity: 0.8;
    transform: translate(-3px, 2px);
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.hero-title.glitch::after {
    opacity: 0.8;
    transform: translate(3px, -2px);
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

.hero-subtitle {
    font-family: 'Source Serif 4', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--ghost);
    opacity: 0.5;
    margin-top: 1.5rem;
    line-height: 1.8;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--teal);
    opacity: 0.15;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}

/* --- Interstitial Words --- */
.interstitial {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    text-align: center;
    padding: 4rem 2rem;
    color: var(--indigo-bright);
    opacity: 0.12;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    position: relative;
    user-select: none;
    transition: opacity 0.6s ease;
}

.interstitial.visible {
    opacity: 0.2;
}

.interstitial.glitch {
    opacity: 0.5;
}

.interstitial.glitch::before,
.interstitial.glitch::after {
    content: attr(data-glitch);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.interstitial.glitch::before {
    color: var(--glitch-red);
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
    transform: translate(calc(-50% - 4px), calc(-50% + 2px));
}

.interstitial.glitch::after {
    color: var(--teal);
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    transform: translate(calc(-50% + 4px), calc(-50% - 2px));
}

/* --- Document Blocks --- */
.document-block {
    padding: 6rem 2rem;
    position: relative;
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}

.document-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--indigo-vivid), transparent);
    opacity: 0.15;
}

.block-inner {
    max-width: 720px;
    margin: 0 auto;
}

.block-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(216, 212, 227, 0.06);
}

.transmission-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mid-indigo);
    flex-shrink: 0;
}

.transmission-dot.active {
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    color: var(--ghost);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.body-text p {
    margin-bottom: 1.25rem;
    color: rgba(216, 212, 227, 0.75);
}

.body-text .emphasis-text {
    border-left: 2px solid var(--indigo-vivid);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: rgba(216, 212, 227, 0.6);
}

/* --- Redacted Blocks --- */
.redacted-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.06);
}

.redacted-bar {
    display: block;
    height: 12px;
    background: var(--deep-indigo);
    border-radius: 1px;
    width: 80%;
}

.redacted-bar.wide {
    width: 95%;
}

.redacted-bar.narrow {
    width: 45%;
}

/* --- Citations & Footnotes --- */
.citation {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(216, 212, 227, 0.04);
    font-size: 0.65rem;
    opacity: 0.4;
}

.citation-marker {
    color: var(--teal);
    margin-right: 0.5rem;
}

.annotation-strip {
    margin: 2rem 0;
    padding: 0.75rem 1rem;
    background: rgba(45, 43, 85, 0.2);
    border-left: 2px solid var(--glitch-red);
}

.annotation {
    font-size: 0.65rem;
    color: var(--glitch-red);
    opacity: 0.6;
}

.footnote-cluster {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(216, 212, 227, 0.06);
}

.footnote {
    font-size: 0.65rem;
    opacity: 0.35;
    margin-bottom: 0.3rem;
}

.footnote sup {
    color: var(--teal);
    margin-right: 0.3rem;
}

/* --- Signal Loss (Footer) --- */
.signal-loss {
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.signal-degradation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 2rem;
}

.degraded-line {
    display: block;
    height: 1px;
    background: var(--indigo-vivid);
    opacity: 0.15;
}

.degraded-line:nth-child(1) { width: 200px; }
.degraded-line:nth-child(2) { width: 120px; }
.degraded-line:nth-child(3) { width: 40px; }

.footer-text {
    margin-bottom: 0.75rem;
    font-size: 0.7rem;
}

.footer-text.dim {
    opacity: 0.25;
    font-size: 0.65rem;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: var(--teal);
    opacity: 0.6;
    margin-top: 2rem;
    animation: cursor-blink 1s steps(1) infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 0.6; }
    51%, 100% { opacity: 0; }
}

/* --- Scroll Reveal --- */
.document-block .block-inner {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.document-block.revealed .block-inner {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    body { font-size: 16px; }
    .document-block { padding: 4rem 1.25rem; }
    .hero-overline { gap: 0.5rem; }
    .redacted-line { width: 30px; }
}
