/* archetypic.dev - Mid-century Scientific Illustration */
/* Colors: #1a2038, #8b6914, #f5f0e8, #8c2f2a, #c4a35a, #6b6560, #2c1810, #3d3530, #3D2B1A, #E8E0D0, #FAF6EE */
/* Fonts: Playfair Display, IBM Plex Sans, IBM Plex Mono */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    background: #2c1810;
    color: #3d3530;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    position: relative;
    overflow: hidden;
}

.section-dark {
    background-color: #1a2038;
    color: #f5f0e8;
}

.section-light {
    background-color: #f5f0e8;
    color: #3d3530;
}

/* Mandala */
.mandala-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.3;
    animation: mandalaSpin 120s linear infinite;
}

@keyframes mandalaSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

/* Section content */
.section-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.section-content.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 15vw, 12rem);
    letter-spacing: 0.03em;
    color: #f5f0e8;
    opacity: 0;
    transition: opacity 1.5s ease;
}

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

.site-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #c4a35a;
    letter-spacing: 0.05em;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 1s ease 0.8s;
}

.site-title.visible ~ .site-tagline {
    opacity: 1;
}

/* Editorial layout */
.editorial-layout {
    max-width: 720px;
    width: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.editorial-layout.visible {
    opacity: 1;
    transform: translateY(0);
}

.margin-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #8b6914;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.margin-note.light {
    color: #c4a35a;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    letter-spacing: 0.03em;
    color: #3d3530;
    margin-bottom: 24px;
}

.section-heading.light {
    color: #f5f0e8;
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.8;
    color: #6b6560;
    margin-bottom: 40px;
}

.body-text.light {
    color: #E8E0D0;
}

.body-text em {
    color: #3D2B1A;
}

.section-light .taxonomy-grid {
    background: #FAF6EE;
}

/* Taxonomy Grid */
.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.taxonomy-card {
    background: rgba(196, 163, 90, 0.06);
    border: 1px solid #c4a35a;
    padding: 24px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease;
}

.taxonomy-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.taxonomy-card:hover {
    border-color: #8c2f2a;
}

.card-sigil {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
}

.card-sigil svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 18px;
    color: #3d3530;
    margin-bottom: 8px;
}

.card-desc {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: #6b6560;
    line-height: 1.6;
}

/* Structure Diagram */
.structure-diagram {
    margin: 30px auto;
    text-align: center;
}

.structure-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* Code Specimen */
.code-specimen {
    margin-top: 10px;
}

.code-block {
    background: #2c1810;
    border: 1px solid #c4a35a;
    padding: 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #f5f0e8;
    overflow-x: auto;
    white-space: pre;
}

.code-keyword { color: #c4a35a; }
.code-type { color: #8c2f2a; }
.code-string { color: #8b6914; }

/* Final Section */
.final-mandala {
    margin-bottom: 30px;
}

.final-mandala-svg {
    width: 120px;
    height: 120px;
    animation: mandalaSpin 120s linear infinite;
}

.closing-text {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 20px;
    color: #c4a35a;
    opacity: 0;
    transition: opacity 1s ease;
}

.closing-text.visible {
    opacity: 1;
}

/* Footer */
.site-footer {
    background: #1a2038;
    padding: 40px;
    text-align: center;
    border-top: 1px solid rgba(196, 163, 90, 0.2);
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #6b6560;
    letter-spacing: 0.08em;
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 60px 24px;
    }

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

    .code-block {
        font-size: 12px;
        padding: 16px;
    }
}
