/* ============================================
   riron.net -- Forest Terminal + Bento Grid
   ============================================ */

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

:root {
    /* Palette */
    --deep-canopy: #0A1F0A;
    --terminal-green: #4ADE80;
    --moss-soft: #2D5A2D;
    --bokeh-amber: #D4A843;
    --leaf-light: #86EFAC;
    --bark-brown: #5C4033;
    --fog-white: #E8F0E8;
    --abyss: #051005;

    /* Typography */
    --font-headline: 'Bitter', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-canopy);
    color: var(--fog-white);
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Bokeh System --- */
.bokeh-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0;
    transition: opacity 1.2s ease;
}

.bokeh-circle.visible {
    opacity: 1;
}

.bokeh-circle.green {
    background: radial-gradient(circle, rgba(74, 222, 128, 0.12), transparent);
}

.bokeh-circle.amber {
    background: radial-gradient(circle, rgba(212, 168, 67, 0.15), transparent);
}

.bokeh-circle.light {
    background: radial-gradient(circle, rgba(134, 239, 172, 0.08), transparent);
}

/* --- Terminal Boot Section --- */
#terminal-boot {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 10vw;
    background-color: var(--deep-canopy);
    overflow: hidden;
}

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

.terminal-line {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--terminal-green);
    margin-bottom: 8px;
    min-height: 1.5em;
    white-space: pre-wrap;
}

.terminal-title {
    font-family: var(--font-headline);
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 700;
    color: var(--terminal-green);
    margin-top: 16px;
    min-height: 1.2em;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: var(--terminal-green);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

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

.scroll-prompt {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.scroll-prompt.visible {
    opacity: 1;
}

.scroll-prompt .terminal-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--moss-soft);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-arrow {
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Theory Bento Grid --- */
#bento-grid {
    position: relative;
    padding: 2px;
    background-color: var(--moss-soft);
}

.bento-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 2px;
}

.bento-cell {
    position: relative;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

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

.cell-small {
    grid-column: span 1;
}

/* Cell shades - varied forest greens */
.cell-shade-1  { background-color: #0D260D; }
.cell-shade-2  { background-color: #0F2B0F; }
.cell-shade-3  { background-color: #122E12; }
.cell-shade-4  { background-color: #0B230B; }
.cell-shade-5  { background-color: #143014; }
.cell-shade-6  { background-color: #0E280E; }
.cell-shade-7  { background-color: #112C11; }
.cell-shade-8  { background-color: #0C240C; }
.cell-shade-9  { background-color: #102A10; }
.cell-shade-10 { background-color: #132F13; }
.cell-shade-11 { background-color: #0A210A; }

.cell-title {
    font-family: var(--font-headline);
    font-size: clamp(24px, 3.5vw, 48px);
    font-weight: 700;
    color: var(--terminal-green);
    margin-bottom: 16px;
}

.cell-small .cell-title {
    font-size: clamp(18px, 2vw, 28px);
}

.cell-body {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 18px);
    font-weight: 400;
    color: var(--fog-white);
    line-height: 1.75;
}

.cell-small .cell-body {
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 1.6;
}

/* Blob decorations */
.blob-decoration {
    position: absolute;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
}

.blob-1 {
    width: 280px;
    height: 260px;
    background: var(--leaf-light);
    border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
    top: -40px;
    right: -30px;
}

.blob-2 {
    width: 200px;
    height: 180px;
    background: var(--leaf-light);
    border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%;
    bottom: -20px;
    left: -20px;
}

.blob-3 {
    width: 320px;
    height: 300px;
    background: var(--leaf-light);
    border-radius: 50% 60% 45% 55% / 40% 50% 60% 50%;
    bottom: -50px;
    right: -40px;
}

/* --- Research Log --- */
#research-log {
    position: relative;
    padding: 80px 10vw;
    background-color: var(--deep-canopy);
    min-height: 80vh;
}

.log-container {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.log-header {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--leaf-light);
    margin-bottom: 48px;
}

.log-entry {
    margin-bottom: 32px;
    padding-left: 20px;
    border-left: 2px solid var(--moss-soft);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.log-entry.revealed {
    opacity: 1;
    transform: translateY(0);
}

.log-timestamp {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--bokeh-amber);
    margin-bottom: 4px;
}

.log-text {
    font-family: var(--font-body);
    font-size: clamp(16px, 1.5vw, 18px);
    font-weight: 400;
    color: var(--fog-white);
    line-height: 1.75;
}

/* --- Session End Footer --- */
#session-end {
    position: relative;
    background-color: var(--abyss);
    padding: 80px 10vw;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.session-line {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--terminal-green);
    min-height: 1.5em;
}

.footer-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: var(--terminal-green);
    animation: blink 1s step-end infinite;
}

.footer-note {
    font-family: var(--font-headline);
    font-size: 14px;
    color: var(--moss-soft);
    margin-top: 24px;
    letter-spacing: 0.05em;
}

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

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

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

    .cell-small {
        grid-column: span 1;
    }

    #terminal-boot {
        padding: 8vw;
    }

    #research-log {
        padding: 60px 8vw;
    }

    #session-end {
        padding: 60px 8vw;
    }
}

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

    .cell-large,
    .cell-medium,
    .cell-small {
        grid-column: span 1;
        grid-row: span 1;
    }

    #terminal-boot {
        padding: 6vw;
    }

    .terminal-title {
        font-size: clamp(28px, 8vw, 48px);
    }
}
