/* ============================================
   miris.xyz - Terminal Alleyway
   Translucent-Frost Palette | Horizontal Scroll
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --terminal-black: #0a0e14;
    --midnight-concrete: #161b22;
    --frost-mist: #b4d2e6;
    --cursor-amber: #d4a056;
    --rain-glass: rgba(180, 210, 230, 0.12);
    --signal-green: #4a9e7a;
    --deep-frost: #1e2a38;
    --warm-cathode: #8b5e3c;
    --neon-leak: #5b7fa6;

    --font-primary: 'IBM Plex Mono', monospace;
    --font-secondary: 'Source Sans 3', sans-serif;
    --font-accent: 'Space Mono', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    height: 100%;
}

body {
    background: var(--terminal-black);
    color: var(--frost-mist);
    font-family: var(--font-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    cursor: default;
}

/* --- Horizontal Scroll Container --- */
#scroll-container {
    display: flex;
    flex-direction: row;
    width: max-content;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Panels --- */
.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    background: rgba(10, 14, 20, 0.95);
}

.panel-wide {
    width: 200vw;
    scroll-snap-align: start;
}

.panel-content {
    width: 100%;
    height: 100%;
    padding: 16px;
    position: relative;
}

/* --- Panel Dividers --- */
.panel-divider {
    width: 1px;
    height: 100vh;
    flex-shrink: 0;
    background: rgba(180, 210, 230, 0.08);
}

/* --- Progress Bar --- */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#progress-track {
    position: absolute;
    bottom: 9px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--deep-frost);
}

#progress-fill {
    position: absolute;
    bottom: 9px;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--cursor-amber);
    transition: width 0.3s ease-out;
}

.progress-marker {
    position: absolute;
    bottom: 4px;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--frost-mist);
    opacity: 0.4;
    transition: color 0.3s ease-out, opacity 0.3s ease-out;
    transform: translateX(-50%);
}

.progress-marker.active {
    color: var(--cursor-amber);
    opacity: 1;
    animation: marker-pulse 2s ease-in-out infinite;
}

@keyframes marker-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ============================================
   PANEL 1: BOOT PANEL
   ============================================ */
#boot-panel {
    background: var(--terminal-black);
}

#boot-panel .panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#terminal-output {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--frost-mist);
    white-space: pre-wrap;
    min-height: 120px;
}

#terminal-output .boot-line {
    display: block;
    opacity: 0;
    animation: line-appear 0.1s forwards;
}

#terminal-output .boot-label {
    color: var(--signal-green);
}

#terminal-output .boot-ok {
    color: var(--cursor-amber);
}

@keyframes line-appear {
    to { opacity: 1; }
}

#ascii-logo {
    font-family: var(--font-primary);
    font-size: clamp(0.6rem, 1.2vw, 0.9rem);
    line-height: 1.2;
    color: var(--cursor-amber);
    white-space: pre;
    margin-top: 20px;
    min-height: 100px;
}

#ascii-logo .logo-line {
    display: block;
    opacity: 0;
    animation: line-appear 0.1s forwards;
}

#boot-prompt {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--frost-mist);
    margin-top: 20px;
    min-height: 30px;
}

#boot-prompt .prompt-green {
    color: var(--signal-green);
}

.cursor-blink {
    color: var(--cursor-amber);
    animation: cursor-blink-anim 1.06s step-end infinite;
}

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

/* Scroll hint */
.scroll-hint {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.scroll-hint.visible {
    opacity: 1;
}

.scroll-hint .chevron {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--frost-mist);
    animation: chevron-pulse 2s ease-in-out infinite;
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

/* ============================================
   PANEL 2: PROJECTS TERMINAL
   ============================================ */
#projects-panel {
    background: rgba(10, 14, 20, 0.95);
}

#projects-panel .panel-content {
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    margin-bottom: 30px;
}

.prompt-char {
    color: var(--signal-green);
    margin-right: 8px;
}

.terminal-command {
    color: var(--frost-mist);
}

.terminal-table-header {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cursor-amber);
    opacity: 0.6;
    display: flex;
    gap: 0;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(180, 210, 230, 0.12);
    margin-bottom: 8px;
}

.col-perm { width: 160px; flex-shrink: 0; }
.col-size { width: 100px; flex-shrink: 0; }
.col-date { width: 140px; flex-shrink: 0; }
.col-name { flex: 1; }

#project-listing {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-row {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    display: flex;
    gap: 0;
    padding: 12px 16px;
    position: relative;
    cursor: default;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease-out, background 0.3s ease-out;
    transform-style: preserve-3d;
    border-radius: 2px;
}

.project-row .col-perm {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--cursor-amber);
    opacity: 0.6;
    display: flex;
    align-items: center;
}

.project-row .col-size,
.project-row .col-date {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--frost-mist);
    opacity: 0.6;
    display: flex;
    align-items: center;
}

.file-name {
    color: var(--frost-mist);
    transition: color 0.3s ease-out;
}

.project-row:hover {
    background: rgba(30, 42, 56, 0.3);
}

.project-row:hover .file-name {
    color: var(--cursor-amber);
}

/* Project Tooltips */
.project-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 20px);
    transform: translateY(-50%);
    width: 320px;
    background: rgba(30, 42, 56, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 210, 230, 0.12);
    border-radius: 4px;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out, border-color 0.3s ease-out;
    z-index: 10;
}

.project-row:hover .project-tooltip {
    opacity: 1;
}

.tooltip-sketch {
    width: 100%;
    height: 80px;
    margin-bottom: 12px;
}

.tooltip-illustration {
    width: 100%;
    height: 100%;
}

.tooltip-text {
    font-family: var(--font-secondary);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 0.01em;
    color: var(--frost-mist);
    opacity: 0.85;
}

/* ============================================
   PANEL 3: CITY WINDOW
   ============================================ */
#city-panel {
    background: var(--terminal-black);
    overflow: hidden;
}

#city-panel .panel-content {
    padding: 0;
    position: relative;
}

.city-perspective {
    perspective: 1200px;
}

#city-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Building window cursors */
.window-cursor {
    font-family: var(--font-primary);
    font-size: 6px;
    fill: var(--frost-mist);
    opacity: 0;
}

.window-cursor.blink {
    animation: window-blink var(--blink-duration, 1.5s) step-end infinite;
    animation-delay: var(--blink-delay, 0s);
}

@keyframes window-blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0; }
}

/* Rain animation */
.rain-drop {
    stroke: var(--frost-mist);
    stroke-width: 0.8;
    opacity: var(--rain-opacity, 0.15);
    animation: rain-fall var(--rain-duration, 1.2s) linear infinite;
    animation-delay: var(--rain-delay, 0s);
}

.rain-drop.blur-drop {
    filter: blur(0.5px);
}

@keyframes rain-fall {
    from { transform: translateY(-40px); }
    to { transform: translateY(850px); }
}

/* Frost-glass philosophy panels */
.frost-panel {
    position: absolute;
    z-index: 10;
    width: clamp(280px, 30vw, 420px);
    padding: 24px 28px;
    background: rgba(30, 42, 56, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 210, 230, 0.12);
    border-radius: 4px;
    transition: background 0.3s ease-out, backdrop-filter 0.3s ease-out, border-color 0.3s ease-out, transform 0.15s ease-out, box-shadow 0.3s ease-out;
    transform-style: preserve-3d;
}

.frost-panel:hover {
    background: rgba(30, 42, 56, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(212, 160, 86, 0.3);
}

.philosophy-text {
    font-family: var(--font-secondary);
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 0.01em;
    color: var(--frost-mist);
    opacity: 0.85;
    transition: opacity 0.3s ease-out;
}

.frost-panel:hover .philosophy-text {
    opacity: 1;
}

/* ============================================
   PANEL 4: CONTACT/SIGNAL PANEL
   ============================================ */
#signal-panel {
    background: rgba(10, 14, 20, 0.95);
}

#signal-panel .panel-content {
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.signal-header {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    align-self: flex-start;
}

#waveform-container {
    width: 100%;
    max-width: 800px;
    height: 120px;
}

#waveform-svg {
    width: 100%;
    height: 100%;
}

/* Signal Cards */
.signal-cards {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 900px;
}

.signal-card {
    flex: 1;
    min-width: 240px;
    max-width: 300px;
    padding: 24px;
    background: rgba(30, 42, 56, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 210, 230, 0.12);
    border-radius: 4px;
    transition: background 0.3s ease-out, border-color 0.3s ease-out, transform 0.15s ease-out, box-shadow 0.3s ease-out;
    transform-style: preserve-3d;
}

.signal-card:hover {
    background: rgba(30, 42, 56, 0.55);
    border-color: rgba(212, 160, 86, 0.3);
}

.freq-label {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cursor-amber);
    opacity: 0.6;
    display: block;
    margin-bottom: 16px;
}

.signal-data {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.signal-key {
    font-family: var(--font-primary);
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--signal-green);
}

.signal-value {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--frost-mist);
    transition: color 0.3s ease-out;
}

.signal-card:hover .signal-value {
    color: var(--cursor-amber);
}

/* Final prompt */
.final-prompt {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
    align-self: flex-start;
    margin-top: 20px;
}

.final-command {
    color: var(--frost-mist);
}

/* ============================================
   ASCII DECORATION BORDERS
   ============================================ */
.ascii-border {
    position: fixed;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 50;
    font-family: var(--font-primary);
    font-size: 10px;
    line-height: 12px;
    color: var(--frost-mist);
    opacity: 0.1;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
}

.ascii-border-top {
    top: 0;
}

.ascii-border-bottom {
    bottom: 20px;
}

/* ============================================
   TILT-3D SHARED STYLES
   ============================================ */
.tilt-target {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .panel-wide {
        width: 300vw;
    }

    #projects-panel .panel-content {
        padding: 20px 20px;
    }

    .project-tooltip {
        display: none;
    }

    .col-perm { width: 100px; }
    .col-size { width: 60px; }
    .col-date { width: 100px; }

    .terminal-table-header {
        font-size: 0.65rem;
    }

    .frost-panel {
        width: clamp(200px, 80vw, 350px);
    }

    #signal-panel .panel-content {
        padding: 30px 20px;
    }

    .signal-cards {
        flex-direction: column;
        align-items: center;
    }

    .signal-card {
        max-width: 100%;
    }
}
