/* miris.quest - Terminal Romanticism */
/* Colors: #061520, #0a1e30, #1a5276, #c8dbe6, #d9a85f, #2ecc71, #1abc9c, #5d7b8f */
/* Fonts: Libre Baskerville, IBM Plex Mono, Cormorant Garamond */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #061520;
    color: #c8dbe6;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== DEEP LAYER: Aurora Background ===== */

.aurora-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-gradient {
    position: absolute;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    mix-blend-mode: screen;
}

.aurora-gradient-1 {
    background: radial-gradient(ellipse at 30% 20%, rgba(46, 204, 113, 0.08), transparent 60%);
    animation: aurora1 30s ease-in-out infinite;
}

.aurora-gradient-2 {
    background: radial-gradient(ellipse at 70% 60%, rgba(26, 188, 156, 0.06), transparent 55%);
    animation: aurora2 30s ease-in-out infinite;
}

.aurora-gradient-3 {
    background: radial-gradient(ellipse at 50% 40%, rgba(26, 82, 118, 0.10), transparent 50%);
    animation: aurora3 30s ease-in-out infinite;
}

@keyframes aurora1 {
    0%   { transform: translate(0%, 0%) scale(1); opacity: 0.8; }
    33%  { transform: translate(10%, -15%) scale(1.2); opacity: 1; }
    66%  { transform: translate(-5%, 10%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(0%, 0%) scale(1); opacity: 0.8; }
}

@keyframes aurora2 {
    0%   { transform: translate(0%, 0%) scale(1); opacity: 0.7; }
    33%  { transform: translate(-15%, 10%) scale(1.1); opacity: 1; }
    66%  { transform: translate(10%, -5%) scale(1.3); opacity: 0.5; }
    100% { transform: translate(0%, 0%) scale(1); opacity: 0.7; }
}

@keyframes aurora3 {
    0%   { transform: translate(0%, 0%) scale(1.1); opacity: 0.9; }
    33%  { transform: translate(5%, 15%) scale(0.8); opacity: 0.6; }
    66%  { transform: translate(-10%, -10%) scale(1.2); opacity: 1; }
    100% { transform: translate(0%, 0%) scale(1.1); opacity: 0.9; }
}

/* ===== BOKEH PARTICLES ===== */

.bokeh-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 168, 95, 0.15), transparent 70%);
    animation: bokeh-pulse 10s ease-in-out infinite;
}

.bokeh-1  { width: 180px; height: 180px; top: 8%; left: 5%; animation-delay: 0s; animation-duration: 12s; }
.bokeh-2  { width: 60px;  height: 60px;  top: 25%; left: 80%; animation-delay: -2s; animation-duration: 9s; }
.bokeh-3  { width: 140px; height: 140px; top: 55%; left: 15%; animation-delay: -4s; animation-duration: 14s; }
.bokeh-4  { width: 90px;  height: 90px;  top: 70%; left: 70%; animation-delay: -1s; animation-duration: 11s; }
.bokeh-5  { width: 200px; height: 200px; top: 15%; left: 45%; animation-delay: -6s; animation-duration: 15s; }
.bokeh-6  { width: 50px;  height: 50px;  top: 85%; left: 30%; animation-delay: -3s; animation-duration: 8s; }
.bokeh-7  { width: 120px; height: 120px; top: 40%; left: 90%; animation-delay: -5s; animation-duration: 13s; }
.bokeh-8  { width: 70px;  height: 70px;  top: 60%; left: 50%; animation-delay: -7s; animation-duration: 10s; }
.bokeh-9  { width: 160px; height: 160px; top: 5%; left: 65%; animation-delay: -8s; animation-duration: 12s; }
.bokeh-10 { width: 40px;  height: 40px;  top: 90%; left: 85%; animation-delay: -2.5s; animation-duration: 9s; }
.bokeh-11 { width: 100px; height: 100px; top: 35%; left: 25%; animation-delay: -4.5s; animation-duration: 11s; }
.bokeh-12 { width: 80px;  height: 80px;  top: 75%; left: 55%; animation-delay: -6.5s; animation-duration: 14s; }

@keyframes bokeh-pulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.15); }
}

/* ===== CRT SCAN LINES ===== */

.crt-scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 999;
}

/* ===== SIDEBAR TERMINAL ===== */

.sidebar-terminal {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(10, 30, 48, 0.92);
    border-right: 1px solid #1a5276;
    box-shadow: inset 0 0 80px rgba(10, 40, 60, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 16px;
    border-bottom: 1px solid #1a5276;
    margin-bottom: 16px;
}

.terminal-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    color: #d9a85f;
    text-shadow: 0 0 12px rgba(217, 168, 95, 0.4);
}

.terminal-version {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: #5d7b8f;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
    line-height: 1.6;
    color: #5d7b8f;
    padding: 8px 0;
    scrollbar-width: none;
}

.terminal-output::-webkit-scrollbar {
    display: none;
}

.terminal-output .term-line {
    margin-bottom: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-output .term-line.visible {
    opacity: 1;
}

.terminal-output .term-line.highlight {
    color: #d9a85f;
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.3);
}

.terminal-output .term-line.success {
    color: #2ecc71;
}

.terminal-nav {
    padding: 16px 0;
    border-top: 1px solid #1a5276;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.terminal-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: #d9a85f;
    text-decoration: none;
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.3);
    transition: text-shadow 0.2s ease, color 0.2s ease;
    display: block;
}

.terminal-link:hover {
    color: #c8dbe6;
    text-shadow: 0 0 16px rgba(200, 219, 230, 0.4);
}

.terminal-cursor-line {
    padding-top: 16px;
    border-top: 1px solid #1a5276;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: #d9a85f;
}

.terminal-prompt {
    margin-right: 8px;
}

.terminal-cursor {
    animation: cursor-blink 1.2s steps(1) infinite;
    text-shadow: 0 0 12px rgba(217, 168, 95, 0.5);
}

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

/* ===== MOBILE TOGGLE ===== */

.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(10, 30, 48, 0.95);
    border: 1px solid #1a5276;
    color: #d9a85f;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    padding: 8px 16px;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.3);
}

/* ===== LETTER PANE ===== */

.letter-pane {
    margin-left: 280px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    background: rgba(8, 22, 36, 0.92);
    border-left: 1px solid #1a5276;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.4);
    padding: 10vh 0;
}

/* ===== TRANSMISSIONS ===== */

.transmission {
    max-width: 68ch;
    margin: 0 auto;
    padding: 6vh 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.transmission.revealed {
    opacity: 1;
}

.transmission-header {
    margin-bottom: 3vh;
}

.transmission-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    color: #5d7b8f;
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.transmission-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 3.5vw, 3.2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c8dbe6;
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.3);
    line-height: 1.2;
}

.transmission-body p {
    margin-bottom: 1.5em;
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.15);
}

.transmission-body .char-span {
    opacity: 0;
    transition: opacity 0.15s ease, text-shadow 0.15s ease;
}

.transmission-body .char-span.typed {
    opacity: 1;
    text-shadow: 0 0 12px rgba(217, 168, 95, 0.4);
}

.transmission-body .char-span.settled {
    text-shadow: 0 0 8px rgba(217, 168, 95, 0.15);
}

.transmission-end {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    color: #5d7b8f;
    margin-top: 2em;
    letter-spacing: 0.03em;
}

/* ===== ASCII DIVIDERS ===== */

.ascii-divider {
    text-align: center;
    padding: 4vh 0;
}

.ascii-divider pre {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.9rem;
    color: #1a5276;
    letter-spacing: 0.1em;
    display: inline;
}

/* ===== FOOTER ===== */

.letter-pane-footer {
    max-width: 68ch;
    margin: 8vh auto 0;
    padding: 0 24px;
}

.footer-ascii {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    color: #5d7b8f;
    line-height: 1.6;
    text-align: center;
}

/* ===== RESPONSIVE: MOBILE ===== */

@media (max-width: 768px) {
    .sidebar-terminal {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 50vh;
        transform: translateY(100%);
        transition: transform 0.4s ease;
        border-right: none;
        border-top: 1px solid #1a5276;
        z-index: 100;
        padding: 16px 20px;
    }

    .sidebar-terminal.open {
        transform: translateY(0);
    }

    .mobile-toggle {
        display: block;
    }

    .letter-pane {
        margin-left: 0;
    }

    .crt-scanlines {
        background: repeating-linear-gradient(
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.08) 3px,
            rgba(0, 0, 0, 0.08) 6px
        );
    }

    .transmission {
        padding: 4vh 20px;
    }

    .transmission-title {
        letter-spacing: 0.04em;
    }
}

/* ===== SELECTION ===== */

::selection {
    background: rgba(217, 168, 95, 0.3);
    color: #c8dbe6;
}
