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

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
}

p {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* =========================================
   BABAK 1: PROLOG & MONTASE ASCII
   ========================================= */
#babak-1 {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: #050505;
}

/* Container for Interactive Gallery */
.ascii-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: grid;
    /* Tepat 5 kolom x 3 baris = 15 kotak memenuhi seluruh viewport */
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    width: 100%;
    height: 100%; /* Otomatis mengikuti ukuran baris/kolom layar */
    background-color: #050505;
    cursor: crosshair;
    border-radius: 4px;
    overflow: hidden;
}

.ascii-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Sangat penting mencegah canvas stretched! */
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.real-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Interaksi Hover */
.gallery-item:hover .ascii-canvas {
    opacity: 0;
}
.gallery-item:hover .real-image {
    opacity: 1;
}

/* Asymmetrical Grid Style Placeholder - we'll let p5 handle the core visual but we can layer here if needed */
.title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    pointer-events: none;
    width: 90%;
}

.title-container h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5); /* Neon cyan hint */
}

.title-container p {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #0ff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-indicator {
    position: absolute;
    bottom: -15vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    color: #888;
    animation: blink 2s infinite;
}

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


/* =========================================
   BABAK 2: KARTOGRAFI SKALA MAKRO
   ========================================= */
#babak-2 {
    position: relative;
    width: 100%;
    height: 100vh; /* Peta menutupi penuh layar */
}

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

/* Memindahkan tombol Zoom MapLibre ke tengah-kanan */
.maplibregl-ctrl-top-right {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* =========================================
   BABAK 3: EKSPLORASI KURATORIAL MIKRO
   ========================================= */
#babak-3 {
    position: relative;
    height: 100vh;
    width: 100%;
    background-color: #000;
    z-index: 10;
}

#panorama {
    width: 100%;
    height: 100%;
}

/* Override pannellum default controls if necessary */
.pnlm-controls-container {
    z-index: 2 !important;
}

#pano-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none; /* Let clicks pass to Pannellum */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-btn {
    pointer-events: auto;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 2rem;
    width: 60px;
    height: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #0ff;
}

.pano-content-panel {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    max-width: 400px;
    pointer-events: auto;
}

#pano-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0ff;
    text-transform: uppercase;
}

#pano-desc {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.pano-indicator {
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    color: #888;
    text-align: right;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
}
