/* ========================================
   xanadu.science - styles.css
   Palette:
     Paper White:      #F4F2ED
     Graph Line:       #C8D0D8
     Ink Graphite:     #2C3038
     Botanical Green:  #4A7C59
     Mineral Blue:     #3A5F8A
     Specimen Amber:   #A67C3B
     Annotation Rose:  #9B5A5A
     Deep Loam:        #3A3530
   Fonts: Space Grotesk 500, IBM Plex Serif 400, IBM Plex Mono 400
======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Serif', Georgia, serif;
    font-weight: 400;
    color: #2C3038;
    line-height: 1.7;
    font-size: 1rem;
    overflow-x: hidden;
    background-color: #F4F2ED;
    background-image:
        repeating-linear-gradient(to right, rgba(200, 208, 216, 0.15) 0px, rgba(200, 208, 216, 0.15) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(to bottom, rgba(200, 208, 216, 0.15) 0px, rgba(200, 208, 216, 0.15) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(to right, rgba(200, 208, 216, 0.25) 0px, rgba(200, 208, 216, 0.25) 1px, transparent 1px, transparent 100px),
        repeating-linear-gradient(to bottom, rgba(200, 208, 216, 0.25) 0px, rgba(200, 208, 216, 0.25) 1px, transparent 1px, transparent 100px);
}

h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.data-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* ---- FADE IN ---- */

.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---- SECTION HEADING ---- */

.section-heading {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #2C3038;
    margin-bottom: 2rem;
}

/* ---- LABORATORY HEADER ---- */

.lab-header {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 3rem;
    max-width: 1100px;
    margin: 0 auto;
}

.header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #2C3038;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.site-subtitle {
    color: #2C3038;
    opacity: 0.6;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.compass-rose {
    width: 40px;
    height: 40px;
    margin-top: 2rem;
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dome-wireframe {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* ---- FIELD SURVEY MODULES ---- */

.survey-modules {
    padding: clamp(3rem, 5vw, 5rem) 3rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 160vh;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.module {
    background: rgba(244, 242, 237, 0.9);
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(200, 208, 216, 0.3);
}

.module-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.border-green { background: #4A7C59; }
.border-blue { background: #3A5F8A; }
.border-amber { background: #A67C3B; }
.border-rose { background: #9B5A5A; }

.module-title {
    font-size: 1rem;
    color: #2C3038;
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

.module-text {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #2C3038;
    margin-bottom: 0.75rem;
}

.module-data {
    color: #2C3038;
    opacity: 0.7;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(200, 208, 216, 0.3);
}

/* ---- CROSS-SECTION ---- */

.cross-section {
    padding: clamp(4rem, 6vw, 6rem) 3rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 80vh;
}

.diagram-container {
    width: 100%;
    border: 1px solid rgba(200, 208, 216, 0.3);
    background: rgba(244, 242, 237, 0.95);
    padding: 1rem;
}

.terrain-svg {
    width: 100%;
    height: auto;
}

/* ---- SPECIMEN CATALOG ---- */

.specimen-catalog {
    padding: clamp(3rem, 5vw, 5rem) 3rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 80vh;
}

.specimen-layout {
    display: grid;
    grid-template-columns: 25% 1fr;
    gap: 2rem;
}

.specimen-nav {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.nav-title {
    font-size: 1.2rem;
    color: #2C3038;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(200, 208, 216, 0.3);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #2C3038;
    cursor: pointer;
}

.nav-flora { border-left: 3px solid #4A7C59; padding-left: 0.75rem; }
.nav-mineral { border-left: 3px solid #3A5F8A; padding-left: 0.75rem; }
.nav-aquatic { border-left: 3px solid #A67C3B; padding-left: 0.75rem; }
.nav-atmos { border-left: 3px solid #9B5A5A; padding-left: 0.75rem; }

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.specimen-card {
    background: rgba(244, 242, 237, 0.9);
    border: 1px solid rgba(200, 208, 216, 0.3);
    padding: 1.5rem;
}

.specimen-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-flower {
    position: relative;
}

.flower-center {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4A7C59;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.flower-petal {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4A7C59;
    position: absolute;
}

.flower-petal.p1 { top: 8px; left: 50%; transform: translateX(-50%); }
.flower-petal.p2 { bottom: 8px; left: 50%; transform: translateX(-50%); }
.flower-petal.p3 { top: 50%; left: 8px; transform: translateY(-50%); }
.flower-petal.p4 { top: 50%; right: 8px; transform: translateY(-50%); }

.icon-crystal {
    display: flex;
    align-items: center;
    justify-content: center;
}

.crystal-shape {
    width: 30px;
    height: 30px;
    background: rgba(166, 124, 59, 0.2);
    border: 1px solid #A67C3B;
    transform: rotate(45deg);
}

.icon-wave svg {
    width: 60px;
    height: 30px;
}

.specimen-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #2C3038;
    margin-bottom: 0.3rem;
}

.specimen-class {
    color: #2C3038;
    opacity: 0.5;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    display: block;
}

.specimen-desc {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #2C3038;
    opacity: 0.8;
}

/* ---- RESEARCH NOTES ---- */

.research-notes {
    padding: clamp(4rem, 6vw, 6rem) 3rem;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 60vh;
}

.notes-content {
    margin: 0 20%;
    position: relative;
}

.notes-margin-area {
    position: absolute;
    left: -15%;
    top: 4rem;
    width: 10%;
}

.annotation-mark {
    width: 20px;
    height: 20px;
    display: block;
    margin-bottom: 4rem;
}

.notes-list {
    padding-left: 1.5rem;
    counter-reset: note;
}

.note-item {
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #2C3038;
}

.survey-coords {
    margin-top: 3rem;
    text-align: center;
    color: #2C3038;
    opacity: 0.5;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 900px) {
    .lab-header {
        flex-direction: column;
        gap: 2rem;
    }

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .specimen-nav {
        position: static;
    }

    .specimen-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .notes-content {
        margin: 0 5%;
    }

    .notes-margin-area {
        display: none;
    }
}

@media (max-width: 600px) {
    .module-grid {
        grid-template-columns: 1fr;
    }

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

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