/* ===================================================
   blockchain.day - Maximalist Burgundy-Cream Design
   Aesthetic: maximalist | Layout: broken-grid
   Typography: serif-revival | Palette: burgundy-cream
   Patterns: tilt-3d | Imagery: water-bubbles
   Motifs: organic-blobs | Tone: futuristic-cutting-edge
   =================================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-burgundy: #2E0610;
    --core-burgundy: #4A0E1B;
    --mid-burgundy: #6B1E2E;
    --warm-cream: #FFF8F0;
    --pale-parchment: #E8D5C4;
    --oxidized-copper: #C79A78;
    --blush-fog: #D4A0A0;
    --deep-ink: #1A0508;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    background-color: var(--deep-burgundy);
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--pale-parchment);
    background: linear-gradient(180deg, var(--deep-burgundy) 0%, var(--core-burgundy) 30%, var(--mid-burgundy) 70%, var(--core-burgundy) 100%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Bubble Particle Layer (fixed, full viewport) --- */
.bubble-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,248,240,0.2), rgba(255,248,240,0.02) 60%, transparent 100%);
    box-shadow: inset 0 -4px 8px rgba(42,6,16,0.3);
    will-change: transform, opacity;
    opacity: 0;
}

.bubble.active {
    animation: bubble-rise var(--rise-duration) cubic-bezier(0.37, 0, 0.63, 1) var(--rise-delay) infinite,
               bubble-drift var(--drift-duration) ease-in-out var(--rise-delay) infinite alternate;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(110vh) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.7;
    }
    85% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-10vh) translateX(0);
        opacity: 0;
    }
}

@keyframes bubble-drift {
    0% { margin-left: -15px; }
    100% { margin-left: 15px; }
}

/* --- Sections --- */
.section {
    position: relative;
    scroll-snap-align: start;
}

/* --- Section 1: The Submersion --- */
.submersion {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--deep-burgundy) 0%, var(--core-burgundy) 50%, var(--mid-burgundy) 100%);
    z-index: 2;
    overflow: hidden;
}

.submersion-content {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 12px;
    width: 90%;
    max-width: 1400px;
}

.site-title {
    grid-column: 3 / 11;
    grid-row: 2 / 3;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 72px;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--warm-cream);
    transform: rotate(2deg) scale(1.03);
    opacity: 0;
    animation: title-reveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
    text-shadow: 0 2px 20px rgba(26,5,8,0.5);
}

@keyframes title-reveal {
    0% {
        opacity: 0;
        transform: rotate(4deg) scale(1.03);
    }
    100% {
        opacity: 1;
        transform: rotate(2deg) scale(1.0);
    }
}

.site-subtitle {
    grid-column: 3 / 12;
    grid-row: 3 / 4;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 22px;
    color: var(--pale-parchment);
    opacity: 0;
    animation: subtitle-fade 0.6s ease 2.5s forwards;
    min-height: 1.5em;
}

.site-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--oxidized-copper);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes subtitle-fade {
    to { opacity: 1; }
}

/* Blob backgrounds */
.blob-bg {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.blob-bg-1 {
    width: 500px;
    height: 500px;
    top: 10%;
    right: -5%;
    opacity: 0.6;
}

.blob-bg-submersion-2 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    left: -8%;
    opacity: 0.5;
}

.blob-bg-2 {
    width: 600px;
    height: 600px;
    top: 10%;
    left: -10%;
    opacity: 0.5;
}

.blob-bg-3 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    right: -5%;
    opacity: 0.4;
}

/* --- Bubble Cluster Dividers --- */
.bubble-divider {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.bubble-divider svg {
    width: 400px;
    height: 80px;
    opacity: 0.7;
}

.chain-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2s ease;
}

.chain-line.revealed {
    stroke-dashoffset: 0;
}

/* --- Section 2: The Lattice --- */
.lattice {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(9, auto);
    gap: 12px;
    padding: 60px 5% 120px;
    min-height: 180vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Content Panels --- */
.panel {
    position: relative;
    z-index: 3;
    perspective: 1200px;
}

.panel-inner {
    background: rgba(255,248,240,0.08);
    border: 1px solid rgba(199,154,120,0.3);
    border-radius: 16px;
    padding: 40px 36px;
    height: 100%;
    transition: border-radius 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 400ms ease;
    will-change: transform;
    transform-style: preserve-3d;
    backdrop-filter: blur(2px);
}

.panel-inner:hover {
    border-radius: 20px 12px 24px 16px;
    box-shadow: 0 8px 40px rgba(26,5,8,0.4);
}

.panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--warm-cream);
    margin-bottom: 24px;
}

.panel-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--pale-parchment);
    margin-bottom: 16px;
}

.panel-body em {
    font-style: italic;
    color: var(--warm-cream);
}

.panel-meta.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: rgba(199,154,120,0.7);
    margin-top: 20px;
}

.inline-bubble {
    display: inline-block;
    vertical-align: middle;
    margin: 8px 0;
}

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.3;
    color: var(--warm-cream);
    padding: 24px 0;
    margin: 20px 0;
    border-left: 3px solid rgba(199,154,120,0.4);
    padding-left: 24px;
    transform: rotate(-1deg);
}

/* Panel positioning offsets for broken-grid effect */
.panel-1 {
    margin-top: 0;
    margin-right: -30px;
}

.panel-2 {
    margin-top: 40px;
    margin-left: -20px;
}

.panel-3 {
    margin-top: -20px;
    margin-right: -25px;
}

.panel-4 {
    margin-top: 20px;
    margin-left: -30px;
}

.panel-5 {
    margin-top: -10px;
}

.panel-6 {
    margin-top: 30px;
    margin-left: -15px;
}

.panel-7 {
    margin-top: -40px;
    margin-left: -20px;
}

.panel-8 {
    margin-top: -30px;
}

/* --- Section 3: The Convergence --- */
.convergence {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--core-burgundy) 0%, var(--deep-burgundy) 100%);
    overflow: hidden;
}

.convergence-blob-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.convergence-blob {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.convergence-text {
    position: relative;
    z-index: 6;
    text-align: center;
    padding: 40px;
}

.convergence-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--warm-cream);
    text-shadow: 0 2px 16px rgba(26,5,8,0.6);
}

.convergence-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: rgba(199,154,120,0.7);
    margin-top: 24px;
}

.convergence-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.convergence-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,248,240,0.15), rgba(255,248,240,0.02) 60%, transparent 100%);
    box-shadow: inset 0 -3px 6px rgba(42,6,16,0.2);
    animation: converge-bubble var(--converge-duration, 15s) cubic-bezier(0.37, 0, 0.63, 1) var(--converge-delay, 0s) infinite;
    will-change: transform;
}

@keyframes converge-bubble {
    0% {
        transform: translate(var(--start-x), var(--start-y)) scale(1);
        opacity: 0.6;
    }
    70% {
        opacity: 0.8;
    }
    100% {
        transform: translate(0, 0) scale(0.3);
        opacity: 0;
    }
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
    .submersion-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .site-title {
        grid-column: 1 / -1;
        font-size: 42px;
    }

    .site-subtitle {
        grid-column: 1 / -1;
        font-size: 18px;
    }

    .lattice {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 40px 16px 80px;
    }

    .panel {
        margin: 0 !important;
    }

    .panel-title {
        font-size: 26px;
    }

    .panel-inner {
        padding: 28px 20px;
    }

    .pull-quote {
        font-size: 22px;
    }

    .convergence-title {
        font-size: 28px;
    }

    .convergence-blob-container {
        width: 300px;
        height: 300px;
    }

    .bubble-divider svg {
        width: 280px;
    }

    .blob-bg-1,
    .blob-bg-submersion-2 {
        opacity: 0.3;
    }
}

@media (max-width: 600px) {
    .site-title {
        font-size: 36px;
    }

    .panel-title {
        font-size: 22px;
    }

    .convergence-title {
        font-size: 24px;
    }
}
