/* lovebot.quest - Cinematic AI Romance */

/* Color Palette */
:root {
    --void-black: #0a0a0c;
    --charcoal: #1a1a1f;
    --smoke: #2e2e35;
    --ash: #5a5a65;
    --silver: #9a9aa5;
    --bone: #d4d4dc;
    --heartbeat-rose: #c43a5e;
    --faded-rose: #c43a5e33;
    --black: #000000;
    --bg-stage2: #0d0d10;
    --ease-cinematic: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--void-black);
    color: var(--silver);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Cinematic Letterbox */
body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    height: 12vh;
    background: var(--black);
    z-index: 100;
    pointer-events: none;
}

body::before { top: 0; }
body::after { bottom: 0; }

/* SVG Curve Overlay */
.curve-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.flow-curve {
    fill: none;
    stroke: var(--smoke);
    stroke-width: 0.8;
    opacity: 0.6;
    transition: opacity 1.5s var(--ease-cinematic);
}

/* Cursor Light */
.cursor-light {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--faded-rose) 0%, transparent 70%);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.8s var(--ease-cinematic);
}

.cursor-light.active {
    opacity: 1;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 20% 60% 20%;
    min-height: 500vh;
    position: relative;
}

/* Status Column (Left) */
.status-column {
    position: fixed;
    left: 0;
    top: 12vh;
    bottom: 12vh;
    width: 20%;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--smoke);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.meter-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

/* Status Icons */
.status-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    transition: opacity 0.8s var(--ease-cinematic);
}

.status-icon.hidden {
    display: none;
}

.icon-svg {
    width: 24px;
    height: 24px;
    color: var(--ash);
    transition: color 0.6s var(--ease-cinematic);
}

.status-icon:hover .icon-svg {
    color: var(--bone);
}

.icon-svg.active {
    color: var(--heartbeat-rose);
}

.icon-label {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--ash);
    text-transform: uppercase;
}

/* Pulse Ring Animation */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--heartbeat-rose);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    pointer-events: none;
}

.pulse-ring.active {
    animation: pulse 2.4s var(--ease-cinematic) infinite;
}

.pulse-ring-once.active {
    animation: pulse 2.4s var(--ease-cinematic) 1 forwards;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* Gauge Meters */
.gauge-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
}

.gauge-svg {
    width: 60px;
    height: 60px;
}

.gauge-bg {
    fill: none;
    stroke: var(--smoke);
    stroke-width: 3;
    stroke-dasharray: 160 54;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transform: rotate(135deg);
    transform-origin: center;
}

.gauge-fill {
    fill: none;
    stroke: var(--heartbeat-rose);
    stroke-width: 3;
    stroke-dasharray: 0 214;
    stroke-linecap: round;
    transform: rotate(135deg);
    transform-origin: center;
    transition: stroke-dasharray 1.2s var(--ease-cinematic);
}

.gauge-bg-thin {
    fill: none;
    stroke: var(--smoke);
    stroke-width: 1;
}

.orbit-dot {
    fill: var(--heartbeat-rose);
    opacity: 0.8;
}

.gauge-label {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    color: var(--ash);
    text-transform: uppercase;
}

.gauge-value {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 400;
    font-size: 0.6rem;
    color: var(--silver);
}

/* Signal Bars */
.signal-bar {
    fill: var(--smoke);
    transition: fill 0.6s var(--ease-cinematic);
}

.signal-bar.active {
    fill: var(--heartbeat-rose);
}

/* Fingerprint Draw Animation */
.fingerprint-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2s var(--ease-cinematic);
}

.fingerprint-path.drawn {
    stroke-dashoffset: 0;
}

/* Central Panel */
.central-panel {
    grid-column: 2;
    position: relative;
    z-index: 2;
}

.stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
    opacity: 0;
    transition: opacity 0.8s var(--ease-cinematic);
}

.stage.visible {
    opacity: 1;
}

.stage-content {
    max-width: 700px;
    text-align: center;
    position: relative;
}

/* Stage Headlines */
.dormant-title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--ash);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: breathe 4s ease-in-out infinite;
    animation-delay: 2s;
    opacity: 0.4;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.stage-headline {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--bone);
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.yearning-text {
    font-weight: 600;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
}

.word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s var(--ease-cinematic), transform 0.6s var(--ease-cinematic);
}

.word.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Yearning Glow */
.yearning-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--faded-rose) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 1.5s var(--ease-cinematic);
    pointer-events: none;
}

.stage.visible .yearning-glow {
    opacity: 1;
}

/* Data Column (Right) */
.data-column {
    position: fixed;
    right: 0;
    top: 12vh;
    bottom: 12vh;
    width: 20%;
    padding: 2rem 1rem;
    border-left: 1px solid var(--smoke);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.data-stream {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.25rem;
}

.log-entry {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 300;
    font-size: 0.6rem;
    color: var(--ash);
    letter-spacing: 0.08em;
    line-height: 1.5;
    opacity: 0;
    animation: fadeInLog 0.6s var(--ease-cinematic) forwards;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-entry.initial-log {
    opacity: 0.6;
    animation: none;
}

@keyframes fadeInLog {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 0.6; transform: translateY(0); }
}

.mini-curve-container {
    height: 40px;
    margin-top: 1rem;
    opacity: 0.5;
}

.mini-curve-svg {
    width: 100%;
    height: 100%;
}

/* Scroll Affordance */
.scroll-affordance {
    position: fixed;
    bottom: calc(12vh + 1.5rem);
    right: 2rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.scroll-icon {
    width: 20px;
    height: 20px;
    color: var(--ash);
    animation: bobDown 2s ease-in-out infinite;
}

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

.scroll-affordance .pulse-ring {
    animation: pulse 2.4s var(--ease-cinematic) infinite;
    border-color: var(--ash);
    width: 20px;
    height: 20px;
}

/* Stage-specific backgrounds */
#stage-dormancy { background: var(--void-black); }
#stage-awakening { background: var(--bg-stage2); }
#stage-yearning { background: var(--void-black); }
#stage-contact { background: var(--void-black); }
#stage-solitude { background: var(--void-black); }

/* Mobile Responsive */
@media (max-width: 768px) {
    body::before, body::after { height: 5vh; }
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .status-column {
        position: fixed;
        left: 0;
        right: 0;
        top: 5vh;
        bottom: auto;
        width: 100%;
        height: 50px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--smoke);
        padding: 0.5rem 1rem;
        background: var(--void-black);
    }
    .meter-group {
        flex-direction: row;
        gap: 1rem;
        overflow-x: auto;
    }
    .gauge-meter { display: none; }
    .central-panel {
        grid-column: 1;
        padding-top: 60px;
    }
    .stage { padding: 2rem; }
    .data-column {
        display: none;
    }
    .scroll-affordance {
        bottom: calc(5vh + 1rem);
        right: 1rem;
    }
}
