/* Základné premenné a reset */
:root {
    --bg-color: #fdfbf7; /* Farba starého papiera */
    --ink-color: #1a1a1a;
    --accent-color: #d35400; /* Jemná akcentová farba - oranžovo-hnedá */
    --s: 1; /* mierka javiska, nastavuje JS */
    --sun: #f6c453;
    --sky-top: #bfe0ef;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
    font-family: 'Kalam', cursive, sans-serif;
    background-color: var(--bg-color);
    color: var(--ink-color);
}

/* ===== CESTA (scrollytelling) ===== */
.journey {
    position: relative;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: linear-gradient(#bfe0ef 0%, #d9ecf3 50%, #eef6f3 100%); /* prepisuje JS podľa dennej doby */
}

.sun {
    position: absolute;
    top: 50vh;
    left: 6vw;
    width: clamp(90px, 14vh, 220px);
    height: auto;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}

.stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.moon {
    position: absolute;
    top: 9vh;
    right: 12vw;
    width: clamp(60px, 9vh, 140px);
    height: auto;
    opacity: 0;
}

.clouds {
    position: absolute;
    inset: 0;
    background: url('layer-clouds.svg?v=0.5.0') repeat-x left 2vh;
    background-size: auto 32vh;
    will-change: transform;
}

/* Javisko: 1080 dizajnových jednotiek na výšku, ukotvené vľavo dole */
.stage {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1080px;
    width: 1920px;
    transform-origin: 0 100%;
    transform: scale(var(--s));
    overflow: hidden; /* bez toho sa pri škálovaní kreslí tenká čiara na hornom okraji vrstiev */
    backface-visibility: hidden;
}

/* Krajina na plátne (vrstvy layer-*.svg kreslí script.js v zvislých pásoch) */
.scene {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1080px;
    width: 1920px;
}

/* Auto s karavanom (mierka 0.75 = 705x300) stojí vodorovne, kolesá na ceste (y = 848). */
.car, .car-lights {
    position: absolute;
    left: 0;
    top: 0;
    width: 705px;
    height: 300px;
    transform-origin: 50% 98.5%;
    will-change: transform;
}
.car svg, .car-lights svg { display: block; width: 100%; height: 100%; overflow: visible; }
.car .dust { transition: opacity 0.3s ease; }

/* Noc */
.night {
    position: absolute;
    inset: 0;
    background: #2a3566;
    mix-blend-mode: multiply;
    opacity: 0;
    pointer-events: none;
}
.lights {
    position: absolute;
    inset: 0;
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
}
.fire-glow {
    position: absolute;
    left: 0;
    top: 0;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    transform-origin: 50% 50%;
    will-change: transform;
    background: radial-gradient(circle, rgba(255,180,80,0.95) 0%, rgba(255,140,50,0.45) 30%, rgba(255,120,30,0) 68%);
}

/* Titulky v bublinách */
.comic-title {
    position: absolute;
    top: 8%;
    left: 6%;
    font-size: clamp(1.6rem, 4vw, 3rem);
    background: #fff;
    border: 3px solid var(--ink-color);
    padding: 10px 24px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 5px 5px 0 var(--ink-color);
    z-index: 5;
    white-space: nowrap;
    will-change: opacity, transform;
}
.title-end { opacity: 0; }

.hint {
    position: absolute;
    left: 50%;
    bottom: 3vh;
    transform: translateX(-50%);
    font-size: 1.1rem;
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--ink-color);
    border-radius: 999px;
    padding: 4px 16px;
    z-index: 5;
}
.hint span { display: inline-block; animation: bob 1.2s infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* Sekcia po ceste */
.after {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border-top: 3px dashed rgba(0,0,0,0.2);
}

/* Hotspot (Interaktívny bod) na dverách karavanu */
.hotspot {
    position: absolute;
    left: 219px;
    top: 144px;
    width: 40px; height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    transform: scale(calc(1 / var(--s)));
    transform-origin: center;
}

.hotspot .icon {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; height: 100%;
    background-color: var(--accent-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid var(--ink-color);
    z-index: 2;
}

.hotspot .pulse {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: 1;
    animation: pulse-anim 1.5s infinite;
}

@keyframes pulse-anim {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Modal Okno */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    border: 4px solid var(--ink-color);
    box-shadow: 10px 10px 0 var(--ink-color);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    border-radius: 15px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.close-modal {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 2rem;
    background: none; border: none; cursor: pointer;
    font-family: inherit;
    color: var(--ink-color);
}

@media (prefers-reduced-motion: reduce) {
    .hint span, .hotspot .pulse { animation: none; }
}
