/* La bendición: Cadaqués, gekalkte muren, blauwe deuren, filmtitel in crème op zwart */
:root {
    --ink: #0b0b0a;
    --cream: #efe6cf;
    --cream-dim: rgba(239, 230, 207, 0.72);
    --door-blue: #1f4f7a;
    --door-blue-dark: #163a5a;
    --terracotta: #b8613b;
    --terracotta-dark: #a05230;

    --font-display: "EB Garamond", Garamond, Georgia, serif;
    --font-body: "Jost", "Helvetica Neue", Arial, sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);

    /* Tijdlijn van de intro (seconden) */
    --t-letters: 0.3s;
    --t-letter-step: 0.075s;
    --t-curtain: 2.2s;
    --t-tagline: 2.7s;
    --t-byline: 3.4s;
    --t-door: 3.8s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--ink);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Titel, letter voor letter ---------- */

.title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3.25rem, 11vw, 8.5rem);
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--cream);
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.title .ch {
    display: inline-block;
    opacity: 0;
    filter: blur(8px);
    transform: translateY(0.18em);
    animation: letter-in 1.4s var(--ease-out) forwards;
    animation-delay: calc(var(--t-letters) + var(--i) * var(--t-letter-step));
}

@keyframes letter-in {
    to {
        opacity: 1;
        filter: blur(0);
        transform: none;
    }
}

/* ---------- Homepage: interactieve Cadaqués-scène ---------- */

.is-login {
    overflow: hidden;
}

.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: max(14vh, 4.5rem) 1rem max(5vh, 1.5rem);
    text-align: center;
    isolation: isolate;
}

.scene {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.scene > * {
    position: absolute;
    inset: -4%;
    transition: translate 1.2s var(--ease-out);
    will-change: translate;
}

.photo {
    background:
        url("cadaques.jpg") 59% 60% / cover no-repeat, /* focus op de kerk */
        linear-gradient(180deg, #9cc0de 0%, #cfdbe2 34%, #6f7a4c 46%, #f2ede2 52%, #e8dfcd 58%, #1f4a72 62%, #12385c 100%);
    scale: 1.16;
    animation: ken-burns 14s var(--ease-soft) forwards;
}

@keyframes ken-burns {
    to {
        scale: 1.04;
    }
}

/* Warme ochtendzon rechtsboven */
.sun {
    background: radial-gradient(circle at 72% 30%, rgba(255, 214, 150, 0.38), transparent 42%);
    mix-blend-mode: soft-light;
    animation: sun-breathe 9s ease-in-out infinite alternate;
}

@keyframes sun-breathe {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Zeemist die over de heuvels links drijft, zoals in de film */
.mist {
    background:
        radial-gradient(ellipse 38% 22% at 18% 34%, rgba(255, 255, 255, 0.55), transparent 70%),
        radial-gradient(ellipse 30% 16% at 34% 26%, rgba(255, 255, 255, 0.35), transparent 70%);
    filter: blur(14px);
    opacity: 0.7;
    animation: mist-drift 26s ease-in-out infinite alternate;
}

@keyframes mist-drift {
    from { transform: translateX(-6%); opacity: 0.45; }
    to { transform: translateX(8%); opacity: 0.8; }
}

/* Leesbaarheid van titel en deur */
.shade {
    inset: 0;
    background:
        radial-gradient(ellipse 85% 34% at 50% 26%, rgba(11, 11, 10, 0.6), transparent 80%),
        linear-gradient(180deg, rgba(11, 11, 10, 0.65) 0%, rgba(11, 11, 10, 0.35) 38%, rgba(11, 11, 10, 0) 58%, rgba(11, 11, 10, 0.25) 75%, rgba(11, 11, 10, 0.75) 100%);
    translate: none !important;
}

.curtain {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--ink);
    pointer-events: none;
    animation: curtain-lift 2s var(--ease-soft) var(--t-curtain) forwards;
}

@keyframes curtain-lift {
    to { opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 2;
    margin-bottom: auto; /* deur + hint samen onderaan */
    transition: translate 1.2s var(--ease-out);
}

.tagline {
    max-width: 42ch;
    margin: 1rem auto 0;
    text-wrap: balance;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.15rem, 2.6vw, 1.6rem);
    line-height: 1.3;
    color: var(--cream);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.55);
    opacity: 0;
    animation: fade-up 1.8s var(--ease-out) var(--t-tagline) forwards;
}

.byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.9rem;
    margin: 1.1rem 0 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cream);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.55);
    opacity: 0;
    animation: fade-up 1.6s var(--ease-out) var(--t-byline) forwards;
}

.byline em {
    font-family: var(--font-display);
    font-size: 1.2em;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cream);
}

.byline .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--terracotta);
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---------- De blauwe boogdeur ---------- */

.door {
    position: relative;
    z-index: 2;
    width: min(100%, 300px);
    padding: 4rem 1.5rem 1.6rem;
    background: var(--door-blue);
    border-radius: 150px 150px 4px 4px;
    box-shadow:
        inset 0 0 0 6px var(--door-blue-dark),
        inset 0 0 0 7px rgba(255, 255, 255, 0.08),
        0 30px 60px -25px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    opacity: 0;
    transform: translateY(40px);
    transform-origin: 50% 100%;
    animation: door-rise 1.6s var(--ease-out) var(--t-door) forwards;
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

@keyframes door-rise {
    to { opacity: 1; transform: none; }
}

.door:focus-within {
    box-shadow:
        inset 0 0 0 6px var(--door-blue-dark),
        inset 0 0 0 7px rgba(255, 255, 255, 0.14),
        0 0 0 1px rgba(239, 230, 207, 0.25),
        0 30px 70px -20px rgba(0, 0, 0, 0.7);
}

.door-label {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.3;
}

.door input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(239, 230, 207, 0.35);
    border-radius: 2px;
    background: rgba(239, 230, 207, 0.08);
    color: var(--cream);
    font: inherit;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.15em;
    transition: border-color 0.3s, background-color 0.3s;
}

.door input::placeholder {
    color: rgba(239, 230, 207, 0.5);
    letter-spacing: 0.1em;
}

.door input:focus {
    outline: none;
    border-color: var(--cream);
    background: rgba(239, 230, 207, 0.14);
}

.door button {
    position: relative;
    overflow: hidden;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 2px;
    background: var(--terracotta);
    color: #fff;
    font: inherit;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.15s ease;
}

.door button:hover,
.door button:focus-visible {
    background: var(--terracotta-dark);
}

.door button:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 2px;
}

.door button:active {
    transform: scale(0.98);
}

.device-hint p {
    margin: 0;
}

.device-joke {
    display: none;
    margin-top: 0.35rem !important;
    font-family: var(--font-display);
    font-size: 1rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
    color: var(--cream);
}

.device-hint {
    position: relative;
    z-index: 2;
    margin: 1rem 0 0;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--cream-dim);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hero-footer {
    position: relative;
    z-index: 2;
    max-width: 100%;
    opacity: 0;
    animation: fade-up 1.6s var(--ease-out) calc(var(--t-door) + 0.6s) forwards;
}

.has-error .hero-footer {
    animation: none;
    opacity: 1;
}

.film-footer .device-hint {
    margin: 0 0 1.25rem;
}

/* Logo's: wit, rustig, gelijke optische hoogte */
.partners {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    margin-top: 0.9rem;
}

.partners img {
    display: block;
    width: auto;
    height: 34px;
    opacity: 0.85;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
    transition: opacity 0.3s ease;
}

.partners a {
    display: block;
    border-radius: 4px;
}

.partners a:hover img,
.partners a:focus-visible img {
    opacity: 1;
}

.partners a:focus-visible {
    outline: 1px solid var(--cream);
    outline-offset: 4px;
}

.film-footer .partners {
    margin: 0 0 2rem;
}

/* Op smalle schermen valt de nagemaakte mist als waas over de zijkant; de foto heeft al echte mist */
@media (max-width: 768px) {
    .mist {
        display: none;
    }
}

@media (max-width: 480px) {
    .device-joke {
        display: block;
    }

    .partners {
        gap: 1.25rem;
    }

    .partners img {
        height: 44px; /* op mobiel bewust groter dan desktop (34px) */
    }
}

.error {
    margin: 0;
    font-size: 0.9rem;
    color: #f3d3c4;
}

/* Foute code: geen intro opnieuw, deur schudt even */
.has-error .curtain {
    display: none;
}

.has-error .title .ch,
.has-error .tagline,
.has-error .byline,
.has-error .photo {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
}

.has-error .photo {
    scale: 1.04;
}

.has-error .door {
    animation: shake 0.55s var(--ease-out) forwards;
    opacity: 1;
}

@keyframes shake {
    0% { opacity: 1; transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
    100% { opacity: 1; transform: none; }
}

/* Na het indrukken van Entra: de deur gaat open en het beeld gaat naar zwart */
.is-entering .door {
    animation: none;
    opacity: 1;
    transform: scale(1.06);
    box-shadow:
        inset 0 0 0 6px var(--door-blue-dark),
        0 0 120px 10px rgba(255, 220, 160, 0.35);
}

.is-entering .curtain {
    display: block;
    z-index: 5;
    opacity: 0;
    animation: fade-to-black 0.8s var(--ease-soft) 0.15s forwards;
}

@keyframes fade-to-black {
    to { opacity: 1; }
}

/* ---------- Filmpagina ---------- */

.is-film {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(31, 79, 122, 0.22), transparent 60%),
        var(--ink);
}

/* Titelkaart zoals in de film, daarna maakt hij plaats voor de video */
.titlecard {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: var(--ink);
    text-align: center;
    animation: titlecard-out 1.4s var(--ease-soft) 2.6s forwards;
}

@keyframes titlecard-out {
    to { opacity: 0; visibility: hidden; }
}

.film-header {
    padding: 3.5rem 1rem 2rem;
    text-align: center;
    opacity: 0;
    animation: fade-up 1.4s var(--ease-out) 3.2s forwards;
}

.eyebrow {
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--terracotta);
}

.eyebrow em {
    font-family: var(--font-display);
    font-size: 1.2em;
    letter-spacing: 0;
}

.film-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    line-height: 1;
}

.film-kicker {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--cream-dim);
}

.film {
    flex: 1;
    width: min(100%, 1100px);
    margin: 0 auto;
    padding: 0 1rem;
    opacity: 0;
    animation: fade-up 1.6s var(--ease-out) 3.5s forwards;
}

.frame {
    position: relative;
    padding: 8px;
    background: #f6f2ea;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

.frame video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.film-footer {
    padding: 3rem 1rem 2rem;
    text-align: center;
}

.film-footer a {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.film-footer a:hover,
.film-footer a:focus-visible {
    color: var(--cream);
    border-bottom-color: currentColor;
}

@media (max-width: 480px) {
    .hero {
        padding-top: max(16vh, 5rem);
    }

    .frame {
        padding: 4px;
    }

    .film-header {
        padding-top: 2.5rem;
    }
}

/* Geen beweging voor wie dat heeft uitgezet */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Streaming controls */
.playback-options { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; flex-wrap: wrap; padding: 1rem 0; color: #d6d2c9; font-family: 'Jost', sans-serif; font-size: .85rem; }
.playback-options select { max-width: 100%; border: 1px solid #777268; border-radius: 4px; padding: .6rem .8rem; background: #161615; color: #f5f1e8; font: inherit; }
.playback-options select:focus-visible { outline: 2px solid #d6b885; outline-offset: 3px; }
.film-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid #f6f2ea; border-radius: 4px; padding: 1rem 1.8rem; background: #234f72; color: #f6f2ea; font: 500 1rem 'Jost', sans-serif; cursor: pointer; }
.film-start[hidden] { display: none; }
.film-start:focus-visible { outline: 3px solid #d6b885; outline-offset: 4px; }
.film-status { position: absolute; top: 1.2rem; left: 1.2rem; right: 1.2rem; width: fit-content; max-width: calc(100% - 2.4rem); margin: 0 auto; padding: .65rem 1rem; background: rgba(11, 11, 10, .85); color: #f6f2ea; font: .9rem/1.5 'Jost', sans-serif; text-align: center; pointer-events: none; }
.film-status:empty { display: none; }
