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

:root {
    --cyan: #00e5ff;
    --magenta: #ff2e97;
    --dark-bg: #0b0e17;
    --panel-bg: #121829;
    --text-primary: #e0e0e0;
    --text-secondary: #c8d6e5;
    --text-muted: #7a8ba3;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--dark-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Rain Effect */
#rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 1px;
    background: var(--cyan);
    opacity: 0.1;
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    0% { transform: translateY(-100px); }
    100% { transform: translateY(100vh); }
}

/* Scan Line */
#scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--cyan);
    opacity: 0.06;
    z-index: 100;
    animation: scan 8s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 1rem 2rem;
    background: linear-gradient(to bottom, var(--dark-bg), transparent);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--magenta);
}

.header-tag {
    opacity: 0.6;
}

.header-status {
    margin-left: auto;
}

.status-active {
    color: var(--cyan);
}

/* Floors */
.floor {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.floor-label {
    position: absolute;
    top: 2rem;
    left: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Floor 0 - Surface */
.title-main {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 6rem);
    line-height: 1;
    text-align: center;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.title-accent {
    color: var(--cyan);
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.3);
}

.epigraph {
    max-width: 600px;
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 2px solid var(--magenta);
    padding-left: 1.5rem;
    text-align: left;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
}

.scroll-arrow {
    width: 1px;
    height: 30px;
    background: var(--cyan);
    opacity: 0.5;
    animation: pulse-arrow 2s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 0.2; transform: scaleY(0.5); }
    50% { opacity: 0.8; transform: scaleY(1); }
}

/* Floor 1 - Index */
.index-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    max-width: 800px;
}

.index-entry {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(18, 24, 41, 0.6);
    border-left: 2px solid transparent;
    transition: border-color 0.3s, background 0.3s;
    align-items: center;
}

.index-entry:hover {
    border-left-color: var(--cyan);
    background: rgba(18, 24, 41, 0.9);
}

.index-ref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--magenta);
    letter-spacing: 0.05em;
}

.index-title {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.index-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
}

/* Floor 2 - Reading Room */
.manuscript-block {
    max-width: 700px;
    width: 100%;
    background: var(--panel-bg);
    border: 1px solid rgba(0, 229, 255, 0.1);
    padding: 2rem;
}

.manuscript-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(200, 214, 229, 0.1);
}

.ms-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.ms-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 0.1em;
}

.manuscript-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.redacted {
    background: var(--magenta);
    color: var(--magenta);
    padding: 0 0.2rem;
    border-radius: 1px;
}

.manuscript-marginalia {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(200, 214, 229, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.marginalia-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-style: italic;
}

/* Floor 3 - Deep Stacks */
.stacks-container {
    display: flex;
    gap: 3rem;
    align-items: flex-end;
}

.stack-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stack-spine {
    height: var(--spine-h, 70px);
    width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--panel-bg);
    border: 1px solid rgba(0, 229, 255, 0.08);
    writing-mode: horizontal-tb;
    transition: border-color 0.3s, color 0.3s;
    padding: 0.5rem;
    text-align: center;
}

.stack-spine:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Floor 4 - Terminal */
.terminal-block {
    max-width: 650px;
    width: 100%;
    background: rgba(11, 14, 23, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(18, 24, 41, 0.8);
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.4;
}

.terminal-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
}

.terminal-line {
    color: var(--text-secondary);
}

.terminal-prompt {
    color: var(--cyan);
    margin-right: 0.5rem;
}

.terminal-output {
    color: var(--text-muted);
    padding-left: 1.2rem;
}

.terminal-warning {
    color: var(--magenta);
}

.terminal-cursor {
    animation: blink 1s step-end infinite;
    color: var(--cyan);
}

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

/* Floor 5 - Depths */
.depths-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.depths-text {
    max-width: 500px;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.glyph-svg {
    width: 150px;
    height: 150px;
    animation: rotate-glyph 30s linear infinite;
}

@keyframes rotate-glyph {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.depths-footer {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    opacity: 0.4;
    margin-top: 3rem;
}

/* Floor reveal animation */
.floor {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.floor.visible {
    opacity: 1;
    transform: translateY(0);
}

.floor-0 {
    opacity: 1;
    transform: translateY(0);
}
