/* ============================================================
   Studio FENNEC — enhancements layer
   Loaded after kit.css. Adds:
   0) Sticky-nav fix (overflow-x: hidden was breaking it) +
      mobile-first responsive polish
   1) Hero background-video mode
   2) Unified primary CTA + service-page typography
   3) Content protection: prevent dragging / native save-as flow
   ============================================================ */

/* ---------- 0) STICKY HEADER + GLOBAL RESPONSIVE FIXES ---------- */
/* `overflow-x: hidden` on html/body breaks `position: sticky` for descendant
   elements. Try `overflow-x: clip` (Chrome 90+, FF 81+, Safari 15.4+) and
   fall back to `visible` for older browsers — both let sticky work. */
html, body {
  overflow-x: visible !important;
}
@supports (overflow: clip) {
  html, body {
    overflow-x: clip !important;
  }
}

/* Belt-and-braces: on viewports below 1024px we use `position: fixed` instead
   of sticky. Fixed is bulletproof — it doesn't depend on any ancestor having
   a usable scroll container, so it works on every iOS Safari version
   regardless of the overflow situation. Desktop keeps sticky because the
   transition between flow and stuck is smoother there. */
.fn-header {
  z-index: 100 !important;
  min-height: 64px;
}
@media (max-width: 1023px) {
  .fn-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    padding: 10px 16px;
  }
  /* Reserve room for the fixed header on inner pages that don't have a
     full-bleed hero. Home (.home) and case studies (.single-case_study)
     bleed the hero/video behind the header on purpose, so they skip this. */
  body:not(.home):not(.single-case_study) .fn-app {
    padding-top: 76px;
  }
  /* Brand word is too long on small phones — hide and rely on the logo */
  .fn-brand-word {
    display: none;
  }
}
@media (min-width: 480px) and (max-width: 1023px) {
  .fn-brand-word { display: inline; font-size: 12px; }
}

/* Burger button polish — bigger touch target, visible against any bg */
.fn-burger {
  width: 44px;
  height: 44px;
  padding: 12px 10px;
  background: transparent;
  border: 1px solid var(--noir-600);
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.fn-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg-1);
}

/* Drawer scrolling fix + nicer spacing */
.fn-drawer {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 80px 24px 40px;
}
.fn-drawer a {
  font-size: 24px;
}
@media (min-width: 480px) {
  .fn-drawer a { font-size: 28px; }
}

/* Case-study secondary nav must sit BELOW the main sticky header — otherwise
   both stack at top:0 and overlap. We offset based on the main header height
   (≈76px mobile, ≈100px desktop with the 64px logo). */
.cs-nav {
  top: 76px !important;
}
@media (min-width: 1024px) {
  .cs-nav { top: 100px !important; }
}

/* ---------- 0bis) SECTION-LEVEL RESPONSIVE POLISH ---------- */
/* Several sections inherit grid templates from kit.css that work well on
   desktop but cram on mobile. Force a single column under 720px and add
   sensible side padding everywhere. */

@media (max-width: 720px) {
  /* Generic section padding — was sometimes too tight on small screens */
  .fn-section {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 56px;
    padding-bottom: 56px;
  }
  /* Services / values / results grids → single column */
  .fn-services-grid,
  .fn-services-grid--4,
  .fn-values-grid,
  .fn-results-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  /* Case grid: 1 col on small phones, 2 on bigger phones */
  .fn-cases-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  /* Section heads: tighter line-height + smaller eyebrow */
  .fn-section-head .display-m {
    font-size: clamp(28px, 9vw, 44px) !important;
    line-height: 1 !important;
  }
  /* Contact form/copy grid → single column */
  .fn-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Footer cols → single column */
  .fn-footer-cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  .fn-footer-bottom {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start !important;
  }
}

@media (min-width: 721px) and (max-width: 1023px) {
  /* Tablet: 2 columns for services/values/cases */
  .fn-services-grid--4 {
    grid-template-columns: 1fr 1fr !important;
  }
  .fn-cases-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .fn-footer-cols {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Hero on mobile — text-first, video-bg should never push content off-screen */
@media (max-width: 720px) {
  .fn-hero.fn-hero--video {
    min-height: 600px;
    padding: 88px 16px 32px;
  }
  .fn-hero--video .fn-hero-grid {
    min-height: 460px;
  }
  .fn-hero-title {
    font-size: clamp(34px, 11vw, 52px) !important;
  }
  .fn-hero-lead {
    font-size: 15px !important;
  }
  /* CTAs stack full-width on mobile (already in kit.css but reinforce) */
  .fn-hero-ctas {
    flex-direction: column !important;
    width: 100%;
  }
  .fn-hero-ctas .btn {
    width: 100% !important;
  }
}

/* Case study pages — mobile-first cs-body layout */
@media (max-width: 720px) {
  .cs-body {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 56px 16px !important;
  }
  .cs-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .cs-hero-title {
    font-size: clamp(34px, 11vw, 52px) !important;
  }
  .cs-cta {
    padding: 48px 16px !important;
  }
  .cs-cta h2 {
    font-size: clamp(26px, 9vw, 40px) !important;
  }
}

/* Service pages on mobile — already harmonized in the service-page block,
   but reinforce paddings + faq spacing */
@media (max-width: 720px) {
  .fn-service-page {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .fn-service-page .fn-faq,
  .fn-prose {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* ---------- 1) HERO · BACKGROUND VIDEO MODE ---------- */

/* ---------- 1) HERO · BACKGROUND VIDEO MODE ---------- */
.fn-hero.fn-hero--video {
  position: relative;
  min-height: min(820px, 100vh);
  overflow: hidden;
  isolation: isolate;
  padding: 88px 20px 24px;
}
@media (min-width: 1024px) {
  .fn-hero.fn-hero--video { padding: 120px 40px 32px; }
}

.fn-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;     /* iframe can't be interacted with by viewers */
  background: var(--noir-1000); /* color while video loads */
}
.fn-hero-bg iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.7777vh;        /* 16:9 — wide enough for any portrait viewport */
  height: 56.25vw;          /* 16:9 — tall enough for any landscape viewport */
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* Dark gradient scrim so the H1 stays readable over any frame */
.fn-hero-bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(5,5,5,0.88) 0%, rgba(5,5,5,0.55) 55%, rgba(5,5,5,0.25) 100%),
    linear-gradient(to top, rgba(5,5,5,0.85) 0%, rgba(5,5,5,0.1) 45%, transparent 100%);
}

/* All hero content stacks above scrim */
.fn-hero--video .fn-hero-grid {
  position: relative;
  z-index: 2;
  grid-template-columns: 1fr;     /* no media column → single column */
  min-height: 60vh;
  align-items: center;
}
.fn-hero--video .fn-hero-marquee,
.fn-hero--video .fn-hero-burrow {
  position: relative;
  z-index: 2;
}

/* On large screens the copy column is narrower so the video reads through */
@media (min-width: 1024px) {
  .fn-hero--video .fn-hero-copy { max-width: 720px; }
  .fn-hero--video .fn-hero-lead { color: var(--blanc-50); }
  .fn-hero--video .fn-hero-marquee {
    background: rgba(5, 5, 5, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 4px;
  }
}

/* ---------- 2) UNIFIED PRIMARY CTA · SAFFRON RECTANGLE ---------- */
/* One look for ALL primary CTAs across the site:
   - Hero "Travaillons ensemble"      → .btn.btn--primary
   - Case study bottom "Prendre RDV"  → .cs-cta > a
   - Service page bottom "Prendre RDV"→ .fn-service-cta > a
   - Service archive cards            → .fn-service-link (text-only variant)
   Slight 2px corner radius, saffron bg, pure black bold uppercase, small
   black arrow icon on the right. */
.btn--primary,
.btn--primary:link,
.btn--primary:visited,
.cs-cta > a,
.cs-cta > a:link,
.cs-cta > a:visited,
.fn-service-cta > a,
.fn-service-cta > a:link,
.fn-service-cta > a:visited {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px !important;
  background: var(--accent) !important;
  color: #000 !important;
  font-family: var(--font-sans);
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: none !important;
  border-radius: 2px !important;     /* kills the .fn-service-cta 999px pill */
  min-height: 48px;
  transition: transform .2s, background .2s;
}

.btn--primary:hover,
.btn--primary:focus-visible,
.cs-cta > a:hover,
.cs-cta > a:focus-visible,
.fn-service-cta > a:hover,
.fn-service-cta > a:focus-visible {
  color: #000 !important;
  background: var(--saffron-600) !important;
  transform: translateY(-2px);
}

.btn--primary:focus-visible,
.cs-cta > a:focus-visible,
.fn-service-cta > a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn--primary img,
.cs-cta > a img,
.fn-service-cta > a img {
  width: 14px;
  height: auto;
  filter: none;
}

.btn--primary .btn-label {
  color: #000;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

/* Service detail CTA wrapper: centered layout + heading */
.fn-service-cta {
  text-align: center;
  margin: 80px auto;
  max-width: 720px;
  padding: 64px 16px;
  border-top: 1px solid var(--noir-700);
}
.fn-service-cta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 0 0 22px;
}

/* ---------- 2ter) SERVICE PAGES · HARMONIZED TYPOGRAPHY ---------- */
/* The inherited display-l scale (up to 120px) was overkill for an inner page.
   We use display-m (clamped 36→56 inside .fn-section-head) for the H1, and
   constrain prose body + FAQ heading to sit one rung below. */

.fn-service-page {
  padding-top: 56px;
}
@media (min-width: 1024px) {
  .fn-service-page { padding-top: 80px; }
}

/* Hero lead — width-constrained + slightly smaller than home hero lead */
.fn-service-page .fn-section-head .lead {
  max-width: 640px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.55;
}

/* Cover image — moved from inline to CSS class */
.fn-service-cover {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin: 32px 0;
}

/* Longform prose body (the_content output) — readable, hierarchical, tight */
.fn-prose {
  max-width: 720px;
  margin: 40px auto;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.7;
}
.fn-prose > h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 48px 0 16px;
}
.fn-prose > h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.2;
  color: var(--fg-1);
  margin: 32px 0 12px;
}
.fn-prose p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
  color: var(--fg-2);
}
.fn-prose ul,
.fn-prose ol {
  margin: 0 0 18px;
  padding-left: 1.4em;
}
.fn-prose li {
  margin-bottom: 8px;
  line-height: 1.65;
  color: var(--fg-2);
}
.fn-prose strong { color: var(--fg-1); }

/* FAQ block heading — smaller than H1, bigger than body */
.fn-service-page .fn-faq {
  max-width: 720px;
  margin: 64px auto;
}
.fn-service-h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 0 0 24px;
}

/* FAQ items — slightly tighter than before */
.fn-faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--noir-700);
}
.fn-faq-item summary {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-1);
}
.fn-faq-item div {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-2);
}

/* Archive services — card titles harmonized at 20px, not the inline 24px.
   Cleaner with the rest of the page scale. */
.fn-service-page .fn-services-grid {
  margin-top: 48px;
}
.fn-service-page .fn-service h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  margin: 8px 0 6px;
  color: var(--fg-1);
}
.fn-service-page .fn-service p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
}

/* CTA at the bottom — section-head sizes already styled via .fn-service-cta h2
   but make sure the heading scales harmoniously even in narrow viewports */
.fn-service-page .fn-service-cta h2 {
  font-size: clamp(28px, 5vw, 44px);
}

/* ---------- 2bis) FENNEC ILLUSTRATIONS · SIZE + ANIMATION OVERRIDES ---------- */

/* Header brand logo — visibly bigger so it reads at a glance */
.fn-brand img,
.fn-brand .custom-logo,
.fn-brand a img {
  height: 56px !important;
  width: 56px !important;
  object-fit: cover;
  border-radius: 6px;
}
@media (min-width: 1024px) {
  .fn-brand img,
  .fn-brand .custom-logo,
  .fn-brand a img {
    height: 64px !important;
    width: 64px !important;
  }
}

/* ---------- HERO · STAGGERED ENTRY ANIMATION ---------- */
/* Each block of the hero fades up sequentially on page load. `backwards`
   fill mode keeps them at opacity 0 during the delay so nothing flashes. */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fn-hero--video .fn-hero-eyebrow,
.fn-hero--video .fn-hero-line,
.fn-hero--video .fn-hero-lead,
.fn-hero--video .fn-hero-ctas,
.fn-hero--video .fn-hero-marquee {
  animation: heroFadeUp 0.9s cubic-bezier(.2, .7, .2, 1) backwards;
}
.fn-hero--video .fn-hero-eyebrow            { animation-delay: 0.1s; }
.fn-hero--video .fn-hero-line:nth-child(1)  { animation-delay: 0.3s; }
.fn-hero--video .fn-hero-line:nth-child(2)  { animation-delay: 0.45s; }
.fn-hero--video .fn-hero-line:nth-child(3)  { animation-delay: 0.6s; }
.fn-hero--video .fn-hero-lead               { animation-delay: 0.8s; }
.fn-hero--video .fn-hero-ctas               { animation-delay: 1.0s; }
.fn-hero--video .fn-hero-marquee            { animation-delay: 1.2s; }

/* Background video fades in last so it doesn't pop in */
.fn-hero--video .fn-hero-bg {
  animation: heroFadeUp 1.4s ease-out backwards;
  animation-delay: 0s;
}

/* Reduce motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  .fn-hero--video .fn-hero-eyebrow,
  .fn-hero--video .fn-hero-line,
  .fn-hero--video .fn-hero-lead,
  .fn-hero--video .fn-hero-ctas,
  .fn-hero--video .fn-hero-marquee,
  .fn-hero--video .fn-hero-bg {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------- HERO · MARQUEE LOWERED ---------- */
/* The clients-marquee was sitting too high in the hero block. Push it
   visibly down so it sits closer to the bottom of the hero. */
.fn-hero-marquee {
  margin-top: 64px !important;
}
@media (min-width: 1024px) {
  .fn-hero-marquee {
    margin-top: 112px !important;
  }
}

/* Services runner — mirror the PNG so the fennec faces right, traverse
   stays the original L→R direction (head matches movement direction).
   Loops INFINITE so the fennec keeps running, not a one-shot animation. */
@keyframes servicesRunStrut {
  0%, 100% { transform: translateY(0)   scaleX(-1); }
  50%      { transform: translateY(-4px) scaleX(-1); }
}
@keyframes servicesRunTraverse {
  0%   { opacity: 0; left: -20%; }
  8%   { opacity: 1; left: -8%;  }
  92%  { opacity: 1; left: 100%; }
  100% { opacity: 0; left: 115%; }
}
/* Override the original 6s `forwards` → 10s `infinite` so the fennec
   keeps running across the section forever, not just once on scroll. */
.fn-services-runner.is-visible .fn-services-runner__img,
.fn-services-runner .fn-services-runner__img {
  animation:
    servicesRunStrut 0.5s ease-in-out infinite,
    servicesRunTraverse 10s linear infinite !important;
}

/* Burrow fennec — used to be in the Home hero, moved to the
   Réseaux sociaux service page (per user request). Positioned top-right
   of the hero section head so it sits next to the title block. */
.fn-service-page--with-burrow {
  position: relative;
}
.fn-service-page--with-burrow .fn-hero-burrow {
  position: absolute;
  top: 64px;
  right: 6%;
  width: clamp(48px, 6vw, 80px);
  height: auto;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition: opacity .6s cubic-bezier(.32, .72, .42, 1),
              transform .6s cubic-bezier(.32, .72, .42, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.fn-service-page--with-burrow .fn-hero-burrow.is-visible,
.fn-service-page--with-burrow .fn-hero-burrow.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.fn-service-page--with-burrow .fn-hero-burrow img {
  display: block; width: 100%; height: auto;
  animation: heroBurrowBreathe 3.6s ease-in-out infinite;
}
@media (max-width: 720px) {
  .fn-service-page--with-burrow .fn-hero-burrow {
    top: 24px;
    right: 8%;
    width: 44px;
  }
}

/* About / Valeurs — bouncing jump fennec sits top-LEFT of the section
   (opposite side from the static fennec which is at right:6%) to balance
   the composition. Soft 12px continuous bounce. */
.fn-about-jump {
  position: absolute;
  top: 10%;
  left: 5%;
  width: clamp(70px, 9vw, 120px);
  height: auto;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .7s ease, transform .7s ease;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}
.fn-about-jump.is-visible,
.fn-about-jump.is-in {
  opacity: 1;
  transform: translateY(0);
}
.fn-about-jump__img {
  display: block;
  width: 100%;
  height: auto;
  animation: aboutBounceSoft 2.6s ease-in-out infinite;
}
@keyframes aboutBounceSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@media (max-width: 540px) {
  .fn-about-jump { width: 60px; top: 6%; left: 6%; }
}

/* Valeurs static — bigger illustration (roughly 1.7× previous) */
.fn-values-static {
  width: clamp(80px, 8.5vw, 130px) !important;
}
@media (max-width: 900px) {
  .fn-values-static { width: 80px !important; }
}

/* Footer jump — bigger illustration */
.fn-footer-jump {
  width: clamp(140px, 16vw, 220px) !important;
  top: -110px !important;
}
@media (max-width: 900px) {
  .fn-footer-jump { width: 150px !important; top: -90px !important; }
}
@media (max-width: 540px) {
  .fn-footer-jump { width: 120px !important; top: -75px !important; }
}

/* Footer logo — visibly bigger (was 56px inline, now scales with viewport) */
.fn-footer-logo {
  height: 96px !important;
  width: 96px !important;
  object-fit: cover;
  border-radius: 8px;
}
@media (max-width: 540px) {
  .fn-footer-logo { height: 72px !important; width: 72px !important; }
}

/* ---------- 3) CONTENT PROTECTION · DETERRENTS ---------- */
/* These don't *prevent* downloading (nothing web-side truly can — DevTools,
   screen recording, and HAR exports always work) but they remove the
   one-click save flow that 99 % of casual visitors use. */
img,
picture,
video,
iframe,
.fn-case-img,
.cs-hero-img,
.fn-case-grid .fn-case,
[style*="background-image"] {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* iOS long-press menu */
}

/* But text should remain selectable so the site is still usable */
p, h1, h2, h3, h4, h5, h6, span, a, li, dt, dd, blockquote, cite, code, label, input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
