/* ============================================
   PARALLENGINE.COM — Retro-Futuristic Candlelit Bento
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #B0A080;
    background: #0C0804;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Abstract Shape Background --- */
#abstract-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.abstract-shape {
    position: absolute;
    fill: #8A7040;
    opacity: 0.08;
}

.shape-1 {
    width: 500px;
    height: 500px;
    top: -100px;
    left: -120px;
    animation: shapeFloat1 20s ease-in-out infinite;
}

.shape-2 {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -150px;
    animation: shapeFloat2 25s ease-in-out infinite;
}

.shape-3 {
    width: 400px;
    height: 400px;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    animation: shapeFloat3 18s ease-in-out infinite;
}

.shape-4 {
    width: 350px;
    height: 350px;
    top: 20%;
    right: 10%;
    animation: shapeFloat4 22s ease-in-out infinite;
}

@keyframes shapeFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, 20px) rotate(3deg); }
}

@keyframes shapeFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-25px, -15px) rotate(-2deg); }
}

@keyframes shapeFloat3 {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-48%, -52%) rotate(2deg); }
}

@keyframes shapeFloat4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 15px) rotate(-3deg); }
}

/* --- Candle Flicker Overlay --- */
#candle-flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 30%, rgba(200,160,80,0.08), transparent 60%);
    animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
    0%, 100% { opacity: 0.06; }
    30% { opacity: 0.1; }
    50% { opacity: 0.07; }
    70% { opacity: 0.1; }
    85% { opacity: 0.06; }
}

/* --- Bento Container --- */
#bento-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 2px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* --- Bento Cell Base --- */
.bento-cell {
    background: #1C1408;
    border: 1px solid #5A4830;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: background 400ms ease;
}

.bento-cell:hover {
    background: #211a0c;
}

.cell-content {
    padding: 28px 32px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Cell Grid Placement --- */
.cell-hero {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.cell-vision {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
    min-height: 185px;
}

.cell-systems {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
    min-height: 185px;
}

.cell-process {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

.cell-spectrum {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    min-height: 200px;
}

.cell-threads {
    grid-column: 2 / 4;
    grid-row: 3 / 4;
}

.cell-philosophy {
    grid-column: 4 / 5;
    grid-row: 3 / 5;
}

.cell-metrics {
    grid-column: 1 / 3;
    grid-row: 4 / 5;
    min-height: 160px;
}

.cell-quote {
    grid-column: 3 / 4;
    grid-row: 4 / 5;
}

.cell-signal {
    grid-column: 1 / 3;
    grid-row: 5 / 6;
    min-height: 180px;
}

.cell-footer {
    grid-column: 3 / 5;
    grid-row: 5 / 6;
    display: flex;
    align-items: center;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Caveat', cursive;
    color: #E0D0A8;
    font-weight: 700;
}

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

h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin-bottom: 14px;
    font-weight: 400;
}

p {
    color: #B0A080;
}

.bento-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    color: #8A7040;
    margin-bottom: 16px;
    letter-spacing: 0.04em;
    text-transform: none;
}

/* --- Hero Cell --- */
.cell-hero .cell-content {
    text-align: center;
}

.hero-title {
    position: relative;
    display: inline-block;
    text-shadow: 0 0 40px rgba(224, 208, 168, 0.2), 0 0 80px rgba(200, 160, 80, 0.08);
}

.hero-title::after {
    content: '.com';
    font-size: 0.45em;
    color: #8A7040;
    vertical-align: super;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    color: #B0A080;
    margin-top: 12px;
    opacity: 0.85;
}

/* --- Architecture Diagram --- */
.architecture-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 0;
}

.arch-layer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arch-node {
    width: 10px;
    height: 10px;
    border: 1px solid #5A4830;
    border-radius: 50%;
    background: transparent;
    transition: background 600ms ease, border-color 600ms ease;
}

.arch-node.active {
    background: #8A7040;
    border-color: #C0B088;
    box-shadow: 0 0 8px rgba(138, 112, 64, 0.4);
}

.arch-line {
    width: 24px;
    height: 1px;
    background: #5A4830;
}

/* --- Process Steps --- */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 300ms ease;
}

.step:hover {
    transform: translateX(4px);
}

.step-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #8A7040;
    width: 26px;
    height: 26px;
    border: 1px solid #5A4830;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 300ms ease, color 300ms ease;
}

.step:hover .step-num {
    border-color: #8A7040;
    color: #C0B088;
}

.step-text {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: #E0D0A8;
}

/* --- Spectrum Bars --- */
.spectrum-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 130px;
    padding-top: 10px;
}

.spectrum-bar {
    flex: 1;
    height: var(--bar-height, 50%);
    background: linear-gradient(to top, #5A4830, #8A7040, #C0B088);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    animation: spectrumPulse 2.5s ease-in-out infinite;
    opacity: 0.8;
    transition: opacity 300ms ease;
}

.cell-spectrum:hover .spectrum-bar {
    opacity: 1;
}

.spectrum-bar:nth-child(2n) {
    animation-delay: 0.3s;
}

.spectrum-bar:nth-child(3n) {
    animation-delay: 0.7s;
}

.spectrum-bar:nth-child(4n+1) {
    animation-delay: 1.1s;
}

@keyframes spectrumPulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.7); }
}

/* --- Thread List --- */
.thread-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.thread-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid #5A4830;
    border-radius: 3px;
    background: rgba(12, 8, 4, 0.5);
    transition: border-color 300ms ease, background 300ms ease;
}

.thread-item:hover {
    border-color: #8A7040;
    background: rgba(28, 20, 8, 0.8);
}

.thread-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #B0A080;
}

.thread-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 10px;
}

.thread-status.active {
    color: #E0D0A8;
    background: rgba(138, 112, 64, 0.3);
    border: 1px solid #8A7040;
    animation: statusGlow 3s ease-in-out infinite;
}

.thread-status.idle {
    color: #5A4830;
    background: rgba(90, 72, 48, 0.15);
    border: 1px solid #5A4830;
}

@keyframes statusGlow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 6px rgba(138, 112, 64, 0.3); }
}

/* --- Metrics --- */
.cell-metrics .cell-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: #E0D0A8;
    font-weight: 400;
}

.metric-unit {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #8A7040;
    margin-top: 4px;
    letter-spacing: 0.03em;
}

/* --- Quote --- */
blockquote {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #E0D0A8;
    line-height: 1.6;
    font-weight: 400;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #5A4830;
}

/* --- Signal Input --- */
.signal-input-wrap {
    margin-top: 18px;
    position: relative;
}

.signal-input {
    width: 100%;
    background: rgba(12, 8, 4, 0.6);
    border: 1px solid #5A4830;
    border-radius: 4px;
    padding: 12px 18px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #E0D0A8;
    outline: none;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.signal-input::placeholder {
    color: #5A4830;
}

.signal-input:focus {
    border-color: #8A7040;
    box-shadow: 0 0 20px rgba(138, 112, 64, 0.15);
}

.signal-pulse {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #8A7040;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: signalBlink 2s ease-in-out infinite;
}

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

/* Signal sent animation */
.signal-input-wrap.signal-sent .signal-pulse {
    animation: signalSend 0.6s ease-out forwards;
}

@keyframes signalSend {
    0% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(3); opacity: 0.6; }
    100% { transform: translateY(-50%) scale(1); opacity: 0.3; }
}

/* --- Footer --- */
.footer-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #5A4830;
}

/* --- Chrome Accents --- */
.bento-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C0B088, transparent);
    opacity: 0;
    transition: opacity 600ms ease;
    z-index: 1;
}

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

/* Retro chrome corner detail on hero */
.cell-hero::after {
    content: '';
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-right: 1px solid #C0B088;
    border-bottom: 1px solid #C0B088;
    opacity: 0.3;
}

/* Chrome corner on philosophy cell */
.cell-philosophy::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 16px;
    height: 16px;
    border-left: 1px solid #C0B088;
    border-top: 1px solid #C0B088;
    opacity: 0.2;
}

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

    .cell-hero {
        grid-column: 1 / 3;
        grid-row: auto;
        min-height: 300px;
    }

    .cell-vision {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .cell-systems {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-process {
        grid-column: 2 / 3;
        grid-row: auto;
    }

    .cell-spectrum {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .cell-threads {
        grid-column: 2 / 3;
        grid-row: auto;
    }

    .cell-philosophy {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .cell-metrics {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .cell-quote {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .cell-signal {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    .cell-footer {
        grid-column: 1 / 3;
        grid-row: auto;
    }
}

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

    .cell-hero,
    .cell-vision,
    .cell-systems,
    .cell-process,
    .cell-spectrum,
    .cell-threads,
    .cell-philosophy,
    .cell-metrics,
    .cell-quote,
    .cell-signal,
    .cell-footer {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .cell-hero {
        min-height: 260px;
    }

    .cell-metrics .cell-content {
        flex-direction: column;
        gap: 20px;
    }
}
