/* sora.markets -- cinematic, letterboxed, immersive scroll */

:root {
    --deep-space: #0B0D17;
    --aurora-cyan: #00D4AA;
    --signal-amber: #FFB347;
    --nebula-rose: #FF6B8A;
    --steel-blue: #2A3B5C;
    --frost-white: #E8ECF1;
    --deep-teal: #0A4A4A;

    --letterbox-h: 12vh;
    --safe-h: 76vh;

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
}

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

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

body {
    background: var(--deep-space);
    color: var(--frost-white);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    min-height: 100vh;
    letter-spacing: 0.01em;
}

/* ============================================
   LETTERBOX BARS (persistent 12vh top and bottom)
   ============================================ */
.letterbox {
    position: fixed;
    left: 0;
    right: 0;
    height: var(--letterbox-h);
    background: #000;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5vw;
    pointer-events: none;
}

.letterbox-top {
    top: 0;
    border-bottom: 1px solid rgba(232, 236, 241, 0.04);
}

.letterbox-bottom {
    bottom: 0;
    border-top: 1px solid rgba(232, 236, 241, 0.04);
}

.letterbox-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(232, 236, 241, 0.55);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.letterbox-meta-center {
    flex: 0;
    color: rgba(232, 236, 241, 0.3);
}

.letterbox-meta-left {
    flex: 1;
}

.letterbox-meta-right {
    flex: 1;
    justify-content: flex-end;
}

/* subtle glowing indicator on letterbox */
.letterbox-top::before,
.letterbox-bottom::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--aurora-cyan);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--aurora-cyan);
    opacity: 0.6;
}

.letterbox-top::before {
    bottom: -2px;
}

.letterbox-bottom::after {
    top: -2px;
}

/* ============================================
   SCENE WIPE OVERLAY
   ============================================ */
.scene-wipe {
    position: fixed;
    top: var(--letterbox-h);
    left: 0;
    height: var(--safe-h);
    width: 100%;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
}

.scene-wipe.active {
    animation: film-wipe 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes film-wipe {
    0% {
        background: linear-gradient(90deg, rgba(0, 212, 170, 0) 0%, rgba(0, 212, 170, 0.3) 50%, rgba(0, 212, 170, 0) 100%);
        background-size: 200% 100%;
        background-position: -100% 0;
        opacity: 1;
    }
    100% {
        background: linear-gradient(90deg, rgba(0, 212, 170, 0) 0%, rgba(0, 212, 170, 0.3) 50%, rgba(0, 212, 170, 0) 100%);
        background-size: 200% 100%;
        background-position: 100% 0;
        opacity: 0;
    }
}

/* ============================================
   FILM REEL (scroll-snap container)
   ============================================ */
.film-reel {
    scroll-snap-type: y mandatory;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.film-reel::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ============================================
   SCENE (viewport-height frame)
   ============================================ */
.scene {
    height: 100vh;
    width: 100vw;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: var(--letterbox-h) 0;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* ============================================
   AURORA LAYER (background gradient wash)
   ============================================ */
.aurora-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    will-change: transform;
}

.aurora-blob {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: aurora-breathe 24s ease-in-out infinite;
}

.aurora-blob-cyan {
    background: radial-gradient(circle, var(--aurora-cyan) 0%, transparent 70%);
    opacity: 0.12;
}

.aurora-blob-amber {
    background: radial-gradient(circle, var(--signal-amber) 0%, transparent 70%);
    opacity: 0.07;
    animation-delay: -8s;
    animation-duration: 28s;
}

.aurora-blob-rose {
    background: radial-gradient(circle, var(--nebula-rose) 0%, transparent 70%);
    opacity: 0.09;
    animation-delay: -16s;
    animation-duration: 32s;
}

.aurora-blob.pos-tl {
    top: 20%;
    left: 15%;
    transform: none;
}

.aurora-blob.pos-tr {
    top: 20%;
    left: auto;
    right: 10%;
    transform: none;
}

.aurora-blob.pos-bl {
    top: auto;
    bottom: 10%;
    left: 10%;
    transform: none;
}

.aurora-blob.pos-br {
    top: auto;
    bottom: 10%;
    left: auto;
    right: 10%;
    transform: none;
}

.aurora-blob.pos-center-lg {
    width: 80vw;
    height: 80vw;
}

.aurora-blob.faint {
    opacity: 0.05;
}

@keyframes aurora-breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15) rotate(20deg);
    }
}

/* Adjust breathe for positioned blobs */
.aurora-blob.pos-tl,
.aurora-blob.pos-tr,
.aurora-blob.pos-bl,
.aurora-blob.pos-br {
    animation-name: aurora-breathe-pos;
}

@keyframes aurora-breathe-pos {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(25deg);
    }
}

/* ============================================
   ICON LAYER (midground depth)
   ============================================ */
.icon-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    will-change: transform;
}

.scene-icon {
    width: min(72vw, 820px);
    height: auto;
    max-height: 60vh;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.3s;
    filter: drop-shadow(0 0 18px rgba(0, 212, 170, 0.18));
}

.scene.is-active .scene-icon {
    opacity: 1;
}

/* ============================================
   SCENE CONTENT (foreground text, lower-third)
   ============================================ */
.scene-content {
    position: absolute;
    z-index: 3;
    left: 7vw;
    bottom: calc(var(--letterbox-h) + 4vh);
    width: 40%;
    max-width: 520px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out 0.4s, transform 1s ease-out 0.4s;
    will-change: transform, opacity;
}

.scene.is-active .scene-content {
    opacity: 1;
    transform: translateY(0);
}

.scene-number {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--aurora-cyan);
    letter-spacing: 0.3em;
    margin-bottom: 1.2em;
    opacity: 0.8;
}

.scene-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1.1;
    color: var(--frost-white);
    margin-bottom: 0.8em;
    letter-spacing: -0.01em;
}

.scene-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    color: rgba(232, 236, 241, 0.82);
    max-width: 36ch;
    margin-bottom: 1.8em;
}

.scene-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(232, 236, 241, 0.45);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: flex;
    gap: 0.6em;
    align-items: center;
}

.scene-meta::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--aurora-cyan);
    opacity: 0.7;
    margin-right: 0.4em;
}

/* ============================================
   SCENE 1 - TITLE CARD
   ============================================ */
.scene-1 {
    align-items: center;
    justify-content: center;
}

.title-card {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 4vw;
}

.title-preamble {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--aurora-cyan);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-bottom: 2.5em;
    opacity: 0;
    animation: fade-in-slow 2s ease-out 0.3s forwards;
}

.title-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--frost-white);
    margin-bottom: 1em;
    opacity: 0;
    animation: fade-in-slow 2s ease-out 0.6s forwards;
    text-shadow: 0 0 40px rgba(0, 212, 170, 0.15);
}

.title-tagline {
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: rgba(232, 236, 241, 0.65);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin-bottom: 3em;
    font-weight: 400;
    opacity: 0;
    animation: fade-in-slow 1.5s ease-out 1.8s forwards;
}

.title-rating {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(232, 236, 241, 0.35);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 0.6em 1em;
    border: 1px solid rgba(232, 236, 241, 0.15);
    display: inline-block;
    opacity: 0;
    animation: fade-in-slow 1.5s ease-out 2.4s forwards;
}

@keyframes fade-in-slow {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
    position: absolute;
    bottom: calc(var(--letterbox-h) + 3vh);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    opacity: 0;
    animation: fade-in-slow 1.5s ease-out 3s forwards;
}

.scroll-indicator-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.4em;
    color: rgba(232, 236, 241, 0.45);
    text-transform: uppercase;
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--aurora-cyan), transparent);
    animation: scroll-pulse 2.2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
}

/* ============================================
   SCENE 6 - CREDITS
   ============================================ */
.scene-6 {
    justify-content: center;
    align-items: stretch;
    padding-top: var(--letterbox-h);
    padding-bottom: var(--letterbox-h);
}

.credits-viewport {
    position: relative;
    z-index: 3;
    width: 100%;
    height: var(--safe-h);
    overflow: hidden;
    display: flex;
    justify-content: center;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.credits-reel {
    position: absolute;
    top: 100%;
    width: min(600px, 90vw);
    text-align: center;
    padding: 3em 0;
    will-change: transform;
}

.credits-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--frost-white);
    margin-bottom: 0.5em;
    letter-spacing: -0.01em;
}

.credits-subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.35em;
    color: var(--aurora-cyan);
    text-transform: uppercase;
    margin-bottom: 5em;
}

.credits-block {
    margin-bottom: 3.5em;
}

.credits-role {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.4em;
    color: rgba(232, 236, 241, 0.45);
    text-transform: uppercase;
    margin-bottom: 0.8em;
}

.credits-name {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--frost-white);
    line-height: 1.4;
}

.credits-list {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: rgba(232, 236, 241, 0.75);
    line-height: 2;
}

.credits-list > div {
    margin-bottom: 0.15em;
}

.credits-themes .credits-list {
    font-style: italic;
}

.credits-end {
    margin-top: 6em;
    padding-top: 3em;
    border-top: 1px solid rgba(232, 236, 241, 0.1);
}

.credits-fin {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.1em;
    color: var(--aurora-cyan);
    margin-bottom: 2em;
    text-shadow: 0 0 30px rgba(0, 212, 170, 0.3);
}

.credits-copyright {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.25em;
    color: rgba(232, 236, 241, 0.3);
    text-transform: uppercase;
    line-height: 1.8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --letterbox-h: 8vh;
        --safe-h: 84vh;
    }

    .scene-content {
        left: 5vw;
        width: 85%;
        bottom: calc(var(--letterbox-h) + 3vh);
    }

    .letterbox-meta-center {
        display: none;
    }

    .letterbox {
        padding: 0 4vw;
    }

    .scene-icon {
        width: 95vw;
        max-height: 40vh;
    }

    .aurora-blob {
        width: 100vw;
        height: 100vw;
    }
}

@media (max-width: 480px) {
    .letterbox-meta {
        font-size: 8px;
    }

    .title-preamble {
        letter-spacing: 0.3em;
    }

    .title-tagline {
        letter-spacing: 0.2em;
    }
}
