/* gabs.day -- brutalist stacked monolith */

:root {
    --earth-primary: #C4A882;
    --earth-secondary: #D9C4A8;
    --iron-oxide: #8B4513;
    --umber-shadow: #2A1F17;
    --bistre: #3D2B1F;
    --burnt-sienna: #6B3A2A;
    --raw-ochre: #D4A24E;
    --khaki: #8B7355;

    --pad-x: clamp(2rem, 8vw, 8rem);
    --pad-bottom: clamp(3rem, 6vh, 6rem);
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--earth-primary);
    color: var(--bistre);
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.stack {
    display: block;
    width: 100%;
}

/* ===== Slab base ===== */

.slab {
    position: relative;
    width: 100vw;
    display: flex;
    align-items: flex-end;
    padding: 0 var(--pad-x) var(--pad-bottom);
    border-bottom: 1px solid var(--umber-shadow);
    background: var(--earth-primary);
    overflow: hidden;
}

.slab__inner {
    width: 100%;
    max-width: 100%;
    display: block;
    opacity: 0;
    transform: scale(1.04);
    transform-origin: center center;
    transition:
        opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
        transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    will-change: opacity, transform;
}

.slab.is-in-view .slab__inner {
    opacity: 1;
    transform: scale(1.0);
}

/* ===== Section variants ===== */

.slab--opening {
    min-height: 100vh;
    background: var(--earth-primary);
}

.slab--content {
    min-height: 100vh;
}

.slab--content.slab--dense {
    min-height: 60vh;
    padding-bottom: clamp(2rem, 4vh, 4rem);
}

.slab--primary {
    background: var(--earth-primary);
}

.slab--secondary {
    background: var(--earth-secondary);
}

.slab--divider {
    min-height: 15vh;
    height: 15vh;
    background: var(--iron-oxide);
    align-items: center;
    padding: 0 var(--pad-x);
}

.slab--iron {
    background: var(--iron-oxide);
}

.slab--closing {
    min-height: 100vh;
    background: var(--umber-shadow);
    color: var(--earth-secondary);
}

/* ===== Grid ghost (formwork lines) ===== */

.slab--grid::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(2rem - 1px),
        rgba(42, 31, 23, 0.08) calc(2rem - 1px),
        rgba(42, 31, 23, 0.08) 2rem
    );
    pointer-events: none;
    z-index: 0;
}

.slab--grid > * {
    position: relative;
    z-index: 1;
}

/* ===== Typography ===== */

.display {
    font-family: "Alfa Slab One", "Zilla Slab", Georgia, serif;
    font-weight: 400;
    font-size: clamp(3.2rem, 9vw, 7rem);
    line-height: 0.92;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--umber-shadow);
}

.display--small {
    font-size: clamp(2.4rem, 6.5vw, 5rem);
    line-height: 0.92;
}

.display--inverted {
    color: var(--earth-secondary);
}

.section-title {
    font-family: "Zilla Slab", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: 0.06em;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--burnt-sienna);
    margin-top: 0.5rem;
}

.body {
    font-family: "IBM Plex Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    color: var(--bistre);
    max-width: 52ch;
    margin-top: 1.4rem;
}

.body--emphasis {
    font-weight: 600;
    color: var(--burnt-sienna);
}

.caption {
    display: inline-block;
    font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--khaki);
    margin-bottom: 1.6rem;
}

.caption--inverted {
    color: var(--khaki);
}

/* ===== Structural elements ===== */

.cross-bar {
    width: 100%;
    height: 4px;
    background: var(--umber-shadow);
    margin: 1.4rem 0 0;
}

.ibeam {
    border: none;
    width: 30vw;
    height: 4px;
    background: var(--iron-oxide);
    margin-top: 2.5rem;
    margin-left: 0;
}

.corner-mark {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 24px;
    height: 24px;
    background: var(--raw-ochre);
    z-index: 2;
}

.corner-mark--inverted {
    background: var(--raw-ochre);
}

.monolith {
    width: clamp(60px, 12vw, 160px);
    height: clamp(120px, 25vw, 320px);
    background: var(--umber-shadow);
    margin-left: 0;
    align-self: center;
    opacity: 0;
    transform: scale(1.12);
    transform-origin: center center;
    transition:
        opacity 900ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
        transform 900ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
    will-change: opacity, transform;
}

.slab--divider {
    overflow: hidden;
    position: relative;
}

.slab--divider .monolith {
    position: relative;
    z-index: 1;
}

.is-in-view .monolith {
    opacity: 1;
    transform: scale(1.0);
}

/* ===== Weight Line (foundation) ===== */

.weight-line {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 12px;
    background: var(--umber-shadow);
}

.slab--closing {
    padding-bottom: calc(var(--pad-bottom) + 12px);
}

/* ===== Opening / closing layouts ===== */

.slab--opening .slab__inner,
.slab--closing .slab__inner {
    width: 100%;
}

.slab--opening .display,
.slab--closing .display {
    display: block;
}

/* ===== Increased compression on descent ===== */

.slab--dense .body {
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.55;
    margin-top: 1rem;
}

.slab--dense .section-title {
    font-size: clamp(1.4rem, 3.4vw, 2.2rem);
}

/* ===== Responsive tweaks ===== */

@media (max-width: 720px) {
    .ibeam {
        width: 50vw;
    }

    .corner-mark {
        top: 1rem;
        left: 1rem;
        width: 18px;
        height: 18px;
    }

    .slab {
        padding-bottom: clamp(2rem, 5vh, 4rem);
    }
}
