/* diplomatic.day v2 -- Classified Document Aesthetic
   Cold War-era diplomatic study; redaction as primary visual system.
   Palette: Deep Graphite #1C1F26 / Anthracite #23262D / Near Black #16181D
   Obsidian #2A2D35 / Frost Silver #C8CDD3 / Diplomatic Slate #5A6472
   Diplomatic Gold #B8A04E / Cipher Red #7A3B3B / Cold Mercury #8E95A0
*/

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

html {
    scroll-behavior: smooth;
    background: #1C1F26;
}

body {
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.4vw, 18px);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: #C8CDD3;
    background: #1C1F26;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Section Indicator (top-right fixed) === */
.section-indicator {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 50;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #5A6472;
    padding: 8px 14px;
    border: 1px solid rgba(90, 100, 114, 0.3);
    background: rgba(28, 31, 38, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    user-select: none;
    transition: color 600ms ease, border-color 600ms ease;
}

.indicator-prefix { color: #5A6472; }
.indicator-divider {
    margin: 0 6px;
    color: #5A6472;
    opacity: 0.6;
}
.indicator-code {
    color: #C8CDD3;
    min-width: 56px;
    display: inline-block;
}

/* === Diagonal Shadow Line === */
.diagonal-shadow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        205deg,
        transparent 0%,
        transparent 38%,
        rgba(42, 45, 53, 0.0) 42%,
        rgba(42, 45, 53, 0.55) 50%,
        rgba(42, 45, 53, 0.0) 58%,
        transparent 62%,
        transparent 100%
    );
    background-size: 220% 220%;
    background-position: -120% -120%;
    transform: translateZ(0);
    opacity: 0;
}

.diagonal-shadow.is-drawn {
    animation: shadow-draw 2000ms ease-in-out 800ms forwards;
}

@keyframes shadow-draw {
    0% {
        opacity: 0;
        background-position: -120% -120%;
    }
    100% {
        opacity: 1;
        background-position: 0% 0%;
    }
}

/* === Timeline Spine === */
.timeline-spine {
    position: absolute;
    top: 100vh;
    left: 20%;
    bottom: 100vh;
    width: 1px;
    pointer-events: none;
    z-index: 2;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 0;
    background: linear-gradient(
        to bottom,
        rgba(90, 100, 114, 0) 0%,
        rgba(90, 100, 114, 0.6) 8%,
        rgba(90, 100, 114, 0.6) 92%,
        rgba(90, 100, 114, 0) 100%
    );
    transition: height 1200ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: height;
}

/* === Sections === */
.section {
    position: relative;
    width: 100%;
    z-index: 5;
}

/* === Section 1: Entrance === */
.section-entrance {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 8vw;
    position: relative;
    z-index: 6;
}

.entrance-content {
    width: 100%;
    max-width: 920px;
    padding-left: 4vw;
}

.entrance-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 400;
    font-size: clamp(40px, 7vw, 72px);
    line-height: 1.05;
    letter-spacing: 0.15em;
    color: #C8CDD3;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(8px);
}

.entrance-title.is-visible {
    animation: fade-up 1200ms cubic-bezier(0.22, 1, 0.36, 1) 200ms forwards;
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entrance-subline {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.85;
    letter-spacing: 0.04em;
    color: #C8CDD3;
    max-width: 720px;
    margin-bottom: 56px;
    word-spacing: 0.08em;
}

.entrance-subline .word,
.entrance-subline .redaction-bar {
    display: inline-block;
    vertical-align: middle;
    opacity: 0;
}

.entrance-subline .word {
    transform: translateY(4px);
}

.entrance-subline.is-revealed .word {
    animation: word-fade 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes word-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entrance-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5A6472;
    opacity: 0;
    transition: opacity 1000ms ease 2400ms;
}

.entrance-meta.is-visible {
    opacity: 1;
}

.meta-divider {
    margin: 0 14px;
    color: #5A6472;
    opacity: 0.5;
}

.meta-value {
    color: #8E95A0;
}

/* === Redaction Bars === */
.redaction-bar {
    display: inline-block;
    vertical-align: middle;
    background: #2A2D35;
    height: 1.05em;
    width: 80px;
    border-radius: 1px;
    margin: 0 0.18em;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 280ms ease;
    cursor: default;
    position: relative;
}

.entrance-subline.is-revealed .redaction-bar {
    animation: bar-slide 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bar-slide {
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.panel-front .redaction-bar {
    transform: scaleX(1);
    opacity: 1;
}

.redaction-bar.is-near {
    opacity: 0.85;
}

/* === Clearance Zones === */
.clearance-zone {
    height: 200px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    z-index: 5;
    padding-left: 20%;
    margin-left: 0;
}

.clearance-code {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #5A6472;
    padding-left: 24px;
    user-select: none;
    min-width: 120px;
    display: inline-block;
}

/* === Dossier Sections === */
.section-dossier {
    position: relative;
    padding: 40px 8vw 40px calc(20% + 60px);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.timeline-node {
    position: absolute;
    left: calc(20% - 8px);
    top: 80px;
    width: 16px;
    height: 16px;
    color: #B8A04E;
    z-index: 6;
}

.node-circle {
    display: block;
    width: 16px;
    height: 16px;
    overflow: visible;
}

.timeline-node.is-active .node-circle circle {
    animation: node-draw 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes node-draw {
    to { stroke-dashoffset: 0; }
}

.timeline-connector {
    position: absolute;
    top: 7.5px;
    left: 16px;
    width: 0;
    height: 1px;
    background: rgba(90, 100, 114, 0.6);
    transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1) 200ms;
}

.timeline-node.is-active .timeline-connector {
    width: 60px;
}

/* === Panel Stack (layered depth) === */
.panel-stack {
    position: relative;
    width: 100%;
    max-width: 760px;
}

.panel {
    background: #23262D;
    padding: 44px 52px;
    position: relative;
    border-left: 1px solid rgba(90, 100, 114, 0.25);
}

.panel-back {
    position: absolute;
    top: -26px;
    left: 36px;
    right: -40px;
    height: 100%;
    opacity: 0.3;
    z-index: 1;
    background: #23262D;
    pointer-events: none;
}

.panel-mid {
    position: absolute;
    top: -14px;
    left: 18px;
    right: -20px;
    height: 100%;
    opacity: 0.6;
    z-index: 2;
    background: #23262D;
    pointer-events: none;
}

.panel-front {
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-dossier.is-active .panel-front {
    opacity: 1;
    transform: translateX(0);
}

.panel-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5A6472;
    margin-bottom: 28px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.meta-code { color: #8E95A0; }
.meta-date { color: #5A6472; }

.panel-heading {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: #C8CDD3;
    margin-bottom: 36px;
}

.key-phrase {
    color: #C8CDD3;
    border-bottom: 1px solid #B8A04E;
    padding-bottom: 2px;
}

.single-red {
    color: #7A3B3B;
}

.panel-body {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: #C8CDD3;
    margin-bottom: 18px;
    max-width: 580px;
}

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

/* === Sealed Footer === */
.sealed-footer {
    min-height: 100vh;
    width: 100%;
    background: #16181D;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 7;
}

.seal-container {
    text-align: center;
    padding: 40px;
}

.envelope-seal {
    width: 180px;
    height: 180px;
    display: block;
    margin: 0 auto 36px;
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity 2000ms ease;
}

.envelope-seal.is-visible {
    opacity: 1;
}

.envelope-seal.is-drawn .seal-circle,
.envelope-seal.is-drawn .seal-x1,
.envelope-seal.is-drawn .seal-x2 {
    animation: seal-draw 2500ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.envelope-seal.is-drawn .seal-x1 { animation-delay: 400ms; }
.envelope-seal.is-drawn .seal-x2 { animation-delay: 700ms; }

@keyframes seal-draw {
    to { stroke-dashoffset: 0; }
}

.envelope-seal.is-tilted {
    animation: seal-tilt 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0ms;
}

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

.seal-domain {
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: lowercase;
    color: #C8CDD3;
    margin-bottom: 14px;
}

.seal-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #5A6472;
}

/* === Responsive === */
@media (max-width: 880px) {
    .section-indicator {
        top: 16px;
        right: 16px;
        font-size: 9px;
        padding: 6px 10px;
    }

    .section-entrance {
        padding: 0 6vw;
    }

    .entrance-content {
        padding-left: 0;
    }

    .timeline-spine {
        left: 7%;
    }

    .clearance-zone {
        padding-left: 7%;
        height: 140px;
    }

    .clearance-code {
        padding-left: 16px;
    }

    .section-dossier {
        padding: 28px 6vw 28px calc(7% + 36px);
        min-height: 50vh;
    }

    .timeline-node {
        left: calc(7% - 8px);
        top: 56px;
    }

    .timeline-node.is-active .timeline-connector {
        width: 30px;
    }

    .panel {
        padding: 28px 28px;
    }

    .panel-back {
        left: 18px;
        right: -20px;
        top: -14px;
    }

    .panel-mid {
        left: 9px;
        right: -10px;
        top: -7px;
    }

    .envelope-seal {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 520px) {
    .entrance-title {
        letter-spacing: 0.10em;
    }

    .panel {
        padding: 22px 22px;
    }

    .panel-heading {
        font-size: 24px;
        letter-spacing: 0.02em;
    }

    .redaction-bar {
        width: 60px;
    }

    .meta-divider {
        margin: 0 8px;
    }

    .panel-meta {
        gap: 14px;
        flex-wrap: wrap;
    }
}

/* === Reduced motion fallback (still required: design works statically) === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .entrance-title { opacity: 1; transform: none; }
    .entrance-subline .word,
    .entrance-subline .redaction-bar { opacity: 1; transform: none; }
    .entrance-meta { opacity: 1; }
    .panel-front { opacity: 1; transform: none; }
    .timeline-node .node-circle circle { stroke-dashoffset: 0; }
    .envelope-seal { opacity: 1; }
    .envelope-seal .seal-circle,
    .envelope-seal .seal-x1,
    .envelope-seal .seal-x2 { stroke-dashoffset: 0; }
    .diagonal-shadow { opacity: 1; background-position: 0% 0%; }
}
