/* ========================================
   undo.sh — Styles
   Colors: #0d0f12, #1a1d24, #2e333d, #c8cdd6, #6b7280, #4a7cac, #8b7fc7, #38b2ac, #e05252
   Fonts: Cormorant Garamond, IBM Plex Mono, Space Grotesk
======================================== */

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    background: #0d0f12;
    color: #c8cdd6;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ---- Noise Overlay ---- */
.noise-svg {
    position: fixed;
    width: 0;
    height: 0;
}

.noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.04;
    filter: url(#grain);
    animation: grainShift 0.12s steps(1) infinite;
}

@keyframes grainShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2%, 3%); }
    50% { transform: translate(1%, -2%); }
    75% { transform: translate(3%, 1%); }
    100% { transform: translate(-1%, -3%); }
}

/* ---- Floating Annotations ---- */
.floating-annotation {
    position: fixed;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: #6b7280;
    opacity: 0.4;
    z-index: 100;
    pointer-events: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.annotation-1 {
    top: 12vh;
    right: 4vw;
    animation: floatY 7s ease-in-out infinite;
}

.annotation-2 {
    top: 35vh;
    left: 3vw;
    animation: floatY 6s ease-in-out infinite 1s;
}

.annotation-3 {
    bottom: 18vh;
    right: 6vw;
    animation: floatY 8s ease-in-out infinite 0.5s;
}

.annotation-4 {
    bottom: 30vh;
    left: 5vw;
    animation: floatY 6.5s ease-in-out infinite 2s;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ---- Status Bar ---- */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8vh;
    background: rgba(26, 29, 36, 0.7);
    backdrop-filter: blur(8px);
    border-top: 1px solid #2e333d;
    display: flex;
    align-items: center;
    padding: 0 3vw;
    gap: 3vw;
    z-index: 200;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.72rem;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-item {
    white-space: nowrap;
}

.stack-depth {
    color: #8b7fc7;
}

/* ---- Scroll Container & Scenes ---- */
.scroll-container {
    width: 100%;
}

.scene {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: 8vh;
}

/* ---- Panels ---- */
.primary-panel {
    width: 60vw;
    max-width: 800px;
    background: rgba(26, 29, 36, 0.6);
    border: 1px solid #2e333d;
    border-radius: 2px;
    padding: 3.5rem 4rem;
    position: relative;
    transform: translateX(-2.5vw);
    animation: panelFloat 7s ease-in-out infinite;
    backdrop-filter: blur(6px);
}

.panel.blur-in {
    filter: blur(0px);
    opacity: 1;
    transition: filter 0.8s ease-out, opacity 0.8s ease-out;
}

.panel.blur-out {
    filter: blur(12px);
    opacity: 0;
}

@keyframes panelFloat {
    0%, 100% { transform: translateX(-2.5vw) translateY(0); }
    50% { transform: translateX(-2.5vw) translateY(-4px); }
}

/* ---- Typography ---- */
.scene-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 5vw, 5.2rem);
    letter-spacing: 0.04em;
    color: #c8cdd6;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.scene-body {
    color: #c8cdd6;
}

.scene-body p {
    margin-bottom: 1rem;
}

.scene-body p:first-child {
    color: #38b2ac;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.scene-body em {
    color: #8b7fc7;
    font-style: italic;
}

/* ---- Log Lines ---- */
.log-line {
    color: #6b7280;
    font-size: 0.82rem;
}

.log-ts {
    color: #4a7cac;
}

/* ---- Ghost Text ---- */
.ghost-text {
    color: #6b7280;
    opacity: 0.35;
    text-decoration: line-through;
    font-style: italic;
    transition: opacity 2s ease;
}

.ghost-text-2 {
    opacity: 0.2;
}

/* ---- Glitch Line ---- */
.glitch-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e05252;
    opacity: 0;
    animation: glitchFlash 4s ease-in-out infinite;
}

@keyframes glitchFlash {
    0%, 90%, 100% { opacity: 0; }
    92% { opacity: 0.6; }
    94% { opacity: 0; }
    96% { opacity: 0.4; }
}

/* ---- Stack Visual ---- */
.stack-visual {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stack-frame {
    background: rgba(46, 51, 61, 0.5);
    border-left: 2px solid #8b7fc7;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    color: #6b7280;
    transform: translateX(0);
    transition: transform 0.5s ease, border-color 0.5s ease;
}

.stack-frame:hover {
    border-color: #e05252;
    transform: translateX(6px);
    color: #c8cdd6;
}

/* ---- Blinking Cursor ---- */
.blink-cursor {
    color: #38b2ac;
    animation: blink 1s step-end infinite;
    font-size: 1.2rem;
}

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

.final-message {
    color: #6b7280;
}

/* ---- Scene-specific accents ---- */
.scene-1 .primary-panel { border-color: #4a7cac; }
.scene-3 .primary-panel { border-color: #8b7fc7; }
.scene-5 .primary-panel { border-color: #38b2ac; }
.scene-7 .primary-panel { border-color: #e05252; }
