/* ==========================================================================
   Base commune — tokens, reset, typographie, boutons, curseur, navigation
   ========================================================================== */

:root {
    /* Couleurs */
    --c-white: #fff;
    --c-text: rgba(255, 255, 255, 0.86);
    --c-text-soft: rgba(255, 255, 255, 0.6);
    --c-line: rgba(255, 255, 255, 0.22);
    --c-night: #0c1014;
    --c-violet-1: rgba(24, 14, 56, 0.6);
    --c-violet-2: rgba(15, 7, 41, 0.8);
    --grad-violet: linear-gradient(90deg, var(--c-violet-1) 0%, var(--c-violet-2) 100%);

    /* Typo */
    --f-display: "itc-avant-garde-gothic-pro", "Avant Garde", "Century Gothic", sans-serif;
    --f-body: "Poppins", system-ui, sans-serif;

    /* Mouvement */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --t-fast: 0.3s;
    --t-med: 0.5s;

    /* Espacements */
    --gutter: 3rem;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Échelle proportionnelle
   Toutes les tailles sont en rem. Sur desktop, 1rem suit la taille de la
   fenêtre en prenant pour référence la maquette 1920×1080 (1rem = 16px) :
   un écran 4K affiche donc le même rendu, deux fois plus grand.
   Sur mobile, 1rem reste à 16px.
   -------------------------------------------------------------------------- */
html {
    font-size: 16px;
}

@media (min-width: 769px) {
    html {
        /* 120 = 1920 / 16 ; 56 ≈ hauteur utile d'une fenêtre 1080p / 16 */
        font-size: clamp(14px, min(100vw / 120, 100vh / 56), 48px);
    }
}

body {
    font-family: var(--f-display);
    color: var(--c-white);
    background: var(--c-night);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, p {
    margin: 0;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

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

button {
    font: inherit;
}

::selection {
    background: rgba(166, 153, 204, 0.45);
    color: #fff;
}

:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.8);
    outline-offset: 0.25rem;
}

/* --------------------------------------------------------------------------
   Boutons (pilule)
   -------------------------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-family: var(--f-display);
    font-size: max(16px, 1rem);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        padding var(--t-med) var(--ease-out),
        background-color var(--t-med) var(--ease-out),
        color var(--t-med) var(--ease-out),
        border-color var(--t-med) var(--ease-out),
        transform var(--t-med) var(--ease-out),
        box-shadow var(--t-med) var(--ease-out);
}

.btn--primary {
    border: 1px solid #000;
    background: #fff;
    color: #000;
}

.btn--secondary {
    border: 1px solid #fff;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    -webkit-backdrop-filter: blur(0.375rem);
    backdrop-filter: blur(0.375rem);
}

/* La flèche apparaît dans la marge droite : le bouton garde sa taille au survol */
.btn .arrow {
    position: absolute;
    right: 1.125rem;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: -0.5625rem;
    opacity: 0;
    transform: translateX(-0.5rem);
    transition:
        opacity var(--t-med) var(--ease-out),
        transform var(--t-med) var(--ease-out);
}

.btn--secondary .arrow {
    filter: invert(1);
}

.btn .icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.btn--with-icon {
    gap: 0.625rem;
}

@media (hover: hover) and (pointer: fine) {
    .btn:has(.arrow):hover {
        padding-left: 1.25rem;
        padding-right: 2.75rem;
    }

    .btn:hover .arrow {
        opacity: 1;
        transform: translateX(0);
    }

    .btn--primary:hover {
        box-shadow: 0 0.625rem 2.5rem -0.75rem rgba(166, 153, 204, 0.8);
    }

    .btn--secondary:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

/* --------------------------------------------------------------------------
   Curseur personnalisé (desktop)
   -------------------------------------------------------------------------- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    -webkit-mask: url("../Content/Cursor_test.svg") center / contain no-repeat;
    mask: url("../Content/Cursor_test.svg") center / contain no-repeat;
    background: #fff;
    mix-blend-mode: difference;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity var(--t-fast) ease,
        scale 0.45s var(--ease-out);
}

.custom-cursor.is-visible {
    opacity: 1;
}

.custom-cursor.is-hover {
    scale: 0.18;
}

@media (hover: none), (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.nav-logo {
    display: inline-block;
    pointer-events: auto;
    transition: transform 0.6s var(--ease-out);
}

.nav-logo:hover {
    transform: rotate(-12deg) scale(1.06);
}

.nav-logo img {
    width: 2.5rem;
    height: 2.5rem;
}

/* --------------------------------------------------------------------------
   Transition entre pages
   -------------------------------------------------------------------------- */
.page-veil {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--c-night);
    pointer-events: none;
    opacity: 0;
    animation: veil-out 0.8s var(--ease-in-out) 0.05s backwards;
    transition: opacity 0.45s var(--ease-in-out);
}

@keyframes veil-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.is-leaving .page-veil {
    opacity: 1;
    transition-duration: 0.45s;
}

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

@media (max-width: 768px) {
    :root {
        --gutter: 1.5rem;
    }

    .btn {
        font-size: max(14px, 0.875rem);
        padding: 0.9375rem 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
