/* reasoner.studio - Dark neon modular blocks */

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

:root {
    --void-black: #0A0A0F;
    --block-dark: #12121C;
    --photo-silver: #B8C6D4;
    --neon-cyan: #00E5FF;
    --neon-magenta: #FF2D7B;
    --warm-amber: #E8A850;
    --pure-white: #FFFFFF;
    --grid-line: rgba(0, 229, 255, 0.3);
    --gap-size: 3px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--photo-silver);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Particle Canvas - fixed atmospheric layer */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Block Counter - fixed bottom-left */
#block-counter {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.6;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Grid Container - modular blocks layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap-size);
    position: relative;
    z-index: 2;
    background-color: var(--grid-line);
}

/* Base Block Styles */
.block {
    position: relative;
    background-color: var(--void-black);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.block-number {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.4;
    letter-spacing: 0.1em;
    z-index: 10;
}

/* Block 01: Hero */
.block-hero {
    grid-column: 1 / -1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void-black);
}

.hero-content {
    width: 100%;
    padding: 0 5vw;
    position: relative;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 8rem);
    color: var(--pure-white);
    text-shadow: 0 0 1px rgba(0, 229, 255, 0.4);
    letter-spacing: -0.02em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.05em;
    line-height: 1.1;
}

.letter {
    display: inline-block;
    transform: translateY(var(--offset, 0));
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--photo-silver);
    text-align: center;
    margin-top: 3rem;
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
}

/* Blocks 02-03: Dual photos */
.block-half-left {
    grid-column: 1 / 7;
    min-height: 50vh;
    background-color: var(--block-dark);
}

.block-half-right {
    grid-column: 7 / -1;
    min-height: 50vh;
    background-color: var(--block-dark);
}

/* Photo containers */
.photo-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.vintage-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(85%) contrast(1.1) brightness(0.9);
    transition: box-shadow 0.5s ease;
}

.vintage-photo svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.block.visible .vintage-photo:hover {
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

/* Grain overlay */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* Amber tint overlay for vintage photos */
.photo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--warm-amber);
    opacity: 0.08;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Block 04: Wide text block */
.block-wide {
    grid-column: 3 / 11;
    min-height: 60vh;
    background-color: var(--block-dark);
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-content {
    max-width: 42ch;
    margin: 0 auto;
}

.text-content p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--photo-silver);
    line-height: 1.72;
    margin-bottom: 1.5rem;
}

.text-content p:last-child {
    margin-bottom: 0;
}

.cyan-emphasis {
    color: var(--neon-cyan);
}

.counter-element {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.6;
    letter-spacing: 0.1em;
    position: absolute;
    top: 12px;
    right: 16px;
    transition: text-shadow 0.3s ease;
}

.counter-element.flash {
    text-shadow: 0 0 12px var(--neon-cyan);
}

.counter-large {
    font-size: 2.5rem;
    position: relative;
    top: auto;
    right: auto;
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Blocks 05-08: Cascade blocks */
.block-small {
    background-color: var(--block-dark);
    overflow: hidden;
}

.block-cascade-1 {
    grid-column: 1 / 5;
    min-height: 40vh;
}

.block-cascade-2 {
    grid-column: 5 / 9;
    min-height: 35vh;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-cascade-3 {
    grid-column: 9 / -1;
    min-height: 30vh;
    background-color: var(--void-black);
}

.block-cascade-4 {
    grid-column: 3 / 10;
    min-height: 35vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.text-fragment {
    max-width: 32ch;
}

.fragment-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--photo-silver);
    line-height: 1.72;
}

.block-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.5;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.particle-field-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Blocks 09-10: Particle interlude */
.block-interlude {
    grid-column: 1 / -1;
    min-height: 70vh;
    background-color: var(--block-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-interlude-2 {
    grid-column: 1 / -1;
    min-height: 40vh;
    background-color: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.interlude-content {
    text-align: center;
}

.convergence-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--neon-cyan);
    opacity: 0.8;
    letter-spacing: 0.05em;
    transition: text-shadow 0.3s ease;
}

.convergence-counter.flash {
    text-shadow: 0 0 30px var(--neon-cyan), 0 0 60px rgba(0, 229, 255, 0.3);
}

.interlude-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    opacity: 0.4;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 1rem;
}

.particle-river {
    width: 100%;
    height: 4px;
    position: relative;
    overflow: visible;
}

/* Blocks 11-14: Convergence blocks growing larger */
.block-convergence {
    background-color: var(--block-dark);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.block-grow-1 {
    grid-column: 2 / 10;
    min-height: 45vh;
}

.block-grow-2 {
    grid-column: 1 / -1;
    min-height: 50vh;
    padding: 0;
}

.block-grow-3 {
    grid-column: 1 / 11;
    min-height: 55vh;
}

/* Block 14: Conclusion */
.block-conclusion {
    grid-column: 1 / -1;
    min-height: 100vh;
    background-color: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.conclusion-content {
    position: relative;
}

.conclusion-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 8rem);
    color: var(--pure-white);
    text-shadow: 0 0 1px rgba(0, 229, 255, 0.4);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.conclusion-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--photo-silver);
    opacity: 0.7;
    max-width: 42ch;
    margin: 0 auto;
}

/* Particle separators */
.particle-separator {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 3;
    pointer-events: none;
}

/* Responsive: single column below 768px */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .block-hero,
    .block-half-left,
    .block-half-right,
    .block-wide,
    .block-cascade-1,
    .block-cascade-2,
    .block-cascade-3,
    .block-cascade-4,
    .block-interlude,
    .block-interlude-2,
    .block-grow-1,
    .block-grow-2,
    .block-grow-3,
    .block-conclusion {
        grid-column: 1 / -1;
    }

    .block-wide {
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .conclusion-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .block-cascade-1,
    .block-cascade-2,
    .block-cascade-3,
    .block-cascade-4 {
        min-height: 30vh;
    }

    .convergence-counter {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    #block-counter {
        bottom: 16px;
        left: 16px;
    }
}
