/* ==========================================
   DIPLOMATIC.BAR - Surrealist Embassy
   ========================================== */

/* --- CSS Custom Properties --- */
:root {
    --diplomatic-noir: #0B0A0F;
    --diplomatic-brass: #C4A265;
    --parchment-light: #D8CFC0;
    --smoked-burgundy: #3D1A2A;
    --mercury-pool: #7B8FA1;
    --amber-pour: #B8742D;
    --shadow-mahogany: #1E1419;
    --embassy-cream: #F0E8D8;
    --muted-umber: #8A7E72;
    --brass-dark: #8A6F3C;
    --walnut-dark: #2A1E16;

    --corridor-gradient: linear-gradient(175deg, #0B0A0F 0%, #1E1419 45%, #3D1A2A 100%);
    --brass-sheen: linear-gradient(135deg, #C4A265 0%, #8A6F3C 50%, #C4A265 100%);
    --mercury-surface: radial-gradient(ellipse, #7B8FA1 0%, #0B0A0F 70%);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-accent: 'DM Sans', 'Helvetica Neue', sans-serif;

    --nameplate-x: 50%;
    --nameplate-y: 50%;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--diplomatic-noir);
    color: var(--parchment-light);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--diplomatic-brass);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

/* --- Section Base --- */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* --- Section Transitions (Clip-path trapezoids) --- */
.section-transition-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--diplomatic-noir);
    clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
    z-index: 2;
}

/* --- Amber Light Cones --- */
.amber-light-cone {
    position: absolute;
    width: 300px;
    height: 400px;
    background: conic-gradient(from 170deg, transparent, #B8742D 10%, transparent 20%);
    filter: blur(60px);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================
   SECTION 1: THE ANTEROOM
   ========================================== */
.anteroom {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--diplomatic-noir);
    position: relative;
}

.anteroom-light {
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    opacity: 0.15;
}

.anteroom-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* --- Doorway --- */
.doorway-container {
    position: relative;
    width: min(80vw, 450px);
    height: min(70vh, 600px);
    z-index: 3;
}

.doorway-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.door-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-path 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

.door-inner-left, .door-inner-right, .door-inner-top {
    animation-delay: 0.9s;
}

.door-molding, .door-molding-2 {
    animation-delay: 1.1s;
}

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

.door-panel {
    position: absolute;
    top: 10%;
    left: 17%;
    width: 66%;
    height: 82%;
    background: linear-gradient(90deg, #0B0A0F 0%, #1E1419 45%, #3D1A2A 100%);
    z-index: 2;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.door-panel.open {
    transform: translateX(-110%);
}

.door-glow {
    position: absolute;
    top: 10%;
    left: 17%;
    width: 66%;
    height: 82%;
    background: radial-gradient(ellipse at center, #3D1A2A 0%, #1E1419 60%, transparent 100%);
    opacity: 0;
    z-index: 1;
    transition: opacity 800ms ease-in-out;
}

.door-glow.visible {
    opacity: 0.7;
}

/* --- Nameplate --- */
.nameplate {
    position: absolute;
    bottom: 22%;
    z-index: 4;
    opacity: 0;
    animation: fade-in 800ms ease-in-out forwards;
    animation-delay: 1.7s;
}

.nameplate-text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--brass-sheen);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    opacity: 0;
    animation: fade-in 600ms ease-in-out forwards;
    animation-delay: 2.5s;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--diplomatic-brass);
    opacity: 0.4;
    animation: scroll-pulse 2s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.15; transform: scaleY(1); }
    50% { opacity: 0.5; transform: scaleY(1.3); }
}

/* ==========================================
   SECTION 2: THE CREDENTIALS HALL
   ========================================== */
.credentials {
    min-height: 120vh;
    background: var(--corridor-gradient);
    padding: 120px 5% 80px;
    position: relative;
}

.credentials-light {
    top: 0;
    left: 30%;
    width: 400px;
    height: 500px;
    opacity: 0.2;
}

.credentials-arch {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.arch-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Credential Frames --- */
.credentials-wall {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px 50px;
    position: relative;
    z-index: 3;
    perspective: 1000px;
}

.credential-frame {
    position: relative;
    padding: 50px 40px;
    background:
        radial-gradient(circle at 30% 20%, rgba(30, 20, 25, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(30, 20, 25, 0.4) 0%, transparent 50%),
        var(--shadow-mahogany);
    border: 1px solid var(--diplomatic-brass);
    box-shadow: inset 0 0 20px rgba(11, 10, 15, 0.5), 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: rotateY(15deg) rotateX(5deg) scale(0.9);
    opacity: 0;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 300ms ease;
    transform-style: preserve-3d;
}

.credential-frame.visible {
    opacity: 1;
}

.credential-frame.visible.frame-1 {
    transform: rotate(-1.5deg);
}

.credential-frame.visible.frame-2 {
    transform: rotate(2deg);
}

.credential-frame.visible.frame-3 {
    transform: rotate(-0.8deg);
}

.credential-frame.visible.frame-4 {
    transform: rotate(1.2deg);
}

.credential-frame:hover {
    transform: rotate(0deg) translateZ(10px) !important;
    box-shadow: inset 0 0 20px rgba(11, 10, 15, 0.5), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.credential-frame:hover .credential-seal-watermark {
    opacity: 0.08;
}

/* --- Seal Watermark (behind credential content) --- */
.credential-seal-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    opacity: 0.04;
    transition: opacity 300ms ease;
    pointer-events: none;
}

.seal-watermark {
    width: 100%;
    height: 100%;
}

/* --- Credential Content --- */
.credential-title {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.credential-text {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--parchment-light);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.credential-date {
    font-family: var(--font-accent);
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-umber);
    position: relative;
    z-index: 1;
}

/* ==========================================
   SECTION 3: THE ROUND TABLE
   ========================================== */
.round-table {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(175deg, #1E1419 0%, #0B0A0F 50%, #1E1419 100%);
    position: relative;
}

.table-light {
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    opacity: 0.15;
}

.table-container {
    position: relative;
    width: min(90vw, 800px);
    height: min(90vw, 800px);
    display: grid;
    place-items: center;
    z-index: 3;
}

/* --- Central Table Surface --- */
.table-surface {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, #2A1E16, #0B0A0F);
    display: grid;
    place-items: center;
    z-index: 2;
    box-shadow: 0 0 60px rgba(42, 30, 22, 0.5);
}

.table-seal {
    width: 150px;
    height: 150px;
}

.seal-ring {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.seal-ring.drawn {
    stroke-dashoffset: 0;
}

.seal-ring-1 { transition-delay: 0s; }
.seal-ring-2 { transition-delay: 0.2s; }
.seal-ring-3 { transition-delay: 0.4s; }
.seal-ring-4 { transition-delay: 0.6s; }

.seal-monogram {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    transition-delay: 1.2s;
}

.seal-monogram.visible {
    opacity: 1;
}

/* --- Connecting Lines --- */
.table-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.connecting-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Table Positions --- */
.table-position {
    position: absolute;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.table-position.visible {
    opacity: 1;
    transform: scale(1);
}

.position-north {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
}

.position-north.visible {
    transform: translateX(-50%) scale(1);
}

.position-east {
    top: 50%;
    right: 2%;
    transform: translateY(-50%) scale(0.9);
}

.position-east.visible {
    transform: translateY(-50%) scale(1);
}

.position-south {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
}

.position-south.visible {
    transform: translateX(-50%) scale(1);
}

.position-west {
    top: 50%;
    left: 2%;
    transform: translateY(-50%) scale(0.9);
}

.position-west.visible {
    transform: translateY(-50%) scale(1);
}

.position-title {
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    margin-bottom: 8px;
}

.position-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--parchment-light);
    opacity: 0.8;
}

/* ==========================================
   SECTION 4: THE BAR COUNTER
   ========================================== */
.bar-counter {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(175deg, #0B0A0F 0%, #1E1419 60%, #0B0A0F 100%);
    position: relative;
    padding-top: 100px;
}

.bar-light {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 500px;
    opacity: 0.25;
}

.bar-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* --- Floating Elements --- */
.floating-elements {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 250px;
    z-index: 3;
    pointer-events: none;
}

.floating-glass {
    position: absolute;
    animation: float-glass 8s ease-in-out infinite;
}

.floating-glass-1 {
    top: 20%;
    left: 20%;
    width: 60px;
    height: 80px;
    animation-duration: 10s;
}

.floating-glass-2 {
    top: 10%;
    right: 25%;
    width: 50px;
    height: 70px;
    animation-duration: 13s;
    animation-delay: -3s;
}

.floating-amber-pool {
    position: absolute;
    top: 40%;
    left: 55%;
    width: 100px;
    height: 50px;
    background: radial-gradient(ellipse, rgba(184, 116, 45, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: float-glass 16s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes float-glass {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(1deg); }
}

/* --- Counter Surface --- */
.counter-surface {
    position: relative;
    width: 100%;
    background:
        radial-gradient(circle at 30% 20%, rgba(30, 20, 25, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(30, 20, 25, 0.4) 0%, transparent 50%),
        var(--shadow-mahogany);
    border-top: 1px solid rgba(196, 162, 101, 0.3);
    border-bottom: 1px solid rgba(184, 116, 45, 0.2);
    padding: 50px 5%;
    z-index: 3;
}

.counter-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.counter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    padding: 20px 24px;
    background: rgba(11, 10, 15, 0.4);
    border-bottom: 1px solid var(--amber-pour);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.counter-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.counter-label {
    font-family: var(--font-accent);
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--diplomatic-brass);
}

.counter-detail {
    font-family: var(--font-accent);
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-umber);
}

/* --- Leather Strip --- */
.leather-strip {
    width: 100%;
    height: 20px;
    background:
        radial-gradient(circle at 15% 50%, rgba(60, 40, 30, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 45% 50%, rgba(60, 40, 30, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 75% 50%, rgba(60, 40, 30, 0.3) 0%, transparent 40%),
        var(--shadow-mahogany);
    border-top: 1px solid rgba(196, 162, 101, 0.15);
    z-index: 3;
    position: relative;
}

/* ==========================================
   SECTION 5: THE PRIVATE ROOM (Footer)
   ========================================== */
.private-room {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--diplomatic-noir);
    position: relative;
}

/* --- Corridor Walls --- */
.corridor-wall {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20%;
    background:
        radial-gradient(circle at 50% 30%, rgba(30, 20, 25, 0.5) 0%, transparent 60%),
        radial-gradient(circle at 50% 70%, rgba(30, 20, 25, 0.3) 0%, transparent 50%),
        var(--shadow-mahogany);
    z-index: 1;
}

.corridor-wall-left {
    left: 0;
    clip-path: polygon(0 0, 100% 8%, 100% 92%, 0 100%);
    border-right: 1px solid rgba(196, 162, 101, 0.1);
}

.corridor-wall-right {
    right: 0;
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%);
    border-left: 1px solid rgba(196, 162, 101, 0.1);
}

/* --- Vanishing Point --- */
.vanishing-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 3;
    text-align: center;
}

.final-seal {
    width: 120px;
    height: 120px;
    animation: spin 60s linear infinite;
}

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

.final-seal-ring {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.final-seal-ring.drawn {
    stroke-dashoffset: 0;
}

.final-ring-1 { transition-delay: 0s; }
.final-ring-2 { transition-delay: 0.15s; }
.final-ring-3 { transition-delay: 0.3s; }
.final-ring-4 { transition-delay: 0.45s; }
.final-ring-5 { transition-delay: 0.6s; }

.final-monogram {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    transition-delay: 1s;
}

.final-monogram.visible {
    opacity: 1;
}

.vanishing-domain {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--diplomatic-brass);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.vanishing-domain.visible {
    opacity: 1;
}

.footer-divider {
    width: 80px;
    height: 1px;
    background: var(--diplomatic-brass);
    opacity: 0.4;
}

.footer-text {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-umber);
}

/* ==========================================
   MERCURY POOLS (Ambient Blobs)
   ========================================== */
.mercury-pool {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    background: var(--mercury-surface);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.mercury-pool-1 {
    width: 200px;
    height: 140px;
    top: 15%;
    left: 5%;
    animation: morph-1 12s ease-in-out infinite;
}

.mercury-pool-2 {
    width: 150px;
    height: 100px;
    bottom: 20%;
    right: 8%;
    animation: morph-2 16s ease-in-out infinite;
    animation-delay: -4s;
}

.mercury-pool-3 {
    width: 180px;
    height: 120px;
    bottom: 10%;
    left: 10%;
    animation: morph-3 8s ease-in-out infinite;
    animation-delay: -2s;
    opacity: 0.08;
}

.mercury-pool-4 {
    width: 120px;
    height: 80px;
    top: 25%;
    left: 15%;
    animation: morph-1 10s ease-in-out infinite;
    animation-delay: -1s;
}

.mercury-pool-5 {
    width: 160px;
    height: 100px;
    top: 15%;
    right: 20%;
    animation: morph-2 14s ease-in-out infinite;
    animation-delay: -6s;
}

.mercury-pool-6 {
    width: 100px;
    height: 70px;
    top: 40%;
    left: 50%;
    animation: morph-3 18s ease-in-out infinite;
    animation-delay: -3s;
}

@keyframes morph-1 {
    0%, 100% { border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; transform: translate(0, 0) scale(1); }
    25% { border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%; transform: translate(10px, -5px) scale(1.05); }
    50% { border-radius: 45% 55% 60% 40% / 60% 45% 55% 40%; transform: translate(-5px, 8px) scale(0.95); }
    75% { border-radius: 60% 40% 45% 55% / 40% 60% 40% 60%; transform: translate(5px, -3px) scale(1.02); }
}

@keyframes morph-2 {
    0%, 100% { border-radius: 50% 50% 45% 55% / 45% 55% 50% 50%; transform: translate(0, 0) scale(1); }
    33% { border-radius: 45% 55% 55% 45% / 55% 45% 45% 55%; transform: translate(-8px, 6px) scale(1.03); }
    66% { border-radius: 55% 45% 50% 50% / 50% 50% 55% 45%; transform: translate(6px, -4px) scale(0.97); }
}

@keyframes morph-3 {
    0%, 100% { border-radius: 60% 40% 50% 50% / 50% 50% 40% 60%; transform: translate(0, 0) rotate(0deg); }
    50% { border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%; transform: translate(5px, 5px) rotate(3deg); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .credentials-wall {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .credential-frame {
        padding: 35px 28px;
    }

    .table-container {
        width: 95vw;
        height: 95vw;
    }

    .table-position {
        max-width: 160px;
    }

    .position-text {
        font-size: 0.8rem;
    }

    .counter-content {
        flex-direction: column;
        align-items: stretch;
    }

    .corridor-wall {
        width: 12%;
    }

    .floating-elements {
        height: 150px;
    }
}

@media (max-width: 600px) {
    .doorway-container {
        width: 85vw;
        height: 55vh;
    }

    .nameplate-text {
        font-size: 1rem;
    }

    .table-container {
        width: 98vw;
        height: 98vw;
        max-height: 90vh;
    }

    .table-position {
        max-width: 120px;
    }

    .position-north, .position-south {
        top: 2%;
    }

    .position-south {
        top: auto;
        bottom: 2%;
    }

    .position-east {
        right: 0;
    }

    .position-west {
        left: 0;
    }

    .corridor-wall {
        width: 8%;
    }
}
