/* =====================================================
   rational.business - Cyberpunk Control Room Styles
   ===================================================== */

/* Color Palette */
:root {
    --bg-deep: #0E0C0A;
    --bg-card: #1A1612;
    --burnt-orange-primary: #C4622A;
    --burnt-orange-light: #D4844A;
    --burnt-orange-dark: #8B3D15;
    --text-primary: #D8CCBA;
    --text-secondary: #9A8B78;
    --status-green: #7A8B6A;
    --copper-border: #5C3A1E;
    --highlight: #E8A060;
}

/* =====================================================
   Global Styles
   ===================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 400;
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 80px 1fr;
    min-height: 100vh;
}

/* =====================================================
   Command Header
   ===================================================== */

.command-header {
    grid-column: 1 / -1;
    grid-row: 1;
    background-color: var(--bg-deep);
    border-bottom: 2px solid var(--burnt-orange-primary);
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.domain-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

/* Copper pipe rail with rivets */
.rivets {
    flex: 1;
    height: 2px;
    margin: 0 24px;
    background: repeating-radial-gradient(
        circle at 10px center,
        var(--burnt-orange-dark) 0,
        var(--burnt-orange-dark) 3px,
        transparent 3px,
        transparent 20px
    );
}

.header-line {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--burnt-orange-primary);
}

/* =====================================================
   Data Spine Sidebar
   ===================================================== */

.data-spine {
    grid-column: 1;
    grid-row: 2;
    background-color: var(--bg-card);
    border-right: 1px solid var(--copper-border);
    padding: 24px 16px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;

    /* Leather texture */
    background-image:
        radial-gradient(circle at 1.5px 1.5px, rgba(90, 60, 30, 0.04) 1px, transparent 1px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 0, 0, 0.03) 40px, rgba(0, 0, 0, 0.03) 41px);
    background-size: 3px 3px, 100% 100%;
    background-blend-mode: overlay;
}

.spine-section {
    border-left: 2px solid var(--burnt-orange-primary);
    padding-left: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.spine-label {
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.spine-readout {
    color: var(--burnt-orange-primary);
    font-weight: 600;
    font-size: 14px;
}

.spine-gauge {
    width: 60px;
    height: 60px;
    margin-top: 8px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: var(--copper-border);
    stroke-width: 2;
}

.gauge-fill {
    fill: none;
    stroke: var(--burnt-orange-primary);
    stroke-width: 3;
    stroke-linecap: round;
}

/* =====================================================
   Main Content Area
   ===================================================== */

.main-content {
    grid-column: 2;
    grid-row: 2;
    padding: 40px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* =====================================================
   Card Styling
   ===================================================== */

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--copper-border);
    border-radius: 2px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;

    /* Leather texture */
    background-image:
        radial-gradient(circle at 1.5px 1.5px, rgba(90, 60, 30, 0.04) 1px, transparent 1px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0, 0, 0, 0.03) 40px, rgba(0, 0, 0, 0.03) 41px);
    background-size: 3px 3px, 100% 100%;
    background-blend-mode: overlay;

    /* Slide-reveal animation */
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0), opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.card[data-reveal="left"] {
    transform: translateX(-100%);
}

.card[data-reveal="right"] {
    transform: translateX(100%);
}

.card.revealed {
    transform: translateX(0);
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.dot-matrix {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.dot-matrix::before,
.dot-matrix::after {
    content: '';
    width: 3px;
    height: 3px;
    background-color: var(--burnt-orange-primary);
    border-radius: 50%;
}

.card h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    flex: 1;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-content p {
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 14px;
}

/* Circuit trace decoration */
.circuit-trace {
    margin-top: 12px;
    height: 2px;
    background: linear-gradient(90deg,
        var(--copper-border) 0%,
        var(--copper-border) 30%,
        transparent 30%,
        transparent 70%,
        var(--copper-border) 70%,
        var(--copper-border) 100%);
    position: relative;
}

.circuit-trace::before,
.circuit-trace::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--burnt-orange-primary);
    border-radius: 50%;
    top: -1px;
}

.circuit-trace::before {
    left: 28%;
}

.circuit-trace::after {
    right: 28%;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 200px;
    }

    .command-header {
        grid-column: 1;
        grid-row: 1;
    }

    .data-spine {
        grid-column: 1;
        grid-row: 3;
        border-right: none;
        border-top: 1px solid var(--copper-border);
        height: auto;
        position: relative;
        top: 0;
        padding: 16px 24px;
        flex-direction: row;
        gap: 24px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .spine-section {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .main-content {
        grid-column: 1;
        grid-row: 2;
        padding: 24px;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .command-header {
        padding: 0 16px;
    }

    .domain-name {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .rivets {
        margin: 0 12px;
    }

    .main-content {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .card {
        padding: 16px;
    }

    .card h2 {
        font-size: 1.4rem;
    }

    .data-spine {
        overflow-x: auto;
    }

    .spine-section {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .domain-name {
        font-size: clamp(1.2rem, 3vw, 2rem);
    }

    .header-content {
        height: 60px;
    }

    .command-header {
        padding: 0 12px;
    }

    .data-spine {
        padding: 12px 16px;
        gap: 16px;
    }

    .main-content {
        padding: 12px;
        gap: 12px;
    }

    .card {
        padding: 12px;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .spine-label {
        font-size: 10px;
    }

    .spine-readout {
        font-size: 13px;
    }
}

/* =====================================================
   Scrollbar Styling
   ===================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--burnt-orange-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--burnt-orange-light);
}

/* =====================================================
   Utility Classes
   ===================================================== */

/* Staggered animation delays for cascade effect */
.card:nth-child(1) { --delay: 0ms; }
.card:nth-child(2) { --delay: 80ms; }
.card:nth-child(3) { --delay: 160ms; }
.card:nth-child(4) { --delay: 240ms; }
.card:nth-child(5) { --delay: 320ms; }
.card:nth-child(6) { --delay: 400ms; }
.card:nth-child(7) { --delay: 480ms; }
.card:nth-child(8) { --delay: 560ms; }
.card:nth-child(9) { --delay: 640ms; }
.card:nth-child(10) { --delay: 720ms; }
.card:nth-child(11) { --delay: 800ms; }
.card:nth-child(12) { --delay: 880ms; }

.card.revealed {
    animation: slideReveal 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) backwards;
}

@keyframes slideReveal {
    from {
        opacity: 0;
        transform: translateX(var(--reveal-distance, -100%));
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
