/* =============================================
   rollup.quest - Data Compression Noir
   ============================================= */

:root {
    --void-black: #07080A;
    --batch-gray: #0F1114;
    --deep-teal: #0A4D68;
    --proof-cyan: #00E5FF;
    --validity-green: #39FF85;
    --pending-amber: #FFB020;
    --cold-white: #E0E6ED;
    --fog-gray: #6B7B8D;
    --glow-cyan: rgba(0, 229, 255, 0.15);
    --glow-cyan-strong: rgba(0, 229, 255, 0.08);
}

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

html {
    scroll-behavior: smooth;
    background: var(--void-black);
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1vw, 1rem);
    line-height: 1.6;
    color: var(--cold-white);
    background: var(--void-black);
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

/* Grid Overlay */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* =============================================
   BATCH 0: Hero
   ============================================= */

.batch-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--void-black);
}

.transaction-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.tx-hash {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--fog-gray);
    letter-spacing: 0.06em;
    white-space: nowrap;
    will-change: transform, opacity;
    transition: color 0.2s ease;
}

.tx-hash.accelerating {
    color: var(--proof-cyan);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.hero-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: var(--cold-white);
    line-height: 1;
    text-shadow: 0 0 60px rgba(0, 229, 255, 0.15);
}

.compression-bar {
    position: relative;
    width: clamp(200px, 40vw, 500px);
    height: 4px;
    background: var(--deep-teal);
    border-radius: 2px;
    overflow: visible;
}

.compression-bar-inner {
    width: 100%;
    height: 100%;
    background: var(--proof-cyan);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4), 0 0 60px rgba(0, 229, 255, 0.15);
    transition: filter 0.4s ease;
}

.compression-bar.pulse .compression-bar-inner {
    filter: brightness(1.4);
}

.compression-label {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--proof-cyan);
}

.tps-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.tps-label {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

.tps-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--pending-amber);
    letter-spacing: 0.04em;
}

/* =============================================
   BATCH CONTENT SECTIONS
   ============================================= */

.batch-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px;
}

.batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--deep-teal);
}

.batch-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

.batch-status {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 2px;
    transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.status-pending {
    color: var(--pending-amber);
    border: 1px solid var(--pending-amber);
    background: rgba(255, 176, 32, 0.08);
}

.status-sealed {
    color: var(--validity-green);
    border: 1px solid var(--validity-green);
    background: rgba(57, 255, 133, 0.08);
}

/* Bento Grid Layouts */
.bento-grid {
    display: grid;
    gap: 2px;
}

.bento-3x2 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, minmax(160px, auto));
}

.bento-2x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, minmax(160px, auto));
}

/* Bento Cell Base */
.bento-cell {
    background: var(--batch-gray);
    border: 2px solid var(--deep-teal);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition:
        transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease;
}

.bento-cell.cell-wide {
    grid-column: span 2;
}

/* Cell labels */
.cell-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

.cell-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    line-height: 1.65;
    color: var(--cold-white);
    letter-spacing: 0.01em;
}

/* Unsealed (deconstructed) state */
.batch-content.unsealed .bento-cell {
    opacity: 0.4;
}

.batch-content.unsealed .bento-cell[data-cell="0"] { transform: translate(-12px, -8px) rotate(-0.5deg); }
.batch-content.unsealed .bento-cell[data-cell="1"] { transform: translate(15px, -12px) rotate(0.3deg); }
.batch-content.unsealed .bento-cell[data-cell="2"] { transform: translate(-8px, 14px) rotate(-0.4deg); }
.batch-content.unsealed .bento-cell[data-cell="3"] { transform: translate(10px, 6px) rotate(0.6deg); }
.batch-content.unsealed .bento-cell[data-cell="4"] { transform: translate(-18px, -5px) rotate(-0.2deg); }
.batch-content.unsealed .bento-cell[data-cell="5"] { transform: translate(7px, -16px) rotate(0.5deg); }

/* Sealed state */
.batch-content.sealed .bento-cell {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
}

.batch-content.sealed .bento-cell {
    border-color: var(--proof-cyan);
    box-shadow: 0 0 30px var(--glow-cyan);
}

.batch-content.sealed .bento-grid {
    box-shadow: 0 0 40px var(--glow-cyan-strong);
}

/* Staggered border illumination */
.batch-content.sealing .bento-cell[data-cell="0"] { transition-delay: 0ms; }
.batch-content.sealing .bento-cell[data-cell="1"] { transition-delay: 80ms; }
.batch-content.sealing .bento-cell[data-cell="2"] { transition-delay: 160ms; }
.batch-content.sealing .bento-cell[data-cell="3"] { transition-delay: 240ms; }
.batch-content.sealing .bento-cell[data-cell="4"] { transition-delay: 320ms; }
.batch-content.sealing .bento-cell[data-cell="5"] { transition-delay: 400ms; }

/* Scale pulse during sealing */
@keyframes sealPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.batch-content.sealed .bento-cell {
    animation: sealPulse 300ms ease forwards;
}

/* Sparklines */
.sparkline {
    width: 100%;
    height: 40px;
    flex-shrink: 0;
}

.sparkline-line {
    fill: none;
    stroke: var(--proof-cyan);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.3));
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.batch-content.sealed .sparkline-line {
    opacity: 1;
}

/* Proof Indicator */
.proof-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.proof-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pending-amber);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.batch-content.sealed .proof-dot {
    background: var(--validity-green);
    box-shadow: 0 0 10px rgba(57, 255, 133, 0.4);
}

.proof-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pending-amber);
    transition: color 0.4s ease;
}

.batch-content.sealed .proof-text {
    color: var(--validity-green);
}

/* Counter */
.counter-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    color: var(--cold-white);
    line-height: 1;
}

.counter-unit {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

/* Hash display */
.hash-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.hash-line {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    letter-spacing: 0.06em;
    color: var(--fog-gray);
    transition: color 0.4s ease;
}

.batch-content.sealed .hash-line {
    color: var(--cold-white);
}

/* Merkle Tree */
.merkle-tree {
    width: 100%;
    height: 60px;
    flex-shrink: 0;
    margin-top: auto;
}

.merkle-node {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.merkle-line {
    stroke: var(--deep-teal);
    stroke-width: 1;
    transition: stroke 0.3s ease;
}

.merkle-node.leaf {
    fill: var(--pending-amber);
    transition: fill 0.3s ease;
}

.merkle-node.branch {
    fill: var(--deep-teal);
    transition: fill 0.3s ease;
}

.batch-content.sealed .merkle-node.leaf,
.batch-content.sealed .merkle-node.branch {
    fill: var(--validity-green);
}

.batch-content.sealed .merkle-line {
    stroke: var(--validity-green);
}

/* Glitch artifacts */
.glitch-artifact {
    position: absolute;
    background: var(--proof-cyan);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
}

@keyframes glitchFlash {
    0% { opacity: 0.9; }
    100% { opacity: 0; }
}

.glitch-artifact.active {
    animation: glitchFlash 150ms ease-out forwards;
}

/* =============================================
   FINAL PROOF: Footer
   ============================================= */

.batch-footer {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.proof-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.proof-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fog-gray);
}

.proof-hash-display {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--cold-white);
    min-height: 1.6em;
    position: relative;
    word-break: break-all;
    max-width: 600px;
    line-height: 1.8;
}

.proof-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    background: var(--proof-cyan);
    vertical-align: text-bottom;
    animation: cursorBlink 530ms step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.proof-char {
    display: inline;
    color: var(--cold-white);
}

.proof-char.flash {
    color: var(--proof-cyan);
    transition: color 0.15s ease;
}

.proof-checkmark {
    width: 52px;
    height: 52px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.proof-checkmark.visible {
    opacity: 1;
}

.checkmark-circle {
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
}

.checkmark-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
}

.proof-checkmark.animate .checkmark-circle {
    animation: drawCircle 0.6s ease-out forwards;
}

.proof-checkmark.animate .checkmark-path {
    animation: drawCheck 0.4s 0.5s ease-out forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.footer-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--fog-gray);
}

.footer-rule {
    width: 60px;
    border: none;
    border-top: 1px solid var(--deep-teal);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .bento-3x2,
    .bento-2x3 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .bento-cell.cell-wide {
        grid-column: span 2;
    }

    .batch-content {
        padding: 80px 16px;
    }

    .batch-footer {
        padding: 80px 16px;
    }
}

@media (max-width: 480px) {
    .bento-3x2,
    .bento-2x3 {
        grid-template-columns: 1fr;
    }

    .bento-cell.cell-wide {
        grid-column: span 1;
    }

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