/* ============================================
   mujun.study — Sci-Fi Bento Study Chamber
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #0E1028;
    color: #8090B0;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */

h1, h2 {
    font-family: 'Cormorant Garamond', serif;
    color: #D0D8F0;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: 0.08em;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

.cell-heading {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    margin-bottom: 0.5rem;
}

.cell-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    color: #5060A0;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.cell-text {
    color: #8090B0;
    font-weight: 300;
}

.cell-text-small {
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ============================================
   Bento Grid
   ============================================ */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 2px;
    background: #0A0A20;
    padding: 2px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ============================================
   Bento Cells
   ============================================ */

.bento-cell {
    background: #1A1A38;
    border-radius: 4px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease;
    opacity: 0;
    transform: translateY(12px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bento-cell.visible {
    opacity: 1;
    transform: translateY(0);
}

.bento-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(10, 10, 40, 0.3);
    z-index: 2;
}

.bento-cell.visible:hover {
    transform: translateY(-4px);
}

/* Cell Sizes */
.cell-2x2 {
    grid-column: span 2;
    grid-row: span 2;
    padding: 2.5rem;
}

.cell-2x1 {
    grid-column: span 2;
}

.cell-1x2 {
    grid-row: span 2;
}

/* ============================================
   Title Cell
   ============================================ */

.cell-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.site-title {
    position: relative;
    z-index: 1;
}

.site-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #5060A0;
    margin-top: 0.75rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   Abstract Geometric Shapes
   ============================================ */

.cell-shape {
    position: absolute;
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.bento-cell:hover .cell-shape {
    opacity: 0.18;
}

/* Circle */
.shape-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #4A5A80;
    top: -20px;
    right: -20px;
}

.shape-circle.shape-large {
    width: 200px;
    height: 200px;
    top: -40px;
    right: -40px;
}

.shape-circle.shape-small {
    width: 60px;
    height: 60px;
    top: 15px;
    right: 15px;
}

.shape-circle.shape-offset {
    width: 80px;
    height: 80px;
    top: auto;
    bottom: 20px;
    right: 20px;
}

/* Triangle */
.shape-triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid #4A5A80;
    bottom: -20px;
    left: -20px;
    background: transparent;
}

.shape-triangle.shape-small {
    border-left-width: 35px;
    border-right-width: 35px;
    border-bottom-width: 60px;
    bottom: 10px;
    left: auto;
    right: 20px;
}

.shape-triangle.shape-offset {
    border-left-width: 40px;
    border-right-width: 40px;
    border-bottom-width: 70px;
    bottom: auto;
    top: 20px;
    left: 30px;
}

/* Hexagon */
.shape-hexagon {
    width: 100px;
    height: 57px;
    background: #4A5A80;
    top: 20px;
    right: 20px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.shape-hexagon.shape-large {
    width: 160px;
    height: 92px;
    top: -10px;
    right: -10px;
}

.shape-hexagon.shape-small {
    width: 50px;
    height: 29px;
    top: 15px;
    right: 15px;
}

/* ============================================
   Retro Dot Patterns
   ============================================ */

.cell-dotted {
    position: relative;
}

.dot-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background: radial-gradient(circle, #3A4A70 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
    border-radius: 4px;
}

/* ============================================
   Visual Cells
   ============================================ */

.cell-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-visual .cell-shape {
    opacity: 0.15;
}

.cell-visual:hover .cell-shape {
    opacity: 0.25;
}

.cell-visual .cell-content {
    position: relative;
    z-index: 1;
}

/* ============================================
   Status Grid
   ============================================ */

.status-grid {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.status-item {
    display: flex;
    flex-direction: column;
}

.status-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #D0D8F0;
    line-height: 1;
}

.status-key {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #5060A0;
    letter-spacing: 0.1em;
    margin-top: 0.3rem;
}

/* ============================================
   Index List
   ============================================ */

.index-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.index-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(80, 96, 160, 0.15);
    transition: border-color 200ms ease;
}

.index-item:hover {
    border-bottom-color: rgba(80, 96, 160, 0.4);
}

.index-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #5060A0;
    letter-spacing: 0.1em;
    min-width: 2rem;
}

.index-name {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: #8090B0;
}

/* ============================================
   Session / Time
   ============================================ */

.cell-highlight {
    border-left: 2px solid #C0A860;
}

.session-info {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-top: 0.25rem;
}

.session-time {
    font-family: 'Space Mono', monospace;
    font-size: 1.8rem;
    color: #C0A860;
    letter-spacing: 0.05em;
}

.session-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #5060A0;
    letter-spacing: 0.05em;
}

/* ============================================
   Metrics
   ============================================ */

.metric-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.25rem;
}

.metric-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #D0D8F0;
    line-height: 1;
}

.metric-unit {
    font-size: 1.5rem;
    color: #5060A0;
}

.metric-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #5060A0;
    letter-spacing: 0.1em;
    margin-top: 0.3rem;
}

/* ============================================
   Cell Content z-index
   ============================================ */

.cell-content {
    position: relative;
    z-index: 1;
}

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

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

    .cell-2x1 {
        grid-column: span 2;
    }

    .cell-2x2 {
        grid-column: span 2;
        grid-row: span 2;
    }

    .status-grid {
        flex-direction: column;
        gap: 1rem;
    }

    .session-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    h1 {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }
}

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

    .cell-2x2,
    .cell-2x1 {
        grid-column: span 1;
    }

    .cell-2x2 {
        grid-row: span 1;
        min-height: 280px;
    }

    .cell-1x2 {
        grid-row: span 1;
    }
}
