/* ─────────────────────────────────────────────────────────────
   Design tokens — agence IA. Inspiré x.ai (dark canvas + pills
   outline + tracking négatif), adapté avec accent rouge signal.
   ───────────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --canvas: #0a0a0a;
  --canvas-soft: #131316;
  --canvas-card: #16161a;
  --canvas-mid: #1f2024;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.18);

  /* Ink */
  --ink: #ffffff;
  --body: #dadbdf;
  --body-mid: #7d8187;
  --body-dim: #4d5157;

  /* Accent */
  --accent: #ff3324;
  --accent-soft: #ff6b5e;
  --accent-deep: #c61d10;
  --accent-glow: rgba(255, 51, 36, 0.45);

  /* Typography */
  --font-display: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 9999px;

  /* Spacing scale (4px base) */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;
  --s-4: 16px;  --s-5: 24px;  --s-6: 32px;
  --s-7: 48px;  --s-8: 64px;  --s-9: 96px;
  --s-10: 128px;

  /* Motion */
  --ease-reveal: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ui: cubic-bezier(0.2, 0.7, 0.2, 1);
  --reveal-y: 18px;
  --reveal-duration: 1100ms;
  --reveal-card-y: 42px;
  --reveal-card-duration: 1800ms;
  --reveal-delay: 0ms;
}

/* Light-mode override applied via [data-theme="light"] on <html> */
html[data-theme="light"] {
  --canvas: #fafaf7;
  --canvas-soft: #f1f1ec;
  --canvas-card: #ffffff;
  --canvas-mid: #ececeb;
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(0, 0, 0, 0.18);
  --ink: #0a0a0a;
  --body: #2a2a2e;
  --body-mid: #5d6166;
  --body-dim: #a0a4a8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.38s var(--ease-ui), color 0.38s var(--ease-ui);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

/* ── Type scale ──────────────────────────────────────────────── */
.t-display-xl { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 400; }
.t-display-lg { font-size: clamp(32px, 4vw, 56px);   line-height: 1.08; letter-spacing: -0.03em;  font-weight: 400; }
.t-display-md { font-size: clamp(26px, 3vw, 40px);   line-height: 1.12; letter-spacing: -0.028em; font-weight: 400; }
.t-display-sm { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -0.02em;  font-weight: 400; }
.t-display-xs { font-size: 18px; line-height: 1.4;  letter-spacing: -0.01em; font-weight: 400; }
.t-body-lg    { font-size: 16.5px; line-height: 1.6; color: var(--body); }
.t-body       { font-size: 15px; line-height: 1.6;  color: var(--body); }
.t-body-sm    { font-size: 14px; line-height: 1.5;  color: var(--body); }

.t-mono       { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4; color: var(--body-mid); font-weight: 400; }
.t-mono-sm    { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.4; color: var(--body-mid); font-weight: 400; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  position: relative;
  padding: clamp(56px, 6.5vw, 96px) 0;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 96px;
}
.section--noborder { border-top: 0; }
.section--tight   { padding: clamp(36px, 4vw, 56px) 0; }

/* ── Pill button (the universal interactive shape) ───────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition:
    background 0.18s var(--ease-ui),
    border-color 0.18s var(--ease-ui),
    transform 0.18s var(--ease-ui),
    box-shadow 0.18s var(--ease-ui);
}
.pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
}
html[data-theme="light"] .pill { background: rgba(0,0,0,0.02); }
html[data-theme="light"] .pill:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.32); }

.pill--sm  { height: 32px; padding: 0 14px; font-size: 13px; }
.pill--lg  { height: 48px; padding: 0 24px; font-size: 15px; }

.pill--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent), 0 0 32px -8px var(--accent-glow);
}
.pill--primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 48px -6px var(--accent-glow);
}

.pill--ghost { border-color: transparent; }
.pill--ghost:hover { background: rgba(255,255,255,0.05); }
html[data-theme="light"] .pill--ghost:hover { background: rgba(0,0,0,0.05); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--canvas-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 24px;
}

/* ── Eyebrow with the red dot ────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--body);
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.75); }
}

/* ── Hairline divider ────────────────────────────────────────── */
.hr { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

/* ── Mono ticker ─────────────────────────────────────────────── */
.ticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--body-mid);
}
.ticker .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Focus ring ──────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ── Scrollbar (subtle dark) ─────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ── Reveal on scroll — fluid, calm, GPU-only ─────────────────── */
.reveal {
  opacity: 0.01;
  transform: translate3d(0, var(--reveal-y), 0);
  transition:
    opacity var(--reveal-duration) var(--ease-reveal) var(--reveal-delay),
    transform var(--reveal-duration) var(--ease-reveal) var(--reveal-delay);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.reveal.interactive-card {
  opacity: 0.08;
  transform: translate3d(0, var(--reveal-card-y), 0);
  transition:
    opacity calc(var(--reveal-card-duration) * 0.78) ease-out var(--reveal-delay),
    transform var(--reveal-card-duration) var(--ease-reveal) var(--reveal-delay),
    border-color 0.28s var(--ease-ui),
    box-shadow 0.36s var(--ease-ui);
}
.reveal.interactive-card.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-stagger] > .reveal:nth-child(1) { transition-delay: 0ms; }
[data-stagger] > .reveal:nth-child(2) { transition-delay: 90ms; }
[data-stagger] > .reveal:nth-child(3) { transition-delay: 180ms; }
[data-stagger] > .reveal:nth-child(4) { transition-delay: 270ms; }
[data-stagger] > .reveal:nth-child(5) { transition-delay: 360ms; }
[data-stagger] > .reveal:nth-child(6) { transition-delay: 450ms; }

/* ── Hero fade-in (CSS-only, GPU-only) ───────────────────────── */
@keyframes heroFade {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.hero-fade   { animation: heroFade 940ms var(--ease-out-soft) both; will-change: opacity, transform; }
.hero-fade-1 { animation-delay: 90ms; }
.hero-fade-2 { animation-delay: 220ms; }
.hero-fade-3 { animation-delay: 350ms; }

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

  .reveal,
  .hero-fade {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    animation: none;
  }
}

/* ── Mobile-specific polish ──────────────────────────────────── */
@media (max-width: 880px) {
  .container { padding: 0 20px; }
  .section {
    padding: clamp(48px, 9vw, 72px) 0;
    scroll-margin-top: 92px;
  }

  /* Bigger tap targets */
  .pill { height: 46px; padding: 0 18px; font-size: 14px; }
  .pill--sm { height: 36px; padding: 0 14px; font-size: 13px; }
  .pill--lg { height: 52px; padding: 0 24px; font-size: 15px; }

  /* Headlines tighter on mobile */
  .t-display-xl { font-size: clamp(34px, 9vw, 52px); line-height: 1.08; letter-spacing: -0.03em; }
  .t-display-lg { font-size: clamp(28px, 7vw, 40px); letter-spacing: -0.028em; line-height: 1.1; }
  .t-display-md { font-size: clamp(24px, 6vw, 32px); letter-spacing: -0.025em; line-height: 1.15; }
  .t-display-sm { font-size: clamp(20px, 5vw, 26px); letter-spacing: -0.02em; }
  .t-body-lg    { font-size: 15.5px; line-height: 1.55; }
  .t-body       { font-size: 14.5px; }

  /* Cards: more breathable padding on mobile */
  .card,
  .interactive-card { padding: 20px 18px; }

  /* Featured case card — keep impact but trim padding */
  .case-featured { padding: 22px 18px !important; min-height: auto !important; }
  .case-featured h3 { font-size: clamp(20px, 5.5vw, 26px) !important; }
  .case-featured-bg { opacity: 0.22 !important; }

  /* Bento featured chat preview — smaller, doesn't dominate */
  .bento-featured > div:last-child { min-height: 220px !important; }

  /* Booking left column needs less side padding */
  #booking .container { padding: 0 16px; }

  /* Reveal: less travel and less waiting on touch screens */
  .reveal {
    --reveal-y: 12px;
    --reveal-duration: 980ms;
    --reveal-card-y: 34px;
    --reveal-card-duration: 1700ms;
  }
  .reveal.in { transform: translate3d(0, 0, 0); }

  [data-stagger] > .reveal:nth-child(1) { transition-delay: 0ms; }
  [data-stagger] > .reveal:nth-child(2) { transition-delay: 0ms; }
  [data-stagger] > .reveal:nth-child(3) { transition-delay: 0ms; }
  [data-stagger] > .reveal:nth-child(4) { transition-delay: 0ms; }
  [data-stagger] > .reveal:nth-child(5) { transition-delay: 0ms; }
  [data-stagger] > .reveal:nth-child(6) { transition-delay: 0ms; }

  /* Tap feedback on interactive cards */
  .interactive-card:not(.reveal) { transition: transform 0.18s var(--ease-ui), border-color 0.3s var(--ease-ui); }
  .interactive-card:active { transform: scale(0.985); }

  /* Disable spotlight effect on touch */
  .interactive-card::before { display: none; }
}

@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .section { padding: 44px 0; }

  .pill--lg { height: 50px; padding: 0 22px; font-size: 15px; }

  .t-display-xl { font-size: clamp(30px, 10vw, 42px); line-height: 1.1; }

  .card,
  .interactive-card { padding: 18px 16px; }

  .case-featured { padding: 20px 16px !important; }
  .case-featured-bg { opacity: 0.16 !important; }
  .case-featured h3 { font-size: clamp(19px, 6vw, 24px) !important; }

  /* Hero on phones — breathing room */
  section[data-screen-label="01 Hero"] {
    min-height: 100svh !important;
    padding-top: 160px !important;
    padding-bottom: 64px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  /* Process timeline on phones — generous spacing marker → content */
  .process-timeline { padding-left: 60px !important; gap: 22px !important; }
  .process-line { left: 19px !important; }
  .process-marker { left: -60px !important; width: 38px !important; height: 38px !important; font-size: 11px !important; top: 2px !important; }
  .process-visual { aspect-ratio: 1.5 / 1 !important; padding: 12px !important; }
}

/* Touch devices specifically */
@media (hover: none) {
  .pill:active { transform: scale(0.97); }
}

/* ── Marquee (logos) ─────────────────────────────────────────── */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee:hover { animation-play-state: paused; }

/* ── Premium card spotlight (driven by --mx/--my from JS) ────── */
.interactive-card {
  position: relative;
  isolation: isolate;
}
.interactive-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    var(--accent-glow),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.interactive-card:hover::before { opacity: 0.5; }
.interactive-card > * { position: relative; z-index: 1; }

/* ── Subtle grain overlay on hero ────────────────────────────── */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(rgba(255,255,255,0.6) 1px, transparent 1px);
  background-size: 3px 3px;
}
