/* mujun.xyz — Victorian-Futuristic Command Console */

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

:root {
    --parchment: #e8dcc8;
    --void: #0a0305;
    --crimson: #8b1a2b;
    --crimson-bright: #d42a4a;
    --deep-wine: #2d1118;
    --gold: #c9a84c;
    --near-black: #1e0a0f;
    --aged-parchment: #d4c4a8;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    color: var(--parchment);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Bokeh Background Layer */
.bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(139, 26, 43, 0.12) 0%, rgba(139, 26, 43, 0.04) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 80% 30%, rgba(139, 26, 43, 0.08) 0%, rgba(139, 26, 43, 0.02) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 45% 60%, rgba(201, 168, 76, 0.06) 0%, rgba(201, 168, 76, 0.02) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 70% 80%, rgba(139, 26, 43, 0.10) 0%, rgba(139, 26, 43, 0.03) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 20% 75%, rgba(201, 168, 76, 0.05) 0%, rgba(201, 168, 76, 0.01) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 90% 10%, rgba(139, 26, 43, 0.07) 0%, transparent 60%) no-repeat,
        radial-gradient(circle at 5% 50%, rgba(212, 42, 74, 0.04) 0%, transparent 50%) no-repeat,
        radial-gradient(circle at 60% 15%, rgba(201, 168, 76, 0.04) 0%, transparent 50%) no-repeat,
        radial-gradient(circle at 35% 90%, rgba(139, 26, 43, 0.09) 0%, rgba(139, 26, 43, 0.02) 40%, transparent 70%) no-repeat,
        radial-gradient(circle at 85% 55%, rgba(201, 168, 76, 0.05) 0%, transparent 60%) no-repeat;
    background-size:
        200px 200px, 150px 150px, 180px 180px, 120px 120px, 160px 160px,
        100px 100px, 80px 80px, 140px 140px, 170px 170px, 90px 90px;
    animation: bokeh-drift 20s ease-in-out infinite alternate;
}

@keyframes bokeh-drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-10px, 5px) scale(1.02); }
    100% { transform: translate(5px, -8px) scale(0.98); }
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(10, 3, 5, 0.03) 2px,
        rgba(10, 3, 5, 0.03) 4px
    );
}

/* Telemetry Sidebar */
.telemetry-sidebar {
    position: fixed;
    right: 2vw;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--gold);
    opacity: 0.7;
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.telemetry-label {
    color: var(--crimson);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
}

.telemetry-value {
    color: var(--gold);
}

.ornament-divider {
    color: var(--crimson);
    text-align: center;
    opacity: 0.5;
}

/* Chambers */
.chamber {
    min-height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
}

.chamber-content {
    grid-column: 2 / 9;
    position: relative;
}

.chamber-content.asymmetric-left {
    grid-column: 2 / 8;
}

.chamber-content.asymmetric-right {
    grid-column: 5 / 11;
}

#chamber-1 .chamber-content {
    grid-column: 3 / 10;
    text-align: center;
}

/* Reticle Frame */
.reticle-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.3;
    animation: reticle-spin 60s linear infinite;
}

.reticle-svg {
    width: 100%;
    height: 100%;
}

@keyframes reticle-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Typography */
.glitch-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--parchment);
    position: relative;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-title::before {
    color: var(--crimson-bright);
    animation: glitch-1 4s infinite;
}

.glitch-title::after {
    color: var(--gold);
    animation: glitch-2 4s infinite;
}

@keyframes glitch-1 {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    91% { opacity: 0.8; transform: translate(-2px, 1px); }
    92% { opacity: 0; }
    95% { opacity: 0.5; transform: translate(1px, -1px); }
    96% { opacity: 0; }
}

@keyframes glitch-2 {
    0%, 88%, 100% { opacity: 0; transform: translate(0); }
    89% { opacity: 0.6; transform: translate(2px, -1px); }
    90% { opacity: 0; }
    93% { opacity: 0.4; transform: translate(-1px, 2px); }
    94% { opacity: 0; }
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    margin-bottom: 3rem;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--aged-parchment);
    max-width: 540px;
    margin-bottom: 2rem;
}

/* Scroll Indicator */
.scroll-indicator {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--crimson);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: pulse-down 2s ease-in-out infinite;
}

.scroll-arrow {
    font-size: 0.8rem;
}

@keyframes pulse-down {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(5px); opacity: 1; }
}

/* Ornate Border */
.ornate-border {
    position: relative;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.ornate-border::before {
    content: '╔══════════════════════════════╗';
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    color: var(--crimson);
    opacity: 0.5;
    letter-spacing: 0;
    margin-bottom: 0.5rem;
}

.ornate-border::after {
    content: '╚══════════════════════════════╝';
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5rem;
    color: var(--crimson);
    opacity: 0.5;
    letter-spacing: 0;
    margin-top: 0.5rem;
}

/* Data Stream */
.data-stream {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0.8;
    padding: 1rem;
    border-left: 1px solid var(--crimson);
}

.stream-line {
    opacity: 0;
    animation: stream-in 0.5s forwards;
}

.stream-line:nth-child(1) { animation-delay: 0.2s; }
.stream-line:nth-child(2) { animation-delay: 0.4s; }
.stream-line:nth-child(3) { animation-delay: 0.6s; }

@keyframes stream-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 0.8; transform: translateX(0); }
}

/* HUD Panel */
.hud-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.5rem;
    border: 1px solid rgba(139, 26, 43, 0.3);
    background: rgba(10, 3, 5, 0.6);
}

.hud-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--parchment);
}

.bar {
    flex: 1;
    height: 4px;
    background: rgba(139, 26, 43, 0.2);
    position: relative;
}

.bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--crimson);
    transition: width 1s ease;
}

.bar-fill-gold {
    background: var(--gold);
}

/* Archive Entries */
.archive-entries {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.archive-entry {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(139, 26, 43, 0.2);
    background: rgba(10, 3, 5, 0.4);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    transition: border-color 0.3s, background 0.3s;
}

.archive-entry:hover {
    border-color: var(--gold);
    background: rgba(45, 17, 24, 0.4);
}

.entry-id {
    color: var(--crimson);
    min-width: 60px;
}

.entry-title {
    color: var(--parchment);
    flex: 1;
}

.entry-status {
    color: var(--gold);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

/* Terminus */
.terminus-sigil {
    width: 150px;
    height: 150px;
    margin: 2rem auto;
    animation: sigil-pulse 4s ease-in-out infinite;
}

.sigil-svg {
    width: 100%;
    height: 100%;
}

@keyframes sigil-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.terminus-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--crimson);
    text-align: center;
    opacity: 0.6;
}

#chamber-5 .chamber-content {
    grid-column: 3 / 10;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .telemetry-sidebar {
        display: none;
    }

    .chamber-content,
    .chamber-content.asymmetric-left,
    .chamber-content.asymmetric-right,
    #chamber-1 .chamber-content,
    #chamber-5 .chamber-content {
        grid-column: 1 / -1;
        padding: 0 1rem;
    }

    .reticle-frame {
        width: 250px;
        height: 250px;
    }
}
