/* ============================================
   ggaji.com - Bauhaus Signal Degradation
   ============================================ */

:root {
    --parchment: #F5ECD7;
    --warm-stone: #DDD0B6;
    --honey: #C8A96E;
    --charred: #3B2F2F;
    --aged-bronze: #7A6652;
    --graphite: #2C2C2C;
    --vermillion: #C1392B;
    --cobalt: #1A4B8C;
}

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

html {
    font-size: 16px;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}

body {
    background: var(--parchment);
    color: var(--charred);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
}

/* --- Scanline Overlay --- */
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(59, 47, 47, 0.03) 2px,
        rgba(59, 47, 47, 0.03) 4px
    );
    transition: opacity 0.3s;
}

/* --- Bauhaus Logo Mark --- */
.bauhaus-mark {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
}

/* --- Snap Sections --- */
.snap-section {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 8vw, 8rem);
    overflow: hidden;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
}

/* --- Modules --- */
.module {
    border: 4px solid var(--charred);
    padding: 48px;
    position: relative;
    transition: filter 0.6s ease-out, transform 0.12s steps(3);
}

.mod-primary {
    grid-column: span 8;
    background: var(--parchment);
}

.mod-secondary {
    grid-column: span 4;
    background: var(--warm-stone);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.mod-tertiary {
    grid-column: span 1;
    background: var(--graphite);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.mod-inverted {
    grid-column: span 4;
    background: var(--graphite);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    border: 4px solid var(--charred);
}

.mod-warm {
    background: var(--honey);
}

.mod-ghost {
    grid-column: span 4;
    background: transparent;
    border: 1px solid rgba(59, 47, 47, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.mod-extinction {
    grid-column: span 8;
    background: var(--parchment);
    border: 1px solid rgba(59, 47, 47, 0.3);
    padding: 48px;
    text-align: center;
}

/* --- Hero Module --- */
.mod-hero {
    grid-column: span 8;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Typography --- */
.display-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--charred);
}

.section-heading {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--charred);
    margin-bottom: 20px;
}

.status-line {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aged-bronze);
    margin-top: 16px;
}

.mod-label {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aged-bronze);
    margin-bottom: 8px;
}

.mod-value {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--charred);
}

.mod-label-light {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-stone);
    margin-bottom: 8px;
}

.mod-value-light {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: 0.04em;
    color: var(--parchment);
}

.large-date {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    color: var(--charred);
    max-width: 58ch;
}

.fragment-text {
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.vert-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* --- Chromatic Split --- */
.chromatic-split {
    text-shadow:
        -1px 0 var(--vermillion),
        1px 0 var(--cobalt),
        0 1px var(--graphite);
}

.extinction-title {
    text-shadow:
        -4px 0 var(--vermillion),
        4px 0 var(--cobalt),
        0 2px var(--graphite);
}

.extinction-meaning {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--aged-bronze);
    margin-top: 16px;
}

.extinction-ts {
    margin-top: 24px;
    opacity: 0.5;
}

/* --- Bauhaus Trio --- */
.bauhaus-trio {
    width: 100px;
    height: 40px;
}

/* --- Interstitials --- */
.interstitial {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: none;
}

.interstitial-rule {
    width: 100%;
    border: none;
    border-top: 1px solid var(--charred);
    position: absolute;
}

.interstitial-dashed {
    border-top-style: dashed;
}

.interstitial-shape {
    position: absolute;
    left: 33%;
    z-index: 2;
    background: var(--parchment);
    padding: 0 8px;
}

.shape-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--vermillion);
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid transparent;
    border-bottom-color: var(--cobalt);
    padding: 0;
    background: none;
}

.shape-square {
    width: 20px;
    height: 20px;
    border: 1px solid var(--graphite);
    border-radius: 0;
}

/* --- Column Fragments --- */
.column-fragment {
    position: absolute;
    width: 8px;
    height: 200px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(to bottom, var(--warm-stone) 60%, var(--honey));
    right: 12%;
    bottom: 15%;
    opacity: 0.4;
}

.column-fragment-2 {
    height: 140px;
    right: 14%;
    bottom: 20%;
    opacity: 0.3;
}

/* --- Entablature Band --- */
.entablature-band {
    grid-column: 1 / -1;
    height: 16px;
    border-top: 1px solid var(--charred);
    border-bottom: 1px solid var(--charred);
    background: linear-gradient(to bottom, transparent 30%, var(--honey) 30%, var(--honey) 70%, transparent 70%);
}

/* --- Rosette Background --- */
.rosette-bg {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Ccircle cx='32' cy='32' r='6' fill='none' stroke='%233B2F2F' stroke-width='1' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 64px 64px;
    pointer-events: none;
}

/* --- Final Rule --- */
.final-rule {
    width: 100%;
    border: none;
    border-top: 1px solid var(--charred);
    position: absolute;
    bottom: 200px;
    left: 0;
}

.emptiness {
    height: 200px;
}

/* --- Grid Variations --- */
.grid-offset .mod-primary {
    grid-column: 2 / span 7;
}

.grid-broken {
    gap: 20px;
}

.grid-fractured {
    gap: 16px;
}

.grid-dissolved {
    gap: 32px;
    justify-items: center;
}

/* --- Section-Specific Scanline Intensity (JS-controlled) --- */
.section-3 ~ .scanlines { opacity: 1; }

/* --- Glitch Oscillation for Section 5 --- */
.section-5 .mod-extinction {
    animation: gentleOscillate 3s ease-in-out infinite;
}

@keyframes gentleOscillate {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

/* --- Blur-Focus on Snap --- */
.snap-section .module {
    filter: blur(6px);
    transition: filter 0.6s ease-out;
}

.snap-section.in-view .module {
    filter: blur(0);
}

.section-4.in-view .module {
    filter: blur(1px);
}

.section-5.in-view .module {
    filter: blur(2px);
}

.section-5.in-view .mod-extinction {
    filter: blur(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .mod-primary,
    .mod-hero,
    .mod-extinction {
        grid-column: span 4;
    }

    .mod-secondary,
    .mod-inverted,
    .mod-ghost {
        grid-column: span 2;
    }

    .mod-tertiary {
        grid-column: span 1;
        min-height: 100px;
    }

    .grid-offset .mod-primary {
        grid-column: span 4;
    }

    html {
        scroll-snap-type: none;
    }
}

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

    .mod-primary,
    .mod-secondary,
    .mod-tertiary,
    .mod-inverted,
    .mod-ghost,
    .mod-extinction,
    .mod-hero {
        grid-column: span 1;
    }

    .snap-section {
        padding: clamp(2rem, 4vw, 3rem);
    }

    .module {
        padding: 24px;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .section-5 .mod-extinction {
        animation: none;
    }

    .snap-section .module {
        filter: none;
        transition: none;
    }

    html {
        scroll-snap-type: none;
    }
}
