:root {
    --bleu-fonce: #1D202B;
    --beige-pale: #D0CDCA;
    --c-bleu:   #327FEF;
    --c-teal:   #33B793;
    --c-jaune:  #F0C177;
    --c-orange: #D3823E;
    --c-mauve:  #D69EE6;
    --c-gris:   #D0CDCA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: var(--bleu-fonce);
    color: var(--beige-pale);
    -webkit-tap-highlight-color: transparent;
}

main {
    width: 100%;
    height: 100%;
    position: relative;
}

#section-video {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0.8rem 1rem;
    padding-top: calc(0.8rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.6s ease;
}
header.hidden {
    opacity: 0;
    pointer-events: none;
}

nav ul {
    display: flex;
    list-style: none;
    width: 100%;
}

nav ul li a {
    color: var(--beige-pale);
    text-decoration: none;
    font-size: clamp(0.55rem, 2.5vw, 0.75rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

.container-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    filter: blur(40px);
    transition: opacity 9s ease, filter 5s ease;
    z-index: 1;
}
.container-video.reveal {
    opacity: 1;
    filter: blur(0px);
}
.container-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.container-video video.active {
    opacity: 1;
}

#grainCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    pointer-events: none;
    mix-blend-mode: screen;
}

.container-options {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    z-index: 10;
    transition: opacity 0.45s ease;
}
.container-options.hidden {
    opacity: 0;
    pointer-events: none;
}

.button-video {
    background: none;
    border: none;
    outline: none;
    padding: 0.3rem 0;
    margin: 0;
    cursor: pointer;
    color: var(--beige-pale);
    font-family: Arial, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: clamp(2rem, 7vw, 5rem);
    line-height: 1;
    position: relative;
    display: inline-block;
    transition: color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-underline {
    display: block;
    height: 2px;
    width: 0;
    transition: width 0.35s ease;
    position: absolute;
    bottom: -2px;
    left: 0;
    pointer-events: none;
}
.btn-underline.active { width: 100%; }

.button-video:active { font-weight: 700; }

.btn-hint {
    font-family: Arial, sans-serif;
    font-size: clamp(0.5rem, 2vw, 0.65rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--beige-pale);
    opacity: 0.35;
    pointer-events: none;
    margin-top: 0.1rem;
}

@keyframes btn-pulse {
    0%, 100% { transform: scale(1);       }
    50%       { transform: scale(1.02); }
}

#startBtn {
    animation: btn-pulse 7s ease-in-out infinite;
}
#startBtn.playing {
    animation: none;
}

@media (orientation: portrait) {
    .button-video {
        font-size: clamp(2.2rem, 10vw, 4.5rem);
    }
}

.timeline-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 0 1.5rem;
}
.timeline-wrap.visible { opacity: 1; }

.tl-track-area {
    width: 65%;
    display: flex;
    flex-direction: column;
}

@media (orientation: portrait) {
    .tl-track-area {
        width: 85%;
    }
}

.tl-ruler {
    position: relative;
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.tl-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 1.5px;
    background: rgba(208, 205, 202, 0.55);
}

.tl-ticks {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tl-tick {
    width: 1.5px;
    background: rgba(208, 205, 202, 0.7);
    flex-shrink: 0;
}
.tl-tick.tall { height: 100%; }
.tl-tick.short { height: 45%; }

.tl-head {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 2px;
    background: var(--beige-pale);
    transition: background 0.3s ease;
    z-index: 2;
}

.tl-year {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    letter-spacing: 0.18em;
    color: rgba(208, 205, 202, 0.65);
    font-family: Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.05s ease, color 0.3s ease;
    text-align: left;
}

.retour-btn {
    position: absolute;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: calc(1.2rem + env(safe-area-inset-left, 0px));
    background: none;
    border: none;
    color: var(--c-jaune);
    font-family: Arial, sans-serif;
    font-size: clamp(0.6rem, 2.5vw, 0.75rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.8s ease;
    z-index: 30;
    padding: 0.5rem 0;
    -webkit-tap-highlight-color: transparent;
}
.retour-btn.visible {
    opacity: 0.85;
    pointer-events: all;
}
.retour-btn::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--c-jaune);
    width: 0;
    transition: width 0.35s ease;
    margin-top: 3px;
}
.retour-btn:active::after { width: 100%; }

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 0.8rem 1rem;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.7rem;
    transition: opacity 0.5s ease;
}
footer.hidden {
    opacity: 0;
    pointer-events: none;
}
.footer-logo {
    height: clamp(16px, 3vw, 24px);
    width: auto;
    opacity: 0.5;
}
.footer-text {
    font-size: clamp(0.5rem, 1.8vw, 0.65rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.4;
    color: var(--beige-pale);
}

@media (orientation: portrait) {
    footer {
        justify-content: center;
    }
}