/* —— Fonts —— */
@font-face {
    font-family: 'Plain';
    src: url('../fonts/Plain-thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plain';
    src: url('../fonts/Plain-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Anchor';
    src: url('../fonts/Anchor_Semibold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Churchward';
    src: url('../fonts/Churchward Marianna.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* —— Base —— */
:root {
    --cursor-size: 25px;
    --image-scale: 0.15;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #f8f8f8;
    font-family: Plain, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    transition: background-color .3s ease;
    touch-action: manipulation;
    cursor: none !important;
}

p {
    margin: 0;
    padding: 0;
    margin-block-start: 0;
    margin-block-end: 0;
}

#loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffdd06;
    z-index: 999900000;
    /* au-dessus de tout */
    transition: opacity .6s ease;
}

#loader-logo {
    background: url('https://avvnc.com/wp-content/themes/AVVNC/assets/img/logo.png') no-repeat center;
    background-size: contain;
    width: 30vw;
    height: 8vw;
    max-width: 300px;
    max-height: 80px;
}

.loader-btn {
    margin-top: 2rem;
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    background: #111;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    display: none;
    /* caché par défaut (desktop) */
}

/* Tweaks faciles */
#loader {
  --breath-min: .3;          /* opacité mini */
  --breath-max: 1;           /* opacité maxi */
  --breath-duration: 1.2s;   /* rythme de la respiration */
}

/* Animation uniquement en opacité pendant que le loader est visible */
#loader-logo {
  will-change: opacity;
  opacity: var(--breath-max);
}

#loader:not(.is-hidden) #loader-logo {
  animation: avvnc-breath-opacity var(--breath-duration) ease-in-out infinite alternate;
}

@keyframes avvnc-breath-opacity {
  0%   { opacity: var(--breath-min); }
  100% { opacity: var(--breath-max); }
}

/* Masquage propre quand tu fermes le loader en JS */
#loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .6s ease, visibility .6s ease;
}

/* Accessibilité : pas d’anim si réduit le mouvement */
@media (prefers-reduced-motion: reduce) {
  #loader:not(.is-hidden) #loader-logo {
    animation: none;
    opacity: 1;
  }
}




header {
    position: relative;
    z-index: 9999;
    padding: 2em 2em 0 2em;
}

/* —— Logo + Title —— */
#logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    gap: .5em;
    user-select: none;
    margin-bottom: .3em;
    --logo-shift: 0px;
    width: 100%;
}

.logo {
    display: inline-flex;
    gap: 0;
    font-family: 'Churchward', sans-serif;
    font-size: 3.3rem;
    font-weight: bold;
    cursor: alias;
    margin-right: .1em;
}

.letter {
    position: relative;
    display: inline-block;
    margin-right: -0.15em;
}

.inner {
    display: inline-block;
}

.tail {
    position: absolute;
    top: 0;
    left: 100%;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-20%);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
    letter-spacing: -2px !important;
    margin-left: -5px;

}

.letter.expanded .tail {
    opacity: 1;
    transform: translateX(0);
}

#logo-wrap h1 {
    display: inline-block;
    font-size: .8em;
    margin: 0;
    padding: 0;
    margin-top: .3em;
    font-weight: normal;
    opacity: 1;
    transform: translateX(var(--logo-shift));
    transition: opacity .25s ease;
}

#logo-wrap.is-animating h1 {
    opacity: 0;
    pointer-events: none;
}


/* LANGAGE SWITCH */
/*
.lang-switch {
  position: absolute;
  bottom: 0;              
  right: 2em;
  display: flex;
  gap: .6em;
  font-family: Plain, sans-serif;
  font-size: .8em;
  line-height: 1;
  transform: translateY(20%); 

}
*/
.lang-switch {
    right: 0;
    gap: .6em;
    font-family: Plain, sans-serif;
    font-size: .8em;
    line-height: 1;
    margin-top: .5em;
    position: absolute;
    float: right;
}

.lang-link {
    text-decoration: none;
    color: #000;
    border: 1px solid transparent;
    border-radius: 999px;
}

.lang-link.active {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/*
.lang-switch .lang-link::after {
    content: "/";
    margin-left: 0.2em;
}

.lang-switch .lang-link:last-child::after {
    content: "";
}
*/



/* —— Intro & Buttons —— */
#intro {
    font-family: Anchor, sans-serif;
    font-size: 3.5em;
    line-height: .9em;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0;
}

.button {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1.5em;
    /*margin: 0 .5em 0 1em;*/
    text-decoration: none;
    color: #000;
    font-family: Plain, sans-serif;
    font-size: 11px;
    line-height: 1;
    font-weight: normal;
}

.pill {
    display: inline-grid;
    align-items: center;
    border: 1px solid;
    border-radius: 20vw;
    padding: .3em .7em;
    overflow: hidden;
    transition: width .22s ease, background .22s ease;
    background: transparent;
}

.pill .label {
    grid-area: 1/1;
    white-space: nowrap;
    transition: opacity .22s ease, transform .22s ease;
}

.pill .label.alt {
    opacity: 0;
    transform: translateY(20%);
}

.button:hover .pill .label.default,
.button:focus-visible .pill .label.default {
    opacity: 0;
    transform: translateY(-20%);
}

.button:hover .pill .label.alt,
.button:focus-visible .pill .label.alt {
    opacity: 1;
    transform: translateY(0);
}

.button:hover .pill,
.button:focus-visible .pill {
    background: #fff;
}

#skills {
    font-size: .8em;
    margin-top: 1em;
}

/* —— Cursor & dropped images —— */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .06) inset, 0 6px 16px rgba(0, 0, 0, .12);
    will-change: transform, left, top;
}

/*
.image {
    position: absolute;
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -50%) scale(var(--image-scale));
    max-width: none;
    max-height: none;
    will-change: transform, left, top;
}
*/

.image {
    position: absolute;
    pointer-events: none;
    user-select: none;
    transform: translate(-50%, -50%) scale(var(--image-scale));
    max-width: none;
    max-height: none;
    will-change: transform, left, top;
}


/* —— Gyro permission overlay —— */
.perm-wrap {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    background: rgb(255, 230, 0);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.perm-card {
    max-width: min(420px, 90vw);
    text-align: center;
}

.perm-card h2 {
    font-size: 18px;
    margin: 0 0 8px;
}

.perm-card p {
    font-size: 14px;
    margin: 0 0 12px;
    opacity: .8;
}

.perm-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    background: #111;
    color: #fff;
    cursor: pointer;
}

footer {
    position: absolute;
    z-index: 9999;
    padding: 0 2em 2em;
    bottom: 0;
}

footer a {
    text-decoration: none;
    color: #000;
    font-size: 0.8em;
    align-items: center;
    border: 1px solid;
    border-radius: 20vw;
    padding: .3em .7em;
    transition: all 0.5s;
}

footer a:hover {
    background: white;
}

/* Desktop: native cursor ok */
@media (hover:hover) and (pointer:fine) {
    body {
        cursor: default;
    }
}

@media screen and (max-width: 768px) {

    #loader-logo {
        width: 60vw;
        height: 16vw;
    }

    #logo-wrap h1 {
        font-size: .6em;
        margin-top: .4em;
    }

    .loader-btn {
        display: inline-block;
    }

    header {
        padding: 1em .5em 0 .5em;
    }

    .logo {
        font-size: 2.3rem;
    }
    .lang-switch {
        font-size: .6em;
    }
    #intro {
        font-size: 2em;
    }

    .button {
        top: -.4em;
        margin: 0;
    }

    #skills {
        font-size: .6em;
        margin-top: 1em;
        line-height: 1.2em;
    }

    footer {
        padding: 0 .5em .5em;
    }

    footer a {
        font-size: .6em;
    }

    :root {
        --image-scale: 0.12;
    }
}
