/* ============================================================
   riron.net v2  ::  forest terminal / bento / bokeh / blobs
   Palette:
     #0A1F0A  Deep Canopy   (primary bg)
     #051005  Deepest Canopy (footer bg)
     #2D5A2D  Moss Soft     (secondary bg, borders)
     #4ADE80  Terminal Green (primary text on dark)
     #86EFAC  Leaf Light    (highlights, links, blob fill)
     #D4A843  Bokeh Amber   (warm light circles, accent)
     #5C4033  Bark Brown    (organic accent)
     #E8F0E8  Fog White     (body text on dark)
   Fonts:
     Bitter (slab-serif) -- titles
     Source Sans 3       -- body
     Fira Code           -- terminal/code
   ============================================================ */

:root {
    --canopy-deep: #0A1F0A;
    --canopy-deepest: #051005;
    --moss: #2D5A2D;
    --term-green: #4ADE80;
    --leaf-light: #86EFAC;
    --bokeh-amber: #D4A843;
    --bark: #5C4033;
    --fog: #E8F0E8;

    --font-slab: "Bitter", "Source Sans 3", Georgia, serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;
    --font-mono: "Fira Code", ui-monospace, "Menlo", monospace;

    --shade-1: #0A1F0A;
    --shade-2: #0E2510;
    --shade-3: #112B14;
    --shade-4: #143018;
    --shade-5: #16361B;
    --shade-6: #193C1F;
    --shade-7: #1B4123;
    --shade-8: #1E4727;
    --shade-9: #214D2A;
    --shade-10: #24522E;
    --shade-11: #275832;
    --shade-12: #2A5E36;

    --border-thin: 1px solid rgba(45, 90, 45, 0.55);
    --border-mid: 2px solid rgba(45, 90, 45, 0.85);

    --shadow-cell: 0 0 0 1px rgba(134, 239, 172, 0.05) inset, 0 1px 0 rgba(212, 168, 67, 0.05) inset;

    --maxw: 1400px;
}

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

html, body {
    background: var(--canopy-deep);
    color: var(--fog);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 12% 20%, rgba(212, 168, 67, 0.04), transparent 40%),
        radial-gradient(circle at 88% 80%, rgba(134, 239, 172, 0.03), transparent 45%);
}

::selection {
    background: var(--term-green);
    color: var(--canopy-deepest);
}

/* ============================================================
   Status bar (top, fixed, terminal-style)
   ============================================================ */

.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--leaf-light);
    background: rgba(5, 16, 5, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(45, 90, 45, 0.6);
    letter-spacing: 0.02em;
}

.status-bar .status-left,
.status-bar .status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--term-green);
    box-shadow: 0 0 10px var(--term-green);
    animation: pulse 2s ease-in-out infinite;
}

.status-sep {
    color: var(--moss);
}

.status-path {
    color: var(--bokeh-amber);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

/* ============================================================
   Bokeh system (CSS-generated soft circles per section)
   ============================================================ */

.bokeh-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0;
    transition: opacity 1.2s ease, transform 0.3s ease-out;
    will-change: transform;
}

.bokeh.bokeh-amber {
    background: radial-gradient(circle, rgba(212, 168, 67, 0.22), rgba(212, 168, 67, 0.04) 50%, transparent 70%);
}

.bokeh.bokeh-leaf {
    background: radial-gradient(circle, rgba(134, 239, 172, 0.18), rgba(134, 239, 172, 0.03) 50%, transparent 70%);
}

.bokeh.bokeh-bright {
    background: radial-gradient(circle, rgba(232, 240, 232, 0.12), rgba(212, 168, 67, 0.05) 55%, transparent 75%);
    filter: blur(2px);
}

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

@keyframes bokeh-drift-a {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(8px, -10px); }
}

@keyframes bokeh-drift-b {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, 6px); }
}

/* ============================================================
   Section 1: Terminal Boot
   ============================================================ */

#terminal-boot {
    position: relative;
    min-height: 100vh;
    background: var(--canopy-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 40px;
    overflow: hidden;
}

.boot-frame {
    position: relative;
    z-index: 2;
    width: min(820px, 100%);
    background: rgba(5, 16, 5, 0.7);
    border: 1px solid var(--moss);
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(134, 239, 172, 0.05) inset,
        0 30px 80px -30px rgba(0, 0, 0, 0.7),
        0 0 60px -20px rgba(74, 222, 128, 0.15);
    overflow: hidden;
}

.boot-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(45, 90, 45, 0.35);
    border-bottom: 1px solid rgba(45, 90, 45, 0.65);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--leaf-light);
}

.boot-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.boot-header .dot-r { background: #d65a4a; opacity: 0.7; }
.boot-header .dot-y { background: var(--bokeh-amber); opacity: 0.85; }
.boot-header .dot-g { background: var(--term-green); }

.boot-frame-title {
    margin-left: 10px;
    color: var(--fog);
    opacity: 0.7;
    letter-spacing: 0.04em;
}

.boot-body {
    padding: 28px 28px 32px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--term-green);
    line-height: 1.85;
    min-height: 320px;
}

.boot-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.boot-spacer {
    height: 14px;
}

.prompt {
    color: var(--bokeh-amber);
    font-family: var(--font-mono);
    user-select: none;
}

.prompt-soft { color: var(--leaf-light); opacity: 0.85; }
.prompt-strong { color: var(--bokeh-amber); }

.typed {
    color: var(--term-green);
    white-space: pre-wrap;
}

.boot-title-row {
    margin: 18px 0 4px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.boot-title {
    font-family: var(--font-slab);
    font-weight: 700;
    color: var(--leaf-light);
    font-size: clamp(28px, 4.5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.boot-subtitle {
    margin-top: 6px;
    color: var(--fog);
    opacity: 0.85;
    font-size: 13px;
}

/* Carets */
.caret-inline {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--term-green);
    transform: translateY(2px);
    margin-left: 2px;
    opacity: 0;
}

.caret-inline.is-active {
    opacity: 1;
    animation: blink 1s step-end infinite;
}

.caret-block {
    display: inline-block;
    width: 14px;
    height: 0.9em;
    background: var(--leaf-light);
    transform: translateY(3px);
    animation: blink 1s step-end infinite;
}

.caret-end {
    background: var(--term-green);
}

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

.scroll-prompt {
    position: relative;
    z-index: 2;
    margin-top: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--leaf-light);
    opacity: 0;
    transition: opacity 0.6s ease;
    letter-spacing: 0.05em;
}

.scroll-prompt.is-visible {
    opacity: 0.95;
}

.scroll-arrow-glyph {
    display: inline-block;
    color: var(--term-green);
    font-family: var(--font-mono);
    animation: nudge 1.6s ease-in-out infinite;
}

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

.kbd {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 2px;
    border: 1px solid rgba(134, 239, 172, 0.4);
    border-radius: 3px;
    background: rgba(45, 90, 45, 0.35);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--leaf-light);
}

/* ============================================================
   Section eyebrow + lede (shared)
   ============================================================ */

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--bokeh-amber);
    letter-spacing: 0.18em;
    text-transform: lowercase;
    margin-bottom: 12px;
}

.section-lede {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.4vw, 17px);
    color: var(--fog);
    opacity: 0.78;
    max-width: 720px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.section-lede .kbd { vertical-align: 1px; }

/* ============================================================
   Section 2: Console
   ============================================================ */

#console-section {
    position: relative;
    padding: 120px 24px;
    background: var(--canopy-deep);
    border-top: 1px solid rgba(45, 90, 45, 0.5);
    overflow: hidden;
}

.console-wrap {
    position: relative;
    z-index: 2;
    max-width: var(--maxw);
    margin: 0 auto;
}

.console-window {
    background: rgba(5, 16, 5, 0.8);
    border: 1px solid var(--moss);
    border-radius: 6px;
    padding: 22px 24px 18px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--term-green);
    line-height: 1.75;
    min-height: 320px;
    max-width: 920px;
    box-shadow:
        0 0 0 1px rgba(134, 239, 172, 0.04) inset,
        0 30px 80px -40px rgba(0, 0, 0, 0.7);
}

.console-output {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--moss) transparent;
}

.console-output::-webkit-scrollbar { width: 8px; }
.console-output::-webkit-scrollbar-track { background: transparent; }
.console-output::-webkit-scrollbar-thumb {
    background: var(--moss);
    border-radius: 4px;
}

.console-line {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
    padding: 2px 0;
    color: var(--fog);
}

.console-line.console-greeting {
    color: var(--leaf-light);
    opacity: 0.9;
}

.console-line.console-user {
    color: var(--term-green);
}

.console-line.console-reply {
    color: var(--fog);
    opacity: 0.92;
    padding-left: 14px;
    border-left: 1px solid rgba(134, 239, 172, 0.2);
    margin: 4px 0 8px 4px;
}

.console-line.console-reply .meta-mark {
    color: var(--bokeh-amber);
    margin-right: 6px;
}

.console-line.console-error {
    color: var(--bark);
}

.console-line.console-error .meta-mark {
    color: var(--bokeh-amber);
}

.console-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px dashed rgba(45, 90, 45, 0.7);
    padding-top: 12px;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--term-green);
    font-family: var(--font-mono);
    font-size: 14px;
    caret-color: transparent;
    padding: 4px 0;
}

.console-input::placeholder {
    color: var(--moss);
}

.caret-input {
    margin-left: -6px;
}

.console-hint {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--leaf-light);
    opacity: 0.55;
    letter-spacing: 0.04em;
}

/* ============================================================
   Section 3: Bento grid
   ============================================================ */

#bento-grid {
    position: relative;
    padding: 120px 24px;
    background: var(--canopy-deep);
    overflow: hidden;
    border-top: 1px solid rgba(45, 90, 45, 0.5);
}

#bento-grid .section-eyebrow,
#bento-grid .section-lede {
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
}

.bento-container {
    position: relative;
    z-index: 2;
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 2px;
    background: var(--moss);
    border: 2px solid var(--moss);
    border-radius: 4px;
    overflow: hidden;
}

.bento-cell {
    position: relative;
    padding: 26px 24px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.35s ease,
                box-shadow 0.35s ease;
    box-shadow: var(--shadow-cell);
    isolation: isolate;
}

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

.cell-shade-1  { background: var(--shade-1); }
.cell-shade-2  { background: var(--shade-2); }
.cell-shade-3  { background: var(--shade-3); }
.cell-shade-4  { background: var(--shade-4); }
.cell-shade-5  { background: var(--shade-5); }
.cell-shade-6  { background: var(--shade-6); }
.cell-shade-7  { background: var(--shade-7); }
.cell-shade-8  { background: var(--shade-8); }
.cell-shade-9  { background: var(--shade-9); }
.cell-shade-10 { background: var(--shade-10); }
.cell-shade-11 { background: var(--shade-11); }
.cell-shade-12 { background: var(--shade-12); }

.bento-cell:hover {
    background: rgba(45, 90, 45, 0.55);
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(134, 239, 172, 0.18) inset,
        0 18px 30px -20px rgba(0, 0, 0, 0.55);
}

.bento-cell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(212, 168, 67, 0.06), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(134, 239, 172, 0.05), transparent 55%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.bento-cell:hover::before { opacity: 1; }

.cell-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--bokeh-amber);
    letter-spacing: 0.16em;
    text-transform: lowercase;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.cell-title {
    font-family: var(--font-slab);
    font-weight: 700;
    color: var(--leaf-light);
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.15;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.005em;
}

.cell-2x2 .cell-title { font-size: clamp(24px, 2.6vw, 36px); }

.cell-body {
    font-family: var(--font-body);
    color: var(--fog);
    opacity: 0.86;
    font-size: 15px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.cell-1x1 .cell-body { font-size: 14px; }

.cell-prompt {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--leaf-light);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.bento-cell:hover .cell-prompt {
    opacity: 0.95;
    transform: translateY(0);
}

/* Organic blob decorations (SVG) */
.blob-decoration {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.blob-svg {
    width: 320px;
    height: 320px;
    fill: var(--leaf-light);
    opacity: 0.07;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
}

.bento-cell:hover .blob-svg {
    opacity: 0.12;
    transform: rotate(8deg) scale(1.05);
}

.blob-1 { right: -40px; bottom: -40px; }
.blob-2 { left: -60px; top: -40px; transform: rotate(20deg); }
.blob-3 { right: -50px; top: -40px; transform: rotate(-15deg); }

.bento-cell:hover .blob-2 {
    transform: rotate(28deg) scale(1.05);
}

.bento-cell:hover .blob-3 {
    transform: rotate(-7deg) scale(1.05);
}

.bento-cell.is-flash {
    animation: cell-flash 0.9s ease-out;
}

@keyframes cell-flash {
    0% { background-color: rgba(134, 239, 172, 0.25); }
    100% { background-color: transparent; }
}

/* ============================================================
   Section 4: Research log
   ============================================================ */

#research-log {
    position: relative;
    padding: 120px 24px 140px;
    background: var(--canopy-deep);
    overflow: hidden;
    border-top: 1px solid rgba(45, 90, 45, 0.5);
}

.log-wrap {
    position: relative;
    z-index: 2;
    max-width: 880px;
    margin: 0 auto;
}

.log-stream {
    margin-top: 20px;
    border-left: 2px solid var(--moss);
    padding-left: 22px;
}

.log-entry {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed rgba(45, 90, 45, 0.5);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--term-green);
    line-height: 1.7;
    flex-wrap: wrap;
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

.log-entry.is-active {
    opacity: 1;
}

.log-entry:last-child { border-bottom: none; }

.log-meta {
    flex: 0 0 auto;
    color: var(--bokeh-amber);
    font-size: 12px;
    letter-spacing: 0.1em;
    min-width: 80px;
}

.log-text {
    flex: 1 1 auto;
    color: var(--fog);
    opacity: 0.92;
    white-space: pre-wrap;
}

.log-caret {
    opacity: 0;
}

.log-entry.is-typing .log-caret {
    opacity: 1;
    animation: blink 1s step-end infinite;
}

/* ============================================================
   Section 5: Session end footer
   ============================================================ */

#session-end {
    position: relative;
    background: var(--canopy-deepest);
    padding: 100px 24px 80px;
    overflow: hidden;
    border-top: 1px solid rgba(45, 90, 45, 0.7);
}

.end-frame {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--term-green);
    line-height: 1.85;
}

.end-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.end-spacer { height: 14px; }

.end-meta {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px dashed rgba(45, 90, 45, 0.55);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--leaf-light);
    opacity: 0.7;
    letter-spacing: 0.04em;
}

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

@media (max-width: 900px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .cell-2x2 { grid-column: span 2; grid-row: span 2; }
    .cell-2x1 { grid-column: span 2; grid-row: span 1; }
    .cell-1x1 { grid-column: span 1; grid-row: span 1; }

    .boot-body { padding: 22px 18px 24px; }
    .console-window { padding: 18px 16px 14px; }
    #terminal-boot { padding-top: 90px; }
}

@media (max-width: 560px) {
    .status-bar { font-size: 11px; padding: 6px 12px; }
    .status-bar .status-path { display: none; }

    .bento-container {
        grid-template-columns: 1fr;
    }
    .cell-2x2, .cell-2x1, .cell-1x1 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .boot-frame-title { display: none; }
    .boot-title { font-size: clamp(26px, 9vw, 44px); }
    .section-eyebrow { font-size: 11px; }
    #console-section, #bento-grid, #research-log { padding: 80px 16px; }
    #session-end { padding: 70px 16px 60px; }

    .log-meta { min-width: auto; }
}
