/* monopole.center - Isometric knowledge institution */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    color: #1a2a3a;
    background: #f2f0ed;
    overflow-x: hidden;
    line-height: 1.75;
    font-size: 16px;
    display: grid;
    grid-template-columns: 25vw 1fr;
    min-height: 100vh;
}

/* Mobile top bar */
#mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: #f2f0ed;
    border-bottom: 1px solid rgba(45, 95, 138, 0.3);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.mobile-domain {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2d5f8a;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #2d5f8a;
    cursor: pointer;
}

/* Sidebar */
#sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #f2f0ed;
    border-right: 1px solid rgba(45, 95, 138, 0.3);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-domain {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #2d5f8a;
    letter-spacing: 0.02em;
}

.sidebar-rule {
    border: none;
    height: 1px;
    background: rgba(45, 95, 138, 0.3);
    margin: 16px 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Source Code Pro', monospace;
    font-size: 13px;
    color: #5a6a7a;
    text-decoration: none;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    transition: border-color 300ms ease, color 300ms ease, font-weight 300ms ease, background-color 300ms ease;
    letter-spacing: 0.05em;
}

.nav-item:hover {
    background: rgba(45, 95, 138, 0.08);
}

.nav-item.active {
    border-left-color: #2d5f8a;
    color: #1a2a3a;
    font-weight: 500;
}

.nav-icon {
    flex-shrink: 0;
}

.sidebar-building {
    margin-top: auto;
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

/* Blueprint grid underlay */
#main-content {
    background-image:
        linear-gradient(rgba(45, 95, 138, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 95, 138, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 48px 48px 80px;
}

/* Halls / Sections */
.hall {
    margin-bottom: 80px;
    max-width: 800px;
}

.hall-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 42px;
    color: #1a2a3a;
    margin-bottom: 24px;
}

.hall-body {
    color: #1a2a3a;
    margin-bottom: 32px;
    max-width: 640px;
}

.hall-body-sm {
    color: #5a6a7a;
    font-size: 15px;
    line-height: 1.75;
}

.hall-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

/* F-pattern layout */
.f-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.f-headline {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: #1a2a3a;
}

/* Figures */
.figure-block {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.fig-illustration {
    display: block;
}

.fig-label {
    font-family: 'Source Code Pro', monospace;
    font-size: 12px;
    color: #c4573a;
    letter-spacing: 0.05em;
}

/* Draw lines animation */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 0.6s ease forwards;
}

.draw-line:nth-child(1) { animation-delay: 0s; }
.draw-line:nth-child(2) { animation-delay: 0.3s; }
.draw-line:nth-child(3) { animation-delay: 0.6s; }
.draw-line:nth-child(4) { animation-delay: 0.9s; }
.draw-line:nth-child(5) { animation-delay: 1.2s; }
.draw-line:nth-child(6) { animation-delay: 1.5s; }
.draw-line:nth-child(7) { animation-delay: 1.8s; }
.draw-line:nth-child(8) { animation-delay: 2.1s; }
.draw-line:nth-child(9) { animation-delay: 2.4s; }
.draw-line:nth-child(10) { animation-delay: 2.7s; }

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline-line {
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(45, 95, 138, 0.3);
}

.timeline-entry {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    gap: 16px;
    align-items: start;
    margin-bottom: 40px;
    position: relative;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 8px;
    width: 8px;
    height: 8px;
    background: #2d5f8a;
    border-radius: 50%;
}

.timeline-date {
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    color: #2d5f8a;
    letter-spacing: 0.05em;
}

.timeline-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
    color: #1a2a3a;
    line-height: 1.7;
}

.timeline-icon {
    justify-self: end;
}

/* Slide-in animation */
.slide-in {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.slide-in.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Exhibit grid */
.exhibit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.exhibit-card {
    border: 1px solid #2d5f8a;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background: #f2f0ed;
    transition: transform 200ms ease, box-shadow 200ms ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.exhibit-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.exhibit-icon {
    display: block;
}

.exhibit-title {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: #1a2a3a;
}

.exhibit-desc {
    font-size: 14px;
    color: #5a6a7a;
    line-height: 1.7;
}

/* Exit */
.hall-exit {
    background: #ffffff;
    padding: 80px 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: none;
    margin-left: -48px;
    margin-right: -48px;
    margin-bottom: 0;
}

.exit-statement {
    font-family: 'DM Serif Display', serif;
    font-size: 32px;
    color: #1a2a3a;
}

.exit-domain {
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
    color: #5a6a7a;
    letter-spacing: 0.05em;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    #mobile-bar {
        display: flex;
    }

    #sidebar {
        display: none;
        position: fixed;
        top: 48px;
        left: 0;
        width: 80vw;
        height: calc(100vh - 48px);
        z-index: 150;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    #sidebar.open {
        display: flex;
    }

    #main-content {
        padding: 72px 24px 40px;
    }

    .f-layout {
        grid-template-columns: 1fr;
    }

    .exhibit-grid {
        grid-template-columns: 1fr;
    }

    .hall-title {
        font-size: 32px;
    }

    .hall-exit {
        margin-left: -24px;
        margin-right: -24px;
        padding: 48px 24px;
    }

    .timeline-entry {
        grid-template-columns: 60px 1fr;
    }

    .timeline-icon {
        display: none;
    }
}
