/* ============================================================
   Bolsheviktion 2: Yurovsky's Revenge — site styles
   ============================================================ */

@font-face {
    font-family: 'Boldine';
    src: url('/static/fonts/Boldine.ttf') format('truetype');
}

@font-face {
    font-family: 'AveriaSerifLibre';
    src: url('/static/fonts/AveriaSerifLibre-Light.ttf') format('truetype');
}

/* Body */
.bn3d-body {
    background-color: #1a0a00;
    color: #e8dcc8;
    font-family: 'AveriaSerifLibre', serif;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Navbar
   ============================================================ */
.bn3d-navbar {
    background-color: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid #3a1a00;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.bn3d-navbar .nav-link {
    color: #c8a87a !important;
    font-family: 'AveriaSerifLibre', serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}

.bn3d-navbar .nav-link:hover {
    color: #ff4500 !important;
}

.bn3d-nav-separator {
    border-left: 1px solid #3a1a00;
    margin-left: 1rem;
    padding-left: 0.5rem;
}

.bn3d-nav-other {
    color: #8a7a6a !important;
    font-size: 0.85rem;
}

/* ============================================================
   Hero Section
   ============================================================ */
/* Scroll container — gives the fixed hero room to scroll through */
.bn3d-hero-scroll-space {
    height: 250vh;
    position: relative;
}

/* Hero viewport — fixed in place, painting pans via JS background-position */
.bn3d-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0d0500;
    z-index: 1;
}

/* Once user scrolls past the hero, push content back into flow */
.bn3d-hero-end {
    position: relative;
    z-index: 2;
    background-color: #1a0a00;
}

/* All paint layers share this base */
.hero-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
    will-change: background-position;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-layer.loaded {
    opacity: 1;
}

/* Individual layer z-ordering */
#layer-bg         { z-index: 1; }
#layer-sky-enemy  { z-index: 2; }
#layer-rain       { z-index: 3; }
#layer-hero       { z-index: 4; }
#layer-baby       { z-index: 5; }
#layer-hand       { z-index: 6; }
#layer-fg         { z-index: 7; }

/* Baby glow — soft pulse, drop-shadow follows the cutout shape */
#layer-baby {
    animation: baby-glow 3s ease-in-out infinite;
}

@keyframes baby-glow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 240, 180, 0.4)); }
    50%       { filter: drop-shadow(0 0 18px rgba(255, 240, 180, 0.9)); }
}

/* Pulsate — hand only */
#layer-hand { animation: pulsate 5.5s ease-in-out infinite; }

@keyframes pulsate {
    0%, 100% { transform: scale(1.00); }
    50%       { transform: scale(1.05); }
}

/* Rain canvas — pixel-perfect, no smoothing */
.rain-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    opacity: 0.55;
    pointer-events: none;
}

/* Title graphic layers — above everything */
#layer-title-1 { z-index: 20; }
#layer-title-2 { z-index: 21; }
#layer-title-3 { z-index: 22; }

/* CTA — fixed to bottom of viewport while in the hero scroll zone */
.hero-cta-wrap {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    pointer-events: all;
    white-space: nowrap;
}

.hero-title-img {
    width: clamp(280px, 72vw, 1535px);
    height: auto;
    image-rendering: auto;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.85));
    pointer-events: none;
    user-select: none;
}

.hero-title-2-img {
    width: clamp(80px, 18vw, 400px);
    height: auto;
    margin-top: 0.25rem;
    image-rendering: auto;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.85));
    pointer-events: none;
    user-select: none;
}

.hero-subtitle-img {
    width: clamp(180px, 50vw, 900px);
    height: auto;
    margin-top: 0.5rem;
    image-rendering: auto;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.9));
    pointer-events: none;
    user-select: none;
}

/* CTA button sits inside title-wrap — needs pointer events re-enabled */
.hero-cta {
    pointer-events: all;
    margin-top: 1.5rem;
}

.bn3d-btn-primary {
    background-color: #8b0000;
    border-color: #5a0000;
    color: #f0e0c0;
    font-family: 'Boldine', 'AveriaSerifLibre', serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.bn3d-btn-primary:hover {
    background-color: #b00000;
    border-color: #8b0000;
    color: #fff;
    text-decoration: none;
}

/* Sound toggle button */
.hero-sound-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 30;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 200, 120, 0.3);
    border-radius: 4px;
    color: rgba(255, 200, 120, 0.8);
    font-size: 1.2rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s;
}

.hero-sound-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Scroll nudge arrow */
.hero-scroll-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    color: rgba(255, 200, 120, 0.6);
    font-size: 2rem;
    animation: bounce 2s infinite;
    pointer-events: none;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0);    }
    50%       { transform: translateX(-50%) translateY(8px);  }
}

/* ============================================================
   Below-hero content
   ============================================================ */
.bn3d-below-hero {
    padding-top: 3rem;
}

.bn3d-below-hero h2 {
    font-family: 'Boldine', serif;
    letter-spacing: 0.12em;
    color: #c8a87a;
}

.bn3d-below-hero .lead {
    max-width: 700px;
    margin: 0 auto 1rem;
    color: #d0c0a0;
}

/* Trailer embed */
.bn3d-trailer-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    aspect-ratio: 16 / 9;
}

.bn3d-trailer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* YouTube facade */
.yt-facade {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #000;
}

.yt-facade-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s;
}

.yt-facade:hover .yt-facade-thumb {
    filter: brightness(0.75);
}

.yt-facade-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(180, 0, 0, 0.85);
    border: 3px solid rgba(255,255,255,0.8);
    color: white;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s, transform 0.2s;
}

.yt-facade:hover .yt-facade-btn {
    background: rgba(220, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ============================================================
   Mobile adjustments
   ============================================================ */
@media (max-width: 768px) {
    .bn3d-hero-scroll-space {
        height: 100svh;
    }

    .hero-title-wrap {
        justify-content: flex-end;
        padding-bottom: 6vh;
    }

    .hero-title-img {
        width: clamp(240px, 90vw, 1535px);
    }

    .hero-subtitle-img {
        width: clamp(160px, 70vw, 800px);
    }
}
