/* =====================================================
   diplomacy.bar — Styles
   A speakeasy where diplomacy is conducted in spirits.
   ===================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: #1C1410;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.75;
    color: #D4CCBC;
    background-color: #1C1410;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    mix-blend-mode: multiply;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAEHklEQVRoge2aW4hVVRjHf2tmzoyXUdNSy0umZlaaF0rTLqZlRRcqKoqioCB66CEIegh66SEIIoiKIIIuBEUQ3R+KrqRd1DTNsmzMSi3NW+o4c+bhW4dZs2fvvc7e+4xQ/uGwYH/r+6/v/6219l5rbThEh+j/XYD/Sg6B/Nd0CKSjddqENFXaFjSovCnqFiAjlq7MWBR0BbAIOBg4G3gaOAXYC/wI/Af4B6oPFxYApwEdAGWACuAh4FTgM5A9xilgaVAdeBL4K/A7cDnxJfBVsD9mADOBE8LrDaKHDNnGVhM3hx3awddIBfBZEqDvWn2EM6yWl8D+A5oBq4FLiU+5w6xgH4Cvgd+AX4Axgef5HfaW1gJ/B74BPgB2AYMBs4lXhwd0VB8hJwEfBYyPMl8XKUqwbyB83pCOBR4ArgdOLBTI5K+AW4E/gSuBk4o0B6vDqDvEjsj5pBTwPPEP/iSGASsHfIswjYAAwFPgbuAB4CjitSLicQn/8GvB4y3glcHvI8XiR9vVYE/6O24EPgCuA24DLiz+Ld+kCuI74OPQ/cHhXwO3ETcDc+fQQ4GriolwF7AreGchaFz5fmArmdeP07G5gBnBnKaU5FXRx0sSqNXgrMBS4h/lLlPOAy4n18FfF5exhwEnBmyDO/QL5UrSF+Ri0m7lHXh2+ux+cPBz4F9gd+Bj4GxgJnES+T3WVVTCR+D30cOBdYAZwKXEB8mH8K/JfYAzyS0P+eolVKJd8dD1xP/JLxMHArcVCHhHJml0gnD8NngQ+JT1nXEA9mCvFlqK+BdcA/gH+Ar4Cvge+Af4Bf4N2qBjgV2BOYBNwNzCN+T3I+8SDeTtyITy+Q9m3gMuLB3kWE3wjMBRYSDzoD3AJcE8qZXyQ9bj39RvxnxJ3AgsCxwDnE56f8Yf4rcCrxefk54mXqQeKDn0e5kvkCuIl40PcWSOurA6fhf/e4mbgRX1YgfROwHNibuJO+CUwnvoyclSO9J/AD8Wfph4m7iNnA6OC7h/i54ynig19IvPxVkJeBd4iPHouBi4DLgaeI94K5xJ3oWcA84r1mBnBm+Hx+kfpRGONaYv/yJvEWejPxHnMPcB9xgJuI96Jri9Rpo0s6B3At8b7zYOh3G/4u/SPxXnNT+GZpgfwCvE78S+n7gRnAReG7u4h/tXkX8Tz8UJH6UaSBNBLvBXcSH8QLwO3EvfM64sPNQ8Qf9t4h3juaiZfFE4v0hy7poJvxK3A6cDrxMnAN8YfCe4n3onuBfxEPvpV4T3k2fL4K+LhAfVWVGvg08b/hPkHcez4B7iMeaBNxQ7+deM+ZVaS+9BoAa4l76pnEB78ncB/xL6gvJR7slcTXoQ+I96B7QzkvFyknq8rhf37U+h/pHwHpBxd2nKMAAAAASUVORK5CYII=");
}

/* --- Fixed Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 48px;
    height: 100vh;
    background-color: #2A1F14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 1000;
}

.sidebar-numeral {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #7A7269;
    text-decoration: none;
    transition: color 0.4s ease;
    cursor: pointer;
}

.sidebar-numeral.active {
    color: #C9A84C;
}

/* --- Room Base --- */
.room {
    position: relative;
    width: 100%;
    padding-left: 48px;
    background-color: #1C1410;
    overflow: hidden;
}

.room-content {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.room-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Room Title --- */
.room-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #D4CCBC;
    text-shadow: 1px 2px 0 rgba(122, 114, 105, 0.3);
    margin-bottom: 0.5rem;
}

/* --- Brass Rules --- */
.brass-rule {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.brass-rule .rule-line {
    display: block;
    height: 1px;
    background-color: #8B7355;
    flex-grow: 1;
    max-width: 280px;
}

.brass-rule .rule-diamond {
    color: #8B7355;
    font-size: 0.5rem;
    margin-left: 0.5rem;
}

.brass-rule .rule-seal {
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.brass-rule-center {
    justify-content: center;
}

.brass-rule-center .rule-line {
    max-width: 200px;
}

/* =====================================================
   Room I: The Entrance
   ===================================================== */
.room-entrance {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.entrance-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.entrance-rule {
    position: absolute;
    top: 50%;
    left: calc(33.333% + 200px);
    width: 37%;
    height: 2px;
    transform: translateY(-50%);
    opacity: 0;
}

.entrance-rule line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.entrance-rule.animate line {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1200ms ease-in-out;
}

.entrance-rule.animate {
    opacity: 1;
}

.entrance-seal {
    position: absolute;
    top: 50%;
    left: calc(33.333% + 200px + 37%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 400ms ease;
}

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

/* The Matchbook */
.matchbook {
    position: absolute;
    top: 50%;
    left: 33.333%;
    transform: translate(-50%, -50%);
    width: 200px;
    padding: 1.5rem 1.25rem;
    border: 1px solid #8B7355;
    border-radius: 2px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 400ms ease, transform 400ms ease;
}

.matchbook.visible {
    opacity: 1;
}

.matchbook-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C9A84C;
    text-shadow: 1px 2px 0 rgba(122, 114, 105, 0.3);
}

.matchbook-rule {
    display: block;
    width: 60%;
    height: 1px;
    background-color: #8B7355;
}

.matchbook-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: #7A7269;
}

/* =====================================================
   Room II: The Counter
   ===================================================== */
.room-counter {
    min-height: 120vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.room-counter .room-content {
    display: flex;
    gap: 2rem;
    padding: 0 3rem;
}

.counter-left {
    flex: 0 0 62%;
    max-width: 62%;
}

.counter-right {
    flex: 0 0 38%;
    max-width: 38%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4rem;
}

/* Glass Illustrations */
.glass-illustrations {
    position: sticky;
    top: 6rem;
}

.glass-svg {
    width: 120px;
    height: 400px;
    opacity: 0.7;
}

/* Classification Headers */
.classification {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #8B7355;
    display: block;
    margin-bottom: 0.25rem;
}

/* Drink Entry */
.drink-entry {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}

.drink-entry:last-child {
    border-bottom: none;
}

.drink-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #D4CCBC;
    text-shadow: 1px 2px 0 rgba(122, 114, 105, 0.3);
    margin-bottom: 0.75rem;
}

.drink-brief {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.75;
    color: #D4CCBC;
}

/* --- Redaction Bars --- */
.redacted {
    position: relative;
    display: inline;
    cursor: pointer;
    color: transparent;
    transition: color 300ms ease-out;
}

.redacted::after {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    top: -1px;
    bottom: -1px;
    background-color: #3A2E24;
    border-top: 1px solid #8B7355;
    transition: transform 300ms ease-out, opacity 300ms ease-out;
    pointer-events: none;
}

.redacted:hover,
.redacted.revealed {
    color: #C9A84C;
    text-decoration: underline;
    text-decoration-color: #8B7355;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.redacted:hover::after,
.redacted.revealed::after {
    transform: translateY(-100%);
    opacity: 0;
}

/* =====================================================
   Room III: The Back Booth
   ===================================================== */
.room-booth {
    min-height: 100vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.room-booth .room-content {
    display: flex;
    position: relative;
    min-height: calc(100vh - 12rem);
}

.booth-watermark {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.watermark-seal {
    width: 300px;
    height: 300px;
    opacity: 0.04;
}

.booth-protocol {
    flex: 0 0 55%;
    padding: 3rem 3rem 3rem 2rem;
    background-color: #221C16;
    border-radius: 2px;
}

/* Protocol Articles */
.protocol-article {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.protocol-article:last-child {
    border-bottom: none;
}

.article-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #8B7355;
    display: block;
    margin-bottom: 0.4rem;
    text-shadow: 1px 2px 0 rgba(122, 114, 105, 0.3);
}

.protocol-article p {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.75;
    color: #D4CCBC;
}

/* =====================================================
   Room IV: The Cellar
   ===================================================== */
.room-cellar {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.cellar-column {
    max-width: 480px;
    text-align: center;
}

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

.cellar-statement {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #D4CCBC;
    margin-bottom: 2rem;
}

.cellar-coordinates {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #7A7269;
    margin-bottom: 2rem;
}

.colophon {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #7A7269;
    margin-top: 1.5rem;
}

/* =====================================================
   Scroll Fade Transition
   ===================================================== */
.room-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.room-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children reveal */
.room-fade.visible .room-title {
    animation: fadeStagger 0.5s ease-out 0.2s both;
}

.room-fade.visible .brass-rule {
    animation: fadeStagger 0.5s ease-out 0.3s both;
}

.room-fade.visible .drink-entry,
.room-fade.visible .protocol-article,
.room-fade.visible .cellar-statement {
    animation: fadeStagger 0.5s ease-out 0.4s both;
}

.room-fade.visible .counter-right,
.room-fade.visible .cellar-coordinates {
    animation: fadeStagger 0.5s ease-out 0.6s both;
}

@keyframes fadeStagger {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   Mobile Responsive (< 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Sidebar becomes bottom bar */
    #sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 36px;
        flex-direction: row;
        gap: 2rem;
        padding: 0;
    }

    .room {
        padding-left: 0;
        padding-bottom: 36px;
    }

    /* Entrance adjustments */
    .matchbook {
        left: 50%;
        width: 160px;
        padding: 1.2rem 1rem;
    }

    .entrance-rule {
        left: calc(50% + 90px);
        width: 25%;
    }

    .entrance-seal {
        left: calc(50% + 90px + 25%);
    }

    /* Counter layout stacks */
    .room-counter .room-content {
        flex-direction: column;
        padding: 0 1.5rem;
    }

    .counter-left,
    .counter-right {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .counter-right {
        padding-top: 2rem;
    }

    .glass-illustrations {
        position: static;
    }

    .glass-svg {
        width: 80px;
        height: 280px;
    }

    /* Booth layout stacks */
    .room-booth .room-content {
        flex-direction: column;
    }

    .booth-watermark {
        flex: 0 0 auto;
        height: 150px;
    }

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

    .booth-protocol {
        flex: 0 0 auto;
        padding: 2rem 1.5rem;
    }

    /* Cellar */
    .cellar-column {
        max-width: 90%;
        padding: 0 1rem;
    }
}
