/* =========================================================================
   NYAMTECHS — polish.css
   Améliorations UI/UX ciblées, chargé en dernier.
   Priorité : typographie, nav, pipeline, cards, micro-détails.
   ========================================================================= */

/* ─── 1. TYPOGRAPHIE GLOBALE ────────────────────────────────────────────── */

/* OpenType — ss01 sur les polices display pour les variantes de glyphes */
body {
  font-feature-settings: "kern" 1, "liga" 1;
}

h1, h2, h3, h4,
.hero h1,
.page-hero h1,
.sec-head h2,
.section-title {
  font-feature-settings: "ss01" 1, "kern" 1;
  text-rendering: optimizeLegibility;
}

/* Chiffres tabulaires sur toutes les data numériques */
.stat-num, .count, .kpi-num, .kpi-large, .pipeline-num,
.term-body, .flow-n, .svc-idx, .step-num, .zf-code {
  font-feature-settings: "tnum" 1, "kern" 1;
}

/* Lettre-espacement légèrement plus serré sur les grands titres */
.hero h1 {
  letter-spacing: -0.03em;
}

.page-hero h1 {
  letter-spacing: -0.028em;
}

/* ─── 2. NAVIGATION ─────────────────────────────────────────────────────── */

/* Compact pour accueillir 5 liens + 2 actions */
.hdr-nav {
  gap: 4px;
}

.hdr-nav a {
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 140ms ease, background 140ms ease;
  letter-spacing: -0.01em;
}

.hdr-nav a:hover {
  background: rgba(17, 24, 39, 0.05);
  color: var(--fg1);
}

.hdr-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Override l'underline de animations.css — trop proche du texte */
.hdr-nav a::after {
  bottom: 2px;
  height: 1.5px;
  background: var(--accent);
  opacity: 0.8;
}

.hdr-actions .btn-ghost {
  font-size: 13.5px;
}

/* Masquer les boutons d'action sur < 1100px, garder juste CTA */
@media (max-width: 1100px) {
  .hdr-actions .btn-ghost {
    display: none;
  }
  .hdr-nav a {
    font-size: 13px;
    padding: 6px 8px;
  }
}

@media (max-width: 900px) {
  .hdr-nav, .hdr-actions {
    display: none;
  }
  .burger {
    display: flex;
  }
}

/* ─── 3. PIPELINE-NUM — correction couleur invisible ──────────────────── */

/* Fix: var(--border) était quasi invisible, on utilise coral à 40% opacité */
.pipeline-num {
  color: var(--accent) !important;
  opacity: 0.35;
  font-size: 52px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 14px;
  transition: opacity 200ms ease, color 200ms ease;
}

.pipeline-step:hover .pipeline-num {
  opacity: 0.75;
  color: var(--accent) !important;
}

/* ─── 4. PIPELINE GRID — espacement et séparateurs ──────────────────────── */

.pipeline-grid {
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pipeline-grid .pipeline-step {
  background: var(--surface);
  padding: 36px 28px 32px;
  transition: background 180ms ease;
  border-radius: 0 !important;
}

.pipeline-grid .pipeline-step:hover {
  background: var(--bg-alt);
}

/* Flèche repositionnée + visible */
.pipeline-grid .pipeline-step::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50px;
  font-size: 16px;
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0.5;
  z-index: 2;
  line-height: 1;
}

.pipeline-grid .pipeline-step:last-child::after {
  display: none;
}

/* ─── 5. PIPELINE HORIZONTAL (carriere/index) ───────────────────────────── */

.pipeline {
  gap: 4px;
  margin-bottom: 0;
}

.pipeline .pipeline-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.pipeline .pipeline-step:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pipeline-arrow {
  color: var(--fg3);
  display: flex;
  align-items: center;
  margin-top: 0;
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
}

.pipeline-arrow svg {
  width: 16px;
  height: 16px;
}

/* ─── 6. SERVICE CARDS ──────────────────────────────────────────────────── */

.svc {
  transition: background 180ms ease, border-left-color 200ms ease, transform 180ms ease;
  border-left: 3px solid transparent;
}

.svc:hover {
  transform: translateY(-2px);
  background: var(--surface);
  border-left-color: var(--accent);
}

/* Numéro plus grand au hover */
.svc:hover .svc-idx {
  letter-spacing: 0.08em;
}

/* ─── 7. CARDS GLOBALES ──────────────────────────────────────────────────── */

/* Transition douce sur toutes les cartes génériques */
[style*="background:var(--surface)"],
article {
  transition: box-shadow 200ms ease, transform 200ms ease;
}

/* ─── 8. BOUTONS ─────────────────────────────────────────────────────────── */

/* Transition plus fluide */
.btn {
  transition: background 150ms ease, border-color 150ms ease,
              transform 150ms ease, box-shadow 150ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(232, 87, 26, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Flèche dans le bouton */
.btn svg {
  flex-shrink: 0;
  transition: transform 200ms var(--ease-out);
}

.btn-primary:hover svg,
.btn-secondary:hover svg {
  transform: translateX(3px);
}

/* ─── 9. PAGE HERO — amélioration visuelle ──────────────────────────────── */

.page-hero {
  padding: 88px 0 80px;
}

/* Ligne décorative sous le titre */
.page-hero::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(232, 87, 26, 0.4) 20%,
    rgba(47, 224, 194, 0.3) 50%,
    rgba(232, 87, 26, 0.2) 80%,
    transparent
  );
}

/* ─── 10. SECTION HEADS — espacement et hiérarchie ─────────────────────── */

.sec-head h2 {
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.eyebrow {
  margin-bottom: 14px;
}

/* ─── 11. STATS BAND ───────────────────────────────────────────────────── */

.stats-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
}

.stat-num {
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-num em {
  color: var(--accent);
  font-style: normal;
  font-size: 0.65em;
  vertical-align: super;
}

/* ─── 12. CHIPS ─────────────────────────────────────────────────────────── */

.chip {
  transition: background 140ms ease, border-color 140ms ease;
  cursor: default;
}

.chip:hover {
  background: rgba(47, 224, 194, 0.20);
  border-color: var(--teal-500);
}

/* ─── 13. FOOTER — micro-améliorations ──────────────────────────────────── */

.ftr a {
  transition: color 140ms ease, padding-left 140ms ease;
}

.ftr a:hover {
  padding-left: 4px;
}

/* ─── 14. CTA BAND ──────────────────────────────────────────────────────── */

.cta-band {
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(
    135deg,
    var(--ink-900) 0%,
    rgba(19, 40, 61, 0.95) 50%,
    var(--ink-900) 100%
  );
}

.cta-band h2 {
  font-feature-settings: "ss01" 1;
  letter-spacing: -0.03em;
}

/* ─── 15. SCROLL INDICATOR ──────────────────────────────────────────────── */

/* Meilleure visibilité du scroll hint */
.scroll-hint {
  opacity: 0.5;
}

/* ─── 16. FOCUS ─────────────────────────────────────────────────────────── */

/* Focus rings plus visibles et cohérents */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── 17. SELECTION ─────────────────────────────────────────────────────── */

::selection {
  background: rgba(232, 87, 26, 0.18);
  color: var(--accent-active);
}

/* ─── 18. RESPONSIVE POLISH ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .pipeline-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1px;
  }

  .pipeline-grid .pipeline-step::after {
    display: none;
  }

  .page-hero {
    padding: 56px 0 48px;
  }
}

@media (max-width: 480px) {
  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-num {
    font-size: 40px !important;
  }
}

/* ─── 19. ANIMATIONS REDUCED MOTION ───────────────────────────────────────*/

@media (prefers-reduced-motion: reduce) {
  .pipeline-step,
  .svc,
  .btn,
  .ftr a,
  .tech-badge,
  .zf-module {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ─── 20. NEWS GRID (actualités) ──────────────────────────────────────────*/

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .news-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ─── 22. FILET DE SÉCURITÉ — grilles inline responsive ──────────────────── */
/* Force les grilles 3-col / 2-col inline (pages expertise/légales) en 1 col
   sur mobile, là où aucune media query dédiée n'existe. */
@media (max-width: 768px) {
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ─── 21. MAINFRAME PANEL (section "Le monde du mainframe") ───────────────── */

.mainframe-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 40px;
  background:
    radial-gradient(circle at 50% 35%, rgba(47, 224, 194, 0.06), transparent 60%),
    linear-gradient(160deg, var(--ink-800) 0%, var(--ink-900) 70%, var(--ink-1000) 100%);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Grille technique discrète en fond */
.mainframe-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(220,230,242,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,230,242,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.mainframe-panel img {
  position: relative;
  z-index: 1;
  max-height: 380px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.45));
}

.mainframe-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-400);
  padding: 5px 10px;
  border: 1px solid rgba(47, 224, 194, 0.25);
  border-radius: 2px;
  background: rgba(47, 224, 194, 0.06);
}

@media (max-width: 900px) {
  .mainframe-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .mainframe-panel { min-height: 320px; }
}

/* ─── 23. ARTICLE BODY (pages article) ───────────────────────────────────── */

.article-body { max-width: 720px; }
.article-body h2 { font-family:var(--font-display); font-size:clamp(22px,3vw,30px); font-weight:700; color:var(--fg1); letter-spacing:-0.02em; margin:40px 0 16px; line-height:1.15; }
.article-body h3 { font-family:var(--font-display); font-size:19px; font-weight:600; color:var(--fg1); margin:28px 0 10px; }
.article-body p { font-size:16px; color:var(--fg2); line-height:1.75; margin-bottom:18px; }
.article-body ul { margin:0 0 18px 0; padding-left:0; list-style:none; display:flex; flex-direction:column; gap:10px; }
.article-body li { font-size:15px; color:var(--fg2); line-height:1.65; position:relative; padding-left:22px; }
.article-body li::before { content:"-"; color:var(--accent); font-family:var(--font-mono); position:absolute; left:0; top:0; }
.article-body li strong { color:var(--fg1); font-weight:600; }
.article-body strong { color:var(--fg1); font-weight:600; }
.article-pullquote { border-left:3px solid var(--accent); padding:8px 0 8px 24px; margin:28px 0; font-family:var(--font-display); font-size:20px; line-height:1.4; color:var(--fg1); font-weight:500; }
.article-data { background:var(--bg-alt); border:1px solid var(--border); border-radius:var(--radius-lg); padding:32px; margin:32px 0; display:flex; gap:32px; flex-wrap:wrap; }
.article-data .num { font-family:var(--font-display); font-size:44px; font-weight:800; color:var(--accent); line-height:1; letter-spacing:-0.03em; }
.article-data .lbl { font-family:var(--font-mono); font-size:12px; text-transform:uppercase; letter-spacing:0.08em; color:var(--fg3); margin-top:8px; }
.article-sources { margin-top:48px; padding-top:24px; border-top:1px solid var(--border); }
.article-sources h3 { font-family:var(--font-mono); font-size:12px; text-transform:uppercase; letter-spacing:0.1em; color:var(--fg3); margin-bottom:12px; }
.article-sources a { display:block; font-size:14px; color:var(--tech-ink); padding:4px 0; word-break:break-word; }
.article-sources a:hover { color:var(--accent); }
