/* ===================================================
   layer-2.report — Pop-Art Blockchain Intelligence
   =================================================== */

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

:root {
    --terracotta: #c4663a;
    --cream: #f5efe4;
    --mustard: #d4a832;
    --deep: #6b2d18;
    --black: #1a1a1a;
    --skeleton: #d0c8bc;
    --dot-opacity: 0.08;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.65;
    color: var(--black);
    background: var(--cream);
    overflow-x: hidden;
}

/* --- Typography --- */
.headline {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(36px, 7vw, 96px);
    line-height: 1.05;
    -webkit-text-stroke: 3px var(--black);
    text-stroke: 3px var(--black);
    paint-order: stroke fill;
    text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.15);
}

.section-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(28px, 5vw, 64px);
    line-height: 1.1;
    -webkit-text-stroke: 2px var(--black);
    text-stroke: 2px var(--black);
    paint-order: stroke fill;
    margin-bottom: 40px;
}

.caption {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* --- Section Backgrounds --- */
.section-terracotta {
    background-color: var(--terracotta);
    color: var(--cream);
    position: relative;
    overflow: hidden;
}

.section-cream {
    background-color: var(--cream);
    color: var(--black);
    position: relative;
    overflow: hidden;
}

/* --- Ben-Day Dot Overlays --- */
.ben-day-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.ben-day-overlay.visible {
    opacity: 1;
}

.ben-day-large {
    background-image: radial-gradient(circle, var(--black) 12px, transparent 12px);
    background-size: 60px 60px;
    opacity: 0;
    right: 0;
    left: auto;
    width: 50%;
}

.ben-day-large.visible {
    opacity: var(--dot-opacity);
}

.ben-day-small {
    background-image: radial-gradient(circle, var(--black) 1.5px, transparent 1.5px);
    background-size: 8px 8px;
}

.ben-day-small.visible {
    opacity: var(--dot-opacity);
}

/* --- Skeleton Loading --- */
.skeleton {
    background: var(--skeleton);
    border-radius: 8px;
    animation: skeletonPulse 0.6s ease-in-out infinite alternate;
}

.skeleton.hidden {
    display: none;
}

@keyframes skeletonPulse {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

.skeleton-headline {
    display: block;
    width: 70%;
    height: clamp(40px, 7vw, 96px);
    margin-bottom: 20px;
}

.skeleton-block {
    display: block;
    width: 100%;
    height: 180px;
    border-radius: 20px;
}

.skeleton-chart {
    display: block;
    width: 100%;
    height: 350px;
    border-radius: 12px;
}

.skeleton-explosion {
    display: block;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    margin: 0 auto;
}

.skeleton-row {
    display: block;
    width: 100%;
    height: 100px;
    border-radius: 8px;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 80px);
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    width: 100%;
}

.headline-text {
    display: block;
    color: var(--cream);
    visibility: hidden;
}

.headline-text.typing {
    visibility: visible;
}

/* --- Speech Bubbles --- */
.speech-bubble {
    background: var(--cream);
    color: var(--black);
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 28px 32px;
    position: relative;
    max-width: 32em;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.speech-bubble.tail-visible::after {
    transform: scale(1);
}

/* Hero speech bubble - tail points up-left */
.speech-bubble--hero {
    margin-top: 40px;
}

.speech-bubble--hero::after {
    top: -20px;
    left: 40px;
    border-width: 0 15px 20px 15px;
    border-color: transparent transparent var(--black) transparent;
}

/* Data speech bubbles */
.speech-bubble--data {
    margin-bottom: 24px;
    border-color: var(--black);
}

.speech-bubble--data::after {
    top: 50%;
    left: -20px;
    transform-origin: right center;
    border-width: 10px 20px 10px 0;
    border-color: transparent var(--black) transparent transparent;
}

/* Analysis speech bubbles - tail points left toward explosion */
.speech-bubble--analysis {
    background: var(--cream);
    margin-bottom: 20px;
}

.speech-bubble--point-left::after {
    top: 50%;
    left: -20px;
    transform-origin: right center;
    border-width: 10px 20px 10px 0;
    border-color: transparent var(--black) transparent transparent;
}

/* Footer speech bubble */
.speech-bubble--footer {
    background: var(--cream);
    color: var(--black);
    text-align: center;
    display: inline-block;
    margin-bottom: 24px;
}

.speech-bubble--footer::after {
    bottom: -20px;
    left: 50%;
    margin-left: -15px;
    border-width: 20px 15px 0 15px;
    border-color: var(--black) transparent transparent transparent;
}

.speech-bubble-label {
    color: var(--terracotta);
    margin-bottom: 8px;
    font-weight: 300;
}

.speech-bubble-text {
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.65;
}

/* Hero speech bubble border-draw animation */
.speech-bubble--hero {
    border-color: transparent;
    transition: border-color 0.4s ease;
}

.speech-bubble--hero.border-drawn {
    border-color: var(--black);
}

/* --- Data Section --- */
#data {
    padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 80px);
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

#data .section-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

.data-hero {
    position: relative;
}

/* Pop-Art Chart */
.chart-container {
    background: var(--cream);
    border: 3px solid var(--black);
    border-radius: 12px;
    padding: 32px;
}

.chart-container .section-title {
    font-size: clamp(20px, 3vw, 36px);
    -webkit-text-stroke: 2px var(--black);
    margin-bottom: 32px;
    color: var(--black);
}

.pop-chart {
    height: 280px;
    display: flex;
    align-items: flex-end;
}

.chart-bar-group {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    width: 100%;
    height: 100%;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    height: 100%;
    padding: 0 6px;
}

.chart-bar-fill {
    width: 100%;
    height: var(--bar-height);
    border: 3px solid var(--black);
    border-radius: 4px 4px 0 0;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chart-bar-fill.animate {
    transform: scaleY(1);
}

.bar-terracotta {
    background-color: var(--terracotta);
}

.bar-mustard {
    background-color: var(--mustard);
}

.bar-deep {
    background-color: var(--deep);
}

.bar-dots {
    background-image: radial-gradient(circle, var(--black) 1.5px, transparent 1.5px);
    background-size: 8px 8px;
}

.chart-bar-label {
    margin-top: 8px;
    color: var(--black);
    font-size: 11px;
    text-align: center;
}

.data-text {
    padding-top: 20px;
}

.data-text .speech-bubble p {
    margin-bottom: 0;
}

/* --- Analysis Section --- */
#analysis {
    padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 80px);
}

.analysis-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.analysis-hero {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Explosion Shape */
.explosion-container {
    position: relative;
}

.explosion-shape {
    width: 320px;
    height: 320px;
    background: var(--mustard);
    border: 4px solid var(--black);
    clip-path: polygon(
        50% 0%,
        63% 18%,
        80% 5%,
        78% 25%,
        100% 22%,
        88% 40%,
        100% 50%,
        88% 60%,
        100% 78%,
        78% 75%,
        80% 95%,
        63% 82%,
        50% 100%,
        37% 82%,
        20% 95%,
        22% 75%,
        0% 78%,
        12% 60%,
        0% 50%,
        12% 40%,
        0% 22%,
        22% 25%,
        20% 5%,
        37% 18%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.explosion-shape.animate {
    transform: scale(1);
}

.explosion-inner {
    text-align: center;
    position: relative;
    z-index: 2;
}

.explosion-metric {
    display: block;
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 6vw, 80px);
    color: var(--black);
    -webkit-text-stroke: 2px var(--black);
    text-stroke: 2px var(--black);
    line-height: 1;
}

.explosion-label {
    display: block;
    color: var(--deep);
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 0.08em;
}

.analysis-bubbles {
    display: flex;
    flex-direction: column;
}

/* --- Archive Section --- */
#archive {
    padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 80px);
}

.archive-title {
    color: var(--black);
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-row {
    border: 3px solid var(--black);
    border-bottom: 0;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}

.archive-row:last-child {
    border-bottom: 3px solid var(--black);
}

.archive-row--terracotta {
    background-color: var(--terracotta);
    color: var(--cream);
}

.archive-row--terracotta .archive-heading {
    color: var(--cream);
}

.archive-row--terracotta .archive-summary {
    color: var(--cream);
    opacity: 0.9;
}

.archive-row--terracotta .archive-date {
    color: var(--mustard);
}

.archive-row--cream {
    background-color: var(--cream);
    color: var(--black);
}

.archive-row--cream .archive-heading {
    color: var(--black);
}

.archive-row--cream .archive-date {
    color: var(--terracotta);
}

.archive-row-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Mini panel thumbnails */
.archive-thumbnail {
    flex-shrink: 0;
}

.mini-panel {
    width: 80px;
    height: 80px;
    border: 3px solid var(--black);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-panel--1 { background: var(--mustard); }
.mini-panel--2 { background: var(--deep); }
.mini-panel--3 { background: var(--terracotta); }
.mini-panel--4 { background: var(--mustard); }
.mini-panel--5 { background: var(--cream); }
.mini-panel--6 { background: var(--deep); }

.mini-dots {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-image: radial-gradient(circle, var(--black) 2px, transparent 2px);
    background-size: 10px 10px;
    opacity: 0.15;
}

.archive-info {
    flex: 1;
}

.archive-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(16px, 2vw, 22px);
    line-height: 1.2;
    margin-bottom: 6px;
    -webkit-text-stroke: 1px var(--black);
    text-stroke: 1px var(--black);
    paint-order: stroke fill;
}

.archive-row--terracotta .archive-heading {
    -webkit-text-stroke: 1px var(--cream);
    text-stroke: 1px var(--cream);
}

.archive-summary {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
    max-width: 32em;
}

.archive-date {
    font-size: 12px;
}

/* --- Footer --- */
.site-footer {
    padding: clamp(40px, 6vh, 80px) clamp(20px, 5vw, 80px);
    text-align: center;
}

.footer-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-brand {
    font-size: clamp(32px, 5vw, 56px);
    color: var(--black);
    -webkit-text-stroke: 2px var(--black);
    margin-bottom: 4px;
}

.footer-tagline {
    font-weight: 300;
    font-size: 14px;
    color: var(--terracotta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-copy {
    color: var(--cream);
    opacity: 0.7;
    margin-top: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #data .section-inner {
        grid-template-columns: 1fr;
    }

    .analysis-layout {
        grid-template-columns: 1fr;
    }

    .analysis-hero {
        order: -1;
    }

    .explosion-shape {
        width: 240px;
        height: 240px;
    }

    .archive-row-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .speech-bubble--point-left::after,
    .speech-bubble--data::after {
        display: none;
    }
}
