/* ==============================================
   namu.works — Cinematic Chrome Screening Room
   ============================================== */

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    background: #0A0C10;
    color: #A0A8B0;
    height: 100%;
    overflow: hidden;
    cursor: default;
}

/* --- Film Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Filmstrip Horizontal Scroll --- */
#filmstrip {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    height: 100vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#filmstrip::-webkit-scrollbar {
    display: none;
}

/* --- Panel Base --- */
.panel {
    flex: 0 0 90vw;
    min-height: 100vh;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 2vw;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #2A2C30, #1A1C20) 1;
    background: #141618;
    transition: transform 0.3s ease;
    will-change: transform;
}

.panel:first-child {
    margin-left: 5vw;
}

.panel:last-child {
    margin-right: 5vw;
}

.panel-inner {
    width: 100%;
    max-width: 1100px;
    padding: 4rem 5rem;
    position: relative;
}

/* --- Chrome Gradient Text --- */
.chrome-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    background: linear-gradient(135deg, #E8E4E0 0%, #A0A8B0 40%, #C0A870 60%, #E8E4E0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.15em;
    line-height: 1.1;
}

/* --- Typography --- */
h2 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: #E8E4E0;
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
}

h3 {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #E8E4E0;
    margin-bottom: 0.5rem;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    color: #A0A8B0;
    max-width: 600px;
}

.section-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #C0A870;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2rem;
}

.section-label::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.section-label::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1.2rem;
    height: 1px;
    background: #C0A870;
}

/* --- Tagline --- */
.tagline {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: #607890;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* --- Scroll Invite --- */
.scroll-invite {
    position: absolute;
    bottom: 3rem;
    right: 5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeInScroll 1.5s ease 2s forwards;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: #C0A870;
    animation: pulseArrow 2s ease-in-out infinite;
}

.scroll-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #607890;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

@keyframes fadeInScroll {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseArrow {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(8px); opacity: 0.5; }
}

/* --- Film Leader Panels --- */
.panel-leader {
    flex: 0 0 30vw;
    background: #0A0C10;
    border: none;
    border-image: none;
}

.leader-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.leader-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #C0A870;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 1.8rem;
    color: #C0A870;
    position: relative;
    opacity: 0.7;
}

.leader-circle.large {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
}

.leader-crosshair {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(192, 168, 112, 0.15);
    border-radius: 50%;
}

.leader-crosshair::before,
.leader-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(192, 168, 112, 0.15);
}

.leader-crosshair::before {
    width: 100%;
    height: 1px;
    top: 50%;
    left: 0;
}

.leader-crosshair::after {
    width: 1px;
    height: 100%;
    top: 0;
    left: 50%;
}

/* Film leader in title panel */
#leader-intro {
    position: absolute;
    top: 3rem;
    right: 5rem;
    opacity: 0;
    animation: leaderFlicker 0.5s ease 0.5s forwards;
}

@keyframes leaderFlicker {
    0% { opacity: 0; }
    20% { opacity: 0.8; }
    40% { opacity: 0.2; }
    60% { opacity: 0.9; }
    80% { opacity: 0.4; }
    100% { opacity: 0.7; }
}

/* --- Data Viz: Bar Chart --- */
.data-viz {
    margin-top: 2.5rem;
}

.viz-title {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #C0A870;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #A0A8B0;
    width: 120px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.bar-track {
    flex: 1;
    height: 6px;
    background: #1A1C20;
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #607890, #A0B0C0);
    border-radius: 3px;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bar-value {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #C0A870;
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

/* --- Work Grid --- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.work-card {
    position: relative;
    background: #0A0C10;
    border: 1px solid #2A2C30;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.work-card:hover {
    border-color: #C0A870;
    transform: translateY(-4px);
}

.work-card-chrome {
    height: 4px;
    background: linear-gradient(90deg, #2A2C30, #607890, #2A2C30);
    transition: background 0.4s ease;
}

.work-card:hover .work-card-chrome {
    background: linear-gradient(90deg, #C0A870, #E8E4E0, #C0A870);
}

.work-card-content {
    padding: 1.5rem;
}

.work-card-content p {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #A0A8B0;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.work-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #C0A870;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid rgba(192, 168, 112, 0.3);
    padding: 0.25rem 0.6rem;
    display: inline-block;
}

/* --- Metrics / Progress Rings --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.progress-ring {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #1A1C20;
    stroke-width: 4;
}

.ring-fill {
    fill: none;
    stroke: #A0B0C0;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-value {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #E8E4E0;
}

.metric-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #C0A870;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Process Timeline --- */
.process-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-top: 2.5rem;
}

.process-step {
    flex: 1;
    padding: 1.5rem;
    background: #0A0C10;
    border: 1px solid #2A2C30;
    position: relative;
    transition: border-color 0.4s ease;
}

.process-step:hover {
    border-color: #607890;
}

.step-number {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #C0A870;
    letter-spacing: 0.15em;
    margin-bottom: 0.75rem;
}

.process-step p {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: #A0A8B0;
    line-height: 1.7;
}

.process-connector {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, #2A2C30, #607890, #2A2C30);
    align-self: center;
    flex-shrink: 0;
}

/* --- Contact Panel --- */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #1A1C20;
}

.contact-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #607890;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    width: 100px;
    flex-shrink: 0;
}

.contact-value {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: #E8E4E0;
}

.status-available {
    color: #C0A870;
}

.end-mark {
    margin-top: 4rem;
    text-align: center;
}

.end-reel {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: rgba(192, 168, 112, 0.4);
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

/* --- Panel Navigation Dots --- */
#panel-nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 1000;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2A2C30;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.nav-dot.active {
    background: #C0A870;
    transform: scale(1.3);
}

.nav-dot:hover {
    background: #607890;
}

/* --- Tilt 3D effect via CSS custom properties --- */
.panel:not(.panel-leader) {
    transform: perspective(1000px) rotateY(var(--ry, 0deg));
    transition: transform 0.15s ease-out;
}

/* --- Panel Enter Animations --- */
.panel-inner {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.panel.in-view .panel-inner {
    opacity: 1;
    transform: translateY(0);
}

/* --- Leader panel fade animation --- */
.panel-leader .panel-inner {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-leader.in-view .panel-inner {
    opacity: 1;
    transform: scale(1);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .panel {
        flex: 0 0 95vw;
        margin: 0 1vw;
    }

    .panel:first-child { margin-left: 2.5vw; }
    .panel:last-child { margin-right: 2.5vw; }

    .panel-inner {
        padding: 2.5rem 2rem;
    }

    .panel-leader {
        flex: 0 0 40vw;
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-timeline {
        flex-direction: column;
    }

    .process-connector {
        width: 1px;
        height: 30px;
        align-self: center;
    }

    .scroll-invite {
        right: 2rem;
        bottom: 2rem;
    }

    #leader-intro {
        right: 2rem;
        top: 2rem;
    }
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .bar-label {
        width: 80px;
        font-size: 0.6rem;
    }

    .contact-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact-label {
        width: auto;
    }
}
