/* ==========================================================================
   quietjoon.net - Cinematic Personal Network
   Palette:
     Cinema Dark:      #0A0E1A
     Midnight Purple:  #1A0A20
     Electric Violet:  #8B5CF6
     Dark Teal:        #0D9488
     Neon Coral:       #F97316
     Silver Screen:    #C8D0D8
     Dim Gray:         #6B7280
   Fonts:
     Playfair Display (headlines/brand)
     Inter (body)
     Space Mono (credits/labels)
   ========================================================================== */

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

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

body {
    background: #0A0E1A;
    color: #C8D0D8;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Depth Layers --- */
.depth-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.depth-bg {
    z-index: 0;
}

.depth-mid {
    z-index: 1;
}

.depth-fg {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

/* --- Circuit Trace Layer --- */
#circuit-layer {
    opacity: 0;
    transition: opacity 1s ease;
}

#circuit-svg {
    width: 100%;
    height: 100%;
}

#circuit-svg .trace {
    stroke: #6B7280;
    stroke-width: 1.5;
    fill: none;
    opacity: 0.1;
}

#circuit-svg .node {
    fill: #6B7280;
    opacity: 0.12;
}

/* --- Watercolor Wash Layer --- */
#wash-layer {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
}

.wash-violet {
    background: radial-gradient(circle, #8B5CF6 0%, transparent 70%);
}

.wash-teal {
    background: radial-gradient(circle, #0D9488 0%, transparent 70%);
}

.wash-coral {
    background: radial-gradient(circle, #F97316 0%, transparent 70%);
}

.wash-1 {
    width: 600px;
    height: 600px;
    top: -10%;
    left: -5%;
    animation: wash-drift-1 22s ease-in-out infinite alternate;
}

.wash-2 {
    width: 500px;
    height: 500px;
    top: 20%;
    right: -8%;
    animation: wash-drift-2 18s ease-in-out infinite alternate;
}

.wash-3 {
    width: 450px;
    height: 450px;
    bottom: 10%;
    left: 15%;
    animation: wash-drift-3 25s ease-in-out infinite alternate;
}

.wash-4 {
    width: 550px;
    height: 550px;
    top: 50%;
    right: 20%;
    animation: wash-drift-4 20s ease-in-out infinite alternate;
}

.wash-5 {
    width: 350px;
    height: 350px;
    bottom: -5%;
    right: -3%;
    opacity: 0.15;
    animation: wash-drift-5 24s ease-in-out infinite alternate;
}

@keyframes wash-drift-1 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(80px, 60px); }
}

@keyframes wash-drift-2 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-70px, 50px); }
}

@keyframes wash-drift-3 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(60px, -40px); }
}

@keyframes wash-drift-4 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-50px, -60px); }
}

@keyframes wash-drift-5 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(40px, 30px); }
}

/* --- Letterboxing --- */
.letterbox {
    width: 100%;
    height: 5vh;
    background: #000000;
    position: relative;
    z-index: 5;
}

/* --- Title Card --- */
#title-card {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(160deg, #0A0E1A 0%, #1A0A20 50%, #0A0E1A 100%);
    position: relative;
    overflow: hidden;
}

.title-card-inner {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 120px);
    color: #C8D0D8;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(50px);
}

.brand.animate-in {
    animation: bounce-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.subtitle {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(16px, 2.5vw, 24px);
    color: #6B7280;
    margin-top: 24px;
    opacity: 0;
    max-width: 600px;
}

.subtitle.animate-in {
    animation: fade-in 1s ease forwards;
}

@keyframes bounce-in {
    0%   { opacity: 0; transform: translateY(50px); }
    60%  { opacity: 1; transform: translateY(-8px); }
    80%  { transform: translateY(3px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Scene Chapters --- */
.scene-chapter {
    padding: 120px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.scene-header {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scene-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-number {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #8B5CF6;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.scene-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 72px);
    color: #C8D0D8;
    line-height: 1.1;
}

.scene-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

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

.scene-content p {
    margin-bottom: 24px;
    color: #C8D0D8;
}

.scene-content p:last-child {
    margin-bottom: 0;
}

/* --- Filmstrip Gallery --- */
#scene-03 {
    padding: 120px 24px;
    max-width: 100%;
    overflow: visible;
}

#scene-03 .scene-header {
    max-width: 800px;
    margin: 0 auto 48px auto;
}

.filmstrip-gallery {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 24px 48px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8B5CF6 #0A0E1A;
}

.filmstrip-gallery::-webkit-scrollbar {
    height: 6px;
}

.filmstrip-gallery::-webkit-scrollbar-track {
    background: #0A0E1A;
}

.filmstrip-gallery::-webkit-scrollbar-thumb {
    background: #8B5CF6;
    border-radius: 3px;
}

.film-frame {
    min-width: 320px;
    max-width: 320px;
    background: #0A0E1A;
    border: 8px solid #1A0A20;
    border-top-width: 28px;
    border-bottom-width: 28px;
    position: relative;
    scroll-snap-align: start;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.film-frame:hover {
    border-color: #8B5CF6;
}

.frame-content {
    padding: 32px 24px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(180deg, rgba(26, 10, 32, 0.4) 0%, rgba(10, 14, 26, 0.8) 100%);
}

.frame-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 22px;
    color: #C8D0D8;
    margin-bottom: 16px;
}

.frame-desc {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #6B7280;
}

/* Sprocket holes */
.sprocket-holes {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    pointer-events: none;
}

.sprocket-top {
    top: -20px;
    height: 12px;
}

.sprocket-bottom {
    bottom: -20px;
    height: 12px;
}

.sprocket-holes::before,
.sprocket-holes::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0A0E1A;
    box-shadow:
        24px 0 0 #0A0E1A,
        48px 0 0 #0A0E1A,
        72px 0 0 #0A0E1A,
        96px 0 0 #0A0E1A,
        120px 0 0 #0A0E1A,
        144px 0 0 #0A0E1A;
}

.sprocket-holes::after {
    position: absolute;
    right: 0;
    box-shadow:
        -24px 0 0 #0A0E1A,
        -48px 0 0 #0A0E1A,
        -72px 0 0 #0A0E1A,
        -96px 0 0 #0A0E1A,
        -120px 0 0 #0A0E1A,
        -144px 0 0 #0A0E1A;
}

/* --- Credits Section --- */
.credits-section {
    background: #000000;
    position: relative;
}

.credits-viewport {
    height: 60vh;
    overflow: hidden;
    position: relative;
}

.credits-scroll {
    text-align: center;
    padding: 60vh 24px;
    animation: credits-roll 30s linear infinite;
}

@keyframes credits-roll {
    0%   { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
}

.credits-label {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 40px);
    color: #C8D0D8;
    margin-bottom: 8px;
}

.credits-role {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #6B7280;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.credits-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #C8D0D8;
    margin-bottom: 8px;
}

.credits-spacer {
    height: 32px;
}

.credits-final {
    font-style: italic;
    color: #8B5CF6;
    margin-top: 48px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .scene-chapter {
        padding: 80px 20px;
    }

    .filmstrip-gallery {
        padding: 24px 20px;
    }

    .film-frame {
        min-width: 280px;
        max-width: 280px;
    }

    .wash {
        filter: blur(80px);
    }

    .wash-1 { width: 350px; height: 350px; }
    .wash-2 { width: 300px; height: 300px; }
    .wash-3 { width: 280px; height: 280px; }
    .wash-4 { width: 320px; height: 320px; }
    .wash-5 { width: 200px; height: 200px; }
}

@media (max-width: 480px) {
    .brand {
        font-size: clamp(36px, 12vw, 64px);
    }

    .scene-chapter {
        padding: 60px 16px;
    }

    .film-frame {
        min-width: 260px;
        max-width: 260px;
    }
}
