/* ========================================
   muhan.ai — Grainy Cinematic Korean AI
   ======================================== */

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

:root {
    --film-dark: #2A2420;
    --film-black: #0C0A08;
    --grain-gray: #A09890;
    --deep-black: #181410;
    --sepia-accent: #C0A080;
    --film-white: #E8D8C0;
    --warm-white: #F0EDE8;
    --letterbox-height: 60px;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    background: #0C0A08;
    color: var(--warm-white);
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Film Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
    mix-blend-mode: overlay;
}

#grain-overlay::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: grainShift 0.5s steps(1) infinite;
}

@keyframes grainShift {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(8%, 5%); }
    30% { transform: translate(-3%, 12%); }
    40% { transform: translate(10%, -8%); }
    50% { transform: translate(-8%, 3%); }
    60% { transform: translate(5%, -5%); }
    70% { transform: translate(-10%, 8%); }
    80% { transform: translate(3%, -12%); }
    90% { transform: translate(8%, 10%); }
    100% { transform: translate(0, 0); }
}

/* Letterbox Bars */
.letterbox-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: var(--letterbox-height);
    background: #000000;
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.letterbox-top {
    top: 0;
}

.letterbox-bottom {
    bottom: 0;
}

.letterbox-nav {
    display: flex;
    gap: 32px;
    width: 100%;
    justify-content: flex-end;
}

.nav-label {
    font-family: 'Geist Mono', 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--grain-gray);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.4s ease;
    opacity: 0;
    animation: fadeInLabel 0.6s ease forwards;
}

.nav-label:nth-child(1) { animation-delay: 2.5s; }
.nav-label:nth-child(2) { animation-delay: 2.7s; }
.nav-label:nth-child(3) { animation-delay: 2.9s; }

.nav-label:hover {
    color: var(--sepia-accent);
}

@keyframes fadeInLabel {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bottom-bar-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.timecode {
    font-family: 'Geist Mono', 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 400;
    color: var(--sepia-accent);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInLabel 0.6s ease 3s forwards;
}

.film-meta {
    font-family: 'Geist Mono', 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 400;
    color: #4A4440;
    letter-spacing: 1.5px;
    opacity: 0;
    animation: fadeInLabel 0.6s ease 3.2s forwards;
}

/* Main Film Frame */
.film-frame {
    position: relative;
    background: var(--film-black);
}

/* Scenes */
.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--letterbox-height) + 40px) 0;
    position: relative;
    scroll-snap-align: start;
    background: var(--deep-black);
    opacity: 0;
    transition: opacity 1.5s ease;
}

.scene.active,
.scene.visible {
    opacity: 1;
}

/* Hero starts visible after intro animation */
#hero {
    background: var(--film-black);
    animation: projectorWarmUp 1.5s ease forwards;
}

@keyframes projectorWarmUp {
    from { background: #000000; }
    to { background: var(--deep-black); }
}

.scene-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 80px;
    width: 100%;
}

/* Rule of Thirds Positioning */
.thirds-right {
    padding-left: 35%;
    padding-right: 80px;
}

.thirds-left {
    padding-left: 80px;
    padding-right: 35%;
}

/* Hero Content */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 15%;
}

.wordmark {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 72px;
    color: var(--warm-white);
    letter-spacing: -1px;
    clip-path: inset(0 100% 0 0);
    animation: wordmarkReveal 2s linear 1.5s forwards;
    margin-bottom: 16px;
}

@keyframes wordmarkReveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

.hero-subtitle {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: var(--grain-gray);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInLabel 0.8s ease 3.5s forwards;
    margin-bottom: 32px;
}

.hero-descriptor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    animation: fadeInLabel 0.8s ease 4s forwards;
}

/* Typography */
.section-title {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--warm-white);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.body-text {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: var(--grain-gray);
    margin-bottom: 16px;
}

.tech-label {
    font-family: 'Geist Mono', 'Space Grotesk', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--sepia-accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-marker {
    display: block;
    margin-bottom: 12px;
    opacity: 0.7;
}

/* Sepia Rule */
.sepia-rule {
    width: 60px;
    height: 1px;
    background: var(--sepia-accent);
    margin-top: 32px;
    opacity: 0.5;
}

/* Model Grid */
.model-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.model-entry {
    padding-left: 16px;
    border-left: 1px solid var(--sepia-accent);
    opacity: 0.5;
}

.model-entry .tech-label {
    display: block;
    margin-bottom: 8px;
}

/* Signal Entries */
.signal-entries {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 24px;
}

.signal-entry {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(192, 160, 128, 0.15);
}

.signal-entry .tech-label {
    display: block;
    margin-bottom: 8px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 800;
    opacity: 0;
    animation: fadeInLabel 0.6s ease 4.5s forwards;
}

.scroll-line {
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--sepia-accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Scene Transitions — Cinematic Dissolve */
.scene {
    transition: opacity 1.2s ease;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --letterbox-height: 40px;
    }

    .scene-content,
    .thirds-right,
    .thirds-left {
        padding: 0 24px;
    }

    .hero-content {
        padding-left: 24px;
    }

    .wordmark {
        font-size: 42px;
    }

    .section-title {
        font-size: 20px;
    }

    .letterbox-nav {
        gap: 16px;
    }

    .nav-label {
        font-size: 9px;
    }
}
