/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #08080c;
    color: #e8dcc0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* === Scroll Progress === */
#scroll-progress {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, #00e5c8, #e930a8);
    z-index: 1000;
    transition: height 0.15s ease-out;
}

/* === Scenes === */
.scene {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    will-change: opacity, filter;
    transition: filter 0.8s ease, opacity 0.8s ease;
}

.scene-content {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    position: relative;
}

/* === Scene 1: The Approach === */
.scene-1 {
    display: flex;
    flex-direction: column;
    background: #08080c;
}

.letterbox-bar {
    height: 22vh;
    background: #08080c;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.scene-1-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12%;
    min-height: 56vh;
}

.data-stream {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    color: #8a849e;
    opacity: 0.08;
    letter-spacing: 0.08em;
}

.data-stream-1 {
    animation: scroll-left 60s linear infinite;
}

.data-stream-2 {
    animation: scroll-left 45s linear infinite;
}

@keyframes scroll-left {
    0% { transform: translateY(-50%) translateX(0); }
    100% { transform: translateY(-50%) translateX(-50%); }
}

.wordmark {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e8dcc0;
    position: relative;
}

/* === Fireflies === */
.firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00e5c8;
    box-shadow: 0 0 12px 4px rgba(0, 229, 200, 0.4);
    pointer-events: none;
}

.ff-1  { top: 15%; left: 10%; animation: drift1 25s ease-in-out infinite; }
.ff-2  { top: 40%; left: 25%; animation: drift2 32s ease-in-out infinite; background: #e930a8; box-shadow: 0 0 12px 4px rgba(233, 48, 168, 0.4); }
.ff-3  { top: 60%; left: 5%;  animation: drift3 18s ease-in-out infinite; }
.ff-4  { top: 20%; left: 55%; animation: drift4 28s ease-in-out infinite; }
.ff-5  { top: 75%; left: 70%; animation: drift1 35s ease-in-out infinite; background: #e930a8; box-shadow: 0 0 12px 4px rgba(233, 48, 168, 0.3); }
.ff-6  { top: 35%; left: 85%; animation: drift2 22s ease-in-out infinite; }
.ff-7  { top: 80%; left: 40%; animation: drift3 40s ease-in-out infinite; }
.ff-8  { top: 10%; left: 75%; animation: drift4 30s ease-in-out infinite; background: #e930a8; box-shadow: 0 0 12px 4px rgba(233, 48, 168, 0.35); }
.ff-9  { top: 50%; left: 50%; animation: drift1 20s ease-in-out infinite; }
.ff-10 { top: 65%; left: 15%; animation: drift2 38s ease-in-out infinite; }
.ff-11 { top: 25%; left: 40%; animation: drift3 27s ease-in-out infinite; background: #e930a8; box-shadow: 0 0 12px 4px rgba(233, 48, 168, 0.3); }
.ff-12 { top: 85%; left: 60%; animation: drift4 33s ease-in-out infinite; }

.ff-c1 { top: 20%; left: 15%; animation: drift1 30s ease-in-out infinite; }
.ff-c2 { top: 70%; left: 80%; animation: drift2 25s ease-in-out infinite; background: #e930a8; box-shadow: 0 0 12px 4px rgba(233, 48, 168, 0.3); }
.ff-c3 { top: 40%; left: 60%; animation: drift3 35s ease-in-out infinite; }
.ff-c4 { top: 60%; left: 30%; animation: drift4 20s ease-in-out infinite; }

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    25% { transform: translate(30px, -20px); opacity: 1; }
    50% { transform: translate(-10px, -40px); opacity: 0.4; }
    75% { transform: translate(20px, 10px); opacity: 0.8; }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    25% { transform: translate(-25px, 15px); opacity: 0.9; }
    50% { transform: translate(15px, 30px); opacity: 0.3; }
    75% { transform: translate(-20px, -10px); opacity: 0.7; }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0); opacity: 0.7; }
    33% { transform: translate(20px, -30px); opacity: 0.4; }
    66% { transform: translate(-15px, 20px); opacity: 1; }
}

@keyframes drift4 {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    20% { transform: translate(-30px, -15px); opacity: 0.8; }
    40% { transform: translate(10px, 25px); opacity: 0.5; }
    60% { transform: translate(25px, -20px); opacity: 1; }
    80% { transform: translate(-10px, 10px); opacity: 0.6; }
}

/* === Scene 2: The Artifact === */
.scene-2 {
    background: #131218;
}

.scene-2-content {
    display: flex;
    align-items: center;
    gap: 6vw;
    padding: 0 8%;
}

.artifact-container {
    position: relative;
    width: 320px;
    height: 430px;
    flex-shrink: 0;
    transform: rotate(2deg);
}

.artifact-surface {
    width: 100%;
    height: 100%;
    background:
        repeating-conic-gradient(from 0deg at 50% 50%, #3a2218 0deg, #2a1610 30deg, #3a2218 60deg),
        radial-gradient(ellipse at 30% 40%, #3a2218 0%, #1e120c 70%, #08080c 100%);
    background-blend-mode: overlay;
    filter: url(#leather-noise);
    border-radius: 3px;
    position: relative;
}

.artifact-inner-glow {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    background: radial-gradient(ellipse at 40% 35%, rgba(212, 168, 75, 0.08) 0%, transparent 60%);
}

.artifact-border {
    position: absolute;
    inset: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
}

.border-trace-1,
.border-trace-2 {
    fill: none;
    stroke: url(#neon-gradient);
    stroke-width: 2;
    stroke-dasharray: 1944;
    stroke-dashoffset: 1944;
    animation: border-trace 8s linear infinite;
}

.border-trace-2 {
    opacity: 0.4;
    animation-delay: -4s;
}

@keyframes border-trace {
    0% { stroke-dashoffset: 1944; }
    100% { stroke-dashoffset: 0; }
}

.artifact-text {
    max-width: 38ch;
}

.artifact-description {
    margin-bottom: 1.5em;
    color: #e8dcc0;
}

.artifact-meta {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #8a849e;
}

/* === Scene 3: The Landscape === */
.scene-3 {
    background: #08080c;
}

.scene-3-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.landscape {
    position: absolute;
    inset: 0;
}

.sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #08080c 0%, #131218 30%, #1a1028 60%, #2a1535 80%, #3d1a3d 100%);
}

.hill {
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
}

.hill-far {
    height: 35%;
    background: #0d0a12;
    border-radius: 80% 60% 0 0 / 100% 100% 0 0;
    z-index: 1;
}

.hill-mid {
    height: 25%;
    background: #100e16;
    border-radius: 50% 70% 0 0 / 100% 100% 0 0;
    z-index: 2;
}

.hill-near {
    height: 15%;
    background: #151320;
    border-radius: 60% 40% 0 0 / 100% 100% 0 0;
    z-index: 3;
}

.ridge-lights {
    position: absolute;
    bottom: 33%;
    left: 0;
    width: 100%;
    z-index: 2;
}

.ridge-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #00e5c8;
    box-shadow: 0 0 6px 2px rgba(0, 229, 200, 0.5);
}

.rd-1 { left: 15%; animation: ridge-blink 4s ease-in-out infinite; }
.rd-2 { left: 30%; animation: ridge-blink 6s ease-in-out 1s infinite; }
.rd-3 { left: 52%; animation: ridge-blink 5s ease-in-out 2s infinite; }
.rd-4 { left: 68%; animation: ridge-blink 7s ease-in-out 0.5s infinite; }
.rd-5 { left: 85%; animation: ridge-blink 4.5s ease-in-out 3s infinite; }

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

.landscape-text {
    position: relative;
    z-index: 10;
    padding: 0 10% 12vh;
}

.subtitle-text {
    max-width: 42ch;
    color: #e8dcc0;
    font-style: normal;
}

.subtitle-text em {
    color: #d4a84b;
    font-style: italic;
    font-weight: 600;
}

/* === Scene 4: The Provenance === */
.scene-4 {
    background: #131218;
}

.scene-4-content {
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.hud-container {
    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-ring {
    width: min(500px, 55vw);
    height: min(500px, 55vw);
    animation: hud-pulse 6s ease-in-out infinite;
}

@keyframes hud-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.hud-ring-outer {
    fill: none;
    stroke: #00e5c8;
    stroke-width: 1;
    stroke-dasharray: 3 7;
    animation: rotate-cw 30s linear infinite;
    transform-origin: 250px 250px;
}

.hud-ring-inner {
    fill: none;
    stroke: #e930a8;
    stroke-width: 1;
    stroke-dasharray: 12 4 2 4;
    animation: rotate-ccw 22s linear infinite;
    transform-origin: 250px 250px;
}

.hud-ring-data {
    fill: none;
    stroke: #00e5c8;
    stroke-width: 0.5;
    stroke-dasharray: 1 12;
    animation: rotate-cw 45s linear infinite;
    transform-origin: 250px 250px;
}

.hud-ring-core {
    fill: none;
    stroke: #8a849e;
    stroke-width: 0.5;
    stroke-dasharray: 8 3 1 3;
    animation: rotate-ccw 60s linear infinite;
    transform-origin: 250px 250px;
}

.hud-text {
    fill: #8a849e;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
}

@keyframes rotate-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-ccw {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.timeline {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding-right: 5%;
}

.timeline-entry {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #2a1535;
    padding-left: 1.2rem;
}

.timeline-date {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    color: #d4a84b;
}

.timeline-event {
    color: #e8dcc0;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    margin: 0.25rem 0;
}

.timeline-hash {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.08em;
    color: #8a849e;
}

/* === Scene 5: The Coda === */
.scene-5 {
    background: #08080c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

.coda-text {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #e8dcc0;
    opacity: 0;
    animation: coda-fade 2s ease forwards 3s;
    max-width: 30ch;
    line-height: 1.6;
}

@keyframes coda-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.coda-frame {
    position: relative;
    margin-top: 3rem;
    width: 200px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: coda-fade 2s ease forwards 4.5s;
    cursor: pointer;
}

.coda-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.coda-trace {
    fill: none;
    stroke: url(#neon-gradient);
    stroke-width: 1;
    stroke-dasharray: 716;
    stroke-dashoffset: 716;
    animation: border-trace-coda 6s linear infinite 4.5s;
}

@keyframes border-trace-coda {
    0% { stroke-dashoffset: 716; }
    100% { stroke-dashoffset: 0; }
}

.coda-label {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.12em;
    color: #8a849e;
    text-transform: lowercase;
    position: relative;
    z-index: 1;
    transition: color 0.6s ease;
}

.coda-frame:hover .coda-label {
    color: #00e5c8;
}
