/* ============================================
   Nelvai — Site vitrine
   Charte : Indigo / Chêne / Ivoire / Encre
   Typo   : Playfair Display (display) · Outfit (body + UI) · Fira Code (code)
   ============================================ */

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

:root {
  --indigo: #3D52A0;
  --indigo-light: #EBF0FF;
  --oak: #B08B5E;              /* éclairci : AA sur fond encre */
  --oak-deep: #8B6F47;         /* version originale, usage décoratif uniquement */
  --ivory: #F5EFE6;
  --surface: #EEECEA;
  --ink: #12121A;
  --muted: #5E5E6A;            /* légèrement assombri pour AA sur ivoire */
  --border: rgba(18, 18, 26, 0.08);

  --font-display: "Playfair Display", Georgia, serif;
  --font-heading: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: "Fira Code", "SF Mono", Menlo, monospace;

  --max-width: 1200px;
  --radius: 4px;
  --radius-lg: 12px;

  --section-pad: 6rem;
  --section-pad-mobile: 4rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Accessibilité : skip link + focus ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--ivory);
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.adn :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--oak);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 239, 230, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo-accent {
  color: var(--indigo);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--indigo);
}

.nav-cta {
  padding: 0.7rem 1.1rem !important;
  background: var(--ink);
  color: var(--ivory) !important;
  border-radius: var(--radius);
}

.nav-cta:hover {
  background: var(--indigo);
  color: var(--ivory) !important;
}

/* Language switch (FR / EN) */
.lang-switch-item {
  display: flex;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-switch:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}

.lang-code {
  padding: 0 0.15rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.lang-code.is-active {
  color: var(--ink);
  font-weight: 600;
}

.lang-sep {
  color: var(--border);
  font-weight: 300;
}

/* Hamburger (mobile only) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.6rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display em {
  font-style: italic;
  color: var(--indigo);
}

.heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 2rem;
}

.eyebrow,
.section-label {
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--indigo);
  margin-bottom: 1.25rem;
}

.lead {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 2.5rem;
}

/* ---------- Buttons ---------- */
.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--ivory);
}

.btn-primary:hover {
  background: var(--indigo);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--ivory);
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--section-pad) 0 var(--section-pad);
  background:
    radial-gradient(ellipse at top right, var(--indigo-light) 0%, transparent 50%),
    var(--ivory);
}

.hero .display {
  max-width: 960px;
  margin-bottom: 2rem;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 3rem 0 0;
}

.stats-hero {
  max-width: 620px;
}

.stat-card {
  padding: 1.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 82, 160, 0.3);
}

.stat-card.dark {
  background: #1d1d27;
  border-color: rgba(245, 239, 230, 0.08);
}

.stat-card.dark:hover {
  border-color: var(--oak);
}

.stat-card.dark .stat-value {
  color: var(--ivory);
}

.stat-card.dark .stat-label {
  color: rgba(245, 239, 230, 0.75);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--indigo);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- CLI / Terminal ---------- */
.cli-section {
  padding: var(--section-pad) 0;
  background: var(--surface);
}

.cli-section .heading {
  max-width: 820px;
}

.terminal {
  margin-top: 2rem;
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(18, 18, 26, 0.15);
}

.terminal-bar {
  background: #1f1f2a;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: rgba(245, 239, 230, 0.6);
}

.terminal-body {
  font-family: var(--font-code);
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--ivory);
  padding: 1.75rem;
  overflow-x: auto;
  letter-spacing: 0.02em;
}

.terminal-body .prompt { color: var(--indigo-light); }
.terminal-body .muted { color: rgba(245, 239, 230, 0.65); }
.terminal-body .ok { color: #7cd992; }

/* ---------- Services ---------- */
.services {
  padding: var(--section-pad) 0;
}

.grid-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.service-card {
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 82, 160, 0.3);
  box-shadow: 0 16px 40px rgba(18, 18, 26, 0.08);
}

.service-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin: 1rem 0 0.75rem;
  color: var(--ink);
}

.service-card p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.35rem 0.75rem;
  background: var(--indigo-light);
  color: var(--indigo);
  border-radius: 999px;
}

/* ---------- ADN ---------- */
.adn {
  padding: var(--section-pad) 0;
  background: var(--ink);
  color: var(--ivory);
}

.adn .heading {
  color: var(--ivory);
}

.adn .section-label {
  color: var(--oak);
}

.founder-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.5;
  max-width: 820px;
  padding: 2rem 0 2rem 2rem;
  border-left: 2px solid var(--oak);
  margin: 2rem 0 3rem;
  color: rgba(245, 239, 230, 0.92);
}

.founder-quote cite {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-style: normal;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--oak);
  margin-top: 1rem;
}

.adn-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.adn-story {
  max-width: 820px;
  margin-bottom: 3.5rem;
}

.adn-story h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--ivory);
}

.adn-story p {
  color: rgba(245, 239, 230, 0.82);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.75;
}

.adn-story strong {
  color: var(--oak);
  font-weight: 500;
  font-style: italic;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.value {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-top: 1px solid rgba(245, 239, 230, 0.15);
  transition: border-color 0.25s ease;
}

.value:hover {
  border-top-color: var(--oak);
}

.value h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 1.25rem 0 0.5rem;
  color: var(--oak);
}

.value p {
  color: rgba(245, 239, 230, 0.8);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Méthode ---------- */
.methode {
  padding: var(--section-pad) 0;
  background: var(--surface);
}

.phases {
  list-style: none;
  display: grid;
  gap: 1.25rem;
  margin-top: 3rem;
  counter-reset: phase;
}

.phases li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: start;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.phases li:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 82, 160, 0.3);
  box-shadow: 0 16px 40px rgba(18, 18, 26, 0.06);
}

.phase-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--indigo);
  line-height: 1;
}

.phases h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.phase-duration {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--indigo);
  margin-bottom: 0.75rem;
}

.phases p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Pourquoi nous ---------- */
.pourquoi {
  padding: var(--section-pad) 0;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.diff {
  padding: 1.5rem 0 1rem;
  border-top: 2px solid var(--indigo);
  transition: border-top-color 0.25s ease;
}

.diff:hover {
  border-top-color: var(--ink);
}

.diff-num {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  color: var(--indigo);
  margin: 0.25rem 0 1rem;
  transition: color 0.25s ease;
}

.diff:hover .diff-num {
  color: var(--ink);
}

.diff h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.diff p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* ---------- Closing ---------- */
.closing {
  padding: 7rem 0;
  text-align: center;
  background:
    radial-gradient(ellipse at center, var(--indigo-light) 0%, transparent 60%),
    var(--ivory);
}

.closing .display {
  max-width: 880px;
  margin: 0 auto 1.5rem;
}

.closing .lead {
  margin: 0 auto 2.5rem;
}

.closing .cta-row {
  justify-content: center;
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 3rem 0 2rem;
  background: var(--ink);
  color: rgba(245, 239, 230, 0.8);
}

.site-footer .logo {
  color: var(--ivory);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(245, 239, 230, 0.1);
  margin-bottom: 1.5rem;
}

.footer-baseline {
  font-family: var(--font-display);
  font-style: italic;
  margin-top: 0.75rem;
  color: rgba(245, 239, 230, 0.75);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(245, 239, 230, 0.8);
  text-decoration: none;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--oak);
}

.footer-meta {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-align: right;
  color: rgba(245, 239, 230, 0.7);
}

.footer-meta p {
  margin-bottom: 0.25rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root {
    --section-pad: var(--section-pad-mobile);
  }

  .nav {
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
  }

  .container {
    padding: 0 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
  }

  .nav-links.is-open {
    max-height: 500px;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.9rem 0.25rem;
    font-size: 0.85rem;
  }

  .nav-cta {
    margin-top: 0.5rem;
    text-align: center;
  }

  .lang-switch-item {
    justify-content: center;
    padding-top: 0.75rem;
  }

  .lang-switch {
    margin: 0 auto;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .closing {
    padding: 5rem 0;
  }

  .phases li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    text-align: left;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
