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

html, body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100dvh;
    width: 100vw;
}

/* Page counter */
.page-counter {
    position: fixed;
    top: 18px;
    right: 28px;
    z-index: 100;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.55);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    mix-blend-mode: difference;
}

/* Horizontal deck */
.deck {
    display: flex;
    flex-direction: row;
    overflow-x: scroll;
    overflow-y: hidden;
    width: 100vw;
    height: 100dvh;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }

/* Each page */
.page {
    flex: 0 0 100vw;
    height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

/* PDF page slide */
.pdf-stage {
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}
.pdf-zoom {
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}
.pdf-page-canvas {
    display: block;
    max-width: 100vw;
    max-height: 100dvh;
}

/* Video page */
.page--video {
    padding: 0;
    background: #000;
}
.video-wrap {
    position: relative;
    width: 100vw;
    height: 100dvh;
    background: #000;
    overflow: hidden;
}
.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* PDF loading overlay */
.pdf-loading {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 0.6s ease;
}
.pdf-loading.is-done {
    opacity: 0;
    pointer-events: none;
}
.pdf-loading__spinner {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: rgba(255,255,255,0.85);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pdf-loading__text {
    font-size: 12px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}
.pdf-loading__dots {
    display: inline-block;
    animation: dotPulse 1.4s steps(4) infinite;
    width: 1.5em;
    text-align: left;
}
@keyframes dotPulse {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: ''; }
}
.pdf-loading__progress {
    width: 240px;
    height: 1px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}
.pdf-loading__bar {
    height: 100%;
    width: 0;
    background: rgba(255,255,255,0.85);
    transition: width 0.2s ease;
}

/* Nav arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, color 0.3s, transform 0.3s;
    padding: 0;
    mix-blend-mode: difference;
}
.nav-arrow:hover {
    color: #fff;
}
.nav-arrow svg { width: 38px; height: 38px; }
.nav-arrow--prev { left: 24px; }
.nav-arrow--next { right: 24px; }
.nav-arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .page-counter { top: 14px; right: 22px; font-size: 10px; }
    .nav-arrow { width: 52px; height: 52px; }
    .nav-arrow svg { width: 32px; height: 32px; }
    .nav-arrow--prev { left: 12px; }
    .nav-arrow--next { right: 12px; }
}

/* Mobile */
@media (max-width: 768px) {
    .page-counter { top: 12px; right: 14px; font-size: 9px; letter-spacing: 0.15em; }
    .nav-arrow { width: 44px; height: 44px; }
    .nav-arrow svg { width: 24px; height: 24px; }
    .nav-arrow--prev { left: 4px; }
    .nav-arrow--next { right: 4px; }
    .pdf-loading__progress { width: 180px; }
    .pdf-loading__text { font-size: 10px; }
}

/* Small mobile (portrait) */
@media (max-width: 480px) {
    .page-counter { font-size: 8px; }
    .nav-arrow { width: 36px; height: 36px; opacity: 0.4; }
    .nav-arrow svg { width: 20px; height: 20px; }
}

/* Landscape phone - arrows could overlap content */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-arrow { width: 38px; height: 38px; }
    .nav-arrow svg { width: 22px; height: 22px; }
}
