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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #1A1A1A;
    background-color: #FFF8F0;
    transition: background-color 1.5s ease;
    overflow-x: hidden;
}

body.bg-dark {
    background-color: #2C1810;
}

body.bg-deepdark {
    background-color: #1A0F0A;
}

/* === TYPOGRAPHY === */
.hero-word {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(8rem, 20vw, 18rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    background: linear-gradient(135deg, #D4447C 0%, #F4A261 50%, #E9C46A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 2px #1A1A1A;
    position: relative;
    z-index: 2;
}

h2.card-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #A0616A;
    display: block;
    margin-bottom: 1rem;
}

.tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 1.65;
    color: #1A1A1A;
    grid-column: 1 / 6;
    align-self: end;
    padding-bottom: 4rem;
    position: relative;
    z-index: 2;
}

/* === THE ATRIUM (HERO) === */
.atrium {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: radial-gradient(ellipse at center, #FFF8F0 0%, #E8D5C4 100%);
    overflow: hidden;
}

.atrium-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    align-content: center;
}

.hero-word-container {
    grid-column: 1 / 8;
    display: flex;
    align-items: center;
}

.marble-column {
    position: absolute;
    right: 38%;
    top: 15%;
    width: 80px;
    height: 70vh;
    background: linear-gradient(170deg, #F5F0EB 0%, #E8DDD4 30%, #F5F0EB 45%, #D4C5B2 60%, #F5F0EB 75%, #E0D3C6 100%);
    border-radius: 4px 4px 0 0;
    box-shadow: 2px 0 8px rgba(26, 26, 26, 0.15);
    z-index: 1;
    transform: translateY(calc(var(--scroll-y, 0) * -0.15px));
}

/* === GALLERY SECTIONS === */
.gallery-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 4rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card placement: asymmetric */
.card-1 { grid-column: 2 / 9; }
.card-2 { grid-column: 5 / 12; }
.card-3 { grid-column: 1 / 8; }

/* === CARDS (Neubrutalist) === */
.card {
    border: 4px solid #1A1A1A;
    box-shadow: 8px 8px 0 #1A1A1A;
    background: #FFF8F0;
    padding: clamp(2rem, 4vw, 4rem);
    position: relative;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 #1A1A1A;
}

.card:active {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 #1A1A1A;
}

.card-inner {
    position: relative;
    z-index: 1;
}

.card-text {
    max-width: 55ch;
}

/* === MARBLE STRIPS === */
.marble-strip {
    position: absolute;
    top: 0;
    width: 16px;
    height: 100%;
    background: linear-gradient(170deg, #F5F0EB 0%, #E8DDD4 30%, #F5F0EB 45%, #D4C5B2 60%, #F5F0EB 75%, #E0D3C6 100%);
}

.marble-strip-left { left: 0; }
.marble-strip-right { right: 0; }

/* === BLUR-FOCUS SCROLL === */
.puzzle-piece {
    filter: blur(4px);
    opacity: 0.5;
    transform: scale(0.97);
    transition: filter 0.8s ease-out, opacity 0.6s ease-out, transform 0.5s ease-out;
}

.puzzle-piece.focus-near {
    filter: blur(2px);
    opacity: 0.75;
    transform: scale(0.99);
}

.puzzle-piece.focus-full {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

.puzzle-piece.focus-full:hover {
    transform: scale(1) translate(-4px, -4px);
}

/* === DECORATIVE DOTS === */
.decorative-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4447C, #F4A261, #E9C46A);
    animation: float 4s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.8s; }
.dot:nth-child(3) { animation-delay: 1.6s; }
.dot:nth-child(4) { animation-delay: 2.4s; }

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

/* === SECTION TRANSITION === */
.section-transition {
    background: linear-gradient(180deg, #FFF8F0 0%, #2C1810 100%);
}

.section-transition .card {
    background: #FFF8F0;
}

/* === ASSEMBLY CHAMBER === */
.assembly {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2C1810 0%, #1A0F0A 100%);
    position: relative;
    padding: 4rem 2rem;
}

.assembly-container {
    position: relative;
    width: 500px;
    height: 400px;
    max-width: 90vw;
}

.assembly-piece {
    position: absolute;
    width: 180px;
    height: 140px;
    border: 4px solid #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    clip-path: polygon(0% 0%, 75% 0%, 75% 35%, 100% 35%, 100% 65%, 75% 65%, 75% 100%, 0% 100%, 0% 65%, 15% 65%, 15% 35%, 0% 35%);
}

.piece-inner {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #FFF8F0;
    text-align: center;
    padding: 1rem;
}

.piece-1 {
    background: #D4447C;
    top: 10%;
    left: 5%;
    transform: translate(-120px, -80px) rotate(-8deg);
}

.piece-2 {
    background: #F4A261;
    top: 10%;
    right: 5%;
    transform: translate(100px, -60px) rotate(5deg);
}

.piece-3 {
    background: #E9C46A;
    bottom: 10%;
    left: 20%;
    transform: translate(-40px, 120px) rotate(-3deg);
}

.assembly.assembled .piece-1 {
    transform: translate(0, 0) rotate(0deg);
}

.assembly.assembled .piece-2 {
    transform: translate(-20px, 0) rotate(0deg);
}

.assembly.assembled .piece-3 {
    transform: translate(40px, -20px) rotate(0deg);
}

.assembly-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #FFF8F0;
    margin-top: 4rem;
    opacity: 0;
    transition: opacity 1s ease-out 1.4s;
}

.assembly.assembled .assembly-text {
    opacity: 1;
}

/* === INSCRIPTION (FOOTER) === */
.inscription {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1A0F0A;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-domain {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #FFF8F0;
    margin-bottom: 2rem;
}

.marble-hr {
    border: none;
    height: 2px;
    width: 60%;
    background: linear-gradient(170deg, #F5F0EB 0%, #E8DDD4 30%, #F5F0EB 45%, #D4C5B2 60%, #F5F0EB 75%, #E0D3C6 100%);
    margin-bottom: 2rem;
}

.footer-text {
    font-family: 'Source Sans 3', sans-serif;
    color: #D4C5B2;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    max-width: 40ch;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .card-1, .card-2, .card-3 {
        grid-column: 1 / -1;
    }

    .hero-word-container {
        grid-column: 1 / -1;
    }

    .tagline {
        grid-column: 1 / -1;
    }

    .marble-column {
        display: none;
    }

    .assembly-container {
        width: 300px;
        height: 350px;
    }

    .assembly-piece {
        width: 140px;
        height: 110px;
    }
}
