/* ==========================================================
   mujun.cafe — Brutalist Cafe Grid
   Palette: Carbon Black #1A1A1A | Raw Linen #E8E0D8
   Accent: Oxidized Copper #C8A882 | Concrete Dust #706860
   Grid: Graphite #2A2A2A | Trace: Tarnished Wire #8B7D6B
   Hover: Weathered Stone #B0A898
   Body on light: #3A3A3A
   Fonts: Libre Baskerville, Space Grotesk, IBM Plex Mono
   ========================================================== */

/* --- Reset & Base --- */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #1A1A1A;
    color: #E8E0D8;
}

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

/* --- Typography --- */
h1, h2 {
    font-family: 'Libre Baskerville', serif;
    margin: 0;
}

h1 {
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2.8rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    color: #E8E0D8;
    line-height: 1.1;
}

h2 {
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0em;
    color: #E8E0D8;
    line-height: 1.3;
}

p, .subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.7;
    color: #B0A898;
    margin: 0;
}

/* Light background variant text color: #3A3A3A (per design spec) */
.light-bg p {
    color: #3A3A3A;
}

.cell-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #706860;
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 5;
}

.menu-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #706860;
    display: block;
    margin-top: 12px;
}

/* --- Grid Container --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 100vh;
    border: 1px solid #2A2A2A;
}

/* --- Grid Cells --- */
.grid-cell {
    border: 1px solid #2A2A2A;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    background: #1A1A1A;
    transition: border-color 0.4s ease;
}

.grid-cell:hover {
    border-color: #C8A882;
}

/* --- Cell A: Contradiction Statement (spans 2 cols) --- */
.cell-a {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

.cell-a .cell-content {
    padding: 0 20px;
    opacity: 1;
    transform: none;
}

.cell-a .subtitle {
    margin-top: 8px;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #706860;
}

/* --- Cell B: Circuit Diagram --- */
.cell-b {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.circuit-full {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.circuit-full .trace-path {
    fill: none;
    stroke: #8B7D6B;
    stroke-width: 2;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawCircuit 2s ease forwards;
}

.circuit-full .trace-path:nth-child(2) { animation-delay: 0.2s; }
.circuit-full .trace-path:nth-child(3) { animation-delay: 0.4s; }
.circuit-full .trace-path:nth-child(4) { animation-delay: 0.6s; }
.circuit-full .trace-path:nth-child(5) { animation-delay: 0.8s; }
.circuit-full .trace-path:nth-child(6) { animation-delay: 1.0s; }
.circuit-full .trace-path:nth-child(7) { animation-delay: 1.2s; }

.circuit-full .junction {
    fill: #8B7D6B;
    opacity: 0.4;
    animation: pulse 3s ease-in-out infinite;
}

.circuit-full .junction:nth-child(8) { animation-delay: 0s; }
.circuit-full .junction:nth-child(9) { animation-delay: 0.3s; }
.circuit-full .junction:nth-child(10) { animation-delay: 0.6s; }
.circuit-full .junction:nth-child(11) { animation-delay: 0.9s; }
.circuit-full .junction:nth-child(12) { animation-delay: 1.2s; }
.circuit-full .junction:nth-child(13) { animation-delay: 1.5s; }
.circuit-full .junction:nth-child(14) { animation-delay: 1.8s; }
.circuit-full .junction:nth-child(15) { animation-delay: 2.1s; }
.circuit-full .junction:nth-child(16) { animation-delay: 2.4s; }
.circuit-full .junction:nth-child(17) { animation-delay: 2.7s; }
.circuit-full .junction:nth-child(18) { animation-delay: 3.0s; }

.circuit-full .component {
    fill: none;
    stroke: #8B7D6B;
    stroke-width: 1.5;
    opacity: 0.6;
}

/* --- Circuit Traces (overlay) --- */
.circuit-trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

.trace-path {
    fill: none;
    stroke: #8B7D6B;
    stroke-width: 2;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawCircuit 2s ease forwards;
}

.junction {
    fill: #8B7D6B;
    opacity: 0.4;
    animation: pulse 3s ease-in-out infinite;
}

/* --- Menu Cells (C-F): Skeleton + Hover Reveal --- */
.cell-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #1A1A1A 25%, #2A2A2A 50%, #1A1A1A 75%);
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
    z-index: 1;
}

.cell-menu .cell-content {
    position: relative;
    z-index: 3;
    padding: 30px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cell-menu:hover .cell-content {
    opacity: 1;
    transform: translateY(0);
}

.cell-menu:hover .skeleton-shimmer {
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.menu-item h2 {
    margin-bottom: 12px;
}

.menu-desc {
    max-width: 320px;
}

/* --- Cell G: The Void --- */
.cell-void {
    background: #1A1A1A;
}

/* --- Cell H: Footer --- */
.cell-h {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-h .cell-content {
    position: relative;
    z-index: 3;
    padding: 30px;
    text-align: center;
}

.footer-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #C8A882;
    margin-bottom: 12px;
}

/* --- Cell I: Closing Statement --- */
.cell-i {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.cell-i h2 {
    color: #706860;
    text-align: center;
    line-height: 1.6;
}

/* --- Animations --- */
@keyframes drawCircuit {
    to {
        stroke-dashoffset: 0;
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* --- Touch Devices: Always show content --- */
@media (hover: none) {
    .cell-menu .cell-content {
        opacity: 1;
        transform: translateY(0);
    }
    .skeleton-shimmer {
        opacity: 0.3;
    }
}

/* --- Tablet: 2 columns --- */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-a {
        grid-column: span 2;
    }
    .grid-cell {
        min-height: 250px;
    }
}

/* --- Mobile: 1 column --- */
@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .cell-a {
        grid-column: span 1;
    }
    .grid-cell {
        min-height: 200px;
    }
    .cell-menu .cell-content {
        opacity: 1;
        transform: translateY(0);
    }
    .skeleton-shimmer {
        opacity: 0.3;
    }
}
