/* ============================================================================
   Ficiel.io — Shared Styles
   Design system global : tokens, reset, typographie, layout, composants.
   Palette : white premium + purple accent (#8B46EB / #6d2bc9)
   Font : Geist Variable (self-hosted)
   ============================================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: 'Geist';
  src: url('/assets/fonts/Geist-Variable.woff2') format('woff2-variations'),
       url('/assets/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Palette */
  --bg: #ffffff;
  --bg-subtle: #fafafb;
  --bg-elevated: #ffffff;
  --text: #0f0f14;
  --text-muted: #5b5f6b;
  --text-subtle: #8b8e98;
  --border: #e8e8ec;
  --border-strong: #d4d4d8;
  --accent: #6d2bc9;           /* primaire plus sombre (ancien 'accent-dark') */
  --accent-dark: #5215a3;       /* hover encore plus profond */
  --accent-soft: #8B46EB;       /* nuance secondaire plus claire, pour accents discrets */
  --accent-tint: rgba(109, 43, 201, 0.08);
  --accent-glow: rgba(109, 43, 201, 0.22);
  --dark: #0f0f14;
  --dark-hover: #22222a;

  /* Typographie */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Type scale fluide */
  --text-xs: 0.75rem;                                   /* 12 */
  --text-sm: 0.875rem;                                  /* 14 */
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);  /* 16→18 */
  --text-lg: clamp(1.125rem, 1.08rem + 0.25vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl: clamp(2rem, 1.7rem + 1.5vw, 2.5rem);
  --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 3.5rem);
  --text-5xl: clamp(3rem, 2.3rem + 3.5vw, 4.5rem);
  --text-hero: clamp(1.75rem, 1.4rem + 2vw, 3.25rem);  /* 28→52 (taille H2 comme demandé) */

  /* Line heights */
  --leading-tight: 1.05;
  --leading-snug: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-tighter: -0.03em;
  --tracking-wide: 0.08em;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, 0.04);
  --shadow: 0 2px 8px rgba(15, 15, 20, 0.06), 0 1px 2px rgba(15, 15, 20, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 15, 20, 0.08), 0 4px 12px rgba(15, 15, 20, 0.05);
  --shadow-glow: 0 8px 32px rgba(139, 70, 235, 0.18);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.68, 0.48);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 450ms;

  /* Layout */
  --nav-height: 80px;
  --container-max: 1200px;
  --container-narrow: 880px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}

html { overflow-x: hidden; }

h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol { padding-left: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

a:hover { color: var(--accent); }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input, textarea, select { font: inherit; color: inherit; }

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- Typography utilities ---------- */
.h1, .h2, .h3, .h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
.h1 { font-size: var(--text-hero); font-weight: 700; letter-spacing: var(--tracking-tight); }
.h2 { font-size: var(--text-4xl); font-weight: 700; }
.h3 { font-size: var(--text-2xl); font-weight: 600; }
.h4 { font-size: var(--text-xl); font-weight: 600; }

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  max-width: min(60ch, 100%);
}

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

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

@media (min-width: 640px) {
  .container { padding-inline: var(--space-8); }
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section--subtle { background: var(--bg-subtle); }

.grid-2, .grid-3 {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-12); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
}

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-8); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.9rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease),
              background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
}

.button:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.button:active { transform: translateY(0); }

.button__icon {
  width: 1em;
  height: 1em;
  transition: transform var(--dur) var(--ease);
}
.button:hover .button__icon { transform: translateX(2px); }

.button--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.button--ghost:hover {
  background: var(--accent-tint);
  color: var(--accent-dark);
  border-color: var(--accent);
  box-shadow: none;
}

.button--dark {
  background: var(--dark);
  color: #fff;
}
.button--dark:hover {
  background: var(--dark-hover);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.button--sm { padding: 0.6rem 1.1rem; font-size: var(--text-sm); }
.button--lg { padding: 1.05rem 1.75rem; font-size: var(--text-lg); }

/* ---------- Pill badge ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.9rem;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-glow);
}
.pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Cards ---------- */
.card {
  padding: var(--space-8);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.card--hoverable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Client card linkable — reusable pattern (landing cases, futur dashboard Ficiel) */
.client-card--linkable {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  position: relative;
  cursor: pointer;
  height: 100%;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.client-card--linkable:hover,
.client-card--linkable:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.client-card__ig {
  /* hidden — carte entière est déjà un lien Instagram, logo redondant */
  display: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  min-height: 68px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
@media (min-width: 640px) { .nav__inner { gap: var(--space-8); } }

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
.nav__logo img, .nav__logo svg {
  height: 38px; width: auto;
}
.nav__logo:hover { color: var(--text); }

.nav__links {
  display: none;
  gap: var(--space-8);
}
.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}
.nav__links a:hover { color: var(--text); }

.nav__cta-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.nav__cta-mobile { display: inline-flex; }
.nav__cta-desktop { display: none; }
@media (min-width: 560px) {
  .nav__cta-mobile { display: none; }
  .nav__cta-desktop { display: inline-flex; }
}

.nav__burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  color: var(--text);
}
.nav__burger:hover { background: var(--accent-tint); color: var(--accent-dark); }

.nav__mobile {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-6);
}
.nav__mobile.is-open { display: block; }
.nav__mobile a {
  display: block;
  padding: var(--space-3) 0;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav__mobile a:last-child { border-bottom: none; }

@media (min-width: 1024px) {
  .nav__links { display: inline-flex; }
  .nav__burger { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-16) var(--space-8);
  background: var(--bg);
}
.footer__grid {
  display: grid;
  gap: var(--space-12);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr repeat(3, 1fr); gap: var(--space-16); }
}
.footer__brand p {
  color: var(--text-muted);
  max-width: 32ch;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}
.footer__col h5 {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-subtle);
  margin-bottom: var(--space-4);
}
.footer__col ul > li {
  padding-block: var(--space-2);
}
.footer__col a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-subtle);
}

/* ---------- Focus (a11y AA) ---------- */
:where(a, button, [role="button"], input, textarea, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Utilities ---------- */
.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;
}

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.max-w-prose { max-width: min(60ch, 100%); }
.max-w-narrow { max-width: var(--container-narrow); }

/* ---------- Entrance animations (respect reduced-motion) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
