/* DToS — Design system
   Brief : §3 (design system), §6 (perf, responsive, a11y)
   ----------------------------------------------------- */

/* ---------- Fonts (auto-hébergées, RGPD-friendly) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-semibold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/inter-bold.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-regular.woff2") format("woff2");
}

/* ---------- Tokens (palette + espacements §3) ---------- */
:root {
  --ink-900: #0F172A;
  --ink-700: #1E293B;
  --slate-500: #475569;
  --slate-400: #64748B;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --bg-light: #F8FAFC;
  --bg-white: #FFFFFF;
  --accent: #14B8A6;
  --accent-dark: #0F9488;
  --accent-soft: #CCFBF1;
  --error: #DC2626;

  --container: 1200px;
  --gutter: 20px;
  --section-y: 96px;
  --section-y-mobile: 64px;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Reset modeste ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--ink-900);
  margin: 0 0 0.5em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; }
h3 { font-size: clamp(18px, 2vw, 22px); font-weight: 600; }

p { margin: 0 0 1em; }

ul { padding-left: 1.25em; }
li { margin-bottom: 0.35em; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y-mobile);
}
@media (min-width: 768px) {
  .section { padding-block: var(--section-y); }
}

.section--alt { background: var(--bg-light); }
.section--dark { background: var(--ink-900); color: #E2E8F0; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }

.section__intro {
  max-width: 680px;
  margin-bottom: 48px;
}

/* ---------- Accessibilité ---------- */
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--ink-900); color: #fff;
  padding: 12px 20px; text-decoration: none;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dark); color: #fff; }

.btn--secondary {
  background: transparent;
  border-color: var(--slate-500);
  color: var(--ink-900);
}
.btn--secondary:hover { background: var(--bg-light); border-color: var(--ink-900); }

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
  padding-inline: 0;
  border: 0;
}
.btn--ghost:hover { color: var(--accent-dark); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--slate-200);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
}
.site-header__logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
}
.site-header__logo img { height: 36px; width: auto; }

.site-nav {
  display: none;
}
.site-nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; align-items: center; gap: 28px;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-700);
  font-weight: 500;
  font-size: 15px;
}
.site-nav a:hover { color: var(--accent-dark); }
.site-nav a[aria-current="page"] {
  color: var(--ink-900);
  position: relative;
}
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px;
  height: 2px; background: var(--accent);
}

.header-cta { display: none; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  width: 42px; height: 42px;
  color: var(--ink-900);
  cursor: pointer;
}

@media (min-width: 1024px) {
  .site-nav { display: block; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* Mobile drawer */
.site-nav.is-open {
  display: block;
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff;
  padding: 16px 20px 24px;
  border-bottom: 1px solid var(--slate-200);
  box-shadow: var(--shadow-card);
}
.site-nav.is-open ul {
  flex-direction: column; align-items: stretch; gap: 4px;
}
.site-nav.is-open li a {
  display: block; padding: 12px 0;
  border-bottom: 1px solid var(--slate-200);
}
.site-nav.is-open li:last-child a { border-bottom: 0; }

/* ---------- Hero ---------- */
.hero {
  padding-block: 64px 80px;
}
@media (min-width: 768px) {
  .hero { padding-block: 96px 112px; }
}
.hero--with-visual .container {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero--with-visual .container {
    grid-template-columns: 1.1fr 1fr;
    gap: 80px;
  }
}
.hero__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 16px;
}
.hero__lede {
  font-size: 18px;
  color: var(--slate-500);
  max-width: 60ch;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .hero__lede { font-size: 20px; }
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.hero__visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-light);
  border: 1px solid var(--slate-200);
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-400);
}
.hero__visual svg { width: 60%; height: auto; opacity: 0.5; }

/* ---------- Grid de cartes ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (min-width: 768px) {
  .grid { gap: 32px; }
}

.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
@media (min-width: 768px) {
  .card { padding: 32px; }
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.card__icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { margin: 0; }
.card p { color: var(--slate-500); margin: 0; }
.card__link {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-dark);
  display: inline-flex; align-items: center; gap: 6px;
}
.card__link:hover { color: var(--ink-900); }
.card__link::after { content: "\2192"; transition: transform 0.15s ease; }
.card__link:hover::after { transform: translateX(3px); }

/* Cards alternées dans le contenu */
.feature {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
@media (min-width: 768px) {
  .feature { padding: 36px 40px; }
}
.feature h3 { color: var(--ink-900); }
.feature p { color: var(--slate-500); }
.feature ul { margin: 12px 0 0; color: var(--slate-500); }

/* ---------- Section "Pourquoi" / 3 colonnes ---------- */
.why__item h3 {
  font-size: 18px;
  display: flex; align-items: center; gap: 12px;
}
.why__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.why__item p { color: var(--slate-500); }

/* ---------- Bandeau logos clients ---------- */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 16px;
  align-items: center;
  justify-items: center;
}
@media (min-width: 600px) { .logo-strip { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .logo-strip { grid-template-columns: repeat(8, 1fr); gap: 24px; } }

.logo-strip img {
  max-height: 56px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.logo-strip img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* ---------- CTA bandeau ---------- */
.cta-banner {
  background: var(--ink-900);
  color: #fff;
  padding: 56px 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
@media (min-width: 768px) {
  .cta-banner { padding: 72px 48px; }
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: #CBD5E1; max-width: 56ch; margin: 0; }
.cta-banner .btn--primary { margin-top: 8px; }

/* ---------- Formulaire ---------- */
.form {
  display: flex; flex-direction: column; gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-900);
}
.field .hint { font-size: 13px; color: var(--slate-500); }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.field--checkbox {
  flex-direction: row; align-items: flex-start; gap: 10px;
}
.field--checkbox input { margin-top: 4px; }
.field--checkbox label { font-weight: 400; color: var(--slate-500); font-size: 14px; }
.field__error {
  font-size: 13px; color: var(--error); display: none;
}
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.field.is-invalid .field__error { display: block; }

.form__feedback {
  display: none;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-weight: 500;
}
.form__feedback.is-visible { display: block; }
.form__feedback--success {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}
.form__feedback--error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Honeypot (anti-spam) */
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Contact layout ---------- */
.contact-layout {
  display: grid;
  gap: 48px;
}
@media (min-width: 1024px) {
  .contact-layout { grid-template-columns: 1.4fr 1fr; gap: 64px; }
}
.contact-info ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.contact-info li {
  display: flex; gap: 12px;
  color: var(--slate-500);
  margin: 0;
}
.contact-info strong { display: block; color: var(--ink-900); font-weight: 600; }
.contact-info a { color: var(--ink-900); text-decoration: none; }
.contact-info a:hover { color: var(--accent-dark); text-decoration: underline; }
.contact-map {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--slate-200);
}
.contact-map iframe { display: block; width: 100%; height: 320px; border: 0; }

/* ---------- Stack tech (page Développement) ---------- */
.tech-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; padding: 0; margin: 0;
}
.tech-list li {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-light);
  border: 1px solid var(--slate-200);
  color: var(--ink-700);
  padding: 6px 12px;
  border-radius: var(--radius);
  margin: 0;
}

/* ---------- Étude de cas (KNX / Clients) ---------- */
.case {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
}
@media (min-width: 768px) {
  .case { grid-template-columns: 1fr 1.2fr; }
}
.case__media {
  background: var(--bg-light);
  min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-400);
  font-size: 14px;
  text-align: center;
  padding: 24px;
  border-bottom: 1px solid var(--slate-200);
}
@media (min-width: 768px) {
  .case__media { border-bottom: 0; border-right: 1px solid var(--slate-200); }
}
.case__body { padding: 28px; }
@media (min-width: 768px) { .case__body { padding: 40px; } }
.case__tag {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.case__body ul { color: var(--slate-500); }

/* ---------- Témoignages ---------- */
.testimonial {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.testimonial blockquote {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-700);
  font-style: italic;
}
.testimonial cite {
  font-style: normal;
  font-size: 14px;
  color: var(--slate-500);
}
.testimonial cite strong { display: block; color: var(--ink-900); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-900);
  color: #CBD5E1;
  padding: 56px 0 24px;
  margin-top: 80px;
}
.site-footer h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.site-footer a {
  color: #CBD5E1;
  text-decoration: none;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1.3fr; gap: 48px; }
}
.footer-grid ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.footer-grid li { margin: 0; font-size: 15px; }
.footer-about p { color: #94A3B8; max-width: 36ch; }
.footer-about img { height: 40px; margin-bottom: 12px; filter: brightness(0) invert(1); }
.site-footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #1E293B;
  font-size: 13px;
  color: #94A3B8;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
}

/* ---------- Utilitaires ---------- */
.muted { color: var(--slate-500); }
.center { text-align: center; }
.mt-md { margin-top: 24px; }
.mb-md { margin-bottom: 24px; }
.lead { font-size: 18px; color: var(--slate-500); }
.divider { height: 1px; background: var(--slate-200); border: 0; margin: 48px 0; }

/* Réduction d'animation (a11y) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
