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

body {
    background: #0d0d0d;
    color: #c9c5bc;
    font-family: 'Source Serif 4', serif;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#grain);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    animation: grainFadeIn 0.5s 0.3s forwards;
}

@keyframes grainFadeIn {
    to { opacity: 0.06; }
}

/* Header */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #1a1a1e;
    border-bottom: 1px solid #2a2228;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c9c5bc;
    transform: translateY(-100%);
    animation: slideDown 0.4s 0.8s forwards;
}

.header-label {
    color: #ede8e0;
}

.header-date {
    color: #ffb627;
}

.header-ref {
    color: #00e5ff;
}

@keyframes slideDown {
    to { transform: translateY(0); }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: 2px;
    padding: 60px 2px 2px 2px;
    min-height: 100vh;
}

.cell {
    position: relative;
    padding: 2rem;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.97);
    animation: cellReveal 0.5s forwards;
    background-color: #1a1a1e;
    background-image:
        radial-gradient(ellipse at var(--marble-x1) var(--marble-y1), rgba(255,255,255,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at var(--marble-x2) var(--marble-y2), rgba(201,197,188,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at var(--marble-x3) var(--marble-y3), rgba(255,255,255,0.05) 0%, transparent 55%);
}

.cell-hero { animation-delay: 1.2s; grid-column: 1 / 8; grid-row: 1 / 3; }
.cell-metric:nth-of-type(2) { animation-delay: 1.28s; grid-column: 8 / 13; grid-row: 1 / 2; }
.cell-metric:nth-of-type(3) { animation-delay: 1.36s; grid-column: 8 / 13; grid-row: 2 / 3; }
.cell-metric:nth-of-type(4) { animation-delay: 1.44s; grid-column: 8 / 13; grid-row: 3 / 4; }
.cell-sidebar { animation-delay: 1.52s; grid-column: 1 / 3; grid-row: 3 / 5; background-color: #16171c; }
.cell-content:nth-of-type(6) { grid-column: 3 / 8; grid-row: 3 / 4; }
.cell-content:nth-of-type(7) { grid-column: 3 / 13; grid-row: 4 / 5; }
.cell-content:nth-of-type(8) { grid-column: 1 / 13; grid-row: 5 / 6; }

@keyframes cellReveal {
    to { opacity: 1; transform: scale(1); }
}

/* Corner Brackets */
.corner-bracket {
    position: absolute;
    width: 12px;
    height: 12px;
}
.corner-bracket.tl { top: 8px; left: 8px; border-left: 1px solid rgba(255,182,39,0.15); border-top: 1px solid rgba(255,182,39,0.15); }
.corner-bracket.tr { top: 8px; right: 8px; border-right: 1px solid rgba(255,182,39,0.15); border-top: 1px solid rgba(255,182,39,0.15); }
.corner-bracket.bl { bottom: 8px; left: 8px; border-left: 1px solid rgba(255,182,39,0.15); border-bottom: 1px solid rgba(255,182,39,0.15); }
.corner-bracket.br { bottom: 8px; right: 8px; border-right: 1px solid rgba(255,182,39,0.15); border-bottom: 1px solid rgba(255,182,39,0.15); }

/* Hero */
.cell-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-headline {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.2rem, 5vw, 5rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #ede8e0;
    line-height: 1.1;
}

.hero-headline .char {
    display: inline-block;
    opacity: 0;
}

.hero-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.8rem, 1vw, 1rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #00e5ff;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(8px);
    text-shadow: 0 0 20px rgba(0,229,255,0.4);
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Stamp */
.stamp {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,182,39,0.3);
    border: 2px solid rgba(255,182,39,0.3);
    padding: 4px 10px;
    transform: rotate(-12deg);
}

/* Metrics */
.cell-metric {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: default;
}

.metric-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c9c5bc;
}

.dot-leader {
    flex: 1;
    height: 1px;
    background-image: radial-gradient(circle, #c9c5bc 1px, transparent 1px);
    background-size: 8px 2px;
    background-repeat: repeat-x;
    background-position: left center;
    min-width: 20px;
    opacity: 0.4;
}

.metric-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 600;
    color: #ede8e0;
    text-shadow: 0 0 10px rgba(0,229,255,0.3);
    transition: text-shadow 0.3s ease;
}

.metric-value.lock-in {
    text-shadow: 0 0 30px rgba(0,229,255,0.6);
}

.sparkline {
    width: 100%;
    height: 30px;
}

#metric-2 .sparkline polyline {
    stroke: #ff2d6f;
    filter: drop-shadow(0 0 3px rgba(255,45,111,0.5));
}

#metric-3 .sparkline polyline {
    stroke: #ffb627;
    filter: drop-shadow(0 0 3px rgba(255,182,39,0.5));
}

.sparkline polyline {
    filter: drop-shadow(0 0 3px rgba(0,229,255,0.5));
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease-out;
}

.sparkline.animate polyline {
    stroke-dashoffset: 0;
}

.metric-tooltip {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: #00e5ff;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cell-metric:hover .metric-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.cell-metric:hover {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

/* Sidebar */
.cell-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffb627;
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-list li {
    display: flex;
    align-items: baseline;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #c9c5bc;
}

.dot-leader-inline {
    flex: 1;
    margin: 0 0.5rem;
    border-bottom: 1px dotted rgba(201,197,188,0.3);
}

.page-num {
    color: #00e5ff;
    font-variant-numeric: tabular-nums;
}

/* Content Cells */
.cell-content {
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.cell-content:hover {
    border-color: #00e5ff;
}

.cell-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 600;
    color: #ede8e0;
    letter-spacing: 0.01em;
    margin-bottom: 1rem;
}

.cell-content p {
    color: #c9c5bc;
    line-height: 1.72;
}

.font-variant-sc {
    font-variant: small-caps;
}

/* Content reveal */
.content-reveal {
    opacity: 0 !important;
    transform: translateY(40px) !important;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.content-reveal.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Decorative Rule */
.decorative-rule {
    position: relative;
    height: 4px;
    border-top: 1px solid #2a2228;
    border-bottom: 1px solid #2a2228;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    transition: width 0.8s ease;
}

.visible .decorative-rule {
    width: 100%;
}

.diamond {
    width: 6px;
    height: 6px;
    background: #ffb627;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* Footer */
.footer-ledger {
    padding: 2rem;
    background: #1a1a1e;
    margin-top: 2px;
}

.footer-ledger .decorative-rule {
    width: 100%;
    margin-bottom: 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(201,197,188,0.5);
}
