/* ============ Tokens ============ */
:root {
  --bg: #07070a;
  --fg: #f2efe9;
  --muted: rgba(242, 239, 233, .55);
  --line: rgba(242, 239, 233, .12);
  --violet: #6d3bff;
  --cyan: #00e0ff;
  --lime: #b4ff39;
  --orange: #ff5b2e;
  --pink: #ff3d9a;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html { background: var(--bg); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: var(--violet); color: #fff; }

@media (hover: hover) and (pointer: fine) {
  body, a, button { cursor: none; }
}

/* ============ Couches fixes ============ */
#gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}
main, footer { position: relative; z-index: 2; }

.grain {
  position: fixed; inset: -50%;
  z-index: 50; pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 60; pointer-events: none;
}
.progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--lime));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ============ Curseur ============ */
.cursor { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot, .cursor__ring { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor__ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid #fff;
  display: grid; place-items: center;
  transition: width .5s var(--ease), height .5s var(--ease), margin .5s var(--ease), background-color .4s, border-color .4s;
}
.cursor__ring em {
  font-family: var(--sans); font-style: normal; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: #000;
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .5s var(--ease);
}
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: #fff; }
.cursor.is-label .cursor__ring em { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-hidden { opacity: 0; }
@media not ((hover: hover) and (pointer: fine)) { .cursor, .preview { display: none; } }

/* ============ Loader ============ */
.loader {
  position: fixed; inset: 0; z-index: 90;
  background: #050507;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--gutter);
  clip-path: inset(0 0 0 0);
}
.loader__inner { display: flex; justify-content: space-between; align-items: flex-end; }
.loader__label { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.loader__count {
  font-size: clamp(80px, 18vw, 260px); line-height: .8; font-weight: 300;
  font-variant-numeric: tabular-nums; letter-spacing: -.04em;
}
.loader__bar { margin-top: 24px; height: 1px; background: var(--line); }
.loader__bar span { display: block; height: 100%; background: var(--fg); transform-origin: 0 50%; transform: scaleX(0); }

/* ============ Navigation ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  mix-blend-mode: difference;
}
.nav__logo { font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
.nav__logo em { color: var(--lime); }
.nav__links { display: flex; gap: clamp(16px, 2.6vw, 40px); }
.nav__links a, .nav__time { font-size: 14px; letter-spacing: .02em; }
.nav__links a { position: relative; display: inline-block; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .6s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__time { color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(180, 255, 57, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(180, 255, 57, 0); } 100% { box-shadow: 0 0 0 0 rgba(180, 255, 57, 0); } }

@media (max-width: 760px) {
  .nav__links a:not(:last-child) { display: none; }
  .nav__time { display: none; }
}

/* ============ Typo commune ============ */
.eyebrow {
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: clamp(20px, 3vw, 40px);
}
.title {
  font-size: clamp(44px, 8vw, 132px); line-height: .92; font-weight: 500; letter-spacing: -.045em;
}
.title em, .contact__title em, .hero__sub em, .manifesto__text em, .card__title em {
  background: linear-gradient(100deg, var(--violet), var(--cyan) 45%, var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-mask > span { display: block; will-change: transform; }

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) clamp(28px, 5vh, 56px);
  position: relative;
}
.hero__kicker {
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1vw;
}
.hero__title {
  font-size: clamp(88px, 25vw, 460px);
  line-height: .78;
  font-weight: 500;
  letter-spacing: -.065em;
  margin-left: -.04em;
  white-space: nowrap;
}
.hero__title .char-mask { display: inline-block; overflow: hidden; padding: 0 .015em .04em; margin-bottom: -.04em; vertical-align: top; }
.hero__title .char {
  display: inline-block;
  font-variation-settings: "wght" 500;
  will-change: transform;
}
.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
  margin-top: clamp(20px, 3vw, 44px);
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.hero__sub { font-size: clamp(18px, 1.9vw, 30px); line-height: 1.25; max-width: 30ch; letter-spacing: -.01em; }
.hero__sub em { font-size: 1.1em; }
.hero__scroll { display: flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); flex-shrink: 0; }
.hero__scroll i { position: relative; width: 1px; height: 56px; background: var(--line); overflow: hidden; }
.hero__scroll i::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--fg); animation: scrollLine 1.8s var(--ease) infinite;
}
@keyframes scrollLine { to { top: 100%; } }
@media (max-width: 760px) {
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero__scroll { display: none; }
}

/* ============ Marquee ============ */
.marquee {
  padding: clamp(40px, 8vw, 120px) 0;
  overflow: hidden;
}
.marquee__row {
  display: flex; white-space: nowrap;
  font-size: clamp(48px, 9vw, 150px); line-height: 1.05; font-weight: 500; letter-spacing: -.04em;
  will-change: transform;
}
.marquee__row--alt { color: transparent; -webkit-text-stroke: 1px rgba(242, 239, 233, .5); }
.marquee__row--alt em { -webkit-text-stroke: 0; color: var(--fg); }
.marquee__track { display: flex; align-items: center; flex-shrink: 0; }
.marquee__track > * { padding: 0 .28em; }
.marquee__track b { font-size: .4em; font-weight: 400; color: var(--lime); -webkit-text-stroke: 0; }
.marquee__row--alt .marquee__track b { color: var(--cyan); }

/* ============ Manifeste ============ */
.manifesto {
  padding: clamp(80px, 14vw, 220px) var(--gutter);
  max-width: 1600px;
}
.manifesto__text {
  font-size: clamp(30px, 4.6vw, 84px); line-height: 1.08; letter-spacing: -.035em; font-weight: 400;
}
.manifesto__text .word { display: inline-block; opacity: .14; will-change: opacity; }

/* ============ Projets ============ */
.projects { padding-top: clamp(60px, 10vw, 140px); }
.projects__head { padding: 0 var(--gutter); margin-bottom: clamp(40px, 6vw, 80px); }
.projects__pin { overflow: hidden; }
.projects__track {
  display: flex; gap: clamp(16px, 2vw, 32px);
  padding: 0 var(--gutter) clamp(40px, 6vw, 80px);
  width: max-content;
  will-change: transform;
}
.card {
  --mx: 50%; --my: 50%;
  position: relative;
  width: clamp(300px, 34vw, 520px);
  min-height: clamp(460px, 70vh, 640px);
  padding: clamp(22px, 2.4vw, 36px);
  border-radius: 28px;
  background: rgba(18, 18, 24, .55);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color .5s;
  isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(500px circle at var(--mx) var(--my), color-mix(in srgb, var(--c1) 35%, transparent), transparent 45%);
  opacity: 0; transition: opacity .5s;
}
.card:hover { border-color: color-mix(in srgb, var(--c1) 60%, transparent); }
.card:hover::before { opacity: 1; }
.card__art {
  position: relative; flex: 1; min-height: 200px;
  border-radius: 18px; margin-bottom: 28px;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--c1) 70%, transparent), transparent 60%),
    radial-gradient(100% 80% at 90% 100%, color-mix(in srgb, var(--c2) 55%, transparent), transparent 60%),
    #0d0d12;
  display: grid; place-items: center; overflow: hidden;
}
.card__art::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
  opacity: .6;
}
.card__art svg { position: relative; z-index: 1; width: 62%; height: auto; transition: transform .8s var(--ease); }
.card:hover .card__art svg { transform: scale(1.08) rotate(-2deg); }
.draw * { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__num { font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.card__title { font-size: clamp(26px, 2.4vw, 40px); line-height: 1; letter-spacing: -.035em; font-weight: 500; margin: 10px 0 14px; }
.card__text { color: var(--muted); max-width: 40ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags li { font-size: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; letter-spacing: .03em; }
.card--end {
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  border-style: dashed; justify-content: center; align-items: center; text-align: center;
  font-size: clamp(32px, 3.4vw, 56px); line-height: 1; letter-spacing: -.04em;
}
.card--end em { color: var(--muted); }

@media (max-width: 899px) {
  .projects__track { flex-direction: column; width: auto; }
  .card { width: 100%; min-height: 0; }
  .card__art { min-height: 220px; flex: none; }
  .card--end { min-height: 200px; }
}

/* ============ Chiffres ============ */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: clamp(60px, 10vw, 140px) 0 0;
  background: rgba(7, 7, 10, .4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stat { padding: clamp(28px, 4vw, 64px) var(--gutter); border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat__num { font-size: clamp(56px, 7vw, 120px); line-height: 1; font-weight: 300; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.stat__unit { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.4vw, 40px); margin-left: 6px; color: var(--cyan); }
.stat p { color: var(--muted); margin-top: 12px; max-width: 22ch; }
@media (max-width: 899px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ============ Savoir-faire ============ */
.skills { padding: clamp(80px, 14vw, 200px) var(--gutter) clamp(40px, 6vw, 80px); }
.skills__head { margin-bottom: clamp(40px, 6vw, 80px); }
.skill {
  position: relative;
  display: grid; grid-template-columns: 60px 1fr auto 40px; align-items: center; gap: 24px;
  padding: clamp(22px, 2.6vw, 40px) 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.skill:last-child { border-bottom: 1px solid var(--line); }
.skill::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--fg);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform .6s var(--ease);
}
.skill:hover::before { transform: scaleY(1); }
.skill > span { transition: color .4s, transform .6s var(--ease); }
.skill:hover > span { color: var(--bg); }
.skill:hover .skill__name { transform: translateX(24px); }
.skill__num { font-size: 13px; color: var(--muted); padding-left: 8px; }
.skill__name { font-size: clamp(26px, 4vw, 64px); letter-spacing: -.04em; line-height: 1; font-weight: 500; }
.skill__desc { color: var(--muted); text-align: right; }
.skill__arrow { font-size: 28px; transform: rotate(0); }
.skill:hover .skill__arrow { transform: rotate(45deg); }
@media (max-width: 760px) {
  .skill { grid-template-columns: 36px 1fr 24px; }
  .skill__desc { display: none; }
}

.preview {
  position: fixed; top: 0; left: 0; z-index: 30; pointer-events: none;
  width: 280px; height: 200px; margin: -100px 0 0 -140px;
  border-radius: 20px;
  display: grid; place-items: center;
  transform: scale(0);
  overflow: hidden;
  background: var(--violet);
  transition: background-color .5s;
}
.preview::before {
  content: ""; position: absolute; inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.45), transparent 40%);
  animation: spin 3s linear infinite;
}
.preview::after { content: ""; position: absolute; inset: 2px; border-radius: 18px; background: inherit; }
.preview__label { position: relative; z-index: 1; font-family: var(--serif); font-style: italic; font-size: 64px; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Contact ============ */
.contact {
  min-height: 100svh;
  padding: clamp(80px, 12vw, 180px) var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.contact__title { font-size: clamp(56px, 12vw, 220px); line-height: .9; letter-spacing: -.055em; font-weight: 500; }
.contact__btn {
  position: absolute; right: clamp(16px, 8vw, 160px); bottom: clamp(60px, 12vw, 200px);
  width: clamp(150px, 15vw, 240px); aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
}
.contact__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 14s linear infinite; }
.contact__ring text { fill: var(--fg); font-size: 15px; letter-spacing: 3.4px; text-transform: uppercase; font-family: var(--sans); }
.contact__core {
  width: 52%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff; font-size: clamp(28px, 3vw, 48px);
  transition: transform .6s var(--ease), background .6s;
  box-shadow: 0 20px 80px -10px rgba(109, 59, 255, .7);
}
.contact__btn:hover .contact__core { transform: scale(1.15) rotate(-45deg); }
@media (max-width: 760px) {
  .contact__btn { position: relative; right: auto; bottom: auto; margin-top: 48px; align-self: flex-end; }
}

/* ============ Footer ============ */
.footer { padding: 0 var(--gutter) 28px; overflow: hidden; }
.footer__big {
  font-size: clamp(40px, 13.6vw, 300px); line-height: .82; letter-spacing: -.06em; font-weight: 600;
  white-space: nowrap; text-align: center;
  background: linear-gradient(180deg, var(--fg) 0%, rgba(242,239,233,0) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0 -2vw;
}
.footer__row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px;
  font-size: 13px; color: var(--muted);
}
.footer__row a { color: var(--fg); }

/* ============ Mouvement réduit ============ */
.reduce .grain, .reduce .contact__ring, .reduce .preview::before, .reduce .dot, .reduce .hero__scroll i::after { animation: none; }
.reduce .manifesto__text .word { opacity: 1; }
.reduce .loader { display: none; }
