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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1C0A10;
    background: #4A0E1B;
    overflow-x: hidden;
    /* palette: #C7899E dusty rose used for surfaces */
}

/* === HERO === */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #4A0E1B;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: -0.04em;
    color: #F0DCC8;
    padding: 0 0 8vh 5vw;
    position: relative;
    z-index: 2;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(-60px);
}

.hero-title span.animate {
    animation: letterDrop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes letterDrop {
    0% { opacity: 0; transform: translateY(-60px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
    position: absolute;
    top: 15vh;
    right: 5vw;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #C8963E;
    transform: rotate(-3deg);
    opacity: 0;
    z-index: 2;
    max-width: 300px;
    text-align: right;
}

.hero-tagline.show {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.hero-characters {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.float-char {
    position: absolute;
    animation: bob var(--dur, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* === MASONRY SECTION === */
.masonry-section {
    background: #F5E6D3;
    padding: 6rem 3rem;
}

.masonry {
    column-count: 3;
    column-gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.block {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    background: #F5E6D3;
    border: 1.5px solid #C8963E;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.block.visible {
    opacity: 1;
    transform: scale(1);
}

.block::before,
.block::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: #C8963E;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.block::before {
    top: 4px;
    left: 4px;
    border-top: 2px solid #C8963E;
    border-left: 2px solid #C8963E;
}

.block::after {
    bottom: 4px;
    right: 4px;
    border-bottom: 2px solid #C8963E;
    border-right: 2px solid #C8963E;
}

.block:hover::before {
    top: 0;
    left: 0;
}

.block:hover::after {
    bottom: 0;
    right: 0;
}

.block-inner {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.block h2, .block h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    letter-spacing: -0.04em;
    color: #1C0A10;
    margin-bottom: 0.75rem;
}

.block p {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1C0A10;
}

.block-tall {
    min-height: 300px;
}

.block-short {
    min-height: auto;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: #6B2D4A;
    display: block;
    margin-bottom: 0.5rem;
}

.block-illustration, .diagram {
    display: block;
    margin: 1rem auto;
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: #E8746F;
    opacity: 0.15;
    transform: scale(0);
    animation: rippleExpand 0.7s ease-out forwards;
    pointer-events: none;
    z-index: 0;
}

@keyframes rippleExpand {
    to {
        transform: scale(1);
        opacity: 0;
    }
}

/* === MANIFESTO === */
.manifesto {
    background: #F5E6D3;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent calc(2rem - 1px),
        rgba(199, 137, 158, 0.2) calc(2rem - 1px),
        rgba(199, 137, 158, 0.2) 2rem
    );
    padding: 6rem 3rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
}

.manifesto-marginalia {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.manifesto-marginalia.show {
    opacity: 1;
}

.manifesto-content {
    max-width: 680px;
}

.manifesto-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.04em;
    color: #1C0A10;
    margin-bottom: 2rem;
}

.manifesto-content p {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.15rem;
    line-height: 1.65;
    color: #1C0A10;
    margin-bottom: 1.5rem;
}

.manifesto-content em {
    font-style: italic;
    color: #6B2D4A;
    font-weight: 500;
}

.manifesto-closing {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: #6B2D4A;
}

/* === LABORATORY === */
.laboratory {
    background: #4A0E1B;
    padding: 6rem 3rem;
}

.lab-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.04em;
    color: #F0DCC8;
    text-align: center;
    margin-bottom: 3rem;
}

.masonry-dark {
    max-width: 1200px;
    margin: 0 auto;
}

.block-dark {
    background: #6B2D4A;
    border-color: #C8963E;
}

.block-dark .block-inner h3,
.block-dark .block-inner h2 {
    color: #F0DCC8;
}

.block-dark .block-inner p {
    color: #F0DCC8;
}

.annotation-dark {
    color: #C8963E;
}

/* Lab character interactions */
.lab-char-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.lab-char {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.thought-bubble {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #F5E6D3;
    color: #1C0A10;
    font-family: 'Caveat', cursive;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.8) translateY(5px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 180px;
    white-space: nowrap;
    z-index: 5;
}

.thought-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #F5E6D3;
    border-radius: 50%;
    transform: scale(0.6);
}

.block-dark:hover .lab-char {
    transform: rotate(-5deg) scale(1.1);
}

.block-dark:hover .thought-bubble {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* === FOOTER === */
.footer-zone {
    background: #1C0A10;
    padding: 3rem;
    text-align: center;
}

.footer-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #F0DCC8;
    margin-bottom: 0.5rem;
}

.footer-annotation {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: #6B2D4A;
}

/* === RIPPLE BACKGROUND TEXTURES === */
.masonry-section::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    top: 10%;
    left: 5%;
    background: radial-gradient(circle, rgba(74, 14, 27, 0.06) 0%, rgba(74, 14, 27, 0.03) 40%, transparent 70%);
    animation: pulseRipple 8s ease-in-out infinite;
}

.masonry-section {
    position: relative;
}

@keyframes pulseRipple {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .masonry {
        column-count: 2;
    }
    .manifesto {
        flex-direction: column;
        align-items: center;
    }
    .manifesto-marginalia {
        display: none;
    }
}

@media (max-width: 600px) {
    .masonry {
        column-count: 1;
    }
    .masonry-section, .manifesto, .laboratory {
        padding: 3rem 1.5rem;
    }
    .hero-title {
        padding: 0 0 5vh 3vw;
    }
}
