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

:root {
    --deep-umber: #1a1612;
    --parchment: #e8d5b0;
    --dark-wood: #2a2118;
    --ocean-blue: #0077b6;
    --gold: #ffd166;
    --terracotta: #e07a5f;
    --warm-sand: #c4a882;
    --near-black: #0f0d0a;
    --teal: #2ec4b6;
    --mid-brown: #3d3024;
    --light-parchment: #f5e6c8;
    --gap: 4px;
    --frame: 48px;
}

body {
    background-color: var(--deep-umber);
    color: var(--parchment);
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--deep-umber);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

#pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px var(--teal), 0 0 40px rgba(46, 196, 182, 0.3);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.4; }
}

/* Site Container */
#site-container {
    padding: var(--frame);
    min-height: 100vh;
    opacity: 1;
    transition: opacity 0.6s ease;
}

#site-container.hidden {
    opacity: 0;
}

/* Masthead */
#masthead {
    margin-bottom: 40px;
    text-align: left;
}

.site-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.05em;
    color: var(--parchment);
    line-height: 0.9;
}

.site-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--warm-sand);
    margin-top: 8px;
    text-transform: uppercase;
}

/* Masonry Grid */
#masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 80px;
    gap: var(--gap);
    max-width: 1200px;
}

.tile {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.tile.assembled {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tile:hover {
    z-index: 10;
}

.tile:hover .tile-image {
    transform: scale(1.05);
}

.tile:hover .tile-overlay {
    opacity: 1;
}

.tile-1 { grid-column: span 2; grid-row: span 3; }
.tile-2 { grid-column: span 1; grid-row: span 2; }
.tile-3 { grid-column: span 1; grid-row: span 3; }
.tile-4 { grid-column: span 2; grid-row: span 2; }
.tile-5 { grid-column: span 1; grid-row: span 2; }
.tile-6 { grid-column: span 1; grid-row: span 3; }
.tile-7 { grid-column: span 2; grid-row: span 2; }
.tile-8 { grid-column: span 1; grid-row: span 2; }
.tile-9 { grid-column: span 1; grid-row: span 2; }
.tile-10 { grid-column: span 2; grid-row: span 3; }

.tile-image {
    position: absolute;
    inset: 0;
    transition: transform 0.4s ease;
}

.tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 13, 10, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    color: var(--teal);
    letter-spacing: 0.2em;
    margin-bottom: 4px;
}

.tile-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    color: var(--parchment);
}

/* Footer / Colophon */
#colophon {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--mid-brown);
}

.colophon-text {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--warm-sand);
}

.colophon-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--mid-brown);
    margin-top: 4px;
    letter-spacing: 0.1em;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --frame: 24px;
    }

    #masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 60px;
    }

    .tile-1, .tile-10 { grid-column: span 2; grid-row: span 2; }
    .tile-2, .tile-3, .tile-4, .tile-5, .tile-6, .tile-7, .tile-8, .tile-9 {
        grid-column: span 1;
        grid-row: span 2;
    }
}
