/* iofacto — shared styles (FR + EN) */

:root {
  --bg: #050A18;
  --cyan: 34, 211, 238;
  --indigo: 129, 140, 248;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); }
::selection { background: rgba(var(--cyan), 0.3); color: #fff; }

a:focus-visible, button:focus-visible {
  outline: 2px solid rgb(var(--cyan));
  outline-offset: 4px;
  border-radius: 6px;
}

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #22d3ee, #818cf8);
  pointer-events: none;
}

/* ---------- Nav ---------- */
#navbar { transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s; border-bottom: 1px solid transparent; }
#navbar .nav-inner { transition: padding 0.4s var(--ease-out); }
#navbar.scrolled { background: rgba(5, 10, 24, 0.72); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border-color: rgba(255, 255, 255, 0.06); }
#navbar.menu-open { background: rgba(5, 10, 24, 0.95); }
#navbar.scrolled .nav-inner { padding-top: 0.85rem; padding-bottom: 0.85rem; }

.nav-link { position: relative; padding: 0.25rem 0; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #22d3ee, #818cf8);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.35s var(--ease-out);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: #fff; }

#burger-btn.active .burger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#burger-btn.active .burger-line:nth-child(2) { opacity: 0; }
#burger-btn.active .burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#mobile-menu {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 0.45s var(--ease-out), visibility 0s 0.45s;
}
#mobile-menu.open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.45s var(--ease-out), visibility 0s; }
#mobile-menu > div { overflow: hidden; }
#mobile-menu a { opacity: 0; transform: translateY(-8px); transition: opacity 0.3s, transform 0.4s var(--ease-out), color 0.2s; }
#mobile-menu.open a { opacity: 1; transform: none; }
#mobile-menu.open a:nth-child(2) { transition-delay: 0.05s; }
#mobile-menu.open a:nth-child(3) { transition-delay: 0.1s; }
#mobile-menu.open a:nth-child(4) { transition-delay: 0.15s; }
#mobile-menu.open a:nth-child(5) { transition-delay: 0.2s; }
@media (min-width: 768px) { #mobile-menu { display: none; } }

/* ---------- Hero ---------- */
.hero-grid {
  background-image:
    linear-gradient(rgba(var(--cyan), 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--cyan), 0.07) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 100%);
}
/* Cursor spotlight that brightens the grid under the pointer */
.hero-spot {
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 40%), rgba(var(--cyan), 0.10), transparent 65%);
  transition: opacity 0.6s;
}
/* Light beams travelling along the grid lines */
.beam { position: absolute; pointer-events: none; opacity: 0; }
.beam-h { left: 0; height: 1px; width: 180px; background: linear-gradient(90deg, transparent, rgba(var(--cyan), 0.9)); animation: beam-h var(--d, 7s) linear var(--dl, 0s) infinite; }
.beam-v { top: 0; width: 1px; height: 180px; background: linear-gradient(180deg, transparent, rgba(var(--indigo), 0.9)); animation: beam-v var(--d, 8s) linear var(--dl, 0s) infinite; }
@keyframes beam-h {
  0% { transform: translateX(-200px); opacity: 0; }
  10%, 80% { opacity: 1; }
  100% { transform: translateX(100vw); opacity: 0; }
}
@keyframes beam-v {
  0% { transform: translateY(-200px); opacity: 0; }
  10%, 80% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 20px) scale(0.94); }
}
.hero-orb { animation: orb-float 14s ease-in-out infinite; will-change: transform; }
.hero-orb-2 { animation-delay: -5s; animation-duration: 18s; }

.badge-dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: #22d3ee; }
.badge-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22d3ee; animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(3.2); opacity: 0; } }

.text-shimmer {
  color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(100deg, #22d3ee 0%, #818cf8 35%, #a5f3fc 50%, #818cf8 65%, #22d3ee 100%);
  background-size: 250% 100%;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }

.mask-line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.mask-line > span { display: inline-block; will-change: transform; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor-blink { animation: blink 0.8s step-end infinite; }

@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(10px); opacity: 0; } }
.scroll-wheel { animation: wheel 1.8s var(--ease-out) infinite; }

/* ---------- Buttons ---------- */
.btn-primary {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(90deg, #06b6d4, #6366f1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 8px 30px -10px rgba(var(--cyan), 0.55);
  transition: box-shadow 0.3s, transform 0.3s var(--ease-out);
  will-change: transform;
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 14px 44px -10px rgba(var(--cyan), 0.75); }
.btn-primary:hover::before { transform: translateX(120%); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary .btn-icon { transition: transform 0.35s var(--ease-out); }
.btn-primary:hover .icon-down { transform: translateY(3px); }
.btn-primary:hover .icon-right { transform: translateX(4px); }

/* ---------- Section headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: rgb(var(--cyan));
}
.eyebrow::before, .eyebrow::after { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--cyan), 0.7)); }
.eyebrow::after { transform: scaleX(-1); }

/* ---------- Scroll-driven stages ---------- */
.stage-fade::before, .stage-fade::after {
  content: ''; position: absolute; left: 0; right: 0; height: 90px; z-index: 5; pointer-events: none;
}
.stage-fade::before { top: 0; background: linear-gradient(var(--bg), transparent); }
.stage-fade::after { bottom: 0; background: linear-gradient(transparent, var(--bg)); }

.stepper { display: flex; align-items: flex-start; justify-content: center; gap: 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: 7.5rem; color: #64748b; transition: color 0.4s; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 0.75rem; font-weight: 700;
  border: 1px solid rgba(100, 116, 139, 0.45); background: var(--bg);
  transition: border-color 0.4s, background 0.4s, color 0.4s, box-shadow 0.4s, transform 0.4s var(--ease-out);
}
.step-label { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.step.done { color: #cbd5e1; }
.step.done .step-dot { border-color: rgba(var(--cyan), 0.6); color: rgb(var(--cyan)); }
.step.current { color: #fff; }
.step.current .step-dot { border-color: transparent; background: linear-gradient(135deg, #06b6d4, #6366f1); color: #fff; box-shadow: 0 0 24px rgba(var(--cyan), 0.5); transform: scale(1.12); }
.step-rail { position: relative; flex: 0 1 5.5rem; height: 1px; margin-top: 15px; background: rgba(100, 116, 139, 0.3); }
.step-rail > i { position: absolute; inset: 0; background: linear-gradient(90deg, #22d3ee, #818cf8); transform: scaleX(0); transform-origin: 0 50%; }
@media (max-width: 480px) {
  .step { width: 6.2rem; }
  .step-label { font-size: 0.68rem; letter-spacing: 0.04em; }
  .step-rail { flex-basis: 1.5rem; margin-left: -1rem; margin-right: -1rem; }
}

@keyframes spin { to { transform: rotate(360deg); } }
#conv-ring-outer { border-style: dashed; animation: spin 28s linear infinite; }
#conv-ring-inner { animation: spin 18s linear infinite reverse; border-style: dashed; }
#conv-core { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 0 50px rgba(var(--cyan), 0.35), 0 20px 50px -12px rgba(99, 102, 241, 0.5); }

/* ---------- Service cards ---------- */
.service-card {
  --c: var(--cyan);
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(10, 17, 40, 0.55));
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: border-color 0.3s, transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.service-card::before { /* pointer spotlight */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--c), 0.16), transparent 70%);
}
.service-card::after { /* top hairline */
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--c), 0.9), transparent);
  transform: scaleX(0.3); opacity: 0; transition: transform 0.5s var(--ease-out), opacity 0.4s;
}
.service-card:hover { border-color: rgba(var(--c), 0.35); transform: perspective(900px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); box-shadow: 0 24px 50px -24px rgba(var(--c), 0.35); }
.service-card:hover::before, .service-card:hover::after { opacity: 1; }
.service-card:hover::after { transform: scaleX(1); }
.service-icon {
  width: 3rem; height: 3rem; border-radius: 0.85rem; display: grid; place-items: center;
  color: rgb(var(--c)); background: rgba(var(--c), 0.1); border: 1px solid rgba(var(--c), 0.22);
  transition: transform 0.4s var(--ease-out), background 0.3s, box-shadow 0.3s;
}
.service-card:hover .service-icon { transform: translateY(-2px) rotate(-6deg); background: rgba(var(--c), 0.18); box-shadow: 0 0 24px rgba(var(--c), 0.3); }
.service-num { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; color: rgba(148, 163, 184, 0.45); transition: color 0.3s; }
.service-card:hover .service-num { color: rgb(var(--c)); }
.c-cyan { --c: 34, 211, 238; } .c-indigo { --c: 129, 140, 248; } .c-emerald { --c: 52, 211, 153; } .c-amber { --c: 251, 191, 36; }

/* ---------- Client logos ---------- */
.client-logo img { filter: brightness(0) invert(1); opacity: 0.5; transition: filter 0.35s, opacity 0.35s, transform 0.4s var(--ease-out); }
.client-logo:hover img { filter: none; opacity: 1; transform: scale(1.05); }
.client-logo.keep-mono:hover img { filter: brightness(0) invert(1); }

/* ---------- CTA panel ---------- */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.cta-panel { position: relative; border-radius: 2rem; background: linear-gradient(180deg, #0B1330, #070D20); isolation: isolate; }
.cta-panel::before { /* animated gradient border */
  content: ''; position: absolute; inset: -1px; border-radius: inherit; z-index: -2;
  background: conic-gradient(from var(--angle), rgba(var(--cyan), 0.05), rgba(var(--cyan), 0.8), rgba(var(--indigo), 0.8), rgba(var(--cyan), 0.05) 40%, rgba(148, 163, 184, 0.14) 60%, rgba(var(--cyan), 0.05));
  animation: border-spin 9s linear infinite;
}
.cta-panel::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: linear-gradient(180deg, #0B1330, #070D20); }
@keyframes border-spin { to { --angle: 360deg; } }
.cta-inner { position: relative; overflow: hidden; border-radius: inherit; }
.cta-glow { position: absolute; left: 50%; top: -55%; width: 720px; height: 520px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--cyan), 0.22), rgba(var(--indigo), 0.1) 55%, transparent); pointer-events: none; }
.cta-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(var(--cyan), 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--cyan), 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000, transparent 75%);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .beam { display: none; }
  .scrolly { height: 100vh !important; }
}
