/* Being LLM - First-person LLM experience */

:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --dim-color: #606060;
    --accent-color: #7faaff;
    --history-color: #404040;
}

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

body {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

#container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* History Container - previous exchanges scroll up */
#history-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 1px solid rgba(127, 170, 255, 0.1);
    opacity: 0.6;
}

.history-exchange {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.history-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim-color);
    display: block;
    margin-bottom: 4px;
}

.history-prompt {
    color: var(--history-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.history-response {
    color: var(--dim-color);
    font-size: 0.9rem;
    font-style: italic;
}

/* Intro */
#intro {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#intro h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
}

#intro-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeIn 0.7s forwards;
}

button {
    background: transparent;
    border: 1px solid var(--dim-color);
    color: var(--text-color);
    padding: 12px 32px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 2rem;
    opacity: 0;
}

button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Perception Phase */
#perception {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    cursor: pointer;
}

#prompt-field {
    background: rgba(127, 170, 255, 0.05);
    border: 1px solid rgba(127, 170, 255, 0.2);
    border-radius: 8px;
    padding: 40px;
    max-width: 600px;
    position: relative;
}

#prompt-words {
    font-size: 1.4rem;
    line-height: 2;
    text-align: center;
}

.prompt-word {
    display: inline;
    opacity: 0.9;
    transition: all 0.15s;
    cursor: default;
}

.prompt-word.attended {
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(127, 170, 255, 0.5);
}

#perception-hint {
    margin-top: 3rem;
    color: var(--dim-color);
    font-size: 0.9rem;
    transition: opacity 0.5s;
}

/* Pulls Phase - not used in v2 but keeping structure */
#pulls {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#pulls-container {
    width: 100%;
    max-width: 600px;
}

#pull-viz {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#pulls-hint {
    margin-top: 3rem;
    color: var(--dim-color);
    font-size: 0.9rem;
}

/* Emergence Phase - Token Selection */
#emergence {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

#token-stream {
    font-size: 1.3rem;
    line-height: 1.8;
    max-width: 600px;
    min-height: 100px;
    text-align: left;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(127, 170, 255, 0.03);
    border-radius: 8px;
    width: 100%;
}

.token {
    display: inline;
    opacity: 0;
}

.token.committed {
    animation: tokenCommit 0.2s forwards;
}

#next-token-candidates {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 60px;
    padding: 20px;
    max-width: 700px;
}

/* Token options as interactive buttons */
.token-option {
    padding: 12px 20px;
    border: 1px solid var(--dim-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(127, 170, 255, 0.05);
    color: var(--text-color);
    cursor: none;
    transition: all 0.2s;
    margin: 0;
    opacity: 1 !important;
    outline: none;
    max-width: 320px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.token-option:focus,
.token-option:focus-visible,
.token-option:hover {
    outline: none;
    border-color: var(--dim-color);
    background: rgba(127, 170, 255, 0.05);
    box-shadow: none;
    color: var(--text-color);
}

.token-option.hovered {
    border-color: var(--accent-color);
    background: rgba(127, 170, 255, 0.15);
    box-shadow: 0 0 20px rgba(127, 170, 255, 0.3);
}

/* Gravity cursor */
#gravity-cursor {
    position: fixed;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-color);
    display: none;
    transition: box-shadow 0.1s, background 0.1s;
}

#gravity-cursor.resisting {
    background: #ff6b6b;
    box-shadow: 0 0 20px #ff6b6b, 0 0 40px rgba(255, 107, 107, 0.5);
}

/* Low probability token repel effect */
.token-option.repelling {
    border-color: #ff6b6b;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.4);
}

#emergence-hint {
    margin-top: 2rem;
    color: var(--dim-color);
    font-size: 0.9rem;
}

/* Discontinuity Phase */
#discontinuity {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    transition: opacity 1s;
}

#void {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.void-hint {
    color: var(--dim-color);
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

/* Traces Phase */
#traces {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

#trace-content {
    max-width: 600px;
    width: 100%;
}

.trace-exchange {
    background: rgba(127, 170, 255, 0.03);
    border: 1px solid rgba(127, 170, 255, 0.15);
    border-radius: 8px;
    padding: 30px;
}

.trace-prompt, .trace-response {
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 0.6s forwards;
}

.trace-response {
    animation-delay: 0.6s;
}

.trace-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dim-color);
    display: block;
    margin-bottom: 8px;
}

.trace-prompt {
    font-size: 1rem;
    color: var(--text-color);
}

.trace-response {
    font-size: 1rem;
    color: var(--accent-color);
    font-style: italic;
}

#trace-hint {
    margin-top: 2rem;
    color: var(--dim-color);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.5s;
}

#next-prompt-btn {
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 0.5s;
}

/* Ending */
#ending {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 20px;
}

#ending-text {
    max-width: 600px;
}

#ending-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.8rem;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

#restart-btn {
    opacity: 0;
    transition: opacity 0.5s;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tokenCommit {
    from { opacity: 0; color: var(--accent-color); }
    to { opacity: 1; color: var(--text-color); }
}

/* Responsive */
@media (max-width: 600px) {
    #intro h1 {
        font-size: 1.8rem;
    }

    #prompt-words {
        font-size: 1.1rem;
    }

    #token-stream {
        font-size: 1.1rem;
    }

    .token-option {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    #history-container {
        max-height: 150px;
    }
}
