/* Dossier OVNI : compléments à landing/landing.css (même langage visuel que la landing Apollo).
   Cinq affaires : la Terre et le repère, puis un voile glisse depuis la droite avec la vidéo de la scène, la pièce
   d'archive et une phrase ; la vidéo grandit (sans plein écran), le phénomène apparaît dans l'image, les mots du témoin
   en sous-titre. Positions et mouvements calés sur le défilement : ovni6.js.
   Puces graphiques modestes : rien de grand ne glisse ni n'apparaît en fondu (découpes et dégradés repeints). */

/* Voile fixe : les phrases restent lisibles quand la Terre est claire */
.ov-veil {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(rgba(5, 5, 5, 0) 55%, rgba(5, 5, 5, 0.5));
}

/* Le son : un haut-parleur, barré quand le son est coupé */
.top__right { display: flex; align-items: center; gap: 22px; }
.top__sound {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--mute);
    cursor: pointer;
    transition: color 0.25s ease;
}
.top__sound:hover,
.top__sound[aria-pressed='true'] { color: var(--ink); }
.top__sound svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.top__sound .spk { fill: currentColor; stroke: none; }
.top__sound .wave { display: none; }
.top__sound[aria-pressed='true'] .wave { display: inline; }
.top__sound[aria-pressed='true'] .mute { display: none; }

/* Arrivée sur un lieu : l'année et le lieu */
.ov-where { bottom: calc(14svh + env(safe-area-inset-bottom)); text-shadow: 0 0 28px rgba(5, 5, 5, 0.6); }
.ov-where .ov-year { display: block; font-weight: 300; font-size: clamp(64px, 18vw, 150px); line-height: 0.9; letter-spacing: -0.02em; }
.ov-place { display: block; margin-top: 12px; font-size: clamp(16px, 4.4vw, 22px); color: rgba(236, 232, 223, 0.85); }

/* Le repère : discret, la ville et le pays à côté */
.ping {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}
.ping__dot {
    position: absolute;
    left: -3.5px;
    top: -3.5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff4e36;
    box-shadow: 0 0 0 1.5px rgba(5, 5, 5, 0.55);
}
.ping__lock {
    position: absolute;
    left: -18px;
    top: -18px;
    width: 36px;
    height: 36px;
    opacity: 0;
    transform: scale(2) rotate(45deg);
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}
.ping.is-locked .ping__lock { opacity: 0.9; transform: none; }
.ping__lock i { position: absolute; width: 9px; height: 9px; border: 0 solid #f4f1ea; }
.ping__lock i:nth-child(1) { left: 0; top: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.ping__lock i:nth-child(2) { right: 0; top: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.ping__lock i:nth-child(3) { left: 0; bottom: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.ping__lock i:nth-child(4) { right: 0; bottom: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.ping__place {
    position: absolute;
    left: 28px;
    top: -10px;
    white-space: nowrap;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: #f4f1ea;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.ping.is-locked .ping__place { opacity: 1; transition-delay: 0.45s; }

/* ------------------------------------------------------------------ les scènes */
.sc {
    position: absolute;
    inset: 0;
    z-index: 2;
    visibility: hidden;
    pointer-events: none;
}

/* Le voile : son bord en dégradé glisse depuis la droite (depuis le bas sur téléphone) */
.sc__veil {
    --edge: 110vw;
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 5, 5, 0) var(--edge), rgba(5, 5, 5, 0.9) calc(var(--edge) + 7vw), rgba(5, 5, 5, 0.97) calc(var(--edge) + 30vw));
}

/* La vidéo de la scène, dans le voile (positions et taille : ovni6.js) ; rendue en gravure (.sc__gl) */
.sc__win {
    position: absolute;
    left: var(--wl, 40%);
    top: var(--wt, 10%);
    width: var(--ww, 55%);
    height: var(--wh, 50%);
    overflow: hidden;
    background: #000;
    clip-path: inset(0 0 0 100%);
}
.sc__video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sc--nimitz .sc__video { object-fit: contain; }
.sc__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sc__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html:not(.engrave) .sc__video { filter: grayscale(1) contrast(1.15); }
/* avec le rendu gravure, la vidéo et le calque des phénomènes ne servent que de sources (pas affichés) */
html.engrave .sc__video { opacity: 0; }
html.engrave .sc__fx { visibility: hidden; }
.sc__black { position: absolute; inset: 0; background: #000; visibility: hidden; }
.sc.is-black .sc__black { visibility: visible; }

/* Les mots du témoin, en sous-titre dans la vidéo */
.sc__sub {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 16% 6% 4.5% 9%;
    background: linear-gradient(rgba(5, 5, 5, 0), rgba(5, 5, 5, 0.82) 55%);
    opacity: 0;
}
.sc__sub p { margin: 0; max-width: 24em; font-weight: 300; font-size: clamp(17px, 1.9vw, 32px); line-height: 1.2; text-wrap: balance; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.sc__sub footer { margin-top: 10px; font-size: 12.5px; line-height: 1.45; letter-spacing: 0.02em; color: rgba(236, 232, 223, 0.75); opacity: 0; transition: opacity 0.6s ease 0.5s; }
.sc__sub .w { display: inline-block; opacity: 0; transform: translateY(0.4em); transition: opacity 0.3s ease, transform 0.3s ease; }
.sc__sub.is-on .w { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.8s var(--ease); transition-delay: calc(var(--i) * 40ms); }
.sc__sub.is-on footer { opacity: 1; }
.sc__sub[data-lines]:not(.is-last) footer { opacity: 0; }
.sc.has-doc .sc__sub { padding-left: 36%; }
/* Rendlesham : la lumière est en bas, entre les arbres, sur un horizon clair ; la phrase passe en haut, sur le ciel sombre */
.sc--rendlesham.has-doc .sc__sub { top: 0; bottom: auto; padding: 4.5% 6% 13% 9%; background: linear-gradient(rgba(5, 5, 5, 0.8) 45%, rgba(5, 5, 5, 0)); }
@media (max-aspect-ratio: 21/20) {
    .sc.has-doc .sc__sub { padding-left: 6%; }
    .sc--rendlesham.has-doc .sc__sub { padding: 4% 6% 13%; }
}

/* La pièce d'archive, posée sur le bas de la vidéo */
.sc__docs { position: absolute; left: var(--dl, 50%); top: var(--dt, 50%); width: var(--dw, 200px); perspective: 1400px; }
.sc__doc {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transform-origin: 50% 40%;
    backface-visibility: hidden;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.55), 0 3px 6px rgba(0, 0, 0, 0.35);
}
.sc__doc--main { position: relative; }
.sc__doc--back { position: absolute; left: 62%; top: -14%; width: 96%; }
.sc--nimitz .sc__doc--back { left: 30%; top: -58%; width: 86%; }
.sc__doc.ev__video { padding: 5px 5px 6px; background: #f3efe6; }
.sc__doc.ev__video img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }

/* La phrase, à côté de la pièce */
.sc__cap { position: absolute; left: var(--cl, 70%); top: var(--ct, 70%); width: var(--cw, 25%); opacity: 0; }
.sc__text { font-weight: 300; font-size: clamp(16px, 1.55vw, 26px); line-height: 1.32; text-wrap: balance; }
.sc__ref { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--mute); }

/* ------------------------------------------------------------------ fin : les pièces qui flottent (rapport AARO, évaluation ODNI) */
.ev {
    position: absolute;
    z-index: 2;
    right: 5vw;
    top: 17svh;
    width: min(42vw, 27svh);
    perspective: 1400px;
    pointer-events: none;
    visibility: hidden;
}
.ev__p {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transform-origin: 50% 40%;
    backface-visibility: hidden;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.32);
}
.ev__p--main { position: relative; }

/* ------------------------------------------------------------------ écran en largeur (ordinateur) */
@media (min-aspect-ratio: 21/20) {
    .ov-veil {
        background: linear-gradient(rgba(5, 5, 5, 0) 50%, rgba(5, 5, 5, 0.5)),
            linear-gradient(90deg, rgba(5, 5, 5, 0.5), rgba(5, 5, 5, 0) 42%);
    }
    .ov-where { top: 50%; bottom: auto; transform: translateY(-50%); }
    .ov-where .ov-year { font-size: clamp(72px, 9vw, 160px); }
    .ov-place { font-size: clamp(17px, 1.5vw, 24px); }
    .ov-final { max-width: 11.5em; }
    .ov-final p:first-child { font-size: clamp(26px, 2.6vw, 46px); }
    .poll { max-width: 11.5em; }
    .poll p:first-child { max-width: none; font-size: clamp(26px, 2.6vw, 46px); }
    .ev { right: var(--gut); top: 50%; width: min(380px, 23vw, 46svh); translate: 0 -50%; }
}

/* ------------------------------------------------------------------ écran en hauteur (téléphone) : le voile monte depuis le bas */
@media (max-aspect-ratio: 21/20) {
    .top__right { gap: 16px; }
    .ping__place { left: -60px; top: 22px; width: 120px; text-align: center; font-size: 13px; }
    .sc__veil {
        --edge: 110svh;
        background: linear-gradient(rgba(5, 5, 5, 0) var(--edge), rgba(5, 5, 5, 0.92) calc(var(--edge) + 6svh), rgba(5, 5, 5, 0.97) calc(var(--edge) + 20svh));
    }
    .sc__win { clip-path: inset(100% 0 0 0); }
    .sc__sub p { font-size: clamp(15px, 4.4vw, 20px); }
    .sc__sub footer { font-size: 11px; }
    .sc__text { font-size: clamp(15px, 4.2vw, 19px); }
    .sc__ref { font-size: 12px; margin-top: 8px; }
    .sc__doc--back { left: -38%; top: -10%; width: 80%; }
}

/* Sans WebGL : une image fixe à la place de la Terre */
.ov-still { display: none; position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.ov-still img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; opacity: 0.85; }
html.no-webgl .ov-still,
html.no-js .ov-still { display: block; }
html.no-js .ov-still { position: absolute; height: 100vh; }
html.no-webgl .ping { display: none; }

/* Sans JavaScript : tout se lit comme une page */
html.no-js .ping,
html.no-js .top__sound,
html.no-js .ov-veil,
html.no-js .sc__veil,
html.no-js .sc__fx,
html.no-js .sc__doc--back { display: none; }
html.no-js .sc { position: relative; inset: auto; visibility: visible; margin: 0 var(--gut) 20vh; }
html.no-js .sc__win { position: relative; left: auto; top: auto; width: auto; height: auto; max-width: 720px; aspect-ratio: 16 / 9; clip-path: none; }
html.no-js .sc__docs,
html.no-js .sc__cap { position: relative; left: auto; top: auto; width: auto; max-width: 560px; margin-top: 24px; opacity: 1; }
html.no-js .sc__doc { opacity: 1; max-width: 320px; }
html.no-js .sc__sub { opacity: 1; }
html.no-js .sc__sub .w,
html.no-js .sc__sub footer { opacity: 1; transform: none; }
html.no-js .ev { position: relative; right: auto; top: auto; translate: none; width: min(340px, 80vw); margin: 0 var(--gut) 24vh; visibility: visible; }
html.no-js .ev__p { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .sc__sub .w { transition: none; transform: none; }
}

