/* ========================================
   PORTFOLIO - Djerareoutar Nestor
   Fichier : style.css
   Version optimisée Mobile / Android (Chrome, Samsung Internet)
   ======================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --gold: #f59e0b;
  --text: #e8e8f0;
  --muted: #8888aa;
  --border: rgba(108,99,255,0.18);
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* évite le zoom auto du texte sur Android */
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; /* enlève le flash gris au toucher sur Android */
}

a, button, .btn-primary, .btn-outline, .contact-link {
  -webkit-tap-highlight-color: transparent;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 6%;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); /* requis pour certains navigateurs Android/WebView */
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--muted);
  font-size: 0.9rem; font-weight: 500; letter-spacing: .03em;
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

/* Le CTA "Devis gratuit" dupliqué dans le menu mobile est caché par défaut (desktop) */
.nav-cta-mobile { display: none; }
.nav-cta-desktop { display: inline-flex; }

/* Menu burger (caché par défaut, affiché en mobile plus bas) */
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .5rem; min-width: 44px; min-height: 44px; /* zone tactile confortable */
  align-items: center; justify-content: center;
  position: relative;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  display: block; width: 24px; height: 2px; background: var(--text);
  margin: 5px auto; transition: transform .2s, opacity .2s;
}
.nav-toggle::before, .nav-toggle::after { content: ''; position: absolute; left: 10px; }
.nav-toggle::before { top: 12px; }
.nav-toggle::after { top: 24px; }
.nav-toggle span { margin-top: 10px; }

.nav-toggle.active span { opacity: 0; }
.nav-toggle.active::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active::after { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO ─── */
#accueil {
  min-height: 100vh;
  min-height: 100dvh; /* hauteur dynamique correcte sur Android Chrome (barre d'adresse) */
  display: flex; align-items: center;
  padding: 8rem 6% 5rem;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(108,99,255,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(167,139,250,0.08) 0%, transparent 60%);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
  max-width: 1200px; width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(108,99,255,0.1); border: 1px solid var(--border);
  border-radius: 100px; padding: .35rem 1rem;
  font-size: .8rem; color: var(--accent2); font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; display: inline-block; }
h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 1.2rem;
}
h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--muted); font-size: 1.05rem; max-width: 460px;
  margin-bottom: 2rem; line-height: 1.8;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; text-decoration: none;
  padding: .85rem 2rem; border-radius: 100px;
  font-weight: 600; font-size: .95rem;
  box-shadow: 0 0 30px rgba(108,99,255,0.35);
  transition: transform .2s, box-shadow .2s;
  min-height: 48px; /* taille tactile recommandée Android (Material Design) */
  touch-action: manipulation; /* supprime le délai de 300ms au tap sur Android */
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 45px rgba(108,99,255,0.5); }
.btn-primary:active { transform: scale(0.97); } /* feedback tactile au toucher */
.btn-outline {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--border); color: var(--text);
  text-decoration: none; padding: .85rem 2rem; border-radius: 100px;
  font-weight: 500; font-size: .95rem;
  transition: background .2s, border-color .2s;
  min-height: 48px;
  touch-action: manipulation;
}
.btn-outline:hover { background: var(--surface); border-color: var(--accent); }
.btn-outline:active { transform: scale(0.97); }

.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.2rem; text-align: center;
  transition: transform .2s, border-color .2s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 2.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

/* ─── SECTIONS COMMUNES ─── */
section { padding: 6rem 6%; }
.section-label {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: .75rem;
}
h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800;
  margin-bottom: .75rem; line-height: 1.2;
}
.section-intro { color: var(--muted); max-width: 520px; margin-bottom: 3rem; line-height: 1.8; }
.container { max-width: 1200px; margin: 0 auto; }

/* ─── SOLUTIONS ─── */
#solutions { background: var(--surface); }
.solutions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1.5rem;
}
.solution-card {
  background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.solution-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .2s;
}
.solution-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.solution-card:hover::before { opacity: 1; }
.card-icon { font-size: 2rem; margin-bottom: 1rem; }
.card-title { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.card-desc { color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; line-height: 1.7; }
.card-features { list-style: none; margin-bottom: 1.5rem; }
.card-features li {
  font-size: .85rem; color: var(--muted); padding: .3rem 0;
  display: flex; align-items: center; gap: .5rem;
}
.card-features li::before { content: '✓'; color: var(--accent2); font-weight: 700; }
.card-price {
  display: inline-block;
  background: rgba(108,99,255,0.12); border: 1px solid var(--border);
  border-radius: 100px; padding: .4rem 1rem;
  font-size: .85rem; font-weight: 600; color: var(--accent2);
}

/* ─── POURQUOI MOI ─── */
.why-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem;
}
.why-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  transition: border-color .2s, transform .2s;
}
.why-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.why-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.why-title { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.why-desc { color: var(--muted); font-size: .88rem; line-height: 1.7; }

/* ─── TECHNOLOGIES ─── */
#technologies { background: var(--surface); }
.tech-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem;
}
.tech-pill {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .85rem; font-weight: 500; color: var(--muted);
  transition: border-color .2s, color .2s, transform .2s;
  text-align: center;
}
.tech-pill:hover { border-color: var(--accent); color: var(--text); transform: translateY(-3px); }
.tech-pill span { font-size: 1.8rem; }

/* ─── PROCESSUS ─── */
.process-steps {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 1.5rem; position: relative;
}
.process-steps::before {
  content: ''; position: absolute;
  top: 2.5rem; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.3; z-index: 0;
}
.step { text-align: center; position: relative; z-index: 1; }
.step-num {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 800;
  margin: 0 auto 1.2rem;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}
.step h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.step p { color: var(--muted); font-size: .85rem; line-height: 1.7; }

/* ─── CONTACT ─── */
#contact { background: var(--surface); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-info h2 { margin-bottom: 1rem; }
.contact-info p { color: var(--muted); line-height: 1.8; margin-bottom: 2rem; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  transition: border-color .2s, transform .2s;
  min-height: 48px;
  touch-action: manipulation;
}
.contact-link:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-link:active { transform: scale(0.98); }
.contact-link-icon { font-size: 1.4rem; width: 42px; text-align: center; }
.contact-link-text strong { display: block; font-size: .9rem; }
.contact-link-text span { font-size: .8rem; color: var(--muted); }

form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: .3rem; display: block; }
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: .85rem 1rem; color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* IMPORTANT : évite le zoom automatique au focus sur Android/Chrome */
  outline: none; transition: border-color .2s;
  min-height: 48px; /* zone tactile confortable */
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }
select option { background: var(--surface); }

.form-status {
  font-size: .9rem; font-weight: 500; text-align: center;
  padding: 0; min-height: 0; border-radius: 10px;
  transition: all .2s; overflow: hidden;
}
.form-status:empty { padding: 0; margin: 0; }
.form-status.success {
  background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.35);
  color: #4ade80; padding: .9rem 1rem;
}
.form-status.error {
  background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.35);
  color: #f87171; padding: .9rem 1rem;
}

/* ─── BARRE PROMO ─── */
.promo-bar {
  background: linear-gradient(90deg, var(--accent), #8b5cf6, var(--gold));
  color: #fff; text-align: center;
  padding: .65rem; font-size: .85rem; font-weight: 500;
}
.promo-bar strong { font-weight: 700; }

/* ─── FOOTER ─── */
footer {
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 2rem 6%; text-align: center;
  color: var(--muted); font-size: .85rem;
}
footer a { color: var(--accent2); text-decoration: none; }

/* ============================================================
   RESPONSIVE — TABLETTE (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .solutions-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .contact-grid { gap: 2.5rem; }
}

/* ============================================================
   RESPONSIVE — MOBILE / ANDROID (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  section { padding: 4rem 5.5%; }

  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  #accueil { padding: 6.5rem 5.5% 3.5rem; }

  .process-steps { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .process-steps::before { display: none; }

  /* Menu mobile : on cache les liens et le CTA desktop, on affiche le burger */
  .nav-links { display: none; }
  .nav-cta-desktop { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding-top: 5.5rem;
    padding-bottom: 1.5rem;
    padding-left: 6%;
    padding-right: 6%;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    gap: 1.2rem;
    z-index: 99;
  }
  .nav-links.mobile-open a {
    font-size: 1.05rem;
    padding: .5rem 0;
  }
  .nav-cta-mobile {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-top: .5rem;
  }

  .form-row { grid-template-columns: 1fr; }

  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: .8rem; }
  .stat-card { padding: 1rem .6rem; }
  .stat-num { font-size: 1.9rem; }

  .hero-ctas { width: 100%; }
  .hero-ctas .btn-primary, .hero-ctas .btn-outline {
    flex: 1 1 auto; justify-content: center;
  }

  /* Les effets de flou/transform coûtent cher en perf sur Android : on les allège */
  .solution-card:hover,
  .why-card:hover,
  .tech-pill:hover,
  .stat-card:hover {
    transform: none;
  }
}

/* ============================================================
   RESPONSIVE — PETITS ÉCRANS ANDROID (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .nav-logo { font-size: 1.25rem; }
  h1 { font-size: clamp(2rem, 7vw, 2.6rem); }
  .hero-sub { font-size: .95rem; }

  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn-primary, .hero-ctas .btn-outline {
    width: 100%;
  }

  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .stat-card { padding: .8rem .4rem; border-radius: 12px; }
  .stat-num { font-size: 1.5rem; }
  .stat-label { font-size: .68rem; }

  .process-steps { grid-template-columns: 1fr 1fr; }
  .step-num { width: 48px; height: 48px; font-size: 1.05rem; }

  .solutions-grid, .why-grid, .tech-grid {
    grid-template-columns: 1fr;
  }

  .solution-card, .why-card { padding: 1.5rem; }

  .contact-link { padding: .85rem 1rem; }
}

/* ============================================================
   ÉCRANS ANDROID TRÈS PETITS (≤ 360px — ex: anciens Galaxy/Moto)
   ============================================================ */
@media (max-width: 360px) {
  section { padding: 3rem 5%; }
  .nav-logo { font-size: 1.1rem; }
  h1 { font-size: 1.85rem; }
  .btn-primary, .btn-outline { padding: .8rem 1.4rem; font-size: .88rem; }
}

/* ============================================================
   MODE PAYSAGE MOBILE (hauteur réduite)
   ============================================================ */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  #accueil { min-height: auto; padding: 6rem 5.5% 3rem; }
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* ============================================================
   ACCESSIBILITÉ — réduit les animations si l'utilisateur le demande
   (option "réduire les animations" activable sur Android)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================================================
   ÉCRANS TACTILES — désactive les effets ":hover" résiduels
   qui peuvent rester "collés" après un tap sur Android
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .solution-card:hover,
  .why-card:hover,
  .tech-pill:hover,
  .stat-card:hover,
  .btn-primary:hover,
  .btn-outline:hover,
  .contact-link:hover {
    transform: none;
    box-shadow: inherit;
  }
}