/* === BASE RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #1a1917;
    background-color: #f5f2ee;
    overflow-x: hidden;
    transition: background-color 800ms ease;
}

/* === PARTICLE CANVAS === */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* === NOISE OVERLAY === */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    opacity: 0.025;
    mix-blend-mode: multiply;
}

/* === STRATA === */
.stratum {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
}

.stratum-2 {
    min-height: 120dvh;
    z-index: 3;
}

.stratum-3 {
    z-index: 4;
}

.stratum-4 {
    z-index: 5;
}

.stratum-5 {
    z-index: 6;
    min-height: 60dvh;
}

/* === STRATUM 1: SURFACE === */
.stratum-1 {
    background-color: #f5f2ee;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12%;
}

.stratum-1-content {
    position: relative;
}

.domain-mark {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    color: #1a1917;
    cursor: default;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.domain-mark:hover {
    transform: scale(1.08);
}

.tagline {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #6b6860;
    margin-top: 1.5rem;
    margin-left: 17%;
}

.line-reveal {
    position: absolute;
    bottom: -30vh;
    left: 0;
    width: 60vw;
    height: 1px;
    background-color: #3a3a3a;
    transform: scaleX(0);
    transform-origin: left;
    animation: lineReveal 4s ease-out forwards;
}

@keyframes lineReveal {
    to { transform: scaleX(1); }
}

/* === STRATUM 2: EROSION === */
.stratum-2 {
    background-color: #d4d0ca;
    padding: 10vh 5%;
}

.stratum-2-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    row-gap: 6rem;
}

.text-block {
    padding: 2.5rem;
}

.text-block .label {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6860;
    display: block;
    margin-bottom: 1rem;
}

.block-1 {
    grid-column: 2 / 5;
    margin-top: 4rem;
}

.block-2 {
    grid-column: 6 / 10;
    margin-top: 12rem;
}

.block-3 {
    grid-column: 3 / 8;
    margin-top: 8rem;
    margin-bottom: -40px;
    position: relative;
    z-index: 3;
}

.tess-divider {
    width: 100%;
    height: 24px;
    margin-top: 6rem;
}

.tess-path {
    stroke: #3a3835;
    stroke-width: 1;
    fill: none;
}

/* === STRATUM 3: FOSSIL RECORD === */
.stratum-3 {
    background-color: #8a8478;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 10%;
}

.stratum-3-content {
    position: relative;
    width: 80%;
    max-width: 1200px;
    aspect-ratio: 4 / 3;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stratum-3-content:hover {
    transform: scale(1.08);
}

#penrose-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.fossil-caption {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f5f2ee;
}

/* === STRATUM 4: COMPRESSION === */
.stratum-4 {
    background-color: #3a3835;
    color: #f5f2ee;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 5%;
}

.stratum-4-cards {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 600px;
}

.puzzle-card {
    position: absolute;
    width: 280px;
    height: 340px;
    border: 1px solid #8a8478;
    padding: 48px;
    background-color: #3a3835;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.puzzle-card:hover {
    transform: scale(1.08);
}

.puzzle-card .label {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8478;
    display: block;
    margin-bottom: 1.5rem;
}

.puzzle-card h2 {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    color: #f5f2ee;
}

.puzzle-card p {
    font-size: 0.9rem;
    color: #d4d0ca;
    line-height: 1.6;
}

.card-1 {
    top: 5%;
    left: 5%;
    z-index: 3;
}

.card-2 {
    top: 25%;
    left: 38%;
    z-index: 4;
}

.card-3 {
    top: 45%;
    left: 60%;
    z-index: 3;
}

/* === STRATUM 5: BEDROCK === */
.stratum-5 {
    background-color: #0d0d0d;
    color: #f5f2ee;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5vh 5%;
}

.ghost-word {
    font-family: 'Poiret One', sans-serif;
    font-weight: 400;
    font-size: clamp(8rem, 20vw, 16rem);
    letter-spacing: 0.12em;
    color: #1a1a1a;
    margin-bottom: 4rem;
}

.bedrock-footer {
    text-align: center;
}

.contact-line {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6860;
    margin-bottom: 0.5rem;
}

.year-line {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #6b6860;
    margin-bottom: 1.5rem;
}

.final-rule {
    border: none;
    height: 1px;
    background-color: #3a3835;
    width: 120px;
    margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .stratum-1 {
        padding-left: 8%;
    }

    .stratum-2-grid {
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }

    .block-1, .block-2, .block-3 {
        margin-top: 0;
    }

    .stratum-3-content {
        width: 95%;
    }

    .stratum-4-cards {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .puzzle-card {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 320px;
        height: auto;
    }
}
