/* bcd.day - Sunset Warm Waveform Design */
/* Colors: #1a0d04, #3d1f0a, #f2e6d6, #f0a86c, #e8856b, #c24b2a, #7a9474, #d4774f */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
    color: #3d1f0a;
    background: #f2e6d6;
    overflow-x: hidden;
}

/* ============ SIDEBAR ============ */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #1a0d04;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    z-index: 100;
}

#sidebar-logo {
    font-family: 'Major Mono Display', monospace;
    font-size: 1.2rem;
    color: #f0a86c;
    letter-spacing: 0.15em;
    margin-bottom: 40px;
}

#sidebar-nav {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#nav-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 320px;
}

#nav-indicators {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    z-index: 2;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #d4774f;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    padding: 0;
}

.nav-dot .dot-inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: all 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.nav-dot.active {
    border-color: #c24b2a;
    box-shadow: 0 0 12px rgba(194, 75, 42, 0.5);
}

.nav-dot.active .dot-inner {
    background: #c24b2a;
}

#sidebar-waveform {
    width: 200px;
    height: 60px;
    margin-top: 24px;
}

#live-waveform {
    width: 100%;
    height: 100%;
}

#sidebar-readout {
    margin-top: 16px;
}

#readout-text {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #7a9474;
}

/* ============ MAIN CONTENT ============ */
#main-content {
    margin-left: 280px;
    width: calc(100vw - 280px);
}

.content-section {
    min-height: 80vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-light {
    background: #f2e6d6;
    color: #3d1f0a;
}

.section-dark {
    background: #3d1f0a;
    color: #f2e6d6;
}

.section-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 24px;
    padding: 80px 48px;
    max-width: 100%;
}

.section-number-display {
    grid-column: 1 / -1;
    display: flex;
    gap: 16px;
    align-items: baseline;
    margin-bottom: 16px;
}

.section-num-decimal {
    font-family: 'Major Mono Display', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    opacity: 0.15;
}

.section-num-binary {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #d4774f;
    opacity: 0.5;
}

.section-title {
    grid-column: 1 / 8;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1.1;
    margin-bottom: 24px;
}

.section-light .section-title {
    color: #c24b2a;
}

.section-dark .section-title {
    color: #f0a86c;
}

.section-text {
    max-width: 65ch;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
}

.section-text.offset-left {
    grid-column: 1 / 8;
}

.section-text.offset-right {
    grid-column: 3 / -1;
}

.section-light .section-text {
    color: #3d1f0a;
}

.section-dark .section-text {
    color: #f2e6d6;
}

/* ============ BCD TITLE ============ */
#bcd-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin: 40px 0;
}

.bcd-char, .bcd-dot {
    font-family: 'Major Mono Display', monospace;
    font-weight: 400;
    font-size: clamp(6rem, 15vw, 14rem);
    color: #c24b2a;
    line-height: 1;
}

.bcd-dot {
    font-size: clamp(4rem, 10vw, 9rem);
    color: #d4774f;
}

.skeleton-wrap {
    position: relative;
    display: inline-block;
}

.skeleton-wrap .char-reveal {
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.skeleton-wrap.revealed .char-reveal {
    opacity: 1;
}

.skeleton-wrap .skeleton {
    position: absolute;
    inset: 10% 5%;
    background: linear-gradient(90deg, #3d1f0a 25%, #f0a86c 50%, #3d1f0a 75%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: 2px;
}

.skeleton-wrap.revealed .skeleton {
    opacity: 0;
    transition: opacity 400ms ease;
}

.skeleton-dot {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    inset: auto !important;
    bottom: 20% !important;
    left: 30% !important;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============ WAVEFORM CANVAS ============ */
.waveform-canvas {
    grid-column: 1 / -1;
    height: 200px;
    margin: 24px 0;
    position: relative;
}

.waveform-canvas-square {
    height: 300px;
    display: flex;
    justify-content: center;
}

.section-waveform {
    width: 100%;
    height: 100%;
}

.section-waveform-square {
    width: 300px;
    height: 300px;
}

/* ============ HALFTONE BACKGROUNDS ============ */
.halftone-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.halftone-light {
    background: radial-gradient(circle, #d4774f 1px, transparent 1px);
    background-size: 12px 12px;
    opacity: 0.08;
}

.halftone-dark {
    background: radial-gradient(circle, #f0a86c 0.5px, transparent 0.5px);
    background-size: 8px 8px;
    opacity: 0.08;
}

/* ============ WAVE DIVIDERS ============ */
.wave-divider {
    position: relative;
    z-index: 2;
    height: 40px;
    width: 100%;
}

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

/* ============ BINARY GRID OVERLAY ============ */
.binary-grid-overlay {
    grid-column: 1 / -1;
    display: flex;
    gap: 0;
    justify-content: center;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.binary-grid-overlay.visible {
    opacity: 1;
}

.bit-header {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #d4774f;
    opacity: 0.3;
    width: 80px;
    text-align: center;
    border-right: 1px solid rgba(212, 119, 79, 0.1);
    padding: 8px 0;
}

.bit-header:last-child {
    border-right: none;
}

/* ============ DECODED READOUT ============ */
.decoded-readout {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-top: 40px;
    justify-content: center;
}

.decoded-label {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #d4774f;
}

.decoded-value {
    font-family: 'Major Mono Display', monospace;
    font-size: clamp(3rem, 6vw, 5rem);
    color: #7a9474;
    transition: color 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    #sidebar {
        width: 60px;
        padding: 16px 8px;
    }
    
    #sidebar-logo {
        font-size: 0.7rem;
        letter-spacing: 0.05em;
    }
    
    #sidebar-waveform {
        display: none;
    }
    
    #sidebar-readout {
        display: none;
    }
    
    #main-content {
        margin-left: 60px;
        width: calc(100vw - 60px);
    }
    
    .section-inner {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }
    
    .section-text.offset-left,
    .section-text.offset-right {
        grid-column: 1 / -1;
    }
    
    .section-title {
        grid-column: 1 / -1;
    }
}
