/* ============================================
   miris.studio — Skeuomorphic Cockpit Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.2vw, 1.05rem);
    line-height: 1.65;
    color: #e8dcc8;
    background-color: #1b2838;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(61,139,139,0.06) 39px, rgba(61,139,139,0.06) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(61,139,139,0.06) 39px, rgba(61,139,139,0.06) 40px);
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* Grid intensifier near center */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(61,139,139,0.12) 39px, rgba(61,139,139,0.12) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(61,139,139,0.12) 39px, rgba(61,139,139,0.12) 40px);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   BOLT / RIVET COMPONENT
   ============================================ */
.bolt {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #9ca8b8, #3a3f4a);
    z-index: 10;
    transform: rotate(var(--bolt-rot, 0deg));
}

.bolt::before,
.bolt::after {
    content: '';
    position: absolute;
    background: #0e1520;
}

.bolt::before {
    width: 6px;
    height: 1.5px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bolt::after {
    width: 1.5px;
    height: 6px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bolt-tl { top: 12px; left: 12px; }
.bolt-tr { top: 12px; right: 12px; }
.bolt-bl { bottom: 12px; left: 12px; }
.bolt-br { bottom: 12px; right: 12px; }

.bolt-panel-tl { top: 8px; left: 8px; }
.bolt-panel-tr { top: 8px; right: 8px; }
.bolt-panel-bl { bottom: 8px; left: 8px; }
.bolt-panel-br { bottom: 8px; right: 8px; }

/* ============================================
   CONTROL PANEL HEADER
   ============================================ */
#control-panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 3rem 1.5rem;
    background:
        repeating-linear-gradient(0deg, rgba(156,168,184,0.03) 0px, rgba(140,150,165,0.02) 1px, transparent 1px, transparent 3px),
        linear-gradient(180deg, #1b2838 0%, #0e1520 100%);
    z-index: 1;
}

/* Nameplate */
.nameplate {
    padding: 1rem 3rem;
    background:
        repeating-linear-gradient(0deg, rgba(156,168,184,0.08) 0px, rgba(130,140,155,0.04) 1px, transparent 1px, transparent 3px),
        linear-gradient(180deg, #9ca8b8, #7a8899);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 4px 12px rgba(0,0,0,0.5),
        0 1px 3px rgba(0,0,0,0.3);
}

.nameplate-inner {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #1b2838;
    text-shadow:
        0 1px 0 rgba(255,255,255,0.3),
        0 -1px 0 rgba(0,0,0,0.2);
}

/* Toggle Row */
.toggle-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.toggle-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.toggle-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: #9ca8b8;
    text-transform: uppercase;
}

.toggle-body {
    width: 20px;
    height: 36px;
    background: linear-gradient(180deg, #3a3f4a, #2a2f3a);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.5),
        0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 3px;
}

.toggle-lever {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: linear-gradient(180deg, #9ca8b8, #6a7585);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.toggle-lever.on {
    transform: translateY(-14px);
}

.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.led-on {
    background: #7ec8c8;
    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.2),
        0 0 6px rgba(126,200,200,0.6),
        0 0 12px rgba(126,200,200,0.3);
    animation: led-pulse 2.5s ease-in-out infinite;
}

.led-off {
    background: #3a3f4a;
}

@keyframes led-pulse {
    0%, 100% { box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 6px rgba(126,200,200,0.4), 0 0 12px rgba(126,200,200,0.15); }
    50% { box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 10px rgba(126,200,200,0.8), 0 0 20px rgba(126,200,200,0.4); }
}

/* CRT Housing */
.crt-housing {
    width: 100%;
    max-width: 600px;
}

.crt-bezel {
    background: linear-gradient(180deg, #3a3f4a, #2a2e38);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 8px 24px rgba(0,0,0,0.5);
}

.crt-screen {
    position: relative;
    background: #0e1520;
    border-radius: 10px / 30px;
    padding: 2rem;
    min-height: 120px;
    display: flex;
    align-items: center;
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.5),
        inset 0 0 15px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: crt-hum 4s ease-in-out infinite;
}

@keyframes crt-hum {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.003); }
}

.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
    pointer-events: none;
    z-index: 2;
    border-radius: 10px / 30px;
}

.crt-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.05em;
    color: #7ec8c8;
    z-index: 1;
    white-space: pre-wrap;
    text-shadow: 0 0 8px rgba(126,200,200,0.4);
}

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.scroll-indicator-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: #9ca8b8;
    opacity: 0.6;
}

.scroll-arrow {
    width: 12px;
    height: 12px;
    border-right: 2px solid #9ca8b8;
    border-bottom: 2px solid #9ca8b8;
    transform: rotate(45deg);
    opacity: 0.5;
}

/* ============================================
   TIMELINE
   ============================================ */
#timeline {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1rem 6rem;
    z-index: 1;
}

/* Spine */
.spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    background:
        repeating-linear-gradient(180deg, #3a3f4a 0px, #3a3f4a 8px, #9ca8b8 8px, #9ca8b8 10px, #3a3f4a 10px, #3a3f4a 18px);
    box-shadow:
        -1px 0 0 rgba(0,0,0,0.3),
        1px 0 0 rgba(255,255,255,0.05);
}

/* Timeline Node */
.timeline-node {
    position: relative;
    width: 50%;
    padding: 2rem 0;
    opacity: 0;
    transition: opacity 0.1s;
}

.timeline-node.visible {
    opacity: 1;
}

.node-left {
    margin-left: 0;
    padding-right: 3rem;
}

.node-right {
    margin-left: 50%;
    padding-left: 3rem;
}

/* Junction */
.junction {
    position: absolute;
    top: 3rem;
    z-index: 5;
}

.node-left .junction {
    right: -8px;
}

.node-right .junction {
    left: -8px;
}

.junction-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #7ec8c8, #3d8b8b);
    box-shadow: 0 0 8px rgba(61,139,139,0.4);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s;
}

.junction-dot.pulse {
    animation: junction-pulse 0.4s ease-out;
}

@keyframes junction-pulse {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(61,139,139,0.4); }
    50% { transform: scale(1.06); box-shadow: 0 0 16px rgba(61,139,139,0.7); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(61,139,139,0.4); }
}

.junction-bar {
    position: absolute;
    top: 50%;
    height: 3px;
    width: 2.5rem;
    background: linear-gradient(90deg, #3a3f4a, #9ca8b8);
    transform: translateY(-50%);
}

.node-left .junction-bar {
    left: 100%;
}

.node-right .junction-bar {
    right: 100%;
    background: linear-gradient(270deg, #3a3f4a, #9ca8b8);
}

/* Panel */
.panel-outer {
    position: relative;
    border-radius: 6px;
    padding: 1.5rem;
}

.panel-aluminum {
    background:
        repeating-linear-gradient(0deg, rgba(156,168,184,0.06) 0px, rgba(140,150,165,0.03) 1px, transparent 1px, transparent 3px),
        linear-gradient(180deg, #4a5060, #3a3f4a);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        inset 0 -1px 0 rgba(0,0,0,0.25),
        0 6px 20px rgba(0,0,0,0.4),
        0 2px 6px rgba(0,0,0,0.3);
}

.panel-dark-steel {
    background:
        repeating-linear-gradient(0deg, rgba(100,110,125,0.05) 0px, rgba(80,90,100,0.03) 1px, transparent 1px, transparent 3px),
        linear-gradient(180deg, #2e333d, #1e2229);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        0 6px 20px rgba(0,0,0,0.5),
        0 2px 6px rgba(0,0,0,0.3);
}

/* Panel entrance animations */
.node-left .panel-outer {
    transform: translateX(-40px) rotate(-2deg);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.node-right .panel-outer {
    transform: translateX(40px) rotate(2deg);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.timeline-node.visible .panel-outer {
    transform: translateX(0) rotate(0deg);
    opacity: 1;
}

.panel-frame {
    background: transparent;
}

.panel-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e8dcc8;
    text-shadow:
        0 1px 0 rgba(0,0,0,0.4),
        0 -1px 0 rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(156,168,184,0.15);
    margin-bottom: 1rem;
}

.panel-content {
    background: rgba(14,21,32,0.3);
    border-radius: 4px;
    padding: 1.2rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.panel-illustration {
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.timeline-node.visible .panel-illustration {
    opacity: 1;
}

.panel-illustration svg {
    width: 100%;
    height: auto;
    max-height: 140px;
}

.panel-description {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.2vw, 1.05rem);
    line-height: 1.65;
    color: #e8dcc8;
    opacity: 0.9;
}

.panel-date {
    margin-top: 1rem;
    display: flex;
}

.node-right .panel-date {
    justify-content: flex-end;
}

.date-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.05em;
    color: #9ca8b8;
    background:
        linear-gradient(180deg, #3a3f4a, #2e333d);
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 2px 4px rgba(0,0,0,0.3);
}

/* ============================================
   WORKSHOP FLOOR
   ============================================ */
#workshop-floor {
    position: relative;
    width: 100%;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 4rem 2rem;
    z-index: 1;
    overflow: hidden;
}

.floor-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg, rgba(58,63,74,0.1) 0px, transparent 1px, transparent 4px),
        repeating-linear-gradient(90deg, rgba(58,63,74,0.1) 0px, transparent 1px, transparent 4px),
        repeating-linear-gradient(45deg, rgba(58,63,74,0.05) 0px, transparent 1px, transparent 6px);
    opacity: 0.8;
}

.floor-tools {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 60px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.tool-svg {
    opacity: 0.15;
}

.tool-wrench {
    width: 40px;
    transform: rotate(-30deg);
}

.tool-controller {
    width: 50px;
    transform: rotate(5deg);
}

.tool-pencil {
    width: 12px;
    transform: rotate(15deg);
}

.founding-plate {
    padding: 0.8rem 2.5rem;
    background:
        repeating-linear-gradient(0deg, rgba(156,168,184,0.06) 0px, transparent 1px, transparent 3px),
        linear-gradient(180deg, #3a3f4a, #2e333d);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.25),
        0 4px 12px rgba(0,0,0,0.4);
    position: relative;
}

.founding-plate-inner {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    color: #9ca8b8;
    text-shadow:
        0 1px 0 rgba(0,0,0,0.3),
        0 -1px 0 rgba(255,255,255,0.08);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .timeline-node {
        width: 85%;
    }

    .node-left {
        margin-left: 15%;
        padding-right: 0;
        padding-left: 2rem;
    }

    .node-right {
        margin-left: 15%;
        padding-left: 2rem;
    }

    .spine {
        left: 12%;
    }

    .node-left .junction,
    .node-right .junction {
        left: -2.5rem;
        right: auto;
    }

    .node-left .junction-bar,
    .node-right .junction-bar {
        left: 100%;
        right: auto;
        background: linear-gradient(90deg, #3a3f4a, #9ca8b8);
    }

    .toggle-row {
        gap: 1rem;
    }

    body::before {
        left: 12%;
        transform: translateX(-50%);
    }
}
