/* ============================================
   DOMUS CINEMA — Cinematic Dark Theme
   Palette: Dark (#0C0A09, #1C1917) + Gold (#D4AF37, #CA8A04)
   Fonts: Cinzel (headings) + Josefin Sans (body)
   ============================================ */

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

:root {
    --bg-deep: #0C0A09;
    --bg-dark: #1C1917;
    --bg-card: #1a1816;
    --bg-elevated: #292524;
    --gold: #D4AF37;
    --gold-dim: #CA8A04;
    --gold-bright: #F5D060;
    --text-primary: #F5F5F4;
    --text-secondary: #A8A29E;
    --text-muted: #78716C;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Josefin Sans', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Film Grain Overlay --- */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    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;
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-inner {
    text-align: center;
}

.film-strip {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    justify-content: center;
}

.film-strip .frame {
    width: 8px;
    height: 32px;
    background: var(--gold);
    animation: filmPulse 1.2s ease-in-out infinite;
}

.film-strip .frame:nth-child(2) { animation-delay: 0.1s; }
.film-strip .frame:nth-child(3) { animation-delay: 0.2s; }
.film-strip .frame:nth-child(4) { animation-delay: 0.3s; }
.film-strip .frame:nth-child(5) { animation-delay: 0.4s; }

@keyframes filmPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

.preloader-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 0.4em;
    color: var(--gold);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    transition: var(--transition);
}

.nav.scrolled {
    background: rgba(12, 10, 9, 0.92);
    backdrop-filter: blur(12px);
    padding: 14px 40px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.nav-logo-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--gold);
}

.nav-logo-sub {
    font-family: var(--font-body);
    font-size: 0.6rem;
    letter-spacing: 0.5em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-link:hover {
    color: var(--gold);
}

.nav-link:hover::after {
    width: 100%;
}

/* Burger */
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-burger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.nav-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-burger.active span:nth-child(2) {
    opacity: 0;
}
.nav-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 10, 9, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.mobile-link:hover {
    color: var(--gold);
}

/* --- HERO Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 100px;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0;
    transition: opacity 1.5s ease;
    transform: scale(1.05);
}

.hero-img.active {
    opacity: 1;
    animation: heroZoom 12s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(12, 10, 9, 0.2) 0%,
            rgba(12, 10, 9, 0.1) 25%,
            rgba(12, 10, 9, 0.5) 50%,
            rgba(12, 10, 9, 0.85) 70%,
            rgba(12, 10, 9, 0.98) 100%
        ),
        linear-gradient(90deg,
            rgba(12, 10, 9, 0.4) 0%,
            transparent 25%,
            transparent 75%,
            rgba(12, 10, 9, 0.4) 100%
        );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
}

.hero-badge {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.5em;
    color: var(--gold-dim);
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 20px;
}

.hero-title-line {
    display: block;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.hero-title-accent {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.6em;
    color: var(--gold);
    margin-top: 8px;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 32px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 14px 32px;
    transition: var(--transition);
}

.hero-cta:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.hero-cta svg {
    transition: transform var(--transition);
}

.hero-cta:hover svg {
    transform: translate(3px, -3px);
}

/* Scroll indicator */
.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.hero-scroll span {
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--gold), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --- Section Common --- */
.section-header {
    text-align: center;
    margin-bottom: 64px;
    padding-top: 120px;
}

.section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--gold-dim);
    display: block;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
}

/* --- FILMS Section (unified poster + video) --- */
.films {
    padding: 0 24px 120px;
    max-width: 1200px;
    margin: 0 auto;
}

.films-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.film-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.film-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.15);
}

/* Media container — poster + video stacked */
.film-card-media {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    background: #000;
}

.film-card-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease;
    z-index: 2;
}

.film-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* When playing — fade out poster to reveal video */
.film-card.is-playing .film-card-poster {
    opacity: 0;
}

/* Play button */
.film-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    cursor: pointer;
}

.film-card-play svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    margin-left: 3px;
}

.film-card-play::before {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 50%;
    background: rgba(12, 10, 9, 0.5);
    backdrop-filter: blur(4px);
    transition: var(--transition);
}

.film-card:hover .film-card-play::before {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
    transform: scale(1.08);
}

/* Hide play button when playing */
.film-card.is-playing .film-card-play {
    opacity: 0;
    pointer-events: none;
}

/* Show pause overlay on hover while playing */
.film-card.is-playing:hover .film-card-play {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.3);
}

.film-card.is-playing .film-card-play svg {
    display: none;
}

.film-card.is-playing .film-card-play::before {
    display: none;
}

.film-card.is-playing:hover .film-card-play::after {
    content: '';
    width: 18px;
    height: 22px;
    border-left: 4px solid var(--gold);
    border-right: 4px solid var(--gold);
}

/* Progress bar */
.film-card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 4;
    opacity: 0;
    transition: opacity var(--transition);
}

.film-card.is-playing .film-card-progress {
    opacity: 1;
}

.film-card-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--gold);
    transition: width 0.2s linear;
}

/* Info section */
.film-card-info {
    padding: 14px 16px 16px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 80px;
}

.film-card-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 4px;
    margin-top: auto;
    line-height: 1.4;
}

.film-card-genre {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- ABOUT Section --- */
.about {
    padding: 0 24px 120px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.about-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-content--single {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.about-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.about-text p {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.about-link {
    color: var(--gold-dim);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    transition: border-color var(--transition);
}

.about-link:hover {
    border-color: var(--gold);
}

.about-quote {
    font-style: italic;
    color: var(--gold-dim);
    font-size: 1.05rem;
    margin: 28px 0;
}

.about-director {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.about-visual {
    padding-top: 20px;
}

.about-principles {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.principle {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.principle:last-child {
    border-bottom: none;
}

.principle-number {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--gold-dim);
    flex-shrink: 0;
}

.principle-text {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    padding: 48px 24px;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo-text {
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.4em;
    color: var(--gold-dim);
}

.footer-logo-sub {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: rgba(212, 175, 55, 0.2);
    margin: 24px auto;
}

.footer-copy {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
}

.footer-year-link {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--gold-dim);
    opacity: 0.5;
    transition: opacity var(--transition);
    text-decoration: none;
}

.footer-year-link:hover {
    opacity: 0.85;
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-burger {
        display: flex;
    }

    .nav {
        padding: 16px 20px;
    }

    .nav.scrolled {
        padding: 12px 20px;
    }

    .hero-title-line {
        letter-spacing: 0.1em;
    }

    .hero-title-accent {
        letter-spacing: 0.3em;
    }

    .section-header {
        padding-top: 80px;
        margin-bottom: 40px;
    }

    .films {
        padding: 0 16px 80px;
    }

    .films-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .film-card-info {
        padding: 12px;
    }

    .film-card-title {
        font-size: 0.85rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .film-card-play::before {
        width: 44px;
        height: 44px;
    }

    .film-card-play svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .films-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .film-card-title {
        font-size: 0.75rem;
    }

    .film-card-info {
        padding: 10px;
        min-height: 60px;
    }
}
