/* ============================================================
   concengine.net — Scholarly Glass Observatory
   Glassmorphism + Ma-Negative-Space + Paper-Aged Texture
   ============================================================ */

/* --- Design Palette Reference ---
   Background Base:   #F2EBD9  (Foxed Parchment)
   Background Warm:   #E6D5B8  (Manuscript Tan)
   Glass Frost:       #FFFFFF  at 12% opacity
   Primary Text:      #2A2520  (Engine Ink)
   Accent Teal:       #2D7D7B  (Patina Teal)
   Accent Amber:      #C4943A  (Aged Amber)
   Accent Violet:     #6B4C7D  (Theorem Violet)
*/

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.85;
    color: #2A2520;
    background-color: #F2EBD9;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(230, 213, 184, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(196, 148, 58, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(230, 213, 184, 0.3) 0%, transparent 45%),
        radial-gradient(ellipse at 35% 15%, rgba(196, 148, 58, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 10% 20%, rgba(230, 213, 184, 0.35) 0%, transparent 30%),
        radial-gradient(circle at 90% 70%, rgba(196, 148, 58, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(230, 213, 184, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 75% 10%, rgba(196, 148, 58, 0.04) 0%, transparent 20%),
        radial-gradient(circle at 25% 85%, rgba(230, 213, 184, 0.3) 0%, transparent 35%),
        radial-gradient(circle at 45% 35%, rgba(196, 148, 58, 0.03) 0%, transparent 28%),
        radial-gradient(circle at 65% 60%, rgba(230, 213, 184, 0.2) 0%, transparent 32%),
        radial-gradient(circle at 15% 55%, rgba(196, 148, 58, 0.04) 0%, transparent 22%),
        radial-gradient(circle at 85% 45%, rgba(230, 213, 184, 0.25) 0%, transparent 38%),
        radial-gradient(circle at 40% 75%, rgba(196, 148, 58, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 55% 20%, rgba(230, 213, 184, 0.2) 0%, transparent 26%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(230, 213, 184, 0.005) 3px,
            rgba(230, 213, 184, 0.005) 4px
        );
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Noise Filter --- */
.noise-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

/* --- Typography --- */
.hero-title {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 10vw, 9rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2A2520;
    text-align: center;
    position: relative;
    z-index: 2;
}

.section-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2A2520;
    margin-bottom: clamp(1rem, 3vh, 2.5rem);
    position: relative;
}

.section-heading::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: #C4943A;
    margin-top: 0.75rem;
}

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.85;
    color: #2A2520;
    max-width: 38em;
    position: relative;
    z-index: 2;
}

.tech-annotation {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #2D7D7B;
}

/* --- Glass Panel (Vitrine) Base --- */
.vitrine {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(42, 37, 32, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: clamp(2rem, 4vw, 4rem);
    position: relative;
    overflow: hidden;
    transition:
        backdrop-filter 400ms ease,
        -webkit-backdrop-filter 400ms ease,
        border-color 400ms ease,
        box-shadow 400ms ease;
}

.vitrine:hover {
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-color: rgba(255, 255, 255, 0.40);
    box-shadow:
        0 8px 32px rgba(42, 37, 32, 0.06),
        0 0 60px rgba(196, 148, 58, 0.04);
}

/* --- Stagger Animation --- */
.vitrine-stagger {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 800ms cubic-bezier(0.23, 1, 0.32, 1),
        transform 800ms cubic-bezier(0.23, 1, 0.32, 1),
        backdrop-filter 400ms ease,
        -webkit-backdrop-filter 400ms ease,
        border-color 400ms ease,
        box-shadow 400ms ease;
}

.vitrine-stagger.vitrine-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Vitrine Background Diagrams --- */
.vitrine-bg-diagram {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.vitrine-bg-diagram svg {
    width: 100%;
    height: 100%;
}

.vitrine-bg-blob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    pointer-events: none;
    z-index: 0;
}

.vitrine-bg-blob svg {
    width: 100%;
    height: 100%;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 2;
}

/* Section 1: Observation Deck */
.observation-deck {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vitrine-hero {
    width: clamp(280px, 38vw, 600px);
    min-height: 18vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: none;
}

/* Section 2: Engine Vitrine */
.engine-vitrine {
    min-height: 120vh;
    padding: 10vh 8vw;
    display: flex;
    flex-direction: column;
    gap: clamp(4rem, 8vh, 8rem);
}

.vitrine-engine {
    max-width: 550px;
    width: 55%;
}

.vitrine-left {
    align-self: flex-start;
    margin-left: 5vw;
}

.vitrine-center {
    align-self: center;
}

.vitrine-right {
    align-self: flex-end;
    margin-right: 5vw;
}

/* Section 3: Theorem Gallery */
.theorem-gallery {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 0;
}

.vitrine-theorem {
    width: 70%;
    max-width: 900px;
    margin: 0 auto;
}

.theorem-text {
    text-indent: 2em;
}

/* Section 4: Mechanism Garden */
.mechanism-garden {
    min-height: 150vh;
    position: relative;
    padding: 15vh 5vw;
}

.vitrine-specimen {
    position: absolute;
    padding: clamp(1.2rem, 2.5vw, 2.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.vitrine-specimen-1 {
    top: 8%;
    left: 15%;
    width: clamp(120px, 14vw, 200px);
    height: clamp(120px, 14vw, 200px);
}

.vitrine-specimen-2 {
    top: 12%;
    right: 20%;
    width: clamp(100px, 12vw, 170px);
    height: clamp(100px, 12vw, 170px);
}

.vitrine-specimen-3 {
    top: 32%;
    left: 8%;
    width: clamp(180px, 22vw, 300px);
    min-height: clamp(80px, 8vw, 120px);
}

.vitrine-specimen-4 {
    top: 38%;
    right: 12%;
    width: clamp(110px, 13vw, 180px);
    height: clamp(110px, 13vw, 180px);
}

.vitrine-specimen-5 {
    top: 55%;
    left: 25%;
    width: clamp(180px, 20vw, 280px);
    min-height: clamp(70px, 7vw, 100px);
}

.vitrine-specimen-6 {
    top: 65%;
    right: 25%;
    width: clamp(130px, 15vw, 210px);
    height: clamp(130px, 15vw, 210px);
}

.vitrine-specimen-7 {
    top: 80%;
    left: 40%;
    width: clamp(110px, 12vw, 180px);
    height: clamp(110px, 12vw, 180px);
}

.specimen-glyph {
    font-size: clamp(2rem, 4vw, 4rem);
    color: #2A2520;
    opacity: 0.7;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.specimen-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #2D7D7B;
    text-transform: uppercase;
}

.specimen-phrase {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #2A2520;
    line-height: 1.6;
}

/* Section 5: Colophon */
.colophon {
    min-height: 80vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10vh 8vw 15vh;
}

.vitrine-colophon {
    max-width: 320px;
    text-align: right;
}

.colophon-text {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2A2520;
    margin-bottom: 1rem;
}

.colophon-sub {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #2A2520;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.colophon-mark {
    margin-top: 1rem;
}

/* --- Organic Blobs --- */
.blobs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    opacity: 0.07;
}

.blob-1 {
    width: 600px;
    height: 600px;
    top: -5%;
    left: -5%;
    animation: drift-1 100s ease-in-out infinite;
}

.blob-2 {
    width: 450px;
    height: 450px;
    top: 25%;
    right: -8%;
    animation: drift-2 85s ease-in-out infinite;
}

.blob-3 {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 10%;
    animation: drift-3 110s ease-in-out infinite;
}

.blob-4 {
    width: 350px;
    height: 350px;
    top: 70%;
    right: 15%;
    animation: drift-4 95s ease-in-out infinite;
}

.blob-5 {
    width: 400px;
    height: 400px;
    top: 15%;
    left: 45%;
    animation: drift-5 120s ease-in-out infinite;
}

@keyframes drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.03); }
    50% { transform: translate(-15px, 25px) scale(0.97); }
    75% { transform: translate(20px, 10px) scale(1.01); }
}

@keyframes drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-25px, 15px) scale(0.98); }
    50% { transform: translate(20px, -30px) scale(1.02); }
    75% { transform: translate(-10px, 20px) scale(1); }
}

@keyframes drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, 25px) scale(1.02); }
    50% { transform: translate(-30px, -10px) scale(0.96); }
    75% { transform: translate(15px, -20px) scale(1.01); }
}

@keyframes drift-4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-20px, -25px) scale(1.01); }
    50% { transform: translate(25px, 15px) scale(0.98); }
    75% { transform: translate(-15px, 30px) scale(1.03); }
}

@keyframes drift-5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(15px, 30px) scale(0.97); }
    50% { transform: translate(-20px, -15px) scale(1.04); }
    75% { transform: translate(25px, -10px) scale(0.99); }
}

/* --- Construction Lines --- */
.construction-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.construction-svg {
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

/* --- Progress Thermometer --- */
.progress-thermometer {
    position: fixed;
    right: 16px;
    top: 10vh;
    height: 80vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-track {
    width: 2px;
    height: 100%;
    background: rgba(45, 125, 123, 0.12);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #2D7D7B;
    border-radius: 1px;
    transition: height 100ms linear;
}

.progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #2D7D7B;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-top: 12px;
    opacity: 0.8;
    transition: opacity 300ms ease;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .vitrine-engine {
        width: 90%;
        max-width: none;
    }

    .vitrine-left,
    .vitrine-center,
    .vitrine-right {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
    }

    .vitrine-theorem {
        width: 90%;
    }

    .mechanism-garden {
        min-height: auto;
        position: static;
        padding: 10vh 5vw;
        display: flex;
        flex-direction: column;
        gap: 3rem;
        align-items: center;
    }

    .vitrine-specimen {
        position: static;
        width: 80% !important;
        height: auto !important;
        min-height: auto !important;
    }

    .engine-vitrine {
        padding: 10vh 5vw;
    }

    .observation-deck {
        height: auto;
        min-height: 100vh;
    }

    .vitrine-hero {
        width: 85vw;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .progress-thermometer {
        display: none;
    }

    .blob-4,
    .blob-5 {
        display: none;
    }

    .blob-1,
    .blob-2,
    .blob-3 {
        animation-duration: 150s;
    }

    .construction-lines {
        display: none;
    }

    .colophon {
        justify-content: center;
        align-items: center;
    }

    .vitrine-colophon {
        text-align: center;
    }

    .section-heading::after {
        margin-left: auto;
        margin-right: auto;
    }
}

/* --- Theorem Violet Shadow on Glass Panels --- */
.vitrine-theorem {
    box-shadow: 0 8px 32px rgba(42, 37, 32, 0.06),
                0 12px 48px rgba(107, 76, 125, 0.04);
}

.vitrine-hero {
    box-shadow: 0 8px 32px rgba(42, 37, 32, 0.06),
                0 16px 64px rgba(107, 76, 125, 0.03);
}

/* --- Manuscript Tan Undertone --- */
.observation-deck {
    background: linear-gradient(180deg, #E6D5B8 0%, transparent 40%);
}

.colophon {
    background: linear-gradient(0deg, #E6D5B8 0%, transparent 30%);
}

/* --- Frosted White Highlight on Hero --- */
.vitrine-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #FFFFFF;
    opacity: 0.15;
}

/* --- Selection --- */
::selection {
    background: rgba(196, 148, 58, 0.2);
    color: #2A2520;
}
