/* Netlogix — identité « réseau lumineux » sur bleu marine.
   Motif de marque : des nœuds reliés (le N du logo), repris dans les puces, la frise et l'illustration.
   CSS natif : @layer, nesting, popover, @starting-style, scroll-driven animations, view transitions. */
@layer reset, tokens, base, layout, components, motion;

@view-transition { navigation: auto; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  svg { display: block; }
  button, input, textarea { font: inherit; color: inherit; }
  ul, ol { padding: 0; list-style: none; }
  i { font-style: normal; }
}

@layer tokens {
  :root {
    color-scheme: dark;
    --bg: #050b1a;
    --navy: #0a1730;
    --text: #e9f0ff;
    --muted: #9cadd0;
    --line: rgb(120 165 255 / .16);
    --line-2: rgb(120 175 255 / .38);
    --glass: linear-gradient(180deg, rgb(24 46 96 / .5), rgb(10 22 48 / .55));
    --blue: #2f7bff;
    --azure: #5aa9ff;
    --cyan: #6fe3ff;
    --ice: #a6f1ff;
    --grad: linear-gradient(100deg, var(--azure), var(--cyan));

    --sans: system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --gutter: clamp(1rem, 4vw, 2rem);
    --space: clamp(4.5rem, 10vw, 8.5rem);
    --ease: cubic-bezier(.2, .7, .2, 1);
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-block-start: 6.5rem; background: var(--bg); }
  body {
    color: var(--text); font: 1.0625rem/1.65 var(--sans);
    -webkit-font-smoothing: antialiased; min-block-size: 100dvh; overflow-x: clip;
    background:
      radial-gradient(70rem 44rem at 85% -12%, rgb(47 123 255 / .30), transparent 62%),
      radial-gradient(52rem 38rem at -12% 18%, rgb(60 200 255 / .13), transparent 60%),
      var(--bg);
    background-repeat: no-repeat;
  }
  h1, h2, h3 { font-weight: 680; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: break-word; }
  h1 { font-size: clamp(2.5rem, 4.6vw + 1.1rem, 5rem); }
  h2 { font-size: clamp(1.9rem, 2.8vw + .9rem, 3.2rem); }
  h3 { font-size: 1.22rem; letter-spacing: -.015em; line-height: 1.25; }
  p { text-wrap: pretty; }
  a { color: var(--cyan); text-underline-offset: .22em; text-decoration-thickness: 1px; }
  a:hover { color: var(--ice); }
  :focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: .4rem; }
  ::selection { background: var(--blue); color: #fff; }
  .small { font-size: .88rem; color: var(--muted); }
  .defs { position: absolute; }
  .skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 100; padding: .6rem 1rem; border-radius: .6rem; background: var(--cyan); color: var(--bg);
    translate: 0 -300%; &:focus { translate: 0 0; color: var(--bg); } }
}

@layer layout {
  .wrap { inline-size: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
  .grow { flex: 1; }

  .top { position: sticky; inset-block-start: .75rem; z-index: 50; margin-block-start: .75rem; }
  .top-in { display: flex; align-items: center; gap: 1.1rem; block-size: 3.9rem; padding-inline: 1.1rem .65rem;
    border: 1px solid var(--line); border-radius: 999px;
    background: rgb(7 16 36 / .68); backdrop-filter: blur(18px) saturate(1.5);
    box-shadow: 0 12px 40px -18px rgb(0 0 0 / .8), inset 0 1px 0 rgb(160 200 255 / .08); }
  .nav { margin-inline: auto; }
  .nav ul { display: flex; gap: clamp(.9rem, 2vw, 1.9rem); }

  .hero { position: relative; padding-block: clamp(3rem, 7vw, 6rem) 0;
    &::before { content: ""; position: absolute; inset: -6rem 0 0; z-index: -1; pointer-events: none;
      background: radial-gradient(circle, rgb(140 180 255 / .22) 1px, transparent 1.5px) 0 0 / 28px 28px;
      mask-image: radial-gradient(60rem 36rem at 70% 30%, #000, transparent 75%); } }
  .hero-grid { display: grid; gap: 2.5rem; align-items: center; }
  .hero-copy { display: grid; gap: 1.5rem; justify-items: start; }
  .orbit { inline-size: min(100%, 26rem); margin-inline: auto; }
  @media (min-width: 62rem) {
    .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 2rem; }
    .orbit { inline-size: min(100%, 36rem); margin-inline-end: -2rem; }
  }

  .sec { padding-block: var(--space); }
  #methode { background: radial-gradient(48rem 30rem at -5% 40%, rgb(47 123 255 / .13), transparent 65%); }
  #technologies { background: radial-gradient(48rem 30rem at 105% 40%, rgb(60 200 255 / .10), transparent 65%); }
  .sec-head { display: grid; gap: 1.1rem; justify-items: start; max-inline-size: 46rem; margin-block-end: clamp(2.2rem, 5vw, 3.8rem); }

  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.1rem; }

  .split { display: grid; gap: 3rem; align-items: center; }
  .split-copy { display: grid; gap: 1.4rem; justify-items: start; }
  @media (min-width: 60rem) { .split { grid-template-columns: 1.1fr .9fr; gap: 4rem; } }

  .panel { display: grid; gap: 2.5rem; }
  .panel-copy { display: grid; gap: 1.2rem; justify-items: start; align-content: start; }
  @media (min-width: 60rem) { .panel { grid-template-columns: 1fr 1.05fr; gap: 3.5rem; } }

  .foot { border-block-start: 1px solid var(--line); padding-block: 2.8rem; margin-block-start: 2rem; }
  .foot-in { display: grid; gap: 1.6rem 2rem; align-items: start;
    > div { display: grid; gap: .6rem; }
    @media (min-width: 48rem) { grid-template-columns: 1fr auto; .copy { grid-column: 1 / -1; } } }
  .foot-links { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-size: .95rem; a { color: var(--text); text-decoration: none; &:hover { color: var(--cyan); } } }

  .center { min-block-size: calc(100dvh - 6rem); display: grid; align-content: center; justify-items: center; text-align: center; gap: 1.5rem; padding-block: var(--space);
    h1 { font-size: clamp(3rem, 9vw, 6.5rem); } }
}

@layer components {
  /* Marque */
  .brand-row { display: flex; align-items: baseline; gap: .7rem; }
  .ver { font: 500 .72rem/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
  .brand { display: inline-flex; align-items: center; gap: 0; color: var(--text); text-decoration: none; font-size: 1.28rem; font-weight: 400; letter-spacing: -.035em;
    i { font-style: normal; font-weight: 720; background: linear-gradient(90deg, #4d9dff, #6fe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
    b { font-weight: 720; }
    &:hover { color: var(--text); } }
  .big-mark { inline-size: 5.5rem; filter: drop-shadow(0 0 22px rgb(90 169 255 / .8)); }

  .nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; padding-block: .4rem; position: relative; transition: color .2s;
    &::after { content: ""; position: absolute; inset: auto 0 0; block-size: 2px; border-radius: 2px; background: var(--grad); scale: 0 1; transition: scale .3s var(--ease); }
    &:hover { color: var(--text); &::after { scale: 1 1; } } }

  .langs { display: flex; gap: .1rem; font: 600 .74rem var(--mono);
    a { display: block; padding: .35rem .45rem; border-radius: .45rem; color: var(--muted); text-decoration: none;
      &:hover { color: var(--text); }
      &[aria-current] { color: var(--ice); background: rgb(90 169 255 / .16); } } }

  .btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
    padding: .95rem 1.5rem; border: 0; border-radius: 999px; cursor: pointer; isolation: isolate;
    background: linear-gradient(100deg, #2f7bff, #58c4ff); color: #03102b; font-weight: 680; line-height: 1.2; text-decoration: none;
    box-shadow: 0 0 0 1px rgb(166 241 255 / .35) inset, 0 10px 34px -10px rgb(47 123 255 / .9);
    transition: translate .25s var(--ease), box-shadow .25s;
    &::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .55) 50%, transparent 70%); translate: -120% 0; transition: translate .7s var(--ease); }
    .arr { transition: translate .25s var(--ease); }
    &:hover { color: #03102b; translate: 0 -2px; box-shadow: 0 0 0 1px rgb(166 241 255 / .6) inset, 0 16px 44px -10px rgb(60 150 255 / 1);
      &::before { translate: 120% 0; } .arr { translate: .3rem 0; } } }
  .btn-ghost { background: rgb(20 40 84 / .45); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset;
    &:hover { color: var(--text); box-shadow: 0 0 0 1px var(--cyan) inset, 0 12px 34px -14px rgb(111 227 255 / .6); } }
  .btn-s { padding: .65rem 1.15rem; font-size: .92rem; }

  .menu-btn { display: none; position: relative; inline-size: 2.7rem; block-size: 2.7rem; border: 1px solid var(--line-2); border-radius: 50%; background: rgb(20 40 84 / .45); cursor: pointer;
    i { position: absolute; inset-inline: .8rem; block-size: 2px; border-radius: 2px; background: var(--text); }
    i:first-child { inset-block-start: 1.02rem; } i:last-child { inset-block-end: 1.02rem; }
    &.open i { inset-block: calc(50% - 1px) auto; rotate: 45deg; &:last-child { rotate: -45deg; } } }
  @media (max-width: 58rem) {
    .top-home .top-in > :is(.nav, .langs, .btn) { display: none; }
    .top .menu-btn { display: block; margin-inline-start: auto; }
  }

  /* Menu mobile : API popover, sans JavaScript */
  .menu { inset: 0; inline-size: 100%; block-size: 100dvh; max-inline-size: none; max-block-size: none; margin: 0; border: 0; padding: .75rem calc(var(--gutter) + .65rem) 2rem;
    color: var(--text); background: radial-gradient(40rem 30rem at 100% 0, rgb(47 123 255 / .35), transparent 65%), #050b1a;
    opacity: 0; translate: 0 -1.5rem;
    transition: opacity .25s, translate .3s var(--ease), display .3s allow-discrete, overlay .3s allow-discrete;
    &:popover-open { display: grid; grid-template-rows: auto 1fr auto; opacity: 1; translate: 0 0;
      @starting-style { opacity: 0; translate: 0 -1.5rem; } }
    .menu-top { display: flex; justify-content: space-between; align-items: center; block-size: 3.9rem; }
    .menu-btn { display: block; }
    nav ul { display: grid; align-content: center; block-size: 100%; }
    nav li { border-block-end: 1px solid var(--line); }
    nav a { display: flex; align-items: center; gap: 1rem; padding-block: 1rem; color: var(--text); font-size: clamp(1.7rem, 7.5vw, 2.4rem); font-weight: 650; letter-spacing: -.03em; text-decoration: none;
      &::before { content: ""; inline-size: .6rem; block-size: .6rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); } }
    .langs { font-size: .95rem; gap: .5rem; } }

  /* Étiquettes */
  .kicker { display: inline-flex; align-items: center; gap: .65rem; padding: .42rem .95rem .42rem .8rem; border: 1px solid var(--line-2); border-radius: 999px;
    background: rgb(20 40 84 / .4); color: var(--ice); font: 500 .76rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
  .node, .pulse { flex: none; inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
  .pulse { animation: ping 2.2s infinite; }

  h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgb(90 169 255 / .45)); }
  @media (min-width: 40rem) { .nowrap { white-space: nowrap; } }
  .lead { font-size: clamp(1.08rem, .7vw + .95rem, 1.28rem); line-height: 1.55; color: var(--muted); max-inline-size: 38rem; }
  .cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-block-start: .4rem; }

  /* Illustration : Netlogix au centre du système */
  .orbit svg { inline-size: 100%; block-size: auto; overflow: visible; }
  .ring circle { fill: none; stroke: rgb(120 165 255 / .2); }
  .ring .sat { fill: var(--cyan); stroke: none; filter: drop-shadow(0 0 6px var(--cyan)); }
  .spin { transform-origin: 280px 280px; animation: spin 46s linear infinite; &.rev { animation-duration: 80s; animation-direction: reverse; } }
  .links path { stroke: rgb(111 227 255 / .4); stroke-width: 1.2; stroke-dasharray: 3 7; animation: dash 1.4s linear infinite; }
  .pulses circle { fill: #d6f8ff; filter: drop-shadow(0 0 6px var(--cyan)); }
  .pills rect { fill: #0a1730; stroke: rgb(120 175 255 / .45); }
  .pills circle { fill: var(--azure); }
  .pills text { font: 600 12px var(--mono); fill: #dbe7ff; }
  .core rect { fill: #0b1b3c; stroke: rgb(140 190 255 / .6); filter: drop-shadow(0 0 26px rgb(47 123 255 / .75)); }

  /* Engagements */
  .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); margin-block-start: clamp(2.5rem, 6vw, 4.5rem);
    border: 1px solid var(--line); border-radius: 1.4rem; background: var(--glass); backdrop-filter: blur(10px); overflow: hidden;
    li { display: grid; gap: .35rem; align-content: start; padding: 1.5rem 1.6rem; box-shadow: -1px -1px 0 var(--line); }
    strong { display: flex; align-items: center; gap: .6rem; font-weight: 650; letter-spacing: -.01em;
      &::before { content: ""; inline-size: .45rem; block-size: .45rem; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); } }
    span { color: var(--muted); font-size: .93rem; line-height: 1.5; } }

  /* Cartes de services, avec halo qui suit le pointeur */
  .card { position: relative; overflow: hidden; display: grid; gap: .75rem; align-content: start; padding: 1.9rem;
    border: 1px solid var(--line); border-radius: 1.4rem; background: var(--glass);
    transition: translate .3s var(--ease), border-color .3s, box-shadow .3s;
    &::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
      background: radial-gradient(22rem circle at var(--x, 50%) var(--y, 0%), rgb(90 169 255 / .22), transparent 60%); }
    p { color: var(--muted); font-size: 1rem; line-height: 1.6; }
    &:hover { translate: 0 -4px; border-color: var(--line-2); box-shadow: 0 24px 60px -28px rgb(47 123 255 / .8); &::before { opacity: 1; } .tile { box-shadow: 0 0 26px -4px rgb(90 169 255 / .8); } } }
  .tile { display: grid; place-items: center; inline-size: 3.2rem; block-size: 3.2rem; margin-block-end: .5rem; border: 1px solid var(--line-2); border-radius: 1rem;
    background: rgb(47 123 255 / .14); transition: box-shadow .3s; svg { inline-size: 1.7rem; } }

  /* Méthode : frise de nœuds reliés */
  .steps { position: relative; display: grid; gap: 0 1.6rem;
    &::before { content: ""; position: absolute; inset: 0 auto 0 .64rem; inline-size: 2px; background: linear-gradient(var(--blue), var(--cyan) 75%, transparent); }
    li { position: relative; display: grid; gap: .5rem; align-content: start; padding: 0 0 2.4rem 2.8rem;
      &::before { content: ""; position: absolute; inset: .1rem auto auto 0; inline-size: 1.4rem; block-size: 1.4rem; border-radius: 50%;
        background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 0 5px rgb(111 227 255 / .12), 0 0 18px rgb(111 227 255 / .8); } }
    .n { font: 600 .8rem var(--mono); color: var(--cyan); letter-spacing: .08em; }
    p { color: var(--muted); font-size: 1rem; line-height: 1.6; }
    @media (min-width: 56rem) { grid-template-columns: repeat(4, 1fr);
      &::before { inset: .64rem 0 auto 0; inline-size: auto; block-size: 2px; background: linear-gradient(90deg, var(--blue), var(--cyan) 75%, transparent); }
      li { padding: 2.7rem 0 0; &::before { inset: 0 auto auto 0; } } } }

  /* Maintenance */
  .checks { display: grid; gap: .8rem; margin-block: .3rem .6rem;
    li { display: flex; gap: .8rem; align-items: flex-start; }
    svg { flex: none; inline-size: 1.35rem; margin-block-start: .2rem; } }
  .term { border: 1px solid var(--line-2); border-radius: 1.2rem; overflow: hidden; background: rgb(4 10 24 / .8); font: .93rem var(--mono);
    box-shadow: 0 30px 80px -30px rgb(47 123 255 / .7), inset 0 1px 0 rgb(160 200 255 / .1);
    .term-head { display: flex; align-items: center; gap: .45rem; padding: .85rem 1.1rem; border-block-end: 1px solid var(--line); color: var(--muted); font-size: .78rem;
      i { inline-size: .65rem; block-size: .65rem; border-radius: 50%; background: rgb(120 165 255 / .3); }
      span { margin-inline-start: .6rem; } }
    pre { padding: 1.4rem 1.5rem 1.6rem; line-height: 2; overflow-x: auto; }
    .c { color: #6f82a8; } .p { color: var(--azure); } .ok { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
    .cursor { display: inline-block; inline-size: .55em; block-size: 1.1em; vertical-align: text-bottom; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1.1s steps(2) infinite; } }

  /* Technologies : bandes défilantes */
  .marquee { overflow: hidden; padding-block: .45rem; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    &:hover .track { animation-play-state: paused; } }
  .track { display: flex; gap: .8rem; inline-size: max-content; animation: marquee 42s linear infinite;
    .rev & { animation-direction: reverse; }
    li { display: flex; align-items: center; gap: .65rem; padding: .8rem 1.35rem; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); font: 500 .95rem var(--mono); white-space: nowrap;
      &::before { content: ""; inline-size: .4rem; block-size: .4rem; border-radius: 50%; background: var(--azure); } } }

  /* Contact */
  .panel { position: relative; padding: clamp(1.5rem, 5vw, 3.5rem); border: 1px solid var(--line-2); border-radius: 2rem; overflow: hidden;
    background: radial-gradient(44rem 26rem at 105% -10%, rgb(47 123 255 / .38), transparent 62%), radial-gradient(30rem 20rem at -10% 110%, rgb(111 227 255 / .14), transparent 60%), rgb(8 18 40 / .8);
    box-shadow: 0 40px 120px -50px rgb(47 123 255 / .8), inset 0 1px 0 rgb(160 200 255 / .12); }
  .mail { font-size: clamp(1.25rem, 1.6vw + .9rem, 1.9rem); font-weight: 650; letter-spacing: -.02em; }
  .form { display: grid; gap: 1.1rem;
    @media (min-width: 36rem) { grid-template-columns: 1fr 1fr; .full { grid-column: 1 / -1; } }
    label { display: grid; gap: .4rem; }
    label span { font-size: .88rem; font-weight: 550; color: var(--muted); }
    input, textarea { inline-size: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .85rem; background: rgb(3 9 22 / .65); resize: vertical; transition: border-color .2s, box-shadow .2s;
      &:focus-visible { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 4px rgb(111 227 255 / .16); } }
    :user-invalid { border-color: #ff8a8a; }
    .btn { justify-self: start; } }

  /* Pages secondaires */
  .prose { max-inline-size: 48rem; margin-block: clamp(2.5rem, 6vw, 4.5rem) var(--space); margin-inline: auto; padding: clamp(1.5rem, 5vw, 3.5rem); display: grid; gap: 1.1rem;
    border: 1px solid var(--line); border-radius: 1.75rem; background: var(--glass);
    h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-block: .5rem; }
    h2 { font-size: 1.4rem; margin-block-start: 1.6rem; }
    p { color: #c6d3ee; }
    .note { padding: 1rem 1.2rem; border: 1px solid var(--line-2); border-radius: .9rem; background: rgb(47 123 255 / .14); } }
}

@layer motion {
  @keyframes rise { from { opacity: 0; translate: 0 1.6rem; } }
  @keyframes spin { to { rotate: 360deg; } }
  @keyframes dash { to { stroke-dashoffset: -20; } }
  @keyframes blink { 50% { opacity: 0; } }
  @keyframes ping { 0% { box-shadow: 0 0 0 0 rgb(111 227 255 / .6), 0 0 10px var(--cyan); } 100% { box-shadow: 0 0 0 .7rem rgb(111 227 255 / 0), 0 0 10px var(--cyan); } }
  @keyframes marquee { to { translate: calc(-25% - .2rem) 0; } }
  @keyframes pop { from { opacity: 0; scale: .9; } }

  .hero-copy > * { animation: rise .8s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .16s; } .hero-copy > :nth-child(4) { animation-delay: .24s; }
  .orbit { animation: pop 1.1s .15s var(--ease) both; }
  .facts { animation: rise .8s .35s var(--ease) both; }

  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .pulses { display: none; }
    .track { flex-wrap: wrap; justify-content: center; inline-size: auto; padding-inline: var(--gutter); [aria-hidden] { display: none; } }
    .marquee { mask-image: none; }
    @view-transition { navigation: none; }
  }
}
