/* ========================================
   xbom.wiki - styles.css
   Palette:
     Canvas White:    #FAFAFA
     Charcoal:        #2B2D30
     Signal Red:      #E63946
     Standard Blue:   #457B9D
     Emerging Yellow: #E9C46A
     Light Gray:      #EDEDED
     Medium Gray:     #6B7280
     Black:           #1A1A1A
   Fonts: Archivo Black, Work Sans 400/600, Fira Mono 400
======================================== */

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    color: #2B2D30;
    background: #FAFAFA;
    line-height: 1.7;
    font-size: 1rem;
    overflow-x: hidden;
}

h1,h2,h3,h4 { font-family: 'Archivo Black', sans-serif; font-weight: 400; }

.mono-text {
    font-family: 'Fira Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
}

/* ---- FADE IN ---- */
.fade-in { opacity:0; transition: opacity 0.6s ease; }
.fade-in.in-view { opacity:1; }

/* ---- ACCENT RULES ---- */
.accent-rule { border:none; height:4px; margin:0; }
.rule-red { background:#E63946; }
.rule-blue { background:#457B9D; }
.rule-yellow { background:#E9C46A; }
.thin-rule { height:4px; margin:1.5rem 0; }

/* ---- SECTION HEADING ---- */
.section-heading {
    font-size: clamp(2rem,5vw,4rem);
    color: #1A1A1A;
    margin-bottom: 2rem;
}

/* ---- DEFINITION BLOCK ---- */
.definition-block {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem,6vw,6rem) clamp(2rem,4vw,4rem);
    max-width: 1200px;
    margin: 0 auto;
}

.def-layout {
    display: grid;
    grid-template-columns: 65% 30%;
    gap: 5%;
    align-items: center;
    margin-bottom: 2rem;
}

.xbom-title {
    font-size: clamp(4rem,16vw,12rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    color: #1A1A1A;
}

.def-expanded {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: #2B2D30;
    margin-bottom: 0.75rem;
}

.def-desc {
    font-size: 0.95rem;
    color: #6B7280;
    line-height: 1.6;
}

.domain-icons {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: center;
}

.domain-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-label {
    font-family: 'Fira Mono', monospace;
    font-size: 0.8rem;
    color: #6B7280;
}

.shape-circle {
    display: inline-block;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #457B9D;
}

.shape-square {
    display: inline-block;
    width: 24px; height: 24px;
    background: #E63946;
}

.shape-triangle {
    display: inline-block;
    width: 24px; height: 24px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: #E9C46A;
}

/* ---- TAXONOMY ---- */
.taxonomy {
    padding: clamp(3rem,5vw,5rem) clamp(2rem,4vw,4rem);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 120vh;
}

.taxonomy-layout {
    display: grid;
    grid-template-columns: 65% 30%;
    gap: 5%;
}

.taxonomy-entry {
    margin-bottom: 2.5rem;
}

.entry-heading {
    font-size: 1.3rem;
    color: #1A1A1A;
    margin-bottom: 0.75rem;
}

.taxonomy-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.def-card {
    background: #EDEDED;
    padding: 1.5rem;
    border-radius: 4px;
    border-top: 4px solid transparent;
}

.card-critical { border-top-color: #E63946; }
.card-standard { border-top-color: #457B9D; }
.card-emerging { border-top-color: #E9C46A; }

.card-title {
    font-size: 1rem;
    color: #1A1A1A;
    margin-bottom: 0.5rem;
}

.card-def {
    font-size: 0.9rem;
    color: #2B2D30;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.card-code {
    font-family: 'Fira Mono', monospace;
    font-size: 0.75rem;
    color: #6B7280;
}

/* ---- ARCHITECTURE ---- */
.architecture {
    padding: clamp(3rem,5vw,5rem) clamp(2rem,4vw,4rem);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
}

.diagram-wrap {
    width: 80%;
    max-width: 900px;
    margin: 0 auto;
}

.arch-diagram {
    width: 100%;
    height: auto;
}

/* ---- REFERENCE ENTRIES ---- */
.reference {
    padding: clamp(3rem,5vw,5rem) clamp(2rem,4vw,4rem);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 140vh;
}

.reference-layout {
    display: grid;
    grid-template-columns: 1fr 20%;
    gap: 3rem;
}

.ref-entry {
    margin-bottom: 1rem;
}

.ref-title {
    font-size: 1.4rem;
    color: #1A1A1A;
    margin-bottom: 0.75rem;
}

.ref-tag {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #6B7280;
}

.ref-entry p {
    margin-bottom: 1em;
    font-size: 0.95rem;
    line-height: 1.7;
}

.ref-related {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6B7280;
    margin-top: 0.5rem;
}

.related-link {
    color: #457B9D;
    cursor: pointer;
}

/* ---- MINIMAP ---- */
.ref-minimap {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.minimap-item {
    font-family: 'Fira Mono', monospace;
    font-size: 0.8rem;
    color: #6B7280;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.minimap-item.active {
    color: #1A1A1A;
    font-weight: 600;
    border-left-color: #E63946;
}

/* ---- FOOTER ---- */
.standard-footer {
    background: #2B2D30;
    padding: clamp(3rem,5vw,4rem) clamp(2rem,4vw,4rem);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.footer-heading {
    font-size: 0.9rem;
    color: #FAFAFA;
    margin-bottom: 1rem;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
}

.footer-link {
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 0.4rem;
}

.footer-copy {
    text-align: center;
    color: rgba(250,250,250,0.4);
    font-size: 0.75rem;
    font-family: 'Fira Mono', monospace;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(250,250,250,0.1);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .def-layout,
    .taxonomy-layout {
        grid-template-columns: 1fr;
    }

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

    .ref-minimap {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .minimap-item {
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .minimap-item.active {
        border-bottom-color: #E63946;
        border-left: none;
    }

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

    .diagram-wrap {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
