/* Root CSS Variables */
:root {
    --nm-light: -6px -6px 12px #F4F0EA;
    --nm-dark: 6px 6px 12px #C4C0BA;

    /* Colors */
    --surface-bg: #E4E0DA;
    --highlight-shadow: #F4F0EA;
    --depth-shadow: #C4C0BA;
    --stone: #6A6560;
    --fog: #7A7570;
    --bedrock: #5A5550;
    --whisper: #D0CCC6;
}

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

html, body {
    width: 100%;
    height: 100%;
    background: var(--surface-bg);
}

body {
    font-family: 'Nunito Sans', sans-serif;
    color: var(--fog);
    overflow-x: hidden;
}

/* Section 1: Emergence */
.emergence {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-bg);
    position: relative;
    overflow: hidden;
}

.emergence-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.hero-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.6rem, 6.5vw, 5rem);
    color: var(--surface-bg);
    text-shadow: -1px -1px 2px var(--highlight-shadow), 1px 1px 2px var(--depth-shadow);
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    color: var(--fog);
    letter-spacing: 0.02em;
    line-height: 1.8;
}

/* Abstract nodes in emergence section */
.abstract-node {
    position: absolute;
    background: var(--surface-bg);
    border-radius: 50%;
    box-shadow: var(--nm-light), var(--nm-dark);
}

.node-1 {
    top: 15%;
    right: 10%;
}

.node-2 {
    bottom: 20%;
    left: 10%;
}

/* Section 2: The Garden of Blocks */
.garden-blocks {
    background: var(--surface-bg);
    padding: 60px 40px;
    min-height: auto;
}

.masonry-container {
    max-width: 1200px;
    margin: 0 auto;
    columns: 3;
    column-gap: 20px;
}

@media (max-width: 1024px) {
    .masonry-container {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .masonry-container {
        columns: 1;
    }
}

/* Card styles */
.nm-card {
    background: var(--surface-bg);
    border-radius: 16px;
    border: none;
    box-shadow: var(--nm-light), var(--nm-dark);
    padding: 1.5rem;
    margin-bottom: 20px;
    break-inside: avoid;
    transition: box-shadow 0.3s ease;
}

.nm-card h2 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--stone);
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.nm-card p {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    color: var(--fog);
    line-height: 1.8;
}

/* Empty cards for visual resting */
.empty-card {
    min-height: 150px;
    background: var(--surface-bg);
    box-shadow: var(--nm-light), var(--nm-dark);
}

/* Diagram cards */
.card-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 150px;
}

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

/* Section 3: The Still Point */
.still-point {
    background: var(--surface-bg);
    padding: 60px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.inset-card {
    max-width: 800px;
    width: 100%;
    box-shadow: inset var(--nm-dark), inset var(--nm-light);
    padding: 3rem;
    border-radius: 16px;
}

.contemplation-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    color: var(--bedrock);
    line-height: 2.2;
    text-align: center;
}

/* Section 4: Dissolution */
.dissolution {
    background: var(--surface-bg);
    padding: 60px 40px;
    min-height: auto;
}

.dissolution-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.dissolution-card {
    width: 100%;
    opacity: var(--dissolve);
    box-shadow:
        calc(-6px * var(--dissolve)) calc(-6px * var(--dissolve)) calc(12px * var(--dissolve)) var(--highlight-shadow),
        calc(6px * var(--dissolve)) calc(6px * var(--dissolve)) calc(12px * var(--dissolve)) var(--depth-shadow);
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.dissolution-closing {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    color: var(--fog);
    line-height: 1.8;
    opacity: 1;
    margin-top: 20px;
    text-align: center;
}

/* Shake animation for error/non-interactive feedback */
@keyframes nm-shake {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(3px);
    }
    40% {
        transform: translateX(-3px);
    }
    60% {
        transform: translateX(2px);
    }
    80% {
        transform: translateX(-1px);
    }
    100% {
        transform: translateX(0);
    }
}

.nm-shake {
    animation: nm-shake 0.3s ease-out;
}
