/* ppuzzle.works - Sci-Fi Horizontal Scroll / Burnt Orange / Glitch Art / Book-Scholarly */
/* Colors: #0A0A12, #14141E, #4A4A5A, #6A6A78, #A85A3A, #D4704A, #4ACD6A, #E0E0E8 */

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

body {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    line-height: 1.75;
    font-weight: 400;
    color: #E0E0E8;
    background: #0A0A12;
    overflow: hidden;
    height: 100vh;
}

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

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

/* Panels */
.panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: grid;
    grid-template-columns: 55% 45%;
    align-items: center;
    padding: 80px;
    position: relative;
    border-right: 1px solid rgba(224, 224, 232, 0.04);
}

.panel-title {
    background: #0A0A12;
}

.panel-end .panel-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Panel Content */
.panel-content {
    padding-right: 60px;
}

.chapter-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #4ACD6A;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 16px;
}

.main-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 700;
    color: #E0E0E8;
    display: inline;
}

.main-title-ext {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 700;
    color: #D4704A;
    display: inline;
}

.cursor {
    color: #4ACD6A;
    animation: blink 1s step-end infinite;
}

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

.main-sub {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #6A6A78;
    letter-spacing: 0.08em;
    margin-top: 16px;
    text-transform: uppercase;
}

.main-caption {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4A4A5A;
    margin-top: 12px;
    font-style: italic;
}

.panel-title-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    color: #E0E0E8;
    margin-bottom: 8px;
}

.ornamental-rule {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, #A85A3A, transparent);
    margin: 16px 0;
    position: relative;
}

.ornamental-rule::before {
    content: '';
    position: absolute;
    left: 0;
    top: -2px;
    width: 5px;
    height: 5px;
    background: #A85A3A;
    border-radius: 50%;
}

.panel-body {
    color: #6A6A78;
    max-width: 480px;
}

/* Panel Meta - Citation format */
.panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(224,224,232,0.06);
}

.meta-key {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #4ACD6A;
    letter-spacing: 0.08em;
}

.meta-val {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #E0E0E8;
}

/* Panel Visuals - Glitch blocks */
.panel-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.glitch-block {
    width: 300px;
    height: 400px;
    background: #14141E;
    border: 1px solid rgba(224,224,232,0.06);
    position: relative;
    overflow: hidden;
}

.glitch-block.offset {
    transform: translate(20px, -20px);
}

.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 205, 106, 0.02) 2px,
        rgba(74, 205, 106, 0.02) 4px
    );
}

.glitch-line {
    position: absolute;
    top: var(--offset);
    left: 10%;
    width: var(--width);
    height: 3px;
    background: linear-gradient(90deg, transparent, #D4704A, transparent);
    opacity: 0.4;
}

.glitch-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(90deg, rgba(168,90,58,0.15), rgba(212,112,74,0.08), transparent);
    transform: translateX(-5px);
}

.channel-split {
    position: absolute;
    top: 30%;
    left: -3px;
    right: 3px;
    height: 40%;
    border: 1px solid rgba(74, 205, 106, 0.1);
    mix-blend-mode: screen;
}

.end-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 6rem;
    color: rgba(168, 90, 58, 0.15);
}

.panel-footer-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #4A4A5A;
    margin-top: 32px;
}

/* Bottom Panel Navigation */
.panel-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-dot {
    background: none;
    border: 1px solid #4A4A5A;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, background 0.3s;
}

.nav-dot.active {
    border-color: #D4704A;
    background: rgba(212, 112, 74, 0.1);
}

.dot-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #6A6A78;
}

.nav-dot.active .dot-label {
    color: #D4704A;
}

/* Scroll Arrows */
.scroll-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    font-size: 24px;
    color: #6A6A78;
    cursor: pointer;
    padding: 12px;
    opacity: 0.4;
    transition: opacity 0.3s;
    user-select: none;
}

.scroll-arrow:hover {
    opacity: 1;
    color: #D4704A;
}

.arrow-left {
    left: 16px;
}

.arrow-right {
    right: 16px;
}

/* Ripple */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(168, 90, 58, 0.15);
    transform: scale(0);
    animation: ripple 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .panel {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        padding: 40px 24px;
    }
    .panel-content {
        padding-right: 0;
    }
    .panel-visual {
        display: none;
    }
    .glitch-block {
        width: 200px;
        height: 250px;
    }
}
