:root{
  --bg: #0b0b0e;
  --panel: #141417;
  --panel-2: #1b1b1f;
  --line: rgba(255,255,255,0.09);
  --ink: #f3f1ec;
  --ink-dim: #9a98a2;
  --ink-faint: #6b6a70;
  --orange: #ff5a1f;
  --orange-deep: #c93f0c;
  --orange-soft: #ffb37a;
  --radius: 14px;
  --maxw: 1180px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark{
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}

a{ color: inherit; }

:focus-visible{
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ---------- Animated background ---------- */
#bg-canvas{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  display: block;
  background: var(--bg);
}

/* Translucent surface so content stays readable over the moving graph,
   while still letting a soft hint of it show through. */
.surface{
  position: relative;
  background: rgba(11,11,14,0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- Nav ---------- */
header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 0;
  transition: background .3s ease, border-color .3s ease, padding .3s ease;
  border-bottom: 1px solid transparent;
}
header.scrolled{
  background: rgba(11,11,14,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
nav.wrap{
  display:flex;
  align-items:center;
  justify-content: space-between;
}
.wordmark{
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--ink);
}
.wordmark span{ color: var(--orange); }

.nav-actions{
  display:flex;
  align-items:center;
  gap: 14px;
}
.btn{
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 10px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-ghost{
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}
.btn-ghost:hover{ border-color: rgba(255,255,255,0.28); }
.btn-solid{
  color: #17100b;
  background: linear-gradient(180deg, var(--orange), var(--orange-deep));
  font-weight: 600;
}
.btn-solid:hover{ opacity: .92; }
.btn-lg{ padding: 14px 30px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding: 220px 0 200px;
  overflow: hidden;
}
.hero::before{
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 55% at 24% 42%, rgba(11,11,14,0.8), transparent 72%);
  z-index: 0;
}
.hero-inner{
  position: relative;
  z-index: 1;
}
.hero h1{
  font-size: clamp(2.5rem, 5.2vw, 4.1rem);
  font-weight: 700;
  line-height: 1.12;
  max-width: 16ch;
}
.hero p.lead{
  margin-top: 26px;
  max-width: 50ch;
  font-size: 1.1rem;
  color: var(--ink-dim);
}
.hero .actions{
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
section.feature{
  padding: 96px 0;
  border-top: 1px solid var(--line);
}
.feature .wrap{
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 60px;
  align-items: center;
}
.feature.reverse .wrap{
  grid-template-columns: 1.08fr 0.92fr;
}
.feature.reverse .feature-copy{ order: 2; }
.feature.reverse .feature-visual{ order: 1; }

.feature-copy h2{
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 600;
  max-width: 14ch;
}
.feature-copy p{
  margin-top: 18px;
  max-width: 46ch;
  color: var(--ink-dim);
  font-size: 1.02rem;
}
.feature-list{
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  max-width: 46ch;
}
.feature-list li{
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  color: var(--ink-dim);
  font-size: 0.96rem;
}
.feature-list li::before{
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.feature-visual{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 26px;
  min-height: 260px;
}

/* mock: graph */
.mock-graph{ position: relative; height: 220px; }
.mock-node{
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.mock-dot{
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}
.mock-tag{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--orange-soft);
  border: 1px solid rgba(255,90,31,0.35);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 4px;
}
.mock-edges{
  position:absolute; inset:0; width:100%; height:100%; overflow:visible;
}
.mock-edges line{ stroke: rgba(255,255,255,0.18); }

/* mock: toolbox */
.mock-tool{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.mock-tool:last-child{ border-bottom: none; }
.mock-favicon{
  width: 22px; height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--orange-soft), var(--orange));
}
.mock-tool .url{ color: var(--ink-faint); font-size: 0.82rem; margin-left: auto; }

/* mock: notes */
.mock-note-line{
  height: 10px;
  border-radius: 4px;
  background: var(--panel-2);
  margin-bottom: 12px;
}
.mock-note-line.highlight{
  background: rgba(255,90,31,0.28);
}

/* mock: chat */
.mock-bubble{
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.mock-bubble.user{
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.mock-bubble.ai{
  margin-left: auto;
  background: linear-gradient(180deg, rgba(255,90,31,0.22), rgba(255,90,31,0.08));
  border: 1px solid rgba(255,90,31,0.32);
}

/* ---------- Closing CTA ---------- */
.closing{
  padding: 120px 0;
  text-align: center;
  border-top: 1px solid var(--line);
}
.closing h2{
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 700;
  max-width: 16ch;
  margin: 0 auto;
}
.closing-sub{
  margin: 16px auto 0;
  color: var(--ink-dim);
}
.closing .actions{
  margin-top: 34px;
  display:flex;
  justify-content:center;
}

footer{
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
}
.legal-link{
  text-decoration: none;
  color: var(--ink-faint);
  transition: color .2s ease;
}
.legal-link:hover{ color: var(--ink-dim); }

/* ---------- Back to top ---------- */
#back-to-top{
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20,20,23,0.9);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, border-color .2s ease;
}
#back-to-top.visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover{ border-color: var(--orange); color: var(--orange-soft); }

/* ---------- Vie au défilement ---------- */
/* États finaux par défaut (toujours visibles) : si la personne préfère
   moins d'animations, tout reste simplement affiché sans mouvement. */
.mock-typing{ display: none; }

@media (prefers-reduced-motion: no-preference){

  /* Graph : les nœuds apparaissent un par un, les liens se "dessinent",
     et le nœud source envoie un petit signal en continu. */
  .mock-graph .mock-node{
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
  }
  .mock-graph.in-view .mock-node{ opacity: 1; transform: none; }
  .mock-graph.in-view .mock-node:nth-child(1){ transition-delay: .05s; }
  .mock-graph.in-view .mock-node:nth-child(2){ transition-delay: .2s; }
  .mock-graph.in-view .mock-node:nth-child(3){ transition-delay: .35s; }
  .mock-graph.in-view .mock-node:nth-child(4){ transition-delay: .5s; }

  .mock-edges line{ transition: stroke-dashoffset .6s ease; }
  .mock-edges .edge-1{ stroke-dasharray: 110; stroke-dashoffset: 110; transition-delay: .35s; }
  .mock-edges .edge-2{ stroke-dasharray: 132; stroke-dashoffset: 132; transition-delay: .5s; }
  .mock-edges .edge-3{ stroke-dasharray: 135; stroke-dashoffset: 135; transition-delay: .65s; }
  .mock-graph.in-view .mock-edges line{ stroke-dashoffset: 0; }

  .mock-node:first-child .mock-dot{ position: relative; }
  .mock-node:first-child .mock-dot::after{
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--orange);
    opacity: 0;
  }
  .mock-graph.in-view .mock-node:first-child .mock-dot::after{
    animation: ping 2.4s ease-out .9s infinite;
  }
  @keyframes ping{
    0%{ transform: scale(.6); opacity: .7; }
    100%{ transform: scale(2.2); opacity: 0; }
  }

  /* Boîte à outils : la liste glisse en place, ligne par ligne. */
  .mock-toolbox .mock-tool{
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity .5s ease, transform .5s ease;
  }
  .mock-toolbox.in-view .mock-tool{ opacity: 1; transform: none; }
  .mock-toolbox.in-view .mock-tool:nth-child(1){ transition-delay: .05s; }
  .mock-toolbox.in-view .mock-tool:nth-child(2){ transition-delay: .18s; }
  .mock-toolbox.in-view .mock-tool:nth-child(3){ transition-delay: .31s; }
  .mock-toolbox.in-view .mock-tool:nth-child(4){ transition-delay: .44s; }

  /* Bloc-notes : les lignes se tracent comme si elles s'écrivaient. */
  .mock-notes .mock-note-line{
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s ease;
  }
  .mock-notes.in-view .mock-note-line{ transform: scaleX(1); }
  .mock-notes.in-view .mock-note-line:nth-child(1){ transition-delay: .05s; }
  .mock-notes.in-view .mock-note-line:nth-child(2){ transition-delay: .22s; }
  .mock-notes.in-view .mock-note-line:nth-child(3){ transition-delay: .39s; }
  .mock-notes.in-view .mock-note-line:nth-child(4){ transition-delay: .56s; }
  .mock-notes.in-view .mock-note-line:nth-child(5){ transition-delay: .73s; }

  /* Chat : la conversation se joue comme un vrai échange. */
  .mock-chat .mock-bubble{
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease;
  }
  .mock-chat .mock-bubble.show{ opacity: 1; transform: none; }
  .mock-chat .mock-bubble.ai.show{ animation: aiGlow 3s ease-in-out .4s infinite; }
  @keyframes aiGlow{
    0%, 100%{ box-shadow: 0 0 0 rgba(255,90,31,0); }
    50%{ box-shadow: 0 0 22px rgba(255,90,31,0.18); }
  }

  .mock-typing.show{
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    width: fit-content;
  }
  .mock-typing span{
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ink-faint);
    animation: typingDot 1.1s ease-in-out infinite;
  }
  .mock-typing span:nth-child(2){ animation-delay: .15s; }
  .mock-typing span:nth-child(3){ animation-delay: .3s; }
  @keyframes typingDot{
    0%, 60%, 100%{ transform: translateY(0); opacity: .5; }
    30%{ transform: translateY(-4px); opacity: 1; }
  }
}

@media (max-width: 860px){
  .hero .wrap, .feature .wrap, .feature.reverse .wrap{
    grid-template-columns: 1fr;
  }
  .feature.reverse .feature-copy, .feature.reverse .feature-visual{ order: initial; }
  .hero{ padding-top: 170px; padding-bottom: 140px; }
  .footer-inner{ flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}
