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

html,
body {
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    color-scheme: dark;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    opacity: 0;
    animation: page-in 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

a,
button {
    color: inherit;
    text-decoration: none;
    font-family: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

img {
    -webkit-user-drag: none;
    user-select: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
 * Design tokens
 * ============================================================ */
:root {
    --edge-x: clamp(1.25rem, 3.15vw, 3.75rem);
    --edge-y: clamp(1.5rem, 4.6vh, 3.25rem);
    --ui-size: clamp(1.05rem, 1.3vw, 1.2rem);
    --ui-weight: 400;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --panel-width: 27.0833%;
    --hit: 1.75rem;
    --hit-in: 2.6rem;
}

/* ============================================================
 * Homepage — full-bleed video
 * ============================================================ */
.hero {
    position: fixed;
    inset: 0;
    background: #000;
    cursor: pointer;
}

.hero video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
}

.logo {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: clamp(140px, min(16.35vw, 42vh), 640px);
    height: auto;
    transform: translate(-50%, -50%);
    cursor: default;
    /* The file is a square with the wordmark centered. Clip the
       transparent margin so only the wordmark catches the click. */
    clip-path: inset(36.5% 10.63% 36.5% 10.67%);
    user-select: none;
}

/* ============================================================
 * À propos (top-right) — same type as Contact
 * ============================================================ */
.about-link {
    position: fixed;
    top: calc(var(--edge-y) - var(--hit));
    right: calc(var(--edge-x) - var(--hit));
    z-index: 10;
    padding: calc(0.35rem + var(--hit)) var(--hit) var(--hit-in) var(--hit-in);
    font-size: var(--ui-size);
    font-weight: var(--ui-weight);
    letter-spacing: 0.02em;
    line-height: 1;
    text-align: right;
    color: #fff;
    opacity: 1;
    -webkit-text-fill-color: #fff;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

/* ============================================================
 * Contact (bottom-left) — fade Contact ↔ email on hover
 * ============================================================ */
.contact {
    position: fixed;
    bottom: calc(var(--edge-y) - var(--hit));
    left: calc(var(--edge-x) - var(--hit));
    z-index: 10;
    padding: var(--hit-in) var(--hit-in) calc(0.35rem + var(--hit)) var(--hit);
    font-size: var(--ui-size);
    font-weight: var(--ui-weight);
    letter-spacing: 0.02em;
    color: #fff;
    opacity: 1;
    -webkit-text-fill-color: #fff;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    line-height: 1;
    min-width: calc(12ch + var(--hit) + var(--hit-in));
    text-align: left;
    isolation: isolate;
}

.contact__label {
    display: inline-block;
    color: #fff;
    -webkit-text-fill-color: #fff;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    transition: opacity 0.35s var(--ease);
}

.contact__label--email {
    position: absolute;
    left: var(--hit);
    bottom: calc(0.35rem + var(--hit));
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

@media (hover: hover) {
    .contact:hover .contact__label--default,
    .contact:focus-visible .contact__label--default {
        opacity: 0;
    }

    .contact:hover .contact__label--email,
    .contact:focus-visible .contact__label--email {
        opacity: 1;
    }
}

.contact.is-revealed .contact__label--default {
    opacity: 0;
}

.contact.is-revealed .contact__label--email {
    opacity: 1;
}

.contact__toast {
    position: absolute;
    left: var(--hit);
    bottom: calc(0.35rem + var(--hit) + var(--ui-size) + 0.7rem);
    font-size: calc(var(--ui-size) * 0.9);
    font-weight: var(--ui-weight);
    letter-spacing: 0.02em;
    color: #fff;
    -webkit-text-fill-color: #fff;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transform: translateY(4px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.contact.is-copied .contact__toast {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
 * YouTube overlay
 * ============================================================ */
.yt-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-overlay[hidden] {
    display: none;
}

.yt-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.yt-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-close {
    position: fixed;
    top: var(--edge-y);
    right: var(--edge-x);
    z-index: 101;
    width: clamp(36px, 5vw, 44px);
    height: clamp(36px, 5vw, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #fff;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.yt-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

body.yt-lock {
    overflow: hidden;
}

/* ============================================================
 * About page
 * ============================================================ */
.about-page {
    display: flex;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #000;
}

.slideshow {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.slideshow__viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slideshow__track {
    display: flex;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 1.3s cubic-bezier(0.42, 0.02, 0.18, 1);
    will-change: transform;
}

.slideshow__track.is-instant {
    transition: none;
}

.slideshow__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.slideshow__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}

.zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    z-index: 2;
    cursor: pointer;
}

.zone--forward {
    left: 0;
}

.zone--back {
    right: 0;
}

.zone:focus {
    outline: none;
}

.zone:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.75);
    outline-offset: -8px;
}

.panel {
    position: relative;
    flex: 0 0 var(--panel-width);
    width: var(--panel-width);
    height: 100%;
    background: #000;
    color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(13.5px, 0.833vw, 16px);
    line-height: 1.45;
}

.panel__content {
    height: 100%;
    overflow-y: auto;
    padding: clamp(2.5rem, 7.13vh, 4.85rem) 12.3% 5.5rem 10.2%;
    scrollbar-width: none;
}

.panel__content::-webkit-scrollbar {
    display: none;
}

.panel section + section {
    margin-top: 1.65em;
}

.panel p {
    margin: 0 0 1.35em;
    font-weight: 400;
}

.panel section p:last-child {
    margin-bottom: 0;
}

.panel .label {
    font-weight: 700;
}

.back {
    position: absolute;
    right: clamp(1.5rem, 3.5vw, 4.2rem);
    bottom: clamp(1.35rem, 4.5vh, 3.05rem);
    z-index: 2;
    width: clamp(28px, 2.4vw, 36px);
    height: clamp(14px, 1.2vw, 18px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.9;
    transition: opacity 0.2s var(--ease), transform 0.35s var(--ease);
}

.back svg {
    width: 100%;
    height: 100%;
    display: block;
}

.back::before {
    content: "";
    position: absolute;
    inset: -1.6rem;
}

.back:hover {
    opacity: 1;
    transform: translateX(-3px);
}

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

    body {
        animation: none;
        opacity: 1;
    }

    .back,
    .about-link,
    .contact__label,
    .contact__toast {
        transition: none;
    }
}

/* ============================================================
 * Narrow screens
 * ============================================================ */
@media (max-width: 860px) {
    .about-page {
        flex-direction: column;
    }

    .slideshow {
        flex: none;
        width: 100%;
        height: 50dvh;
    }

    .panel {
        flex: none;
        width: 100%;
        height: 50dvh;
        min-height: 0;
        font-size: 14.5px;
    }

    .panel__content {
        padding: 1.5rem 1.35rem 4.5rem;
    }

    .back {
        position: fixed;
        top: max(2rem, env(safe-area-inset-top));
        left: max(2rem, env(safe-area-inset-left));
        right: auto;
        bottom: auto;
        z-index: 5;
        opacity: 1;
        filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.7));
    }
}

@media (max-width: 640px) {
    :root {
        --ui-size: 0.95rem;
    }

    .about-link {
        left: 50%;
        right: auto;
        width: max-content;
        transform: translateX(-50%);
        text-align: center;
        top: calc(max(var(--edge-y), env(safe-area-inset-top)) - var(--hit));
        padding-left: var(--hit);
        padding-right: var(--hit);
    }

    .contact {
        left: 50%;
        right: auto;
        width: max-content;
        min-width: calc(24ch + (var(--hit) * 2));
        transform: translateX(-50%);
        text-align: center;
        bottom: calc(max(var(--edge-y), env(safe-area-inset-bottom)) - var(--hit));
        padding-left: var(--hit);
        padding-right: var(--hit);
    }

    .contact__label--email,
    .contact__toast {
        left: 50%;
        transform: translateX(-50%);
    }

    .contact__toast {
        transform: translate(-50%, 4px);
    }

    .contact.is-copied .contact__toast {
        transform: translate(-50%, 0);
    }
}
