/* diplomacy.bar — Isometric Grand Diplomacy */
/* Monochrome Palette */
:root {
    --obsidian: #0e0e0e;
    --anthracite: #1a1a1a;
    --gunmetal: #2e2e2e;
    --pewter: #4a4a4a;
    --graphite: #6a6a6a;
    --silver: #a0a0a0;
    --platinum: #e8e8e8;
    --diplomatic-gold: #c9a84c;
    --card-surface: #2a2a2a;
    --skeleton-bone: #3a3a3a;
    --card-border: #b0b0b0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--obsidian);
    color: var(--silver);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    letter-spacing: 0.03em;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Typography */
h1, h2 {
    font-family: 'Playfair Display', serif;
    color: var(--platinum);
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    font-weight: 400;
    letter-spacing: 0.02em;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ===============================
   CHAMBER: Global
   =============================== */
.chamber {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ===============================
   CHAMBER 1: The Antechamber
   =============================== */
#antechamber {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--obsidian);
}

.antechamber-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

/* Isometric Cube */
.iso-cube-wrapper {
    width: 200px;
    height: 200px;
    perspective: 800px;
}

.iso-cube {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: cube-rotate 20s linear infinite;
}

@keyframes cube-rotate {
    0% { transform: rotateX(-20deg) rotateY(0deg); }
    100% { transform: rotateX(-20deg) rotateY(360deg); }
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--platinum);
    letter-spacing: 0.02em;
    border: 1px solid var(--gunmetal);
    backface-visibility: visible;
}

.cube-front  { background: rgba(26,26,26,0.9); transform: translateZ(100px); }
.cube-back   { background: rgba(26,26,26,0.9); transform: rotateY(180deg) translateZ(100px); }
.cube-right  { background: rgba(46,46,46,0.85); transform: rotateY(90deg) translateZ(100px); }
.cube-left   { background: rgba(46,46,46,0.85); transform: rotateY(-90deg) translateZ(100px); }
.cube-top    { background: #3a3a3a; transform: rotateX(90deg) translateZ(100px); }
.cube-bottom { background: rgba(14,14,14,0.95); transform: rotateX(-90deg) translateZ(100px); }

/* Horizontal Rule / Skeleton Bar */
.antechamber-rule {
    width: 80vw;
    max-width: 600px;
    position: relative;
    height: 2px;
}

.rule-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gunmetal);
    animation: rule-expand 3s ease-out forwards;
}

@keyframes rule-expand {
    to { width: 100%; left: 0; }
}

.skeleton-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--pewter);
    animation: skeleton-fill 4s ease-in-out 1s forwards;
}

@keyframes skeleton-fill {
    to { width: 100%; }
}

/* ===============================
   Dove Ghost Transition
   =============================== */
.dove-ghost {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.2s ease;
}

.dove-ghost.visible {
    opacity: 0.15;
}

.dove-body {
    width: 40px;
    height: 20px;
    background: var(--pewter);
    border-radius: 50% 50% 50% 20%;
    position: relative;
}

.dove-wing-left,
.dove-wing-right {
    position: absolute;
    top: -12px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 20px solid var(--pewter);
}

.dove-wing-left { left: -10px; transform: rotate(-20deg); }
.dove-wing-right { right: -10px; transform: rotate(20deg); }

.dove-head {
    position: absolute;
    top: -4px;
    right: -8px;
    width: 12px;
    height: 12px;
    background: var(--pewter);
    border-radius: 50%;
}

/* ===============================
   CHAMBER 2: The Assembly Hall
   =============================== */
#assembly-hall {
    min-height: 200vh;
    padding: 120px 0;
    position: relative;
    background: var(--obsidian);
}

/* Olive Branch Watermark */
.olive-branch-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.04;
    pointer-events: none;
}

.olive-leaf {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 16px;
    background: var(--gunmetal);
    border-radius: 50%;
    transform-origin: -30px center;
    transform: translate(-50%, -50%) rotate(calc(var(--i) * 15deg)) translateX(80px);
}

.olive-stem {
    position: absolute;
    top: 20%;
    left: 50%;
    width: 3px;
    height: 60%;
    background: var(--gunmetal);
    transform: translateX(-50%) rotate(-10deg);
    border-radius: 2px;
}

/* Data Streams */
.data-streams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.data-stream {
    position: absolute;
    left: var(--x);
    bottom: 100%;
    width: 4px;
    height: var(--h);
    background: var(--gunmetal);
    animation: stream-flow var(--d) linear infinite;
}

@keyframes stream-flow {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(100vh + var(--h) + 200vh)); }
}

/* Assembly Container */
.assembly-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 48px;
    position: relative;
    z-index: 2;
}

.assembly-title {
    text-align: center;
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.assembly-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Isometric Card Grid */
.iso-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 32px;
    perspective: 1200px;
    max-width: 1100px;
    margin: 0 auto;
}

.iso-card {
    width: 100%;
    min-height: 420px;
    background: var(--anthracite);
    border: 1px solid #b0b0b0;
    padding: 40px 32px;
    position: relative;
    transform: perspective(800px) rotateX(15deg) rotateY(-10deg);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.3s ease;
    overflow: hidden;
}

.iso-card:hover {
    transform: perspective(800px) rotateX(5deg) rotateY(-3deg) translateZ(20px);
    border-bottom: 1px solid var(--diplomatic-gold);
}

.iso-card.back-row {
    transform: perspective(800px) rotateX(15deg) rotateY(-10deg) scale(0.92) translateY(-40px);
}

.iso-card.back-row:hover {
    transform: perspective(800px) rotateX(5deg) rotateY(-3deg) translateZ(20px) scale(0.92) translateY(-40px);
    border-bottom: 1px solid var(--diplomatic-gold);
}

/* Card Skeleton */
.card-skeleton {
    background: #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: absolute;
    top: 40px;
    left: 32px;
    right: 32px;
    bottom: 40px;
}

.skel-line {
    height: 14px;
    background: var(--skeleton-bone);
    border-radius: 2px;
    animation: skeleton-pulse 2s ease-in-out infinite;
}

.skel-line.skel-title {
    width: 60%;
    height: 24px;
    margin-bottom: 12px;
}

.skel-line.skel-body {
    width: 100%;
}

.skel-line.skel-body.short {
    width: 70%;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Card Content (hidden until revealed) */
.card-content {
    opacity: 0;
    filter: blur(4px);
    transition: opacity 0.8s ease, filter 0.8s ease;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.iso-card.revealed .card-skeleton {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iso-card.revealed .card-content {
    opacity: 1;
    filter: blur(0);
}

.card-label {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--graphite);
    margin-bottom: 16px;
}

.card-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin-bottom: 20px;
}

.card-text {
    color: var(--silver);
    flex: 1;
    margin-bottom: 24px;
}

.card-meta {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--graphite);
    margin-top: auto;
}

/* ===============================
   CHAMBER 3: The War Room
   =============================== */
#war-room {
    min-height: 150vh;
    padding: 120px 0;
    position: relative;
    background: var(--obsidian);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Oak Sentinels */
.oak-sentinel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.oak-left { left: 5%; }
.oak-right { right: 5%; }

.oak-canopy {
    display: grid;
    grid-template-columns: repeat(3, 16px);
    gap: 2px;
    margin-bottom: 4px;
}

.oak-cube {
    width: 16px;
    height: 16px;
    position: relative;
}

.oak-cube::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 14px;
    height: 12px;
    background: var(--gunmetal);
    transform: skewX(-20deg);
}

.oak-cube::after {
    content: '';
    position: absolute;
    top: 0;
    left: 2px;
    width: 12px;
    height: 10px;
    background: var(--pewter);
    transform: skewY(-10deg);
}

.oak-trunk {
    width: 4px;
    height: 60px;
    background: var(--gunmetal);
    margin: 0 auto;
}

/* War Room Content */
.war-room-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 0 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.war-room-quote {
    text-align: center;
}

.war-room-quote p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--platinum);
    line-height: 1.4;
    letter-spacing: 0.02em;
}

/* Map Table */
.map-table {
    width: 100%;
    max-width: 700px;
    height: 500px;
    position: relative;
    transform: perspective(800px) rotateX(30deg);
    transform-style: preserve-3d;
}

.grid-floor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            #1e1e1e 49px,
            #1e1e1e 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            #1e1e1e 49px,
            #1e1e1e 50px
        );
    background-color: var(--obsidian);
    border: 1px solid var(--pewter);
}

.map-tokens {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.token {
    position: absolute;
    left: var(--tx);
    top: var(--ty);
    transition: left 1.5s cubic-bezier(0.23, 1, 0.32, 1), top 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.token-cube {
    width: 16px;
    height: 16px;
}

.token-cube::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 12px;
    background: var(--gunmetal);
    top: 4px;
    left: 0;
    transform: skewX(-20deg);
}

.token-cube::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 14px;
    background: var(--pewter);
    top: 0;
    left: 2px;
    transform: skewY(-10deg);
}

.token-pyramid {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 18px solid var(--pewter);
}

.token-pyramid::after {
    content: '';
    position: absolute;
    top: 6px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 12px solid var(--gunmetal);
}

/* ===============================
   CHAMBER 4: The Archive
   =============================== */
#archive {
    min-height: 100vh;
    padding: 120px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--obsidian);
}

.archive-content {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 0 48px;
}

.archive-title {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.archive-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Receding Corridor */
.receding-corridor {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.corridor-frame {
    position: absolute;
    border: 1px solid var(--gunmetal);
    width: calc(100% - var(--depth) * 10%);
    height: calc(100% - var(--depth) * 10%);
    opacity: calc(1 - var(--depth) * 0.1);
    transform: translateZ(calc(var(--depth) * -60px));
}

/* Diplomatic Seal */
.diplomatic-seal {
    position: absolute;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--diplomatic-gold);
}

.seal-outer { width: 140px; height: 140px; }
.seal-middle { width: 110px; height: 110px; opacity: 0.7; }
.seal-inner { width: 80px; height: 80px; opacity: 0.5; }
.seal-core { width: 50px; height: 50px; background: rgba(201, 168, 76, 0.1); }

.seal-text {
    position: absolute;
    font-family: 'Courier Prime', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--diplomatic-gold);
    white-space: nowrap;
}

/* ===============================
   Section Transitions (blackout)
   =============================== */
.chamber-transition {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chamber-visible {
    opacity: 1;
    transition: opacity 0.3s ease 0.3s;
}

/* ===============================
   Responsive (mobile < 768px)
   =============================== */
@media (max-width: 768px) {
    .iso-card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .iso-card,
    .iso-card.back-row {
        transform: none;
        min-height: 320px;
    }

    .iso-card:hover,
    .iso-card.back-row:hover {
        transform: translateY(-4px);
        border-bottom: 1px solid var(--diplomatic-gold);
    }

    .map-table {
        transform: perspective(800px) rotateX(15deg);
        height: 350px;
    }

    .assembly-container,
    .war-room-content,
    .archive-content {
        padding: 0 24px;
    }

    .iso-cube-wrapper,
    .iso-cube {
        width: 140px;
        height: 140px;
    }

    .cube-face {
        width: 140px;
        height: 140px;
        font-size: 1.2rem;
    }

    .cube-front  { transform: translateZ(70px); }
    .cube-back   { transform: rotateY(180deg) translateZ(70px); }
    .cube-right  { transform: rotateY(90deg) translateZ(70px); }
    .cube-left   { transform: rotateY(-90deg) translateZ(70px); }
    .cube-top    { transform: rotateX(90deg) translateZ(70px); }
    .cube-bottom { transform: rotateX(-90deg) translateZ(70px); }

    .oak-sentinel { display: none; }

    .receding-corridor { height: 350px; }
}