/* archetype.works - Systematic Design Pattern Observatory */

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

body {
    background-color: #FFFFFF;
    color: #111111;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Blueprint Grid Underlay */
#blueprint-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(224,224,220,0.3) 39px, rgba(224,224,220,0.3) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(224,224,220,0.3) 39px, rgba(224,224,220,0.3) 40px);
    pointer-events: none;
    z-index: 0;
}

/* Left Reading Rail */
#left-rail {
    position: fixed;
    left: 0;
    top: 0;
    width: 160px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding-left: 20px;
    z-index: 50;
}

.rail-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6B6B6B;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 8px;
}

.rail-label.active {
    color: #2D5BFF;
}

.rail-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #2D5BFF;
    transition: width 0.3s ease;
}

.rail-label.active::after {
    width: 100%;
}

/* Module System */
.module {
    border: 1px solid #E0E0DC;
    position: relative;
    padding: 24px;
    background: #FFFFFF;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.module:hover {
    border-color: #2D5BFF;
    border-width: 2px;
    transform: scale(1.02);
}

.module.alt-bg {
    background: #FAFAF5;
}

/* Hero Module */
.module-hero {
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 160px;
    border: 1px solid #E0E0DC;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: #111111;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-title.visible {
    opacity: 1;
}

.hero-statement {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    color: #6B6B6B;
    margin-top: 12px;
}

/* Taxonomy Grid */
#taxonomy-grid {
    margin-left: 160px;
    padding: 0 8px 8px;
}

.module-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* Module sizes */
.module-1x1 { width: 160px; min-height: 160px; flex-shrink: 0; }
.module-1x2 { width: 160px; min-height: 320px; flex-shrink: 0; }
.module-2x2 { width: 328px; min-height: 320px; flex-shrink: 0; }
.module-3x2 { flex: 1; min-height: 320px; }
.module-void { flex: 1; border: none; background: transparent; }
.module-void:hover { border-color: transparent; transform: none; }
.module-void-small { width: 160px; flex-shrink: 0; border: none; background: transparent; }
.module-void-small:hover { border-color: transparent; transform: none; }

/* Module Content */
.module-content {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.module-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.module-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.module-body {
    margin-bottom: 0.8em;
}

.module-body-small {
    font-size: 0.9rem;
}

.module-code {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: #6B6B6B;
    display: block;
    margin-bottom: 8px;
}

/* Counter Badge */
.counter-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2D5BFF;
    color: #FFFFFF;
    font-family: 'DM Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Geometric Symbols */
.geo-symbol {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.geo-symbol svg {
    transition: transform 0.4s ease;
}

.module:hover .geo-symbol svg {
    transform: rotate(15deg);
}

/* Footer */
#footer-strip {
    margin-left: 160px;
    height: 80px;
    background: #1A1A1A;
    display: flex;
    align-items: center;
    padding: 0 32px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.footer-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #FFFFFF;
}

.footer-code {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #6B6B6B;
}

/* Responsive */
@media (max-width: 900px) {
    #left-rail {
        display: none;
    }
    .module-hero,
    #taxonomy-grid,
    #footer-strip {
        margin-left: 0;
    }
    .module-row {
        flex-wrap: wrap;
    }
    .module-1x1,
    .module-1x2,
    .module-2x2 {
        width: 100%;
        min-height: auto;
    }
    .module-void,
    .module-void-small {
        display: none;
    }
}
