/* economics.day - Midnight-Blue Avant-Garde Design */
/* Palette: Abyss #050a12, Deep Water #080e18, Midnight Shelf #0f1e30,
   Steel Current #1e3a5f, Deep Signal #3b6fa0, Fog Light #c8d6e4,
   Slate Wash #8fa4b8, Drift #7a8e9f, Undertow #4a6070, Error Red #a03b3b */

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

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

body {
    background: #050a12;
    color: #7a8e9f;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ==================== SIDEBAR ==================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #050a12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    z-index: 100;
    border-right: 1px solid #0f1e30;
}

.sidebar-indicators {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

.sidebar-indicator {
    height: 2px;
    width: 100%;
    background: #0f1e30;
    position: relative;
    transition: height 0.3s ease;
    cursor: pointer;
}

.sidebar-indicator.active {
    height: 6px;
    box-shadow: 0 0 8px rgba(59, 111, 160, 0.3);
}

.sidebar-indicator .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #0a1628, #1e3a5f);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.indicator-label {
    position: absolute;
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #4a6070;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.sidebar-indicator:hover .indicator-label,
.sidebar-indicator.active .indicator-label {
    opacity: 1;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    margin-left: 280px;
    width: calc(100vw - 280px);
}

/* ==================== CHAMBERS (SECTIONS) ==================== */

.chamber {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Chamber 1: The Opening Void */
.chamber-void {
    background: #050a12;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 15vh 8vw;
}

.diagonal-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 1px;
    background: #1e3a5f;
    transform-origin: bottom left;
    transform: rotate(-23.4deg);
    pointer-events: none;
}

.void-content {
    position: relative;
    z-index: 2;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #5a7fa0;
    line-height: 1.1;
    margin-bottom: 0.8rem;
}

.site-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #4a6070;
    letter-spacing: 0.02em;
}

/* Chamber 2: The Supply Chamber */
.chamber-supply {
    background: #050a12;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
}

.supply-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.sharp-panel {
    border: 1px solid #1e3a5f;
    background: #080e18;
    padding: 3rem 3.5rem;
    position: relative;
    transition: border-color 0.15s ease;
}

.sharp-panel.shake-trigger {
    animation: market-correction 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-color: #a03b3b;
}

.supply-panel-1 {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    transform: translateX(-5%);
    z-index: 3;
}

.supply-panel-2 {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    transform: translateX(5%);
    margin-top: -2rem;
    z-index: 2;
}

.supply-panel-3 {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    transform: translateX(-5%);
    margin-top: -2rem;
    z-index: 1;
}

.panel-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.95rem, 1.15vw, 1.12rem);
    line-height: 1.65;
    color: #8fa4b8;
}

/* Chamber 3: The Demand Chamber */
.chamber-demand {
    background: #080e18;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
}

.demand-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.demand-panel-1 {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    transform: translateX(5%);
    z-index: 3;
}

.demand-panel-2 {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    transform: translateX(-5%);
    margin-top: -2rem;
    z-index: 2;
}

.demand-panel-3 {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    transform: translateX(5%);
    margin-top: -2rem;
    z-index: 1;
}

/* Chamber 4: The Equilibrium Chamber */
.chamber-equilibrium {
    background: #050a12;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.crosshair-line {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #1e3a5f 30%, #1e3a5f 70%, transparent);
    height: 141vh;
    transform-origin: center;
    pointer-events: none;
    z-index: 1;
}

.crosshair-tl {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.crosshair-tr {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.crosshair-bl {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(135deg);
}

.crosshair-br {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-135deg);
}

.equilibrium-circle {
    width: 320px;
    height: 320px;
    border: 1px solid #3b6fa0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    z-index: 2;
    background: #050a12;
}

.equilibrium-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.65;
    color: #8fa4b8;
    text-align: center;
}

/* Chamber 5: The Projection Chamber */
.chamber-projection {
    background: #080e18;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8vh 6vw;
}

.projection-year {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(8rem, 20vw, 16rem);
    color: #0f1e30;
    line-height: 1;
    user-select: none;
    cursor: default;
    font-variant-numeric: tabular-nums;
    z-index: 1;
    transition: border-color 0.15s ease;
}

.projection-year.shake-trigger {
    animation: market-correction 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.projection-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 700px;
}

.projection-block {
    border: 1px solid #1e3a5f;
    background: rgba(8, 14, 24, 0.85);
    padding: 2.5rem 3rem;
    transition: border-color 0.15s ease;
}

.projection-block-1 {
    transform: rotate(-2deg);
}

.projection-block-2 {
    transform: rotate(3deg);
}

.projection-block.shake-trigger {
    animation: market-correction 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-color: #a03b3b;
}

/* ==================== ANIMATIONS ==================== */

@keyframes market-correction {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px) rotate(-0.5deg); }
    20% { transform: translateX(6px) rotate(0.3deg); }
    30% { transform: translateX(-4px) rotate(-0.2deg); }
    40% { transform: translateX(3px) rotate(0.1deg); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(1px); }
}

/* Override for rotated projection blocks to preserve their rotation */
.projection-block-1.shake-trigger {
    animation: market-correction-r1 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.projection-block-2.shake-trigger {
    animation: market-correction-r2 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes market-correction-r1 {
    0%, 100% { transform: rotate(-2deg) translateX(0); }
    10% { transform: rotate(-2deg) translateX(-8px); }
    20% { transform: rotate(-2deg) translateX(6px); }
    30% { transform: rotate(-2deg) translateX(-4px); }
    40% { transform: rotate(-2deg) translateX(3px); }
    50% { transform: rotate(-2deg) translateX(-2px); }
    60% { transform: rotate(-2deg) translateX(1px); }
}

@keyframes market-correction-r2 {
    0%, 100% { transform: rotate(3deg) translateX(0); }
    10% { transform: rotate(3deg) translateX(-8px); }
    20% { transform: rotate(3deg) translateX(6px); }
    30% { transform: rotate(3deg) translateX(-4px); }
    40% { transform: rotate(3deg) translateX(3px); }
    50% { transform: rotate(3deg) translateX(-2px); }
    60% { transform: rotate(3deg) translateX(1px); }
}

/* ==================== ACTIVE CHAMBER STATES ==================== */

.chamber.chamber-active .sharp-panel {
    border-color: #1e3a5f;
}

/* ==================== RESPONSIVE: BELOW 768px ==================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: auto;
        bottom: 0;
        width: 100vw;
        height: 48px;
        flex-direction: row;
        padding: 0 20px;
        border-right: none;
        border-top: 1px solid #0f1e30;
    }

    .sidebar-indicators {
        flex-direction: row;
        gap: 12px;
        align-items: center;
        height: 100%;
    }

    .sidebar-indicator {
        height: 2px;
        flex: 1;
    }

    .sidebar-indicator.active {
        height: 4px;
    }

    .indicator-label {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
        padding-bottom: 48px;
    }

    .chamber-void {
        padding: 0 0 15vh 6vw;
    }

    .supply-panels,
    .demand-panels {
        max-width: 100%;
    }

    .supply-panel-1,
    .supply-panel-3 {
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }

    .supply-panel-2 {
        clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    }

    .demand-panel-1,
    .demand-panel-3 {
        clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    }

    .demand-panel-2 {
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }

    .supply-panel-1,
    .supply-panel-3,
    .demand-panel-2 {
        transform: translateX(-2%);
    }

    .supply-panel-2,
    .demand-panel-1,
    .demand-panel-3 {
        transform: translateX(2%);
    }

    .sharp-panel {
        padding: 2rem 2rem;
    }

    .equilibrium-circle {
        width: min(280px, 70vw);
        height: min(280px, 70vw);
        padding: 2rem;
    }

    .projection-block-1 {
        transform: rotate(-1deg);
    }

    .projection-block-2 {
        transform: rotate(1.5deg);
    }

    .projection-content {
        gap: 2rem;
    }

    .projection-block {
        padding: 2rem;
    }

    .crosshair-line {
        height: 100vh;
    }
}

@media (max-width: 480px) {
    .site-title {
        letter-spacing: 0.2em;
    }

    .sharp-panel {
        padding: 1.5rem 1.5rem;
    }

    .equilibrium-circle {
        padding: 1.5rem;
    }

    .equilibrium-text {
        font-size: 0.82rem;
    }

    .projection-block {
        padding: 1.5rem;
    }
}

/* ==================== SELECTION STYLING ==================== */

::selection {
    background: #1e3a5f;
    color: #c8d6e4;
}
