/* =============================================
   layer-2.report — Field Notes on L2 Scaling
   Pixel-Art Field Manual Aesthetic
   ============================================= */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: #3d3630;
    background-color: #f5efe3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* === Bento Container === */
.bento-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* === Bento Cell Base === */
.bento-cell {
    position: relative;
    border: 1px solid #c2b8a3;
    padding: 20px;
    opacity: 0;
    transform: scale(0.92);
    animation: elasticReveal 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: border-color 300ms ease;
}

.bento-cell:hover {
    border-color: #7a9e8e;
}

/* === Elastic Reveal Animation === */
@keyframes elasticReveal {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger delays applied via data-cell attribute */
.bento-cell[data-cell="0"] { animation-delay: 0ms; }
.bento-cell[data-cell="1"] { animation-delay: 75ms; }
.bento-cell[data-cell="2"] { animation-delay: 150ms; }
.bento-cell[data-cell="3"] { animation-delay: 225ms; }
.bento-cell[data-cell="4"] { animation-delay: 300ms; }
.bento-cell[data-cell="5"] { animation-delay: 375ms; }
.bento-cell[data-cell="6"] { animation-delay: 450ms; }
.bento-cell[data-cell="7"] { animation-delay: 525ms; }
.bento-cell[data-cell="8"] { animation-delay: 600ms; }
.bento-cell[data-cell="9"] { animation-delay: 675ms; }
.bento-cell[data-cell="10"] { animation-delay: 750ms; }
.bento-cell[data-cell="11"] { animation-delay: 825ms; }
.bento-cell[data-cell="12"] { animation-delay: 900ms; }
.bento-cell[data-cell="13"] { animation-delay: 975ms; }
.bento-cell[data-cell="14"] { animation-delay: 1050ms; }

/* === Corner Marks === */
.corner-mark {
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
}

.corner-tl {
    top: 3px;
    left: 3px;
    border-top: 2px solid #c2b8a3;
    border-left: 2px solid #c2b8a3;
}

.corner-br {
    bottom: 3px;
    right: 3px;
    border-bottom: 2px solid #c2b8a3;
    border-right: 2px solid #c2b8a3;
}

/* === Header Slab === */
.header-slab {
    grid-column: 1 / -1;
    background: #f5efe3;
    border-bottom: 1px dashed #c2b8a3;
    padding: 28px 24px 20px;
}

.domain-name {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #3d3630;
    line-height: 1.1;
    margin-bottom: 8px;
}

.subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: #7a9e8e;
}

/* === Synopsis Block === */
.synopsis-block {
    grid-column: span 2;
    background: #f5efe3;
}

.synopsis-block p {
    margin-bottom: 12px;
    color: #3d3630;
}

.synopsis-block p:last-child {
    margin-bottom: 0;
}

/* === Pixel Diagram Cell === */
.pixel-diagram-cell {
    grid-column: span 2;
    grid-row: span 2;
    background: #2b2922;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 280px;
}

.pixel-diagram-cell.small-diagram {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 180px;
}

.cell-label {
    font-family: 'Silkscreen', cursive;
    font-size: 14px;
    color: #eee7d8;
    margin-bottom: 16px;
    display: block;
    text-align: center;
}

/* === Pixel Grids === */
.pixel-grid {
    display: grid;
    width: 100%;
    max-width: 256px;
    aspect-ratio: 1;
}

.compression-funnel {
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    gap: 1px;
}

.rollup-stack {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 1px;
    max-width: 160px;
}

.bridge-icon {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 1px;
    max-width: 80px;
    margin: 0 auto 12px;
}

.pixel-cell {
    aspect-ratio: 1;
    opacity: 0;
    animation: pixelFadeIn 100ms ease forwards;
}

@keyframes pixelFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* === Data Cells === */
.data-cell {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    min-height: 140px;
}

.bg-linen {
    background: #eee7d8;
}

.bg-canvas {
    background: #e5ddd0;
}

.data-number {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: #3d3630;
    line-height: 1.2;
    margin-bottom: 8px;
}

.data-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: #3d3630;
    line-height: 1.3;
    max-height: 1.3em;
    overflow: hidden;
    transition: max-height 300ms ease;
}

.data-cell:hover .data-label {
    max-height: 4em;
}

.data-unit {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: #c2b8a3;
    margin-top: 4px;
}

/* === Bridge Cell === */
.bridge-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* === Annotation Strip === */
.annotation-strip {
    grid-column: span 3;
    background: #f5efe3;
    display: flex;
    align-items: center;
    padding: 16px 24px;
    max-height: 80px;
    border-style: dashed;
    border-color: #c2b8a3;
}

.annotation-strip-2 {
    grid-column: span 2;
}

.annotation-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: #c4876e;
    line-height: 1.4;
}

/* === Vintage Photo Cell === */
.vintage-photo-cell {
    grid-column: span 1;
    grid-row: span 2;
    background: #eee7d8;
    padding: 0;
    overflow: hidden;
}

.vintage-photo-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: sepia(0.35) contrast(1.15) saturate(0.65) brightness(0.95);
    mix-blend-mode: multiply;
}

.photo-grain {
    position: absolute;
    inset: 0;
    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='0.15'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 1;
}

.photo-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.infrastructure-svg {
    width: 100%;
    height: auto;
    max-height: 100%;
}

/* === Footer Tray === */
.footer-tray {
    grid-column: 1 / -1;
    background: #2b2922;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    flex-wrap: wrap;
}

.footer-item {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    font-size: 12px;
    color: #eee7d8;
    white-space: nowrap;
}


/* === Beeswax Accent === */
.data-number {
    color: #3d3630;
}

.data-cell:hover .data-number {
    color: #d4b86a;
    transition: color 300ms ease;
}

/* === Tablet Layout === */
@media (max-width: 960px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
    }

    body {
        padding: 16px;
    }

    .header-slab {
        grid-column: 1 / -1;
    }

    .synopsis-block {
        grid-column: span 2;
    }

    .pixel-diagram-cell {
        grid-column: span 2;
        grid-row: span 1;
        min-height: 220px;
    }

    .pixel-diagram-cell.small-diagram {
        grid-column: span 2;
    }

    .annotation-strip {
        grid-column: 1 / -1;
    }

    .annotation-strip-2 {
        grid-column: 1 / -1;
    }

    .vintage-photo-cell {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 200px;
    }

    .footer-tray {
        grid-column: 1 / -1;
    }
}

/* === Mobile Layout === */
@media (max-width: 600px) {
    .bento-container {
        grid-template-columns: 1fr;
    }

    .header-slab,
    .synopsis-block,
    .pixel-diagram-cell,
    .pixel-diagram-cell.small-diagram,
    .annotation-strip,
    .annotation-strip-2,
    .vintage-photo-cell,
    .footer-tray {
        grid-column: 1;
        grid-row: span 1;
    }

    .data-cell {
        min-height: 120px;
    }

    .pixel-diagram-cell {
        min-height: 250px;
    }

    .vintage-photo-cell {
        min-height: 200px;
    }

    .footer-tray {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
