:root {
  --bg: #05040d;
  --surface: #0d0b1f;
  --lilac: #e6e0ff;
  --lilac-2: #a49bd0;
  --coral: #ff8a66;
  --rule: rgba(230, 224, 255, 0.12);
  --gutter: clamp(16px, 4vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Funnel Display", sans-serif;
  --body: "Funnel Sans", sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
}
html {
  scrollbar-color: var(--lilac-2) var(--bg);
  touch-action: pan-y pinch-zoom; /* sideways touch drags reach the 3D scene */
}
body {
  background: var(--bg);
  color: var(--lilac);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection {
  background: var(--coral);
  color: var(--bg);
}
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}
a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--coral);
}
h1,
h2,
h3 {
  font-family: var(--display);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Fixed scene layers ---------- */
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(5, 4, 13, 0.92) 0%,
    rgba(5, 4, 13, 0.7) 30%,
    rgba(5, 4, 13, 0) 52%
  );
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.static #gl {
  display: none;
}

/* ---------- Chrome ---------- */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter);
}
.top .me {
  font: 600 1rem var(--display);
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
}
.top .me i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}
.top .mail {
  font-size: 0.9375rem;
  color: var(--lilac-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.top .me {
  margin-right: auto;
}
.top .mail:hover,
.top .lang:hover {
  color: var(--lilac);
}
.top .lang {
  margin-left: 24px;
  font: 600 0.8125rem var(--body);
  letter-spacing: 0.12em;
  color: var(--lilac-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 11;
  background: var(--coral);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

/* Depth meter: the network's layers, doubles as navigation */
.depth {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.depth a {
  display: grid;
  grid-template-columns: 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  text-decoration: none;
  font-size: 0.8125rem;
  color: var(--lilac-2);
  text-align: right;
  transition: color 0.4s var(--ease);
}
.depth a span {
  opacity: 0;
  transform: translateX(6px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.4s var(--ease);
}
.depth a i {
  height: 1px;
  background: currentColor;
  transition:
    background 0.4s var(--ease),
    transform 0.4s var(--ease);
  transform-origin: right;
  transform: scaleX(0.5);
}
.depth:hover a span,
.depth a.on span,
.depth a:focus-visible span {
  opacity: 1;
  transform: none;
}
.depth a.on {
  color: var(--lilac);
}
.depth a.on i {
  background: var(--coral);
  transform: scaleX(1);
}

/* ---------- Sections ---------- */
main {
  position: relative;
  z-index: 3;
}
.layer {
  min-height: 135vh;
  display: flex;
  align-items: center;
  padding: 120px var(--gutter);
}
.col {
  width: min(600px, 100%);
}
.col.wide {
  width: min(760px, 100%);
}
h2 {
  font-size: clamp(2.2rem, 4.6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede {
  margin-top: 22px;
  color: var(--lilac-2);
  font-size: 1.125rem;
  max-width: 52ch;
}
.lede strong {
  color: var(--lilac);
  font-weight: 500;
}
.note {
  color: var(--coral);
  font-size: 0.875rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  align-items: flex-end;
  padding-bottom: clamp(48px, 12vh, 120px);
}
.hero .who {
  font: 500 1rem var(--display);
  color: var(--lilac-2);
  margin-bottom: 28px;
}
.hero h1 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
}
.hero h1 .from {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 300;
  color: var(--lilac-2);
  font-size: 0.5em;
  letter-spacing: -0.02em;
  margin-bottom: 0.3em;
}
.hero h1 .arrow {
  position: relative;
  display: inline-block;
  width: 2.4em;
  height: 1px;
  background: var(--rule);
  overflow: hidden;
}
.hero h1 .arrow::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 1px;
  background: var(--coral);
  animation: signal 2.4s var(--ease) infinite;
}
@keyframes signal {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}
.hero h1 .domains {
  display: block;
  font-weight: 300;
  font-size: 0.5em;
  letter-spacing: -0.01em;
  margin-top: 0.45em;
}
.hero h1 .domains b {
  font-weight: 300;
  color: var(--coral);
}
.cue {
  margin-top: 48px;
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--lilac-2);
  font-size: 0.875rem;
}
.cue i {
  position: relative;
  width: 1px;
  height: 44px;
  background: var(--rule);
  overflow: hidden;
}
.cue i::after {
  content: "";
  position: absolute;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  animation: drop 2s var(--ease) infinite;
}
@keyframes drop {
  from {
    top: -6px;
  }
  to {
    top: 46px;
  }
}
.portrait-fallback {
  display: none;
  position: absolute;
  right: 8vw;
  top: 50%;
  transform: translateY(-50%);
  width: min(42vw, 600px);
  height: auto;
  mix-blend-mode: lighten;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    closest-side,
    #000 62%,
    transparent
  );
  mask-image: radial-gradient(closest-side, #000 62%, transparent);
}
.static .portrait-fallback,
.no-sample .portrait-fallback {
  display: block;
}

/* Approche */
.steps-list {
  list-style: none;
  padding: 0;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
}
.steps-list li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.steps-list b {
  font: 600 1.0625rem var(--display);
}
.steps-list span {
  color: var(--lilac-2);
}

/* Architecture pipeline */
.pipe {
  width: 100%;
  height: auto;
  margin-top: 44px;
  overflow: visible;
}
.pipe .wire-bg {
  stroke: var(--rule);
  stroke-width: 1;
  fill: none;
}
.pipe .wire {
  stroke: var(--coral);
  stroke-width: 1.5;
  fill: none;
}
.pipe .node circle,
.pipe .node rect,
.pipe .node path {
  fill: var(--bg);
  stroke: var(--lilac-2);
  stroke-width: 1.2;
  transition:
    fill 0.5s var(--ease),
    stroke 0.5s var(--ease);
}
.pipe .node text {
  font: 500 13px var(--body);
  fill: var(--lilac-2);
  text-anchor: middle;
  transition: fill 0.5s var(--ease);
}
.pipe .node.on circle,
.pipe .node.on rect,
.pipe .node.on path {
  fill: var(--coral);
  stroke: var(--coral);
}
.pipe .node.on text {
  fill: var(--lilac);
}
.pipe .dot {
  fill: var(--lilac);
}

/* Explainer: what a neural network is */
.explain {
  position: relative;
  padding: 140px var(--gutter) 96px;
  background: linear-gradient(180deg, rgba(5, 4, 13, 0), var(--bg) 220px);
}
.explain-in {
  max-width: 1100px;
}
.nn {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 56px;
  overflow: visible;
  --p: 1;
}
.nn .wires line {
  stroke: var(--lilac-2);
  stroke-opacity: 0.22;
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(
    0,
    calc((var(--c) * 0.176 + 0.12 - var(--p)) * 5),
    1
  );
}
.nn .attn path {
  fill: none;
  stroke: var(--coral);
  stroke-width: 1.4;
  stroke-opacity: 0.75;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(0, calc((0.62 - var(--p)) * 5), 1);
}
.nn .skip {
  fill: none;
  stroke: var(--lilac);
  stroke-width: 1.2;
  stroke-opacity: 0.55;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(0, calc((0.85 - var(--p)) * 5), 1);
}
.nn .n {
  fill: var(--bg);
  stroke: var(--lilac);
  stroke-width: 1.5;
  opacity: clamp(0, calc((var(--p) - var(--c) * 0.16) * 6), 1);
}
.nn .n.out {
  fill: var(--coral);
  stroke: var(--coral);
}
.nn .ring {
  fill: none;
  stroke: var(--coral);
  stroke-opacity: 0.5;
  opacity: clamp(0, calc((var(--p) - 0.9) * 10), 1);
}
.nn .sig {
  fill: var(--coral);
  opacity: clamp(0, calc((var(--p) - 0.95) * 20), 1);
}
.nn-steps {
  list-style: none;
  padding: 0;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}
.nn-steps li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.nn-steps b {
  font: 600 1.0625rem var(--display);
}
.nn-steps span {
  color: var(--lilac-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.nn-steps em {
  font-style: normal;
  color: var(--coral);
  font-size: 0.875rem;
}
.nn-key {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  color: var(--lilac-2);
  font-size: 0.875rem;
}
.nn-key li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nn-key i {
  display: inline-block;
  flex: none;
}
.nn-key .k-n {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--lilac);
}
.nn-key .k-w {
  width: 24px;
  height: 1px;
  background: var(--lilac-2);
}
.nn-key .k-s {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}
.nn-key .k-a {
  width: 18px;
  height: 10px;
  border: 1.4px solid var(--coral);
  border-left: 0;
  border-radius: 0 10px 10px 0;
}
.explain .foot {
  margin-top: 64px;
}

/* HUD and cursor */
.hud {
  position: fixed;
  right: var(--gutter);
  bottom: 20px;
  text-align: right;
  z-index: 10;
  font:
    400 0.75rem ui-monospace,
    "SFMono-Regular",
    Menlo,
    monospace;
  color: var(--lilac-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.static .hud {
  display: none;
}
.cursor {
  opacity: 0;
  position: fixed;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--lilac-2);
  z-index: 30;
  pointer-events: none;
  transition:
    width 0.3s var(--ease),
    height 0.3s var(--ease),
    left 0.3s var(--ease),
    top 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.cursor.live {
  opacity: 1;
}
.cursor.hot {
  width: 52px;
  height: 52px;
  left: -26px;
  top: -26px;
  border-color: var(--coral);
}
@media (pointer: coarse) {
  .cursor {
    display: none;
  }
}
.magnetic {
  transition:
    transform 0.35s var(--ease),
    background 0.4s var(--ease);
}

/* Attention: skills */
.heads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.heads h3 {
  font-size: 1.125rem;
  font-weight: 600;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.heads h3 small {
  font: 400 0.8125rem var(--body);
  color: var(--lilac-2);
}
.heads ul {
  list-style: none;
  padding: 0;
}
.heads button {
  all: unset;
  display: block;
  width: 100%;
  padding: 7px 0;
  cursor: pointer;
  color: var(--lilac-2);
  transition:
    color 0.3s var(--ease),
    transform 0.3s var(--ease);
}
.heads button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.heads.focus button {
  color: rgba(164, 155, 208, 0.45);
}
.heads button.on,
.heads.focus button.on {
  color: var(--lilac);
  transform: translateX(6px);
}
.heads button.src,
.heads.focus button.src {
  color: var(--coral);
}
.attn-read {
  margin-top: 28px;
  min-height: 3.2em;
  color: var(--lilac-2);
}
.attn-read b {
  color: var(--lilac);
  font-weight: 500;
}

/* Résiduel: career with particle logos */
.career {
  list-style: none;
  padding: 0;
  margin-top: 44px;
}
.career > li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.career > li:first-child {
  border-top: 1px solid var(--rule);
}
.logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule);
  display: block;
}
.career b {
  font: 600 1.0625rem/1.3 var(--display);
  display: block;
}
.career span {
  color: var(--lilac-2);
  font-size: 0.9375rem;
}
.career time {
  color: var(--lilac-2);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}
.career .now > time {
  color: var(--coral);
}
.roles {
  list-style: none;
  padding: 0;
  margin-top: 14px;
  display: grid;
  gap: 10px;
  border-left: 1px solid var(--rule);
}
.roles li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-left: 18px;
  font-size: 0.9375rem;
  color: var(--lilac-2);
}
.roles li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--lilac-2);
}
.roles li:first-child {
  color: var(--lilac);
}
.roles li:first-child::before {
  background: var(--coral);
  border-color: var(--coral);
}
.roles time {
  padding: 0;
}
.facts {
  margin-top: 36px;
}
.facts h3 {
  font: 500 0.8125rem var(--body);
  color: var(--lilac-2);
  margin-bottom: 8px;
}

/* Sortie */
.out-layer {
  min-height: 110vh;
}
.contact h2 {
  font-size: clamp(2.6rem, 6.6vw, 5.4rem);
}
.contact .mail-btn {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin-top: 36px;
  padding: 16px 28px;
  border-radius: 99px;
  background: var(--lilac);
  color: var(--bg);
  text-decoration: none;
  font: 600 clamp(1.05rem, 2vw, 1.375rem) var(--display);
  transition:
    background 0.4s var(--ease),
    transform 0.4s var(--ease);
}
.contact .mail-btn:hover {
  background: var(--coral);
  transform: translateY(-2px);
}
.contact .mail-btn svg {
  transition: transform 0.4s var(--ease);
}
.contact .mail-btn:hover svg {
  transform: translateX(4px);
}
.contact .alt {
  margin-top: 24px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--lilac-2);
}
/* System diagram: Produit, Architecture, IA as one circuit */
.sys {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 44px;
  overflow: visible;
  --p: 1;
}
.sys .zone {
  fill: rgba(230, 224, 255, 0.025);
  stroke: var(--rule);
  stroke-dasharray: 4 6;
}
.sys .zone-tab {
  stroke: var(--rule);
}
.sys .ico rect {
  fill: var(--bg);
  stroke: var(--lilac-2);
  stroke-width: 1.1;
}
.sys .st {
  font: 400 11px var(--body);
  fill: var(--lilac-2);
  opacity: 0.8;
}
.sys .zl {
  font: 600 11px var(--body);
  letter-spacing: 0.18em;
  fill: var(--coral);
}
.sys .se {
  fill: none;
  stroke: var(--lilac-2);
  stroke-opacity: 0.6;
  stroke-width: 1.4;
  stroke-dasharray: 1;
  stroke-dashoffset: clamp(0, calc((var(--c) * 0.16 + 0.1 - var(--p)) * 5), 1);
}
.sys .se.back {
  stroke: var(--coral);
  stroke-opacity: 0.8;
}
.sys .sn {
  opacity: clamp(0, calc((var(--p) - var(--c) * 0.18) * 5), 1);
}
.sys .sn rect {
  fill: var(--bg);
  stroke: var(--lilac);
  stroke-opacity: 0.55;
  stroke-width: 1.2;
}
.sys .sn.ai rect {
  stroke: var(--coral);
  stroke-opacity: 0.9;
}
.sys .t {
  font: 600 17px var(--display);
  fill: var(--lilac);
}
.sys .s,
.sys .el {
  font: 400 13px var(--body);
  fill: var(--lilac-2);
}
.sys .sig {
  fill: var(--coral);
  opacity: clamp(0, calc((var(--p) - 0.95) * 20), 1);
}
.foot {
  margin-top: 96px;
  font-size: 0.8125rem;
  color: var(--lilac-2);
}

/* ---------- Scroll reveal: mask + blur, staggered ---------- */
.js [data-rv] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease),
    filter 1.1s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-rv].in {
  opacity: 1;
  transform: none;
  filter: none;
}
.js h2[data-rv] {
  clip-path: inset(0 0 100% 0);
  transform: translateY(40%);
  filter: none;
  transition-property: clip-path, transform, opacity;
  transition-duration: 1.2s;
}
.js h2[data-rv].in {
  clip-path: inset(0 0 -12% 0);
  transform: none;
}

@media (max-width: 900px) {
  .scrim {
    background: linear-gradient(
      180deg,
      rgba(5, 4, 13, 0) 0%,
      rgba(5, 4, 13, 0) 38%,
      rgba(5, 4, 13, 0.8) 58%,
      rgba(5, 4, 13, 0.9) 100%
    );
  }
  .depth {
    display: none;
  }
  /* sections hug their content on phones; only the hero keeps a full screen */
  .layer {
    min-height: 0;
    padding-block: 96px;
  }
  .hero {
    min-height: 100svh;
  }
  .heads {
    grid-template-columns: 1fr;
  }
  .steps-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .career > li {
    grid-template-columns: 52px 1fr;
    gap: 16px;
  }
  .career > li > time {
    grid-column: 2;
    grid-row: 2;
  }
  .logo {
    width: 52px;
    height: 52px;
  }
  .roles li {
    flex-direction: column;
    gap: 0;
  }
  .portrait-fallback {
    right: 50%;
    transform: translateX(50%);
    top: 70px;
    width: 82vw;
  }
  .top .mail {
    display: none;
  }
  .hud {
    display: none;
  }
  .nn-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .nn {
    margin-top: 36px;
  }
  .deep .scrim {
    background: rgba(5, 4, 13, 0.82);
  }
  .pipe .node text {
    font-size: 21px;
  }
  .sys .t {
    font-size: 23px;
  }
  .sys .s,
  .sys .el,
  .sys .zl {
    font-size: 20px;
  }
  .sys .st {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nn .sig,
  .sys .sig {
    display: none;
  }
  .cursor {
    display: none;
  }
  .js [data-rv],
  .js h2[data-rv] {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: none;
    transition: none;
  }
  .hero h1 .arrow::after,
  .cue i::after {
    animation: none;
  }
}

/* Heading decode: real letter holds the space, scrambled glyph drawn on top */
.dc { position: relative; -webkit-text-fill-color: transparent; }
.dc::after { content: attr(data-g); position: absolute; left: 50%; top: 0; transform: translateX(-50%); -webkit-text-fill-color: currentColor; }

/* Lenis smooth scroll (from lenis/dist/lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }
