/* ==========================================================================
   Sébastien Debauche — Développeur freelance
   ========================================================================== */

:root {
    --bg: #0b0b0e;
    --bg-soft: #131318;
    --fg: #f5f2ec;
    --muted: #a09fa8;
    --coral: #ff4764;
    --coral-soft: #ff7a8f;
    --violet: #6a4dff;
    --line: rgba(255, 255, 255, .1);
    --pad: clamp(20px, 5vw, 80px);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --script: 'Caveat', 'Segoe Script', cursive;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--coral); color: #fff; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--coral); outline-offset: 4px; border-radius: 4px; }

.script {
    font-family: var(--script);
    font-weight: 700;
    color: var(--coral);
    letter-spacing: 0;
    font-size: 1.12em;
    line-height: 1;
}

.mark { display: block; fill: var(--coral); }

/* --- Chargement ---------------------------------------------------------- */

.loader {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    background: var(--bg);
    animation: loader-out .9s 1.15s var(--ease) forwards;
}
.loader .mark { width: 92px; overflow: visible; }
.loader .mark-l { animation: mark-in-l .8s var(--ease) both; }
.loader .mark-r { animation: mark-in-r .8s var(--ease) both; }

@keyframes mark-in-l { from { transform: translate(-160px, -160px); opacity: 0; } }
@keyframes mark-in-r { from { transform: translate(160px, 160px); opacity: 0; } }
@keyframes loader-out { to { transform: translateY(-100%); visibility: hidden; } }

/* --- Décor fixe : grain, curseur, progression ---------------------------- */

.grain {
    position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
    position: fixed; top: 0; left: 0; z-index: 80;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--violet));
    transform: scaleX(0); transform-origin: left;
}

.cursor {
    position: fixed; top: 0; left: 0; z-index: 95;
    width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--fg);
    mix-blend-mode: difference;
    pointer-events: none;
    display: none; place-items: center;
    transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s;
}
.has-cursor .cursor { display: grid; opacity: 0; }
.has-cursor .cursor.is-active { opacity: 1; }
.cursor-label { font-size: 13px; font-weight: 600; color: #fff; opacity: 0; transition: opacity .2s; }
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.cursor.is-view {
    width: 96px; height: 96px; margin: -48px 0 0 -48px;
    background: var(--coral); mix-blend-mode: normal;
}
.cursor.is-view .cursor-label { opacity: 1; }

/* --- Navigation ---------------------------------------------------------- */

.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 18px var(--pad);
    transition: background .4s, backdrop-filter .4s, padding .4s, transform .5s var(--ease);
}
.nav.is-scrolled {
    padding-block: 12px;
    background: rgba(11, 11, 14, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark { width: 30px; transition: transform .6s var(--ease); }
.brand:hover .mark { transform: rotate(-90deg); }

.nav-links { display: flex; gap: 34px; font-size: 15px; }
.nav-links a { position: relative; color: var(--muted); transition: color .3s; }
.nav-links a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
    background: var(--coral); transform: scaleX(0); transform-origin: right;
    transition: transform .4s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* --- Boutons & liens ----------------------------------------------------- */

.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 18px 34px; border: 0; border-radius: 999px;
    background: var(--coral); color: #fff;
    font: 600 16px/1 var(--font); white-space: nowrap;
    cursor: pointer; overflow: hidden; isolation: isolate;
    box-shadow: 0 10px 40px -10px rgba(255, 71, 100, .7);
}
.btn::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: var(--fg); border-radius: inherit;
    transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover { color: var(--bg); }
.btn:hover::before { transform: translateY(0); }
.btn { transition: color .35s; }
.btn-small { padding: 13px 22px; font-size: 14px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.link-arrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 4px;
    transition: border-color .3s, gap .3s var(--ease);
}
.link-arrow::after { content: '→'; color: var(--coral); }
.link-arrow:hover { border-color: var(--coral); gap: 16px; }
.link-up::after { content: '↑'; }

/* --- Hero ---------------------------------------------------------------- */

.hero {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: flex; align-items: flex-end;
    padding: 140px var(--pad) clamp(70px, 10vh, 120px);
    overflow: hidden;
    background:
        radial-gradient(60% 50% at 80% 20%, rgba(255, 71, 100, .28), transparent 70%),
        radial-gradient(50% 50% at 15% 10%, rgba(106, 77, 255, .22), transparent 70%),
        var(--bg);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s; }
.hero-canvas.is-ready { opacity: 1; }
.hero::after {
    content: ''; position: absolute; inset: auto 0 0 0; height: 35%;
    background: linear-gradient(transparent, var(--bg)); pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; width: 100%; }

.hero-kicker { font-size: clamp(30px, 3.6vw, 52px); margin-bottom: 10px; transform: rotate(-3deg); transform-origin: left; display: inline-block; }

.hero-title {
    font-size: clamp(50px, min(9.4vw, 16vh), 190px);
    font-weight: 800; line-height: .95; letter-spacing: -.045em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .09em; margin-bottom: -.09em; }
.hero-title .line > span { display: block; }
.hero-title em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--coral); }

.hero-foot {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap;
    margin-top: clamp(28px, 5vh, 56px);
}
.hero-lead { max-width: 30em; font-size: clamp(17px, 1.5vw, 21px); color: #d6d3cf; }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.scroll-hint {
    position: absolute; z-index: 2; left: 50%; bottom: 22px;
    width: 26px; height: 42px; margin-left: -13px;
    border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 20px;
}
.scroll-hint span {
    position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
    border-radius: 4px; background: var(--coral);
    animation: hint 1.8s var(--ease) infinite;
}
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(16px); opacity: 0; } }

/* --- Bandeau défilant ---------------------------------------------------- */

.marquee {
    overflow: hidden; padding: clamp(26px, 4vw, 46px) 0;
    border-block: 1px solid var(--line);
    transform: rotate(-1.2deg) scale(1.02);
    background: var(--bg);
}
.marquee-track { display: flex; align-items: center; gap: 40px; width: max-content; animation: marquee 32s linear infinite; }
.marquee span { font-size: clamp(34px, 6vw, 88px); font-weight: 800; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.marquee .outline { color: transparent; -webkit-text-stroke: 1.5px rgba(245, 242, 236, .55); }
.marquee i { flex: none; width: 18px; height: 18px; background: var(--coral); transform: rotate(45deg); }
.marquee i:last-child { margin-right: 40px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --- Sections ------------------------------------------------------------ */

.section { padding: clamp(90px, 14vw, 190px) var(--pad); }
.section-head { max-width: 1100px; margin-bottom: clamp(44px, 6vw, 84px); }

.eyebrow {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
    margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--coral); }

h2 { font-size: clamp(34px, 5.4vw, 84px); font-weight: 700; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }

/* --- Services ------------------------------------------------------------ */

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }

.service {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 14px;
    min-height: 320px; padding: 30px;
    border: 1px solid var(--line); border-radius: 22px;
    background: var(--bg-soft);
    transition: border-color .4s, transform .5s var(--ease);
}
.service::before {
    content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 71, 100, .26), transparent 65%);
}
.service:hover { border-color: rgba(255, 71, 100, .55); transform: translateY(-6px); }
.service:hover::before { opacity: 1; }
.service > * { position: relative; }
.service-num { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 1.5px var(--coral); margin-bottom: auto; }
.service p { color: var(--muted); font-size: 16px; }

/* --- Réalisations -------------------------------------------------------- */

.work { padding: clamp(40px, 6vw, 90px) 0 clamp(90px, 12vw, 160px); background: linear-gradient(var(--bg), #0f0f14 30%, #0f0f14 70%, var(--bg)); }
.work-head { padding: 0 var(--pad); max-width: 1100px; margin-bottom: clamp(40px, 5vw, 70px); }
.work-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: clamp(40px, 5vw, 70px); padding: 0 var(--pad); }

.project { min-width: 0; }
.project-shot {
    display: block; overflow: hidden;
    border: 1px solid var(--line); border-radius: 18px;
    background: #1b1b22;
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9);
    transform-style: preserve-3d; will-change: transform;
    transition: border-color .4s, box-shadow .4s;
}
.project-shot:hover { border-color: rgba(255, 71, 100, .6); box-shadow: 0 50px 110px -40px rgba(255, 71, 100, .45); }
.browser-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; background: #1b1b22; border-bottom: 1px solid var(--line); }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a44; }
.browser-bar i:first-child { background: var(--coral); }
.browser-bar b { margin: 0 auto; padding-right: 44px; font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-shot img { width: 100%; }

.project-body { display: flex; gap: 22px; margin-top: 26px; }
.project-num { flex: none; font-size: 15px; font-weight: 600; color: var(--coral); padding-top: 3px; }
.project-cat { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.project-summary { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 46em; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: #d6d3cf; }

.project-next a {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
    height: 100%; min-height: 340px; padding: clamp(28px, 4vw, 56px);
    border: 1px dashed rgba(255, 71, 100, .5); border-radius: 18px;
    transition: background .4s, border-color .4s;
}
.project-next a:hover { background: rgba(255, 71, 100, .08); border-color: var(--coral); }
.project-next .mark { width: 54px; margin-bottom: 18px; transition: transform .7s var(--ease); }
.project-next a:hover .mark { transform: rotate(-90deg); }
.project-next .script { font-size: clamp(30px, 3vw, 44px); }
.project-next strong { font-size: clamp(48px, 6vw, 96px); font-weight: 800; line-height: 1; letter-spacing: -.04em; margin-bottom: 26px; }

/* Défilement horizontal : classe posée par le JS (écran large, animations autorisées). */
.is-horizontal .work { padding: 0; }
.is-horizontal .work-pin { height: 100vh; display: flex; align-items: center; overflow: hidden; }
.is-horizontal .work-track { display: flex; align-items: flex-start; gap: clamp(36px, 3.6vw, 64px); padding: 70px var(--pad) 0; width: max-content; will-change: transform; }
.is-horizontal .work-head { flex: none; width: min(40vw, 620px); padding: 0; margin: 0; }
.is-horizontal .work-head { align-self: center; margin-right: clamp(20px, 3vw, 60px); }
.is-horizontal .project { flex: none; width: clamp(400px, 40vw, 640px); }
.is-horizontal .project-shot { border-radius: 16px; }
.is-horizontal .browser-bar { height: 34px; padding: 0 14px; gap: 6px; }
.is-horizontal .browser-bar i { width: 9px; height: 9px; }
.is-horizontal .browser-bar b { font-size: 11px; padding-right: 36px; }
.is-horizontal .project-body { gap: 18px; margin-top: 22px; }
.is-horizontal .project-num { font-size: 13px; }
.is-horizontal .project-cat { font-size: 12px; }
.is-horizontal .project h3 { font-size: 24px; }
.is-horizontal .project-summary { margin-top: 10px; font-size: 15.5px; line-height: 1.6; }
.is-horizontal .tags { gap: 6px; margin-top: 14px; }
.is-horizontal .tags li { padding: 5px 13px; font-size: 13px; }
.is-horizontal .project-next { width: clamp(300px, 26vw, 400px); align-self: stretch; display: flex; }
.is-horizontal .project-next a { width: 100%; height: auto; min-height: 0; padding: 32px; }
.is-horizontal .project-next strong { font-size: clamp(44px, 4vw, 64px); }

/* --- Méthode ------------------------------------------------------------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.steps li { position: relative; padding: 34px 28px 10px 0; }
.steps li::before { content: ''; position: absolute; top: -1px; left: 0; width: 56px; height: 2px; background: var(--coral); }
.steps span { display: block; font-family: var(--script); font-size: 60px; font-weight: 700; line-height: 1; color: var(--coral); margin-bottom: 14px; }
.steps p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 22em; }

/* --- Contact ------------------------------------------------------------- */

.contact { position: relative; overflow: hidden; padding: clamp(90px, 14vw, 190px) var(--pad) clamp(70px, 9vw, 120px); border-top: 1px solid var(--line); }
.contact-glow {
    position: absolute; left: 50%; bottom: -55%; width: min(1300px, 130vw); aspect-ratio: 1; transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(255, 71, 100, .38), rgba(106, 77, 255, .14) 55%, transparent);
    pointer-events: none;
}
.contact > :not(.contact-glow) { position: relative; }
.contact-title { font-size: clamp(56px, 12vw, 200px); font-weight: 800; line-height: .92; letter-spacing: -.05em; margin-bottom: clamp(44px, 6vw, 80px); }
.contact-title .script { font-size: 1em; }

.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 40px; max-width: 980px; }
.field { position: relative; }
.field-wide, .form-foot { grid-column: 1 / -1; }
.field input, .field textarea {
    width: 100%; padding: 26px 0 12px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .28); border-radius: 0;
    background: transparent; color: var(--fg); font: 400 19px/1.4 var(--font); resize: vertical;
    transition: border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--coral); }
.field label {
    position: absolute; left: 0; top: 26px; color: var(--muted); font-size: 19px; pointer-events: none;
    transform-origin: left top; transition: transform .3s var(--ease), color .3s;
}
.field :is(input, textarea):is(:focus, :not(:placeholder-shown)) + label { transform: translateY(-26px) scale(.7); color: var(--coral); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.form-status { font-size: 16px; }
.form-status.is-error { color: var(--coral-soft); }

/* --- Pied de page -------------------------------------------------------- */

.footer {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding: 30px var(--pad); border-top: 1px solid var(--line);
    font-size: 14px; color: var(--muted);
}
.footer .brand { color: var(--fg); }

/* --- Adaptations --------------------------------------------------------- */

@media (max-width: 760px) {
    body { font-size: 16px; }
    .nav-links { display: none; }
    .brand-name { font-size: 15px; }
    .hero { padding-top: 120px; }
    .hero-title em { -webkit-text-stroke-width: 1.5px; }
    .hero-foot { flex-direction: column; align-items: flex-start; gap: 28px; }
    .scroll-hint { display: none; }
    .service { min-height: 0; }
    .service-num { margin-bottom: 26px; }
    .contact-form { grid-template-columns: 1fr; }
    .steps li { padding-right: 0; }
}

@media (max-width: 400px) {
    .nav .btn-small { padding: 11px 16px; font-size: 13px; }
    .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .loader { display: none; }
    .marquee-track, .scroll-hint span { animation: none; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
