/* historic.quest -- parallax journey through history */

:root {
    --c-ancient: #c4a366;
    --c-medieval: #2d5a3d;
    --c-renaissance: #4a6fa5;
    --c-industrial: #4a4a52;
    --c-modern: #5a7a94;
    --c-gold: #d4a634;
    --c-parchment: #f0e8d8;
    --c-deep: #2c2418;
    --c-fog: rgba(240, 238, 232, 0.6);
    --font-display: "Cinzel Decorative", "Cinzel", serif;
    --font-quest: "Cinzel", serif;
    --font-body: "Alegreya", Georgia, serif;
    --font-ui: "Inter", system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--c-deep);
    color: var(--c-parchment);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Parallax stage shared ---------- */

.parallax-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 130%;
    will-change: transform;
}

.layer .silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block;
}

.fog {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.fog-bottom {
    bottom: 0;
    height: 30%;
    background: linear-gradient(to top, rgba(240, 238, 232, 0.35), transparent);
    mix-blend-mode: screen;
}

/* ---------- World Gate / Hero ---------- */

.world-gate {
    position: relative;
}

.world-gate .layer-sky {
    background: radial-gradient(ellipse at center top, #2a3850 0%, #1a2030 50%, #0d1018 100%);
}

.sun-disc {
    position: absolute;
    top: 22%;
    left: 50%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #f0e8d8 0%, #d4a634 50%, transparent 70%);
    transform: translateX(-50%);
    filter: blur(2px);
    opacity: 0.85;
}

.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 8% 18%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 22% 32%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 38% 12%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 55% 28%, #d4a634 50%, transparent 51%),
        radial-gradient(1px 1px at 72% 14%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 26%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 14% 42%, #f0e8d8 50%, transparent 51%),
        radial-gradient(1px 1px at 64% 38%, #d4a634 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 8%, #f0e8d8 50%, transparent 51%);
    opacity: 0.7;
    animation: twinkle 6s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

.archway {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 60vmin;
    height: 90vh;
    transform: translateX(-50%);
}

.archway svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 -10px 40px rgba(212, 166, 52, 0.25));
}

.path-line {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 8%;
    height: 30%;
    background: linear-gradient(to top, rgba(212, 166, 52, 0.5), transparent);
    transform: translateX(-50%) skewX(0deg);
    filter: blur(8px);
}

.hero-text {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
    color: var(--c-parchment);
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

.title-glyph {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: 0.06em;
    color: var(--c-parchment);
    animation: fogIn 2.4s ease-out;
}

.title-glyph .dot {
    color: var(--c-gold);
}

@keyframes fogIn {
    0% { opacity: 0; filter: blur(20px); letter-spacing: 0.4em; }
    100% { opacity: 1; filter: blur(0); letter-spacing: 0.06em; }
}

.subtitle {
    margin-top: 1.4rem;
    font-family: var(--font-quest);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--c-gold);
    animation: pulseSoft 3s ease-in-out infinite;
}

@keyframes pulseSoft {
    0%, 100% { opacity: 0.7; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

.scroll-cue {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.scroll-cue span {
    width: 16px;
    height: 2px;
    background: var(--c-parchment);
    opacity: 0.4;
    animation: cue 2s ease-in-out infinite;
}

.scroll-cue span:nth-child(2) { animation-delay: 0.2s; }
.scroll-cue span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cue {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(4px); }
}

/* ---------- Era sections ---------- */

.era {
    position: relative;
}

.era .parallax-stage {
    background: var(--c-deep);
}

.era-ancient .parallax-stage      { background: linear-gradient(180deg, #c4a366 0%, #7a5d33 100%); }
.era-medieval .parallax-stage     { background: linear-gradient(180deg, #2d5a3d 0%, #102014 100%); }
.era-renaissance .parallax-stage  { background: linear-gradient(180deg, #4a6fa5 0%, #1a2c4b 100%); }
.era-industrial .parallax-stage   { background: linear-gradient(180deg, #4a4a52 0%, #1c1c20 100%); }
.era-modern .parallax-stage       { background: linear-gradient(180deg, #5a7a94 0%, #16222e 100%); }

.celestial {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    opacity: 0.85;
}
.celestial.sun {
    top: 14%;
    right: 16%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #f0e8d8 0%, #d4a634 60%, transparent 75%);
}
.celestial.moon {
    top: 16%;
    right: 18%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, #f0e8d8 0%, rgba(240, 232, 216, 0.4) 55%, transparent 70%);
}

.smoke-haze {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(80, 80, 90, 0.55) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 25%, rgba(60, 60, 70, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 40%, rgba(100, 100, 110, 0.4) 0%, transparent 55%);
    mix-blend-mode: screen;
    animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translateX(-3%); }
    100% { transform: translateX(3%); }
}

.era-title {
    position: absolute;
    top: 12%;
    left: 8%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    color: var(--c-parchment);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
    z-index: 6;
    pointer-events: none;
}

.era-blurb {
    position: absolute;
    top: calc(12% + clamp(2.6rem, 6vw, 5rem));
    left: 8%;
    max-width: 480px;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--c-parchment);
    opacity: 0.85;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    z-index: 6;
    pointer-events: none;
}

/* ---------- Fog Zones ---------- */

.fog-zone {
    position: relative;
    height: 50vh;
    background: linear-gradient(to bottom, transparent 0%, rgba(240, 238, 232, 0.5) 30%, rgba(240, 238, 232, 0.6) 50%, rgba(240, 238, 232, 0.5) 70%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fog-zone::before,
.fog-zone::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(255, 255, 255, 0.3), transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(255, 255, 255, 0.25), transparent 55%);
    animation: fogShift 12s ease-in-out infinite alternate;
}
.fog-zone::after {
    animation-duration: 16s;
    animation-direction: alternate-reverse;
    opacity: 0.7;
}

@keyframes fogShift {
    0% { transform: translateX(-8%); }
    100% { transform: translateX(8%); }
}

.era-label {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.5em;
    color: var(--c-deep);
    text-transform: uppercase;
    opacity: 0.78;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ---------- Quest Nodes ---------- */

.quest-node {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-gold);
    color: var(--c-deep);
    font-family: var(--font-quest);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 8;
    box-shadow: 0 0 0 0 rgba(212, 166, 52, 0.55);
    animation: questPulse 2.4s ease-out infinite;
    transition: transform 0.25s ease;
}

.quest-node:hover {
    transform: scale(1.25);
    animation-play-state: paused;
}

@keyframes questPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 166, 52, 0.55);
    }
    100% {
        box-shadow: 0 0 0 16px rgba(212, 166, 52, 0);
    }
}

/* ---------- Quest Tooltip ---------- */

.quest-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 50;
    min-width: 220px;
    max-width: 300px;
    padding: 0.9rem 1.1rem;
    background: rgba(20, 16, 12, 0.92);
    border: 1px solid rgba(212, 166, 52, 0.5);
    color: var(--c-parchment);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translate(-50%, -110%) translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.quest-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -110%) translateY(0);
}

.tt-title {
    font-family: var(--font-quest);
    font-weight: 600;
    font-size: 1rem;
    color: var(--c-gold);
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.tt-desc {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.55;
    color: var(--c-parchment);
    opacity: 0.92;
}

/* ---------- Coda ---------- */

.coda {
    position: relative;
    min-height: 60vh;
    background: linear-gradient(180deg, #16222e 0%, #0a0a0c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

.coda-inner {
    text-align: center;
    max-width: 640px;
}

.coda-mark {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--c-gold);
    margin-bottom: 1rem;
    opacity: 0.85;
}

.coda-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.08em;
    color: var(--c-parchment);
    margin-bottom: 1.4rem;
}

.coda-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--c-parchment);
    opacity: 0.85;
    margin-bottom: 2.4rem;
}

.coda-sign {
    font-family: var(--font-quest);
    font-weight: 600;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--c-gold);
    opacity: 0.8;
}

/* ---------- Progress Map ---------- */

.progress-map {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 56px;
    background: rgba(8, 6, 4, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(240, 238, 232, 0.12);
    z-index: 40;
    font-family: var(--font-ui);
}

.map-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-markers {
    position: absolute;
    inset: 0;
}

.map-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-parchment);
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.map-marker.active {
    background: var(--c-gold);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 12px rgba(212, 166, 52, 0.7);
}

.map-marker:hover {
    opacity: 1;
}

.map-marker span {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-parchment);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.map-marker:hover span,
.map-marker.active span {
    opacity: 1;
}

.player-dot {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--c-gold);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(212, 166, 52, 0.25), 0 0 20px rgba(212, 166, 52, 0.7);
    transition: left 0.15s linear;
    pointer-events: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .era-title { left: 6%; top: 8%; }
    .era-blurb { left: 6%; max-width: 80%; }
    .archway { width: 90vmin; }
    .map-marker span { display: none; }
    .progress-map { height: 44px; }
    .quest-node { width: 22px; height: 22px; font-size: 0.85rem; }
}
