/* Self-hosted fonts (latin subset, SIL OFL). */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-variable.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-variable.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Design tokens (docs/design-system.md). Single deliberate dark look. */
@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: dark;

  /* Colors */
  --bg: #000000;
  --card: #09090b;
  --field: #0c0c0e;
  --stage: #050506;
  --line: #1f1f23;
  --line-2: #2e2e33;
  --fg: #fafafa;
  --muted: #a1a1aa;
  --faint: #787881; /* 4.8:1 on black (the mock-up's #71717A is below AA) */

  /* Translucent whites: glows, dotted rest states, canvas strokes */
  --white: #ffffff;
  --white-rgb: 255, 255, 255; /* for canvas colors built in scripts */
  --dot-rest: rgba(255, 255, 255, 0.35);
  --dot-underline: rgba(255, 255, 255, 0.4);
  --ring-base: rgba(255, 255, 255, 0.14);
  --ring-lit: rgba(255, 255, 255, 0.9);
  --glow: rgba(255, 255, 255, 0.45);
  --glow-soft: rgba(255, 255, 255, 0.65);
  --glow-strong: rgba(255, 255, 255, 0.7);
  --glow-node: rgba(255, 255, 255, 0.55);
  --glow-hot: rgba(255, 255, 255, 0.6);
  --veil: rgba(0, 0, 0, 0.62);
  --fill-1: rgba(255, 255, 255, 0.04);
  --fill-2: rgba(255, 255, 255, 0.08);
  --menu-btn-bg: rgba(10, 10, 12, 0.92);

  /* Typography */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Motion and layout */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
  --content-max: 1240px;

  /* Circuit ring (buttons, fields, cards, CTA) */
  --ring: conic-gradient(
    from var(--ang),
    var(--ring-base) 0 62%,
    var(--ring-lit) 80%,
    var(--white) 84%,
    var(--ring-base) 92%
  );
}

/* Base layout: reset, page frame, titles, accent words, labels, skip link. */
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Keeps the notch area black on phones. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--bg);
}
.wrap {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
h1,
h2,
h3,
h4 {
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
/* Accent words (Instrument Serif italic), one per title, usually the end. */
.it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
/* Mono labels and tags. */
.tag {
  font: 400 12px var(--mono);
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}
/* Visually hidden, still read by screen readers. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Skip link. */
.skip {
  position: fixed;
  left: 16px;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 80;
  transform: translateY(-200%);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 999px;
  font: 500 13px var(--sans);
  text-decoration: none;
}
.skip:focus {
  transform: none;
}
/* Placeholder shown by the build for unknown facts (never in production). */
.todo {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Components of step 1: buttons, links, logo and picto. */

/* ---------- BTN-01 / BTN-02 / BTN-03 · le circuit ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 500 15px/1 var(--sans);
  letter-spacing: -0.005em;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  cursor: pointer;
  white-space: nowrap;
  isolation: isolate;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    background-color 0.35s var(--ease);
}
.btn > * {
  position: relative;
  z-index: 2;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:focus-visible {
  outline: 1px dashed var(--muted);
  outline-offset: 5px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.32;
  cursor: not-allowed;
}
.btn svg {
  width: 1em;
  height: 1em;
  flex: none;
}

/* BTN-01: dark pill, the ring always runs, glow on hover/focus. */
.btn--primary {
  background: var(--field);
}
.btn--primary::before,
.btn--secondary::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--ring);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ring-spin 3.2s linear infinite;
}
.btn--primary:not(:disabled):hover,
.btn--primary:focus-visible {
  box-shadow: 0 0 28px -6px var(--glow);
}

/* BTN-02: transparent, dotted border at rest; the ring runs on hover/focus. */
.btn--secondary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px dotted var(--dot-rest);
  transition: opacity 0.3s;
}
.btn--secondary::before {
  opacity: 0;
  animation-play-state: paused;
  transition: opacity 0.3s;
}
.btn--secondary:not(:disabled):hover::before,
.btn--secondary:focus-visible::before {
  opacity: 1;
  animation-play-state: running;
}
.btn--secondary:not(:disabled):hover::after,
.btn--secondary:focus-visible::after {
  opacity: 0;
}

/* Sizes (normal is the default). */
.btn--lg {
  font-size: 17px;
  padding: 19px 30px;
}
.btn--sm {
  font-size: 13px;
  padding: 11px 18px;
}
.btn--xs {
  font-size: 13px;
  padding: 10px 16px;
}
/* BTN-03: round icon button, aria-label required. */
.btn--icon {
  width: 46px;
  height: 46px;
  padding: 0;
}
.btn--icon svg {
  width: 18px;
  height: 18px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
}
@keyframes ring-spin {
  to {
    --ang: 360deg;
  }
}

/* ---------- LIEN-01 · le fil de points (links in text) ---------- */
.link-dots {
  position: relative;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 5px;
  background-image: radial-gradient(circle, var(--dot-underline) 0.9px, transparent 1.3px);
  background-size: 6px 3px;
  background-repeat: repeat-x;
  background-position: 0 100%;
}
.link-dots::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 1px;
  background: var(--fg);
  box-shadow: 0 0 8px var(--glow-strong);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.6s var(--ease);
}
.link-dots::before {
  content: "";
  position: absolute;
  left: -2px;
  bottom: -1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 10px 2px var(--glow-soft);
  opacity: 0;
  transition:
    left 0.6s var(--ease),
    opacity 0.3s;
}
.link-dots:hover::after,
.link-dots:focus-visible::after {
  transform: scaleX(1);
}
.link-dots:hover::before,
.link-dots:focus-visible::before {
  left: calc(100% - 3px);
  opacity: 1;
}
.link-dots:focus-visible {
  outline: 1px dashed var(--faint);
  outline-offset: 5px;
  border-radius: 2px;
}

/* ---------- LIEN-02 · la flèche (footer, card links) ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.4em;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.link-arrow:hover,
.link-arrow:focus-visible {
  color: var(--fg);
}
.link-arrow:focus-visible {
  outline: 1px dashed var(--faint);
  outline-offset: 4px;
  border-radius: 2px;
}
@media (pointer: coarse) {
  .link-arrow {
    min-height: 44px;
  }
}
/* Arrow swap: the first arrow leaves top-right, the second enters from bottom-left. */
.arw {
  position: relative;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  overflow: hidden;
  flex: none;
}
.arw svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s var(--ease);
}
.arw svg + svg {
  transform: translate(-110%, 110%);
}
a:hover > .arw svg,
a:focus-visible > .arw svg {
  transform: translate(110%, -110%);
}
a:hover > .arw svg + svg,
a:focus-visible > .arw svg + svg {
  transform: none;
}

/* ---------- LOGO-01 · full logo (static SVG) ---------- */
.logo {
  display: inline-block;
  line-height: 0;
}
.logo img {
  display: block;
  height: 76px;
  width: auto;
}
@media (max-width: 640px) {
  .logo img {
    height: 60px;
  }
}

/* ---------- LOGO-02 · picto glitch (header) ---------- */
.mark {
  position: relative;
  display: inline-block;
  line-height: 0;
  color: var(--fg);
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.mark:focus-visible {
  outline: 1px dashed var(--muted);
  outline-offset: 6px;
  border-radius: 4px;
}
.mark svg {
  position: relative;
  z-index: 1;
  display: block;
  overflow: visible;
  height: 28px;
  width: auto;
}
.mark canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.mark .rot {
  transform-box: view-box;
  transform-origin: 505.4px 427px;
}
.mark .bolt {
  fill: none;
  stroke: currentColor;
  stroke-width: 62;
  stroke-linejoin: round;
}
.mark .ghost {
  fill: none;
  stroke: var(--muted);
  stroke-width: 62;
  stroke-linejoin: round;
  opacity: 0;
}
@media (pointer: coarse) {
  .mark {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* NAV-01 header bar and NAV-02 full-screen menu « Les nœuds ». */

/* ---------- NAV-01 · la barre ---------- */
.nv {
  position: fixed;
  left: 0;
  right: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
}
.nv .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: var(--nav-h);
  transition:
    background-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}
.nv.scrolled .row {
  background: var(--veil);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: inset 0 -1px 0 var(--line);
}
.nv .end {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 640px) {
  .nv .end .cta-nav {
    display: none;
  }
}

/* Menu button: BTN-02 behaviour with its own size and hover lines. */
.menu-btn {
  gap: 10px;
  font: 500 13px/1 var(--sans);
  padding: 10px 14px;
  background: var(--fill-1);
  transition:
    background-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.menu-btn .ic {
  position: relative;
  width: 14px;
  height: 8px;
  transition: transform 0.45s var(--ease);
}
.menu-btn .ic i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.45s var(--ease),
    top 0.45s var(--ease);
}
.menu-btn .ic i:first-child {
  top: 0;
}
.menu-btn .ic i:last-child {
  top: 6.5px;
}
.menu-btn[aria-expanded="true"] .ic i:first-child {
  top: 3.25px;
  transform: rotate(45deg);
}
.menu-btn[aria-expanded="true"] .ic i:last-child {
  top: 3.25px;
  transform: rotate(-45deg);
}
.menu-btn:hover,
.menu-btn:focus-visible {
  background: var(--fill-2);
  box-shadow: 0 0 24px -8px var(--glow);
}
.menu-btn:focus-visible {
  outline: 1px dashed var(--muted);
  outline-offset: 4px;
}
.menu-btn:not([aria-expanded="true"]):hover .ic i:first-child {
  transform: scaleX(0.55);
  transform-origin: 100% 50%;
}
.menu-btn:not([aria-expanded="true"]):hover .ic i:last-child {
  transform: scaleX(0.55);
  transform-origin: 0 50%;
}
.menu-btn[aria-expanded="true"]:hover .ic {
  transform: rotate(90deg);
}

/* ---------- NAV-02 · menu « Les nœuds » ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: var(--bg);
}
.menu.on {
  display: block;
  animation: menu-fade 0.4s var(--ease);
}
@keyframes menu-fade {
  from {
    opacity: 0;
  }
}
.menu > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.menu-top {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  margin-top: env(safe-area-inset-top, 0px);
}
.menu .menu-btn {
  background: var(--menu-btn-bg);
}
.menu nav {
  position: absolute;
  inset: calc(var(--nav-h) + env(safe-area-inset-top, 0px)) 0 96px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.menu nav a {
  position: relative;
  display: block;
  overflow: hidden;
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(36px, 7vw, 76px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.14;
  padding-left: 0.62em;
  transition: opacity 0.35s var(--ease);
}
.menu nav a .w {
  display: block;
  transform: translateY(105%);
}
.menu.shown nav a .w {
  animation: menu-up 0.8s var(--ease) forwards;
  animation-delay: calc(0.1s + var(--i) * 70ms);
}
@keyframes menu-up {
  to {
    transform: none;
  }
}
.menu nav:hover a {
  opacity: 0.2;
}
.menu nav a:hover,
.menu nav a:focus-visible {
  opacity: 1;
}
.menu nav a[aria-current="page"] .w::after {
  content: "";
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.25em;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: 0.55em;
}
.menu nav a:focus-visible {
  outline: 1px dashed var(--faint);
  outline-offset: 4px;
}
/* Each link owns a node of the network. */
.menu nav a .nd {
  position: absolute;
  left: 0.12em;
  top: 54%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 10px 2px var(--glow-node);
  opacity: 0;
  transition: transform 0.4s var(--ease);
}
.menu.shown nav a .nd {
  animation: menu-node 0.6s var(--ease) forwards;
  animation-delay: calc(0.35s + var(--i) * 70ms);
}
@keyframes menu-node {
  to {
    opacity: 0.5;
  }
}
.menu nav a:hover .nd,
.menu nav a:focus-visible .nd {
  transform: scale(1.7);
  opacity: 1 !important;
}
.menu-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.menu-bottom .contacts {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  justify-content: center;
  font: 400 12px var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
}
.menu-bottom .contacts span {
  user-select: all;
}
@media (prefers-reduced-motion: reduce) {
  .menu nav a .w {
    transform: none;
  }
  .menu nav a .nd {
    opacity: 0.5;
  }
}

/* FOOTER-01 · la convergence, and BTN-04 back to top. */
.ft {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.ft > canvas.fnet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.ft .in {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
.ft .in a,
.ft .in button,
.ft .in .selectable {
  pointer-events: auto;
}
.ft .head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: 96px 0 60px;
}
.ft .flogo {
  display: inline-block;
  line-height: 0;
}
.ft .flogo img {
  display: block;
  height: 76px;
  width: auto;
}
.ft .flogo:focus-visible {
  outline: 1px dashed var(--muted);
  outline-offset: 6px;
  border-radius: 4px;
}
@media (max-width: 640px) {
  .ft .flogo img {
    height: 60px;
  }
}
.ft .head h2 {
  font-size: clamp(30px, 4.4vw, 56px);
}
.ft .cbtn.hot {
  box-shadow: 0 0 40px -4px var(--glow-hot);
}
.ft .cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 64px;
}
@media (max-width: 900px) {
  .ft .cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .ft .cols {
    grid-template-columns: 1fr;
  }
}
.ft .col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.ft .col .tag {
  font-size: 10px;
  margin-bottom: 4px;
}
.ft .col .txt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.ft .col .txt.selectable {
  user-select: all;
  color: var(--fg);
}
.ft .legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
  flex-wrap: wrap;
  padding: 22px 0 calc(26px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}
.ft .legal .lk {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}
.ft .legal .link-arrow {
  font-size: 13px;
}

/* BTN-04 · retour en haut: the arrow leaves upward, a new one enters from below. */
.arwv {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  overflow: hidden;
}
.arwv svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s var(--ease);
}
.arwv svg + svg {
  transform: translateY(120%);
}
.totop:hover .arwv svg,
.totop:focus-visible .arwv svg {
  transform: translateY(-120%);
}
.totop:hover .arwv svg + svg,
.totop:focus-visible .arwv svg + svg {
  transform: none;
}

/* Hero backgrounds (HERO-01..05) and network stages (ANIM-xx). */

/* The hero: a canvas behind the text. */
.hero {
  position: relative;
  isolation: isolate;
  min-height: max(620px, 100svh);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.hero.short {
  min-height: max(560px, 78svh);
}
.hero > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
/* Text layer: the canvas gets the pointer, links and buttons keep theirs. */
.hero .in {
  position: relative;
  z-index: 1;
  pointer-events: none;
  padding-block: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 40px) 72px;
}
.hero .in a,
.hero .in button {
  pointer-events: auto;
}
.hero .ct {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 96px);
}
.hero p {
  color: var(--muted);
  max-width: 44ch;
  font-size: clamp(16px, 1.4vw, 19px);
}
@media (max-width: 640px) {
  .hero {
    justify-content: flex-start;
  }
  .hero .in {
    padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 56px);
  }
}

/* A network stage: a framed canvas next to the content. */
.stage {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--stage);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  max-width: 100%;
  touch-action: pan-y;
}
.stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.stage .cap {
  position: absolute;
  left: 18px;
  bottom: 16px;
  font: 400 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

