/* ═══════════════════════════════════════════════════════════════
   PerfShop.io — Thème centralisé
   Importé par toutes les pages
═══════════════════════════════════════════════════════════════ */


:root {
  --bg:       #0d0d14;
  --surface:  #13131e;
  --surface2: #1c1c2e;
  --border:   #2a2a40;
  --accent:   #667eea;
  --electric: #00d4ff;
  --teal:     #4ecdc4;
  --purple:   #a855f7;
  --cyan:     #06b6d4;
  --danger:   #ff4757;
  --warning:  #ffa502;
  --success:  #2ed573;
  --text:     #e8e8f0;
  --text2:    #7878a0;
  --font-mono: 'DM Mono', monospace;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; overflow-x:clip; max-width:100%; }
body { font-family:'DM Sans','Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif; background:var(--bg); color:var(--text); line-height:1.6; overflow-x:clip; min-width:320px; max-width:100%; }
.hero-h1-nowrap { white-space:nowrap; }

/* ── Typographie ── */
h1,h2,h3,h4 { letter-spacing:-.02em; }
/* Syne utilisé uniquement dans index.html via ses styles inline */
img { max-width:100%; height:auto; display:block; }

/* ── Boutons ── */
.btn        { display:inline-flex; align-items:center; gap:7px; padding:10px 22px; border-radius:8px; font-family:'DM Sans',sans-serif; font-size:.88rem; font-weight:600; cursor:pointer; transition:all .2s; text-decoration:none; border:none; }
.btn-primary{ background:var(--accent); color:#fff; box-shadow:0 0 20px rgba(102,126,234,.35); }
.btn-primary:hover { background:#7b8ff0; box-shadow:0 0 32px rgba(102,126,234,.55); transform:translateY(-1px); }
.btn-electric { background:linear-gradient(135deg,var(--electric),#0099cc); color:#000; font-weight:700; box-shadow:0 0 20px rgba(0,212,255,.25); }
.btn-electric:hover { box-shadow:0 0 36px rgba(0,212,255,.45); transform:translateY(-1px); }
.btn-ghost  { background:transparent; color:var(--text); border:1px solid var(--border); }
.btn-ghost:hover { border-color:var(--text2); transform:translateY(-1px); }
.btn-purple { background:var(--purple); color:#fff; box-shadow:0 0 20px rgba(168,85,247,.3); }
.btn-purple:hover { background:#b56cf5; }
.btn-lg { padding:13px 28px; font-size:.95rem; border-radius:9px; }
.btn-sm { padding:6px 14px; font-size:.8rem; border-radius:6px; }

/* ── Nav ── */
nav {
  position:fixed; top:0; left:0; right:0; z-index:200;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 40px; height:64px;
  background:rgba(13,13,20,.88); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
  box-sizing:border-box; width:100%;
}
.nav-logo { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:700; font-size:1.1rem; }
.logo-icon { width:32px; height:32px; border-radius:8px; background:linear-gradient(135deg,var(--accent),var(--purple)); display:flex; align-items:center; justify-content:center; font-size:1rem; flex-shrink:0; }
.nav-links { display:flex; align-items:center; gap:26px; }
.nav-links a { color:var(--text2); text-decoration:none; font-size:.875rem; font-weight:500; transition:color .2s; }
.nav-links a:hover, .nav-links a.active { color:var(--text); }
.nav-right { display:flex; align-items:center; gap:10px; }
/* ── Slider langue FR / EN ── */
.lang-switch { display:inline-flex; align-items:center; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:20px; padding:2px; cursor:pointer; gap:0; transition:all .2s; flex-shrink:0; }
.lang-switch:hover { border-color:var(--accent); background:rgba(102,126,234,.1); }
.lang-switch span { font-family:'DM Mono','Noto Sans SC','Microsoft YaHei','PingFang SC',monospace; font-size:.65rem; font-weight:700; letter-spacing:.06em; padding:3px 9px; border-radius:16px; transition:all .2s; color:var(--text2); user-select:none; line-height:1; }
@keyframes ps-lang-pop {
  0%   { transform:scale(.82); opacity:.5; }
  60%  { transform:scale(1.12); }
  100% { transform:scale(1); opacity:1; }
}
.lang-switch span.active { background:var(--accent); color:#fff; box-shadow:0 0 8px rgba(102,126,234,.5); animation:ps-lang-pop .32s cubic-bezier(.34,1.56,.64,1); }
@media (prefers-reduced-motion: reduce) { .lang-switch span.active { animation: none; } }

/* ── Layout sections ── */
.section-wrap { padding:96px 40px; max-width:1200px; margin:0 auto; box-sizing:border-box; width:100%; }
.section-wrap.narrow { max-width:860px; }
.page-hero { padding:72px 40px 60px; max-width:1200px; margin:0 auto; box-sizing:border-box; width:100%; }
.full-divider { border:none; border-top:1px solid var(--border); margin:0; }

/* ── Tags ── */
.section-tag { display:inline-flex; align-items:center; gap:6px; font-family:'DM Mono',monospace; font-size:.72rem; font-weight:500; letter-spacing:.08em; text-transform:uppercase; padding:4px 12px; border-radius:20px; margin-bottom:16px; }
.tag-accent { background:rgba(102,126,234,.1); color:var(--accent);   border:1px solid rgba(102,126,234,.2); }
.tag-teal   { background:rgba(78,205,196,.1);  color:var(--teal);     border:1px solid rgba(78,205,196,.2); }
.tag-purple { background:rgba(168,85,247,.1);  color:var(--purple);   border:1px solid rgba(168,85,247,.2); }
.tag-warn   { background:rgba(255,165,2,.1);   color:var(--warning);  border:1px solid rgba(255,165,2,.2); }
.tag-elec   { background:rgba(0,212,255,.08);  color:var(--electric); border:1px solid rgba(0,212,255,.2); }
.tag-danger { background:rgba(255,71,87,.08);  color:var(--danger);   border:1px solid rgba(255,71,87,.2); }
.tag-cyan   { background:rgba(6,182,212,.08);    color:var(--cyan);     border:1px solid rgba(6,182,212,.2); }

h2.section-title { font-family:'DM Sans',sans-serif; font-size:clamp(1.6rem,2.5vw,2.2rem); font-weight:700; line-height:1.2; margin-bottom:12px; letter-spacing:-.02em; }
p.section-sub { color:var(--text2); font-size:1rem; max-width:560px; line-height:1.7; margin-bottom:52px; }

/* ── Cards ── */
.card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:24px; transition:border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { transform:translateY(-3px); }
.card.c-accent:hover { border-color:rgba(102,126,234,.4); box-shadow:0 8px 32px rgba(102,126,234,.1); }
.card.c-teal:hover   { border-color:rgba(78,205,196,.4);  box-shadow:0 8px 32px rgba(78,205,196,.1); }
.card.c-purple:hover { border-color:rgba(168,85,247,.4);  box-shadow:0 8px 32px rgba(168,85,247,.1); }
.card.c-warn:hover   { border-color:rgba(255,165,2,.4);   box-shadow:0 8px 32px rgba(255,165,2,.1); }
.card.c-cyan:hover   { border-color:rgba(6,182,212,.4);   box-shadow:0 8px 32px rgba(6,182,212,.1); }
.card.c-danger:hover { border-color:rgba(255,71,87,.4);   box-shadow:0 8px 32px rgba(255,71,87,.1); }

/* ── Footer ── */
footer { border-top:1px solid var(--border); background:var(--surface); padding:48px 40px 32px; }
.footer-grid { display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:40px; max-width:1200px; margin:0 auto 40px; }
.footer-brand p { color:var(--text2); font-size:.82rem; line-height:1.6; margin-top:10px; max-width:240px; }
.footer-col h4  { font-size:.78rem; font-weight:600; color:var(--text2); text-transform:uppercase; letter-spacing:.05em; margin-bottom:14px; font-family:'DM Mono',monospace; }
.footer-col a   { display:block; color:var(--text2); text-decoration:none; font-size:.83rem; margin-bottom:8px; transition:color .2s; }
.footer-col a:hover { color:var(--text); }
.footer-bottom { max-width:1200px; margin:0 auto; border-top:1px solid var(--border); padding-top:24px; display:flex; align-items:center; justify-content:space-between; font-size:.75rem; color:var(--text2); flex-wrap:wrap; gap:12px; }
.footer-bottom a { color:var(--text2); text-decoration:none; }
.footer-bottom a:hover { color:var(--text); }

/* ── Animations ── */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.dot-live { width:6px; height:6px; border-radius:50%; background:var(--success); animation:blink 1.5s infinite; display:inline-block; }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

/* ── Forms ── */
.form-group { margin-bottom:18px; }
.form-label { display:block; font-size:.78rem; color:var(--text2); font-family:'DM Mono',monospace; margin-bottom:7px; text-transform:uppercase; letter-spacing:.05em; }
.form-input, .form-select, .form-textarea {
  width:100%; background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; padding:11px 14px; color:var(--text);
  font-family:'DM Sans',sans-serif; font-size:.9rem; outline:none; transition:border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color:var(--accent); }
.form-textarea { resize:vertical; min-height:120px; line-height:1.6; }
.form-select { cursor:pointer; }

/* ── Code block ── */
.code-block { display:inline-block; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:14px 22px; font-family:'DM Mono',monospace; font-size:.8rem; color:var(--teal); line-height:1.9; text-align:left; }

/* ── Responsive ── */

/* Hamburger button */
.nav-hamburger {
  display:none;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  width:36px;
  height:36px;
  background:none;
  border:1px solid var(--border);
  border-radius:7px;
  cursor:pointer;
  padding:6px;
  flex-shrink:0;
}
.nav-hamburger span {
  display:block;
  width:100%;
  height:2px;
  background:var(--text);
  border-radius:2px;
  transition:all .25s;
}
.nav-hamburger.open span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity:0; }
.nav-hamburger.open span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }

/* Menu mobile overlay */
.nav-mobile-menu {
  display:none;
  position:fixed;
  top:64px;
  left:0;
  right:0;
  z-index:199;
  background:rgba(13,13,20,.97);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
  padding:16px 20px 24px;
  flex-direction:column;
  gap:4px;
}
.nav-mobile-menu.open { display:flex; }
.nav-mobile-menu a {
  color:var(--text2);
  text-decoration:none;
  font-size:.95rem;
  font-weight:500;
  padding:10px 12px;
  border-radius:8px;
  transition:all .2s;
  display:block;
}
.nav-mobile-menu a:hover,
.nav-mobile-menu a.active { color:var(--text); background:var(--surface2); }
.nav-mobile-divider { border:none; border-top:1px solid var(--border); margin:10px 0; }
.nav-mobile-menu .btn { width:100%; justify-content:center; margin-top:4px; }

@media(max-width:900px) {
  nav { padding:0 20px; }
  .nav-links { display:none; }
  .nav-right .btn { display:none; }
  .nav-hamburger { display:flex; }
  .section-wrap { padding:64px 20px; }
  .page-hero { padding:64px 20px 48px; overflow:hidden; max-width:100vw; }
  .footer-grid { grid-template-columns:1fr 1fr; gap:24px; }
  /* 7 lang spans × ~38px would overflow — compact them on mobile */
  .lang-switch span { padding:2px 5px; font-size:.55rem; }
}

@media(max-width:480px) {
  /* Extra-small screens (375px iPhones) — tighten further */
  .lang-switch span { padding:2px 4px; font-size:.5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   PerfShop.io — Animations premium
   ═══════════════════════════════════════════════════════════════ */

/* ── Scroll progress bar ─────────────────────────────────────── */
#ps-pg-bar {
  position:fixed; top:0; left:0; height:3px; width:0%;
  background:linear-gradient(90deg, var(--accent), var(--purple));
  z-index:9999; pointer-events:none;
  transition:width .12s linear;
  border-radius:0 2px 2px 0;
}

/* ── Scroll reveal — états initiaux ─────────────────────────── */
/* Activés uniquement quand JS a chargé (.ps-anim-ready sur <html>) */
.ps-anim-ready .ps-reveal {
  opacity:0;
  transform:translateY(22px);
  transition:opacity .55s cubic-bezier(.25,.46,.45,.94),
             transform .55s cubic-bezier(.25,.46,.45,.94);
  transition-delay:calc(var(--ps-i, 0) * 75ms);
}
.ps-anim-ready .ps-reveal-block {
  opacity:0;
  transform:translateY(14px);
  transition:opacity .65s ease, transform .65s ease;
}
.ps-reveal.ps-in-view,
.ps-reveal-block.ps-in-view {
  opacity:1;
  transform:translateY(0);
}

/* ── Nav links — underline slide depuis la gauche ───────────── */
.nav-links a { position:relative; }
.nav-links a::after {
  content:'';
  position:absolute;
  bottom:-3px; left:0;
  width:0; height:2px;
  background:var(--accent);
  border-radius:1px;
  transition:width .3s cubic-bezier(.25,.46,.45,.94);
}
.nav-links a:hover::after,
.nav-links a.active::after { width:100%; }

/* ── Hero badge — halo pulsant ──────────────────────────────── */
.hero-badge .dot { position:relative; }
.hero-badge .dot::after {
  content:'';
  position:absolute;
  inset:-4px;
  border-radius:50%;
  border:1.5px solid var(--success);
  animation:ps-badge-halo 2.2s ease-out infinite;
}
@keyframes ps-badge-halo {
  0%   { transform:scale(1);   opacity:.7; }
  100% { transform:scale(2.4); opacity:0;  }
}
@media (prefers-reduced-motion: reduce) { .hero-badge .dot::after { animation: none; } }

/* ── Button ripple ───────────────────────────────────────────── */
.btn, .btn-hero, .btn-primary, .btn-hero-ghost, .btn-ghost {
  position:relative;
  overflow:hidden;
}
.ps-ripple {
  position:absolute;
  width:0; height:0;
  transform:translate(-50%,-50%);
  background:rgba(255,255,255,.22);
  border-radius:50%;
  pointer-events:none;
  animation:ps-ripple-anim .55s ease-out forwards;
}
@keyframes ps-ripple-anim {
  to { width:220px; height:220px; opacity:0; }
}

@media(max-width:600px) {
  .footer-grid { grid-template-columns:1fr; }
  .footer-bottom { flex-direction:column; align-items:flex-start; gap:8px; }
  .section-wrap { padding:48px 16px; }
  .page-hero { padding:56px 16px 40px; width:100%; max-width:100%; overflow-x:hidden; box-sizing:border-box; }
  .page-hero h1 { white-space:normal !important; }
  .hero-h1-nowrap { white-space:normal; }
  h2.section-title { font-size:1.5rem; }
  p.section-sub { font-size:.92rem; }
  /* Notice banners */
  .notice-banner { flex-direction:column; gap:10px; padding:16px; }
  /* Boutons plein largeur dans CTA row */
  .cta-row .btn { width:100%; justify-content:center; }
}

@media(max-width:480px) {
  .page-hero { padding:50px 14px 32px; overflow:hidden; }
  .section-wrap { padding:40px 14px; }
  h2.section-title { font-size:1.35rem; }
  .card { overflow-wrap:break-word; word-break:break-word; }
  .section-tag { max-width:calc(100vw - 28px); box-sizing:border-box; display:inline-block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}

/* ══════════════════════════════════════════════════════════
   SYSTÈME DE TRADUCTION — HTML dupliqué, CSS lang=
   Usage : <span lang="fr">Texte FR</span><span lang="en">Text EN</span>
   Le JS fait juste : document.documentElement.lang = 'en'
   ══════════════════════════════════════════════════════════ */
[lang="fr"] [lang="en"] { display:none !important; }
[lang="en"] [lang="fr"] { display:none !important; }

/* ── Utilitaires — extraits des styles inline répétés ──────────
   Remplacent les attributs style="" identiques sur 3+ éléments
   ─────────────────────────────────────────────────────────────── */

/* Couleurs sémantiques */
.c-success  { color: var(--success); }
.c-danger   { color: var(--danger); }
.c-accent   { color: var(--accent); }
.c-cyan     { color: var(--cyan); }
.text-accent   { color: var(--accent); }
.c-warning  { color: var(--warning); }
.c-muted    { color: var(--text2); }
.c-teal     { color: var(--teal); }
.c-purple   { color: var(--purple); }

/* Typographie */
.text-mono  { font-family: 'DM Mono', monospace; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }

/* En-têtes de card (label monospace uppercase gris) */
.card-label {
  font-size: .72rem;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

/* Feature list (check ✓ / ✗) */

/* Hero subtitle standard */
.hero-sub {
  color: var(--text2);
  font-size: 1.05rem;
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* CTA row centré */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Section CTA centrée */
.section-cta {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.section-cta p {
  color: var(--text2);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Icône emoji grande (cards) */
.card-icon-lg { font-size: 1.4rem; margin-bottom: 10px; }
.card-icon-xl { font-size: 1.6rem; margin-bottom: 8px; }

/* Badge statut inline */
.badge-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════
   EFFETS PREMIUM — v2
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Texte gradient animé — hero H1 deuxième ligne ───── */
@keyframes ps-grad-text {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.hero-title .line2 {
  background: linear-gradient(90deg,
    var(--accent)   0%,
    var(--purple)  30%,
    var(--electric) 60%,
    var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ps-grad-text 5s linear infinite;
  display: inline-block;
}
@media (prefers-reduced-motion: reduce) { .hero-title .line2 { animation: none; } }

/* ── 2. Gradient border glow sur les cards au hover ─────── */
@keyframes ps-card-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(102,126,234,.55), 0 12px 36px rgba(102,126,234,.12); }
  50%       { box-shadow: 0 0 0 1px rgba(168,85,247,.55), 0 12px 36px rgba(168,85,247,.12); }
}
.feature-card:hover,
.anomaly-card:hover,
.service-card:hover,
.socle-card:hover {
  border-color: transparent !important;
  animation: ps-card-glow 2.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .feature-card:hover, .anomaly-card:hover, .service-card:hover, .socle-card:hover { animation: none; }
}

/* ── 3. Flip counters (chiffres qui tombent du haut) ─────── */
.ps-flip-digit {
  display: inline-block;
  overflow: hidden;
  height: 1.15em;
  vertical-align: bottom;
  line-height: 1.15;
}
.ps-flip-digit-inner {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}
.ps-flip-digit-inner.ps-flip-in {
  transform: translateY(0);
}

/* ── 4. Boutons magnétiques — transition snap retour ─────── */
.btn-hero, .btn-hero-ghost {
  transition: transform .15s ease, box-shadow .2s, background .2s, color .2s, border-color .2s;
}

/* ── 5. Cursor ambient glow ──────────────────────────────── */
#ps-cursor-glow {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102,126,234,.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  top: 0; left: 0;
  will-change: transform;
}
@media (hover: none), (pointer: coarse) { #ps-cursor-glow { display: none; } }

/* ── Skip link accessibilité ─────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 6px 0;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ── Accessibilité : focus visible (WCAG 2.4.7) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 3px;
  border-radius: 3px;
}

.btn:focus-visible,
.btn-hero:focus-visible,
.btn-hero-ghost:focus-visible,
.btn-ghost:focus-visible,
.btn-primary:focus-visible,
.btn-sm:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 3px;
}

.lang-switch:focus-visible,
#ps-lang-switch:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
  border-radius: 20px;
}

.nav-links a:focus-visible,
.nav-mobile-menu a:focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
  border-radius: 2px;
}

/* QA-14 — Lang-switcher overflow on very small screens (320px) */
@media (max-width: 380px) {
  .lang-switch span {
    padding: 1px 3px;
    font-size: 0.45rem;
  }
  /* Prevent switcher overflow — allow wrap */
  #ps-lang-switch {
    flex-wrap: wrap;
    max-width: 180px;
  }
}

/* Typographie CJK — annuler letter-spacing incompatible */
:lang(zh) .section-tag,
:lang(zh) .lang-switch span,
:lang(zh) .footer-col h4,
:lang(zh) h1,
:lang(zh) h2,
:lang(zh) h3,
:lang(zh) .btn {
  letter-spacing: 0;
  line-height: 1.4;
}
