/* historical.quest - Seapunk Oceanic Descent Through History */

:root {
    --bg-surface: #B8D8D8;
    --bg-photic: #5B8A8A;
    --bg-twilight: #1E3A3A;
    --bg-abyss: #0A1628;
    --bg-hadal: #060E1C;
    --text-light: #E8E0D4;
    --text-dark: #2A3A3A;
    --accent-cyan: #4DE8C2;
    --accent-violet: #7B6ECC;
    --accent-warm: #D4856A;
    --glass-edge: #4A7A7A;
    --font-main: 'Commissioner', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --bg-current: #B8D8D8;
    --text-current: #2A3A3A;
    --accent-current: #4DE8C2;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: var(--text-dark);
    background: var(--bg-surface);
    overflow-x: hidden;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Background Layer */
.background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, #B8D8D8 0%, #5B8A8A 20%, #3A6A6A 35%, #1E3A3A 50%, #132C2C 65%, #0A1628 80%, #060E1C 100%);
    filter: blur(2px);
}
.background-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(77,232,194,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(123,110,204,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(77,232,194,0.02) 0%, transparent 40%);
    animation: causticDrift 25s ease-in-out infinite alternate;
}
@keyframes causticDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20px, 10px) scale(1.05); }
}

/* Midground - Bubble Layer */
.midground-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    filter: blur(0.5px);
}

/* Depth Gauge */
.depth-gauge {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-current);
    opacity: 0.6;
    transition: color 1s ease;
}
.depth-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}
.depth-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-current);
    transition: color 1s ease;
}

/* Zones */
.zone {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    position: relative;
    z-index: 2;
}

.surface-zone { color: var(--text-dark); }
.photic-zone { color: var(--text-light); }
.twilight-zone { color: var(--text-light); }
.abyss-zone { color: var(--text-light); }
.hadal-zone { color: var(--text-light); min-height: 120vh; }

/* Content Column */
.content-column {
    max-width: 680px;
    width: 100%;
    background: rgba(10, 22, 40, 0.25);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(74, 122, 122, 0.3);
    border-radius: 4px;
    padding: 60px;
}
.content-column.narrow { max-width: 540px; }

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.23, 1, 0.32, 1), transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glow Text */
.glow-text h2, .glow-text p {
    text-shadow: 0 0 20px rgba(77, 232, 194, 0.3), 0 0 40px rgba(77, 232, 194, 0.1);
}

/* Typography */
h1 {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    letter-spacing: 0.12em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.05em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--accent-current);
    transition: color 1s ease;
}

p {
    margin-bottom: 2rem;
}

/* Data Labels */
.data-label {
    font-family: var(--font-main);
    font-weight: 200;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

/* Chevron Cue */
.chevron-cue {
    margin-top: 2rem;
    color: var(--accent-cyan);
    animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* Epoch Timelines */
.epoch-timeline {
    width: 100%;
    max-width: 500px;
    height: 40px;
    display: block;
    margin-top: 1.5rem;
}
.tl-line {
    stroke: var(--accent-cyan);
    stroke-width: 1.5;
    opacity: 0.6;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease-out;
}
.tl-line.tl-violet { stroke: var(--accent-violet); }
.visible .tl-line { stroke-dashoffset: 0; }
.tl-node {
    fill: var(--accent-cyan);
    opacity: 0;
    transition: opacity 0.6s ease-out, r 0.3s ease;
}
.tl-node.tl-violet { fill: var(--accent-violet); }
.visible .tl-node { opacity: 0.8; }
.tl-node:hover { r: 7; filter: drop-shadow(0 0 8px var(--accent-cyan)); }

/* Epoch Wheel */
.epoch-wheel-container { display: flex; justify-content: center; margin: 3rem 0; }
.epoch-wheel {
    width: 60vmin;
    max-width: 300px;
    height: auto;
    animation: wheelSpin 120s linear infinite;
}
@keyframes wheelSpin { to { transform: rotate(360deg); } }

/* Bioluminescent Dot */
.bioluminescent-dot {
    width: 16px;
    height: 16px;
    background: var(--accent-cyan);
    border-radius: 50%;
    margin: 3rem auto 0;
    animation: bioGlow 4s ease-in-out infinite;
}
@keyframes bioGlow {
    0%, 100% { box-shadow: 0 0 15px var(--accent-cyan); opacity: 0.4; }
    50% { box-shadow: 0 0 50px var(--accent-cyan), 0 0 80px rgba(77,232,194,0.2); opacity: 1; }
}

/* Sediment Dividers between sections */
.zone + .zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(74,122,122,0.3), transparent);
}

/* Responsive */
@media (max-width: 768px) {
    .content-column { padding: 36px 24px; max-width: 100%; }
    .content-column.narrow { max-width: 100%; }
    .zone { padding: 60px 20px; }
    .depth-gauge { display: none; }
}
