/* diplomacy.boo — Ethereal Spectral Narrative
   Palette: #0E1117 #1E1C19 #5A7B8A #4A3F35 #E0DCD6 #7A7B7F #8B2500 #C8DCC8
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0E1117;
    color: #E0DCD6;
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Timeline Spine */
#timeline-spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: #5A7B8A;
    opacity: 0.2;
    z-index: 1;
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 2s ease;
}

#timeline-spine.visible {
    transform: scaleY(1);
}

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

.smoke-layer {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}

.smoke-layer.visible {
    opacity: 1;
}

.smoke-1 {
    background: radial-gradient(circle, rgba(90, 123, 138, 0.08) 0%, transparent 70%);
    top: 30%;
    left: 40%;
    animation: smokeDrift1 40s ease-in-out infinite;
}

.smoke-2 {
    background: radial-gradient(circle, rgba(90, 123, 138, 0.06) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    animation: smokeDrift2 35s ease-in-out infinite;
}

.smoke-3 {
    background: radial-gradient(circle, rgba(14, 17, 23, 0.1) 0%, transparent 70%);
    top: 35%;
    left: 45%;
    animation: smokeDrift3 50s ease-in-out infinite;
}

@keyframes smokeDrift1 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(30px, -20px, 0); }
}

@keyframes smokeDrift2 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-25px, 15px, 0); }
}

@keyframes smokeDrift3 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(15px, 25px, 0); }
}

.wax-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    color: #E0DCD6;
    min-height: 1.2em;
}

.hero-title .boo-suffix {
    color: #C8DCC8;
    opacity: 0.6;
}

.hero-classification {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: #7A7B7F;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-classification.visible {
    opacity: 1;
}

/* Timeline Content */
#timeline-content {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 24px 40px;
}

.timeline-event {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 120px;
}

.event-left {
    flex-direction: row-reverse;
}

.event-right {
    flex-direction: row;
}

.timeline-node {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border: 1px solid #5A7B8A;
    border-radius: 50%;
    background: #0E1117;
    z-index: 3;
}

.timeline-node.pulse {
    animation: nodePulse 3s ease-in-out;
}

@keyframes nodePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.15); }
}

.connector {
    width: 100px;
    height: 2px;
    position: absolute;
    top: 25px;
    z-index: 2;
}

.connector-left {
    right: 50%;
    margin-right: 10px;
}

.connector-right {
    left: 50%;
    margin-left: 10px;
}

.connector line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.8s ease;
}

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

.event-panel {
    width: 45%;
    background: #1E1C19;
    border: 1px solid rgba(74, 63, 53, 0.3);
    border-radius: 4px;
    padding: 32px 28px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-left {
    margin-right: auto;
    transform: translateX(20px);
}

.panel-right {
    margin-left: auto;
    transform: translateX(-20px);
}

.event-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.event-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: #7A7B7F;
    display: block;
    margin-bottom: 12px;
}

.event-title {
    font-family: 'Special Elite', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #5A7B8A;
    margin-bottom: 16px;
}

.event-body {
    color: #E0DCD6;
}

/* Redaction Bars */
.redaction-container {
    position: relative;
    display: inline;
}

.redacted-text {
    color: #8B2500;
    transition: opacity 0.3s ease;
}

.redaction-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: #8B2500;
    transform: translateY(-50%);
    transition: transform 0.2s ease-out;
    cursor: pointer;
}

.redaction-container:hover .redaction-bar {
    transform: translateY(-50%) translateX(110%);
}

.redaction-container:hover {
    animation: shakeError 0.2s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* The Veil */
#the-veil {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(180deg, #0E1117, rgba(200, 220, 200, 0.05), #0E1117);
}

.veil-content {
    text-align: center;
    max-width: 500px;
    padding: 40px 24px;
}

.veil-text {
    font-family: 'Crimson Text', serif;
    font-size: 1.1rem;
    margin-bottom: 32px;
    color: #E0DCD6;
}

.veil-opacity-80 { opacity: 0.8; }
.veil-opacity-60 { opacity: 0.6; }
.veil-opacity-40 { opacity: 0.4; }
.veil-opacity-20 { opacity: 0.2; }

/* Archive Footer */
#archive-footer {
    text-align: center;
    padding: 80px 24px;
    position: relative;
}

.footer-grain {
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #5A7B8A, transparent);
    opacity: 0.15;
    margin: 0 auto 24px;
}

.footer-classification {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #7A7B7F;
    margin-bottom: 8px;
}

.footer-name {
    font-family: 'Special Elite', cursive;
    font-size: 1rem;
    color: #4A3F35;
}

/* Responsive */
@media (max-width: 768px) {
    .event-panel {
        width: 80%;
    }

    .timeline-event {
        flex-direction: column;
        align-items: center;
    }

    .event-left {
        flex-direction: column;
    }

    .panel-left,
    .panel-right {
        margin: 40px auto 0;
        transform: translateY(10px);
    }

    .event-panel.visible {
        transform: translateY(0);
    }

    .connector {
        display: none;
    }

    .timeline-node {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: 16px;
    }
}
