/* ============================================
   Julien Suard — Portfolio 2026
   Reset + base
   ============================================ */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

:root {
    --color-bg: #ffffff;
    --color-fg: #000000;
    --color-muted: #9a9a9a;
    --color-accent: #1F77EA;
    --color-accent-hover: #1660C9;
    --color-halo: 255, 255, 255;
    --logo-filter: grayscale(1) contrast(1.1);

    --font-sans: "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --pad-x: clamp(20px, 4vw, 48px);
    --pad-y: clamp(20px, 3vw, 32px);
}

html.dark {
    --color-bg: #0b0b0b;
    --color-fg: #ffffff;
    --color-muted: #6a6a6a;
    --color-halo: 11, 11, 11;
    --logo-filter: grayscale(1) contrast(1.25) invert(1);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.4;
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

/* ============================================
   Background particles
   ============================================ */

.bg-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.hero,
.clients {
    position: relative;
    z-index: 1;
}

/* ============================================
   Header
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--pad-y) var(--pad-x);
}

.site-header > * {
    display: inline-flex;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    height: 44px;
    color: var(--color-fg);
    transition: transform 0.2s ease, color 0.4s ease;
}

.logo__content {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
}

.logo__text {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.05em;
    line-height: 1.3;
    max-width: 0;
    overflow: clip;
    overflow-clip-margin: 0.3em;
    opacity: 0;
    white-space: nowrap;
    transition: max-width 0.4s ease, opacity 0.2s ease;
}

.logo--revealed .logo__text {
    max-width: 140px;
    opacity: 1;
}

.logo__caret {
    display: inline-block;
    width: 2px;
    height: 22px;
    background: currentColor;
    align-self: center;
    margin: 0 1px;
    animation: caret-blink 0.56s steps(1) infinite;
    transition: opacity 0.5s ease;
}

.logo--caret-hidden .logo__caret {
    opacity: 0;
    animation: none;
}

.logo__dot {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: -0.05em;
    line-height: 1;
    color: #FF2D6F;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo--revealed .logo__dot {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.35s;
}

@keyframes caret-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: var(--color-fg);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

html.dark .theme-toggle {
    border-color: rgba(255, 255, 255, 0.18);
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

html.dark .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle__icon {
    width: 20px;
    height: 20px;
    display: block;
}

.theme-toggle__icon--sun { display: none; }
.theme-toggle__icon--moon { display: block; }
html.dark .theme-toggle__icon--sun { display: block; }
html.dark .theme-toggle__icon--moon { display: none; }

.logo:hover {
    transform: scale(1.04);
}

.connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    background: var(--color-accent);
    color: #ffffff;
    border-radius: 999px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.connect-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.connect-btn__icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* ============================================
   Hero
   ============================================ */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: calc(var(--pad-y) * 4) var(--pad-x) var(--pad-y);
    gap: clamp(20px, 3vw, 36px);
}

.hero__block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__name,
.hero__title,
.hero__location {
    position: relative;
    z-index: 1;
}

.hero__halo {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.7s ease 0.25s;
}

html:not(.js-ready) .hero__halo {
    opacity: 0;
    transition: none;
}

html.theme-switching .hero__halo {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hero__halo--name,
.hero__halo--location {
    inset: -90% -40%;
    background: radial-gradient(ellipse at center, rgba(var(--color-halo),1) 0%, rgba(var(--color-halo),0.9) 40%, rgba(var(--color-halo),0) 75%);
    filter: blur(18px);
}

.hero__halo--title {
    inset: -25% -8%;
    background: radial-gradient(ellipse at center, rgba(var(--color-halo),0.49) 0%, rgba(var(--color-halo),0.31) 35%, rgba(var(--color-halo),0) 70%);
    filter: blur(23px);
}

.hero__name {
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.hero__name strong {
    font-weight: 500;
}

.hero__title {
    font-size: clamp(48px, 10vw, 140px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
}

.hero__location {
    font-size: clamp(16px, 1.6vw, 20px);
    font-weight: 400;
    color: var(--color-fg);
}

/* Ticker rotatif (remplace l'ancien hero__location) */
.hero__ticker {
    position: relative;
    z-index: 1;
    font-size: clamp(16px, 1.6vw, 20px);
    font-weight: 400;
    color: var(--color-fg);
}

.hero__ticker-list {
    position: relative;
    display: grid;
    grid-template-areas: "stack";
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero__ticker-item {
    grid-area: stack;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(18px);
    filter: blur(1.5px);
    transition:
        opacity 0.5s cubic-bezier(0.65, 0, 0.35, 1),
        transform 0.5s cubic-bezier(0.65, 0, 0.35, 1),
        filter 0.5s ease;
    pointer-events: none;
}

.hero__ticker-item.is-active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    pointer-events: auto;
}

.hero__ticker-item.is-leaving {
    opacity: 0;
    transform: translateY(-18px);
    filter: blur(1.5px);
}

.hero__ticker-item a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.hero__ticker-item a:hover {
    opacity: 0.65;
}

/* ============================================
   Clients — carrousel infini
   ============================================ */

.clients {
    padding: var(--pad-y) 0;
    overflow: hidden;
}

.clients__viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
}

.clients__track {
    display: flex;
    align-items: center;
    gap: clamp(48px, 6vw, 96px);
    list-style: none;
    width: max-content;
    will-change: transform;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.clients__track.is-dragging {
    cursor: grabbing;
}

.clients__track img {
    -webkit-user-drag: none;
    pointer-events: none;
}

.clients__track li {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clients__track img {
    height: clamp(43px, 4.8vw, 67px);
    width: auto;
    max-width: none;
    object-fit: contain;
    filter: var(--logo-filter);
    opacity: 0.85;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.clients__track img:hover {
    opacity: 1;
    filter: grayscale(0);
}

html.dark .clients__track img {
    opacity: 1;
    filter: brightness(0) invert(1) contrast(1.1) drop-shadow(0 0 0.4px rgba(255, 255, 255, 0.5));
}

html.dark .clients__track img:hover {
    filter: grayscale(0);
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .hero {
        padding-top: calc(var(--pad-y) * 5);
    }

    .clients__track {
        gap: 20px;
    }

    .clients__track li {
        width: 18vw;
    }

    .clients__track img {
        height: 68px;
        max-width: 100%;
    }

    .clients__viewport {
        mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
    }
}

@media (max-width: 599px) {
    .clients__track li {
        width: 30vw;
    }
}

@media (max-width: 480px) {
    .connect-btn span {
        display: none;
    }

    .connect-btn {
        width: 44px;
        height: 44px;
        padding: 0;
        gap: 0;
        justify-content: center;
        border-radius: 50%;
        aspect-ratio: 1;
    }

    .connect-btn__icon {
        width: 16px;
        height: 16px;
    }

    .hero__title {
        letter-spacing: -0.03em;
    }
}

/* Accessibilité : focus visible */
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
