/* ========================================
   diplomatic.boo - Y2K Diplomatic Dispatch Console
   Colors: #F4E8D1 #8B5E3C #C85A17 #E8913A #8A9BA8 #2B1810 #1A0E08 #D4451A #0D0704
   Fonts: Space Grotesk, Cormorant, Inter
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0D0704;
    color: #F4E8D1;
    font-family: 'Cormorant', Georgia, serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- INTRO OVERLAY --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0D0704;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out;
}

#intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-overlay.hidden {
    display: none;
}

#intro-content {
    text-align: center;
    position: relative;
}

#intro-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(244, 232, 209, 0.015) 2px,
        rgba(244, 232, 209, 0.015) 4px
    );
    pointer-events: none;
    z-index: 1;
}

#intro-text-container {
    font-family: 'Space Grotesk', monospace, sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #C85A17;
    position: relative;
    z-index: 2;
}

#intro-prefix {
    color: #8A9BA8;
}

#intro-cursor {
    animation: cursor-blink 0.6s step-end infinite;
    color: #D4451A;
}

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

#intro-status {
    margin-top: 32px;
    position: relative;
    z-index: 2;
}

#intro-progress-bar {
    width: 280px;
    height: 2px;
    background-color: #1A0E08;
    margin: 0 auto 12px;
    border-radius: 1px;
    overflow: hidden;
}

#intro-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #C85A17, #E8913A, #D4451A);
    transition: width 0.1s linear;
}

#intro-status-text {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #8A9BA8;
    opacity: 0.6;
}

/* --- HUD FRAME --- */
#hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

#hud-frame.visible {
    opacity: 1;
}

.hud-bar {
    position: absolute;
    display: flex;
    align-items: center;
}

.hud-bar-top {
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    border-bottom: 1px solid rgba(200, 90, 23, 0.25);
    background: linear-gradient(180deg, rgba(13, 7, 4, 0.95) 0%, rgba(13, 7, 4, 0.7) 100%);
    padding: 0 16px;
    justify-content: space-between;
}

.hud-bar-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    border-top: 1px solid rgba(200, 90, 23, 0.25);
    background: linear-gradient(0deg, rgba(13, 7, 4, 0.95) 0%, rgba(13, 7, 4, 0.7) 100%);
    padding: 0 16px;
    justify-content: space-between;
}

.hud-bar-left {
    top: 48px;
    left: 0;
    bottom: 48px;
    width: 48px;
    border-right: 1px solid rgba(200, 90, 23, 0.15);
    background: linear-gradient(90deg, rgba(13, 7, 4, 0.9) 0%, transparent 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.hud-bar-right {
    top: 48px;
    right: 0;
    bottom: 48px;
    width: 48px;
    border-left: 1px solid rgba(200, 90, 23, 0.15);
    background: linear-gradient(270deg, rgba(13, 7, 4, 0.9) 0%, transparent 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* HUD corners */
.hud-corner {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hud-corner-tl {
    border-left: 2px solid #C85A17;
    border-top: 2px solid #C85A17;
    margin-top: -1px;
    margin-left: -1px;
}

.hud-corner-tr {
    border-right: 2px solid #C85A17;
    border-top: 2px solid #C85A17;
    margin-top: -1px;
    margin-right: -1px;
}

.hud-corner-bl {
    border-left: 2px solid #C85A17;
    border-bottom: 2px solid #C85A17;
    margin-bottom: -1px;
    margin-left: -1px;
}

.hud-corner-br {
    border-right: 2px solid #C85A17;
    border-bottom: 2px solid #C85A17;
    margin-bottom: -1px;
    margin-right: -1px;
}

/* HUD text styles */
.hud-status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.hud-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #8A9BA8;
    opacity: 0.6;
}

.hud-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #C85A17;
}

.hud-separator {
    color: rgba(200, 90, 23, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
}

.hud-timestamp {
    font-family: 'Space Grotesk', monospace, sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #E8913A;
    opacity: 0.7;
}

.hud-pulse {
    animation: hud-pulse-glow 2s ease-in-out infinite;
}

@keyframes hud-pulse-glow {
    0%, 100% { opacity: 1; text-shadow: 0 0 4px rgba(200, 90, 23, 0.3); }
    50% { opacity: 0.6; text-shadow: 0 0 8px rgba(200, 90, 23, 0.6); }
}

.hud-blink {
    animation: hud-blink-anim 3s step-end infinite;
}

@keyframes hud-blink-anim {
    0%, 90% { opacity: 1; }
    91%, 95% { opacity: 0; }
    96%, 100% { opacity: 1; }
}

/* Vertical HUD text */
.hud-vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

/* HUD dots */
.hud-vertical-indicator {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.hud-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #2B1810;
    border: 1px solid rgba(200, 90, 23, 0.3);
}

.hud-dot-active {
    background-color: #C85A17;
    box-shadow: 0 0 6px rgba(200, 90, 23, 0.5);
}

/* Signal bars */
.hud-signal-bars {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    align-items: center;
}

.signal-bar {
    width: 6px;
    height: 3px;
    background-color: rgba(200, 90, 23, 0.2);
    border-radius: 1px;
}

.signal-bar-1 { background-color: rgba(200, 90, 23, 0.8); }
.signal-bar-2 { background-color: rgba(200, 90, 23, 0.7); }
.signal-bar-3 { background-color: rgba(200, 90, 23, 0.5); }
.signal-bar-4 { background-color: rgba(200, 90, 23, 0.3); }
.signal-bar-5 { background-color: rgba(200, 90, 23, 0.15); }

/* --- SCROLL PROGRESS --- */
#scroll-progress {
    position: fixed;
    top: 48px;
    left: 0;
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, #C85A17, #E8913A, #D4451A);
    z-index: 1001;
    transition: width 0.05s linear;
}

/* --- MAIN CONTENT --- */
#dispatch-container {
    padding: 48px 48px;
    position: relative;
    z-index: 1;
}

/* --- DISPATCH CARDS --- */
.dispatch-card {
    max-width: 740px;
    margin: 0 auto 80px;
    padding: 48px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    background-color: #2B1810;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%232B1810'/%3E%3Crect width='1' height='1' x='1' y='1' fill='%23231509' opacity='0.3'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 20% 50%, rgba(139, 94, 60, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(139, 94, 60, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 94, 60, 0.03) 0%, transparent 60%);
    border: 1px solid rgba(200, 90, 23, 0.15);
    border-radius: 2px;
    box-shadow:
        0 4px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(244, 232, 209, 0.03),
        0 0 0 1px rgba(200, 90, 23, 0.08);
}

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

/* Leather emboss edge effect */
.dispatch-card::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(139, 94, 60, 0.1);
    border-radius: 1px;
    pointer-events: none;
}

/* Corner decorations */
.dispatch-card::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    border-left: 1px solid rgba(200, 90, 23, 0.2);
    border-top: 1px solid rgba(200, 90, 23, 0.2);
    pointer-events: none;
}

/* --- HERO CARD --- */
.dispatch-hero {
    min-height: calc(100vh - 96px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 120px;
    background-color: #1A0E08;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%231A0E08'/%3E%3Crect width='1' height='1' x='2' y='0' fill='%23150B06' opacity='0.4'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at center, rgba(200, 90, 23, 0.04) 0%, transparent 60%);
}

.dispatch-seal {
    margin-bottom: 40px;
}

.seal-svg {
    width: 160px;
    height: 160px;
    animation: seal-rotate 60s linear infinite;
}

@keyframes seal-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dispatch-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 56px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #F4E8D1;
    margin-bottom: 16px;
    text-shadow: 0 0 40px rgba(200, 90, 23, 0.15);
}

.dispatch-subtitle-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C85A17, transparent);
    margin: 0 auto 16px;
}

.dispatch-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: #8A9BA8;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.dispatch-meta {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-label {
    color: #8A9BA8;
    opacity: 0.5;
}

.meta-value {
    color: #C85A17;
}

.meta-divider {
    color: rgba(200, 90, 23, 0.3);
}

.meta-highlight {
    color: #D4451A;
    text-shadow: 0 0 8px rgba(212, 69, 26, 0.3);
}

/* --- DISPATCH HEADER --- */
.dispatch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(200, 90, 23, 0.12);
}

.dispatch-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #C85A17;
}

.dispatch-classification {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #8A9BA8;
    opacity: 0.7;
}

.classification-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8A9BA8;
    box-shadow: 0 0 4px rgba(138, 155, 168, 0.4);
}

.classification-dot-amber {
    background-color: #E8913A;
    box-shadow: 0 0 4px rgba(232, 145, 58, 0.4);
}

.classification-dot-green {
    background-color: #4a9a6a;
    box-shadow: 0 0 4px rgba(74, 154, 106, 0.4);
}

.dispatch-date {
    font-family: 'Space Grotesk', monospace, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #8B5E3C;
    margin-bottom: 24px;
}

/* --- DISPATCH HEADING --- */
.dispatch-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #F4E8D1;
    margin-bottom: 28px;
    line-height: 1.3;
}

/* --- DISPATCH BODY --- */
.dispatch-body {
    font-family: 'Cormorant', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: #F4E8D1;
    opacity: 0.85;
}

.dispatch-body p {
    margin-bottom: 20px;
}

.dispatch-body p:last-child {
    margin-bottom: 0;
}

/* Blockquote */
.dispatch-quote {
    border-left: 2px solid #C85A17;
    padding: 16px 24px;
    margin: 28px 0;
    background: rgba(200, 90, 23, 0.04);
    font-style: italic;
    font-size: 17px;
    color: #F4E8D1;
    opacity: 0.9;
}

.dispatch-quote cite {
    display: block;
    margin-top: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #8A9BA8;
    opacity: 0.7;
}

/* Data block */
.dispatch-data-block {
    margin: 24px 0;
    padding: 20px;
    background: rgba(13, 7, 4, 0.4);
    border: 1px solid rgba(200, 90, 23, 0.1);
    border-radius: 2px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200, 90, 23, 0.06);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #8A9BA8;
    opacity: 0.6;
}

.data-value {
    font-family: 'Space Grotesk', monospace, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #E8913A;
    letter-spacing: 0.05em;
}

/* Redacted text */
.redacted {
    background-color: #1A0E08;
    color: #1A0E08;
    padding: 2px 4px;
    border-radius: 1px;
    position: relative;
    user-select: none;
}

.redacted::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        #2B1810 0px,
        #2B1810 4px,
        #1A0E08 4px,
        #1A0E08 6px
    );
    border-radius: 1px;
}

/* --- DISPATCH FOOTER --- */
.dispatch-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(200, 90, 23, 0.12);
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #8B5E3C;
    opacity: 0.6;
}

/* --- DISPATCH FINAL --- */
.dispatch-final {
    text-align: center;
    margin-bottom: 120px;
}

.dispatch-seal-footer {
    margin: 32px auto;
    display: flex;
    justify-content: center;
}

.seal-svg-small {
    width: 80px;
    height: 80px;
    opacity: 0.7;
    animation: seal-rotate 40s linear infinite reverse;
}

.dispatch-closing {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #C85A17;
    opacity: 0.7;
    margin-top: 24px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    #dispatch-container {
        padding: 48px 16px;
    }

    .dispatch-card {
        padding: 28px 20px;
        margin-bottom: 48px;
    }

    .dispatch-title {
        font-size: 36px;
    }

    .dispatch-heading {
        font-size: 22px;
    }

    .dispatch-body {
        font-size: 16px;
    }

    .hud-bar-left,
    .hud-bar-right {
        display: none;
    }

    .hud-status-line {
        font-size: 7px;
    }

    .hud-status-line .hud-label,
    .hud-status-line .hud-value,
    .hud-status-line .hud-separator,
    .hud-status-line .hud-timestamp {
        font-size: 7px;
    }
}

@media (max-width: 480px) {
    .dispatch-card {
        padding: 20px 16px;
    }

    .dispatch-title {
        font-size: 28px;
    }

    .dispatch-meta {
        font-size: 8px;
    }

    .seal-svg {
        width: 100px;
        height: 100px;
    }
}

/* --- GLOBAL SCANLINE OVERLAY --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(244, 232, 209, 0.008) 2px,
        rgba(244, 232, 209, 0.008) 4px
    );
    pointer-events: none;
    z-index: 999;
}

/* --- AMBIENT GLOW --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(200, 90, 23, 0.03) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 998;
}
