/* =====================================================
   YASEI CORE
   © 2026 Yasei Home
   ===================================================== */

html, body { overflow-x: clip; max-width: 100%; }

h1, h2, h3, h4 { text-wrap: balance; }
p, li, blockquote, figcaption { text-wrap: pretty; hyphens: auto; }

.yh-no-widow { text-wrap: balance; }
.yh-pretty { text-wrap: pretty; }

h1, h2, h3, .font-display {
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

blockquote {
  hanging-punctuation: first last;
  text-indent: -0.4em;
}

/* ---------- DESIGN TOKENS ---------- */
:root {
  --yh-ink: #0F0F0E;
  --yh-ink-soft: #1C1C1C;
  --yh-paper: #FFFFFF;
  --yh-paper-warm: #FBF7F1;
  --yh-cream: #E8D8C1;
  --yh-amber: #C9A882;
  --yh-green: #16A34A;
  --yh-green-soft: #15803D;

  --yh-slate-900: #0F172A;
  --yh-slate-700: #334155;
  --yh-slate-600: #475569;
  --yh-slate-500: #64748B;
  --yh-slate-300: #CBD5E1;
  --yh-slate-200: #E2E8F0;
  --yh-slate-100: #F1F5F9;
  --yh-slate-50: #F8FAFC;

  --yh-bg: var(--yh-paper);
  --yh-bg-soft: var(--yh-slate-50);
  --yh-fg: var(--yh-slate-900);
  --yh-fg-muted: var(--yh-slate-600);
  --yh-border: var(--yh-slate-200);

  --yh-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --yh-font-serif: 'Playfair Display', Georgia, serif;
  --yh-scale-display: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  --yh-scale-h1: clamp(2rem, 3vw + 1rem, 3.75rem);
  --yh-scale-h2: clamp(1.5rem, 2vw + 0.5rem, 2.25rem);

  --yh-ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
  --yh-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --yh-duration-reveal: 1.2s;
  --yh-duration-soft: 400ms;

  --yh-shadow-soft: 0 1px 2px rgba(15, 15, 14, 0.04), 0 4px 24px rgba(15, 15, 14, 0.06);
  --yh-shadow-medium: 0 4px 12px rgba(15, 15, 14, 0.06), 0 12px 48px rgba(15, 15, 14, 0.10);

  --yh-focus-ring: 0 0 0 3px rgba(22, 163, 74, 0.35), 0 0 0 5px rgba(255, 255, 255, 0.9);
}

/* ---------- FOCUS & SKIP LINK ---------- */
*:focus-visible {
  outline: none;
  box-shadow: var(--yh-focus-ring);
  border-radius: 4px;
  transition: box-shadow 150ms var(--yh-ease-soft);
}
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, [role="slider"]:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--yh-focus-ring);
}

.yh-skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  background: var(--yh-ink);
  color: var(--yh-cream);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 999;
  transition: top 200ms var(--yh-ease-soft);
}
.yh-skip-link:focus {
  top: 12px;
  box-shadow: var(--yh-focus-ring);
}

/* ---------- WHATSAPP FAB ---------- */
.yh-fab-whatsapp {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  background: var(--yh-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 40;
  transition: transform 300ms var(--yh-ease-reveal), opacity 300ms var(--yh-ease-soft), box-shadow 200ms var(--yh-ease-soft);
  transform: translateY(120%) scale(0.8);
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
}
.yh-fab-whatsapp.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.yh-fab-whatsapp:hover,
.yh-fab-whatsapp:focus-visible {
  box-shadow: 0 6px 28px rgba(22, 163, 74, 0.6), 0 3px 10px rgba(0, 0, 0, 0.18);
}
.yh-fab-whatsapp iconify-icon { font-size: 26px; }
@media (min-width: 900px) { .yh-fab-whatsapp { display: none; } }

/* ---------- SLIDER AVANT/APRÈS ---------- */
.comparison-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yh-ink);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: ew-resize;
  z-index: 10;
  transition: transform 200ms var(--yh-ease-soft), box-shadow 200ms;
}
.comparison-handle-btn:hover,
.comparison-handle-btn:focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
}

@keyframes yh-handle-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(255, 255, 255, 0.7); }
  50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 14px rgba(255, 255, 255, 0); }
}
.comparison-handle-btn.yh-pulse {
  animation: yh-handle-pulse 1.8s var(--yh-ease-soft) 2;
}

/* ---------- REVEAL ANIMATIONS ---------- */
.yh-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--yh-ease-reveal), transform 900ms var(--yh-ease-reveal);
  will-change: opacity, transform;
}
.yh-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.yh-reveal-stagger > .yh-reveal,
.yh-reveal-stagger > * > .yh-reveal {
  transition-delay: calc(var(--yh-stagger-i, 0) * 40ms);
}

.yh-reveal-wipe {
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--yh-duration-reveal) var(--yh-ease-reveal);
  will-change: clip-path;
}
.yh-reveal-wipe.is-visible {
  clip-path: inset(0 0 0 0);
}

.yh-countup,
.price-amt,
.price-per-visual,
[data-yh-countup],
time,
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .yh-reveal,
  .yh-reveal-wipe {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .yh-fab-whatsapp {
    transform: none !important;
  }
  .comparison-handle-btn.yh-pulse {
    animation: none !important;
  }
}

/* ---------- HAUTE LISIBILITÉ ---------- */
[data-a11y="high-readability"] {
  --yh-font-sans: 'Inter', system-ui, sans-serif;
}
[data-a11y="high-readability"] body {
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.01em;
}
[data-a11y="high-readability"] em,
[data-a11y="high-readability"] i {
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 4px;
}
[data-a11y="high-readability"] p,
[data-a11y="high-readability"] li {
  max-width: 62ch;
}

/* ---------- VIEW TRANSITIONS ---------- */
@supports (view-transition-name: root) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 400ms;
    animation-timing-function: var(--yh-ease-soft);
  }
  ::view-transition-old(root) { animation-name: yh-fade-out; }
  ::view-transition-new(root) { animation-name: yh-fade-in; }
}
@keyframes yh-fade-out { to { opacity: 0; } }
@keyframes yh-fade-in { from { opacity: 0; } }

/* ---------- PRINT ---------- */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }
  nav, .yh-fab-whatsapp, .yh-skip-link, video, iframe,
  [data-print="hide"] {
    display: none !important;
  }
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  a[href^="http"]::after,
  a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after,
  a[href^="wa.me"]::after,
  a[href*="whatsapp"]::after {
    content: "";
  }
  h1, h2, h3 { page-break-after: avoid; break-after: avoid; }
  img { max-width: 100% !important; page-break-inside: avoid; break-inside: avoid; }
  article, section { page-break-inside: avoid; break-inside: avoid; }
  .yh-print-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 9pt;
    color: #555;
    padding: 6pt 12pt;
    border-top: 1px solid #ccc;
    text-align: center;
  }
  @page { margin: 18mm; }
}

/* ---------- LAYOUT HELPERS ---------- */
body { background: var(--yh-bg); color: var(--yh-fg); }
.yh-bg-paper { background: var(--yh-paper-warm); }
.yh-text-muted { color: var(--yh-fg-muted); }
.yh-border-soft { border-color: var(--yh-border); }

img[width][height] { height: auto; max-width: 100%; }

@media (hover: none) {
  a:hover, button:hover { transform: none !important; }
}

:target,
main[id],
section[id],
article[id],
h1[id], h2[id], h3[id], h4[id] {
  scroll-margin-top: 96px;
}

a[href],
button:not([disabled]),
[role="button"]:not([aria-disabled="true"]),
.yh-cta,
input[type="submit"],
input[type="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:not([disabled]):active,
[role="button"]:not([aria-disabled="true"]):active,
a.inline-flex:active,
.yh-cta:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: scale(0.98);
  transition: transform 80ms var(--yh-ease-soft);
}

.yh-fab-whatsapp:active,
.comparison-handle-btn:active { transform: translateY(0) scale(1); }

.comparison-handle-btn::after {
  content: "← →";
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--yh-ink);
  background: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--yh-ease-soft);
  white-space: nowrap;
}
.comparison-handle-btn:focus-visible::after { opacity: 1; }

@supports (content-visibility: auto) {
  section[id="tarifs"],
  section[id="faq"],
  section[id="methode"],
  section[id="etudes"],
  section[id="process"] {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}

/* ---------- BANDEAU AVIS ---------- */
.yh-reviews-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--yh-amber) 0%, var(--yh-cream) 100%);
  color: var(--yh-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: filter 150ms;
}
.yh-reviews-banner:hover { filter: brightness(0.95); }
.yh-reviews-banner::before { content: "★★★★★"; letter-spacing: 2px; color: var(--yh-ink); }

/* ---------- GRAIN PAPIER ---------- */
body.yh-grain::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' /></svg>");
  mix-blend-mode: multiply;
}
@media (prefers-reduced-motion: reduce) {
  body.yh-grain::before { opacity: 0.02; }
}

/* ---------- BLOG ---------- */
.yh-drop-cap::first-letter {
  float: left;
  font-family: 'Playfair Display', serif;
  font-size: 4.5rem;
  line-height: 0.9;
  font-weight: 700;
  margin: 0.15rem 0.5rem 0 0;
  color: #16a34a;
}
@media (max-width: 640px) {
  .yh-drop-cap::first-letter { font-size: 3.5rem; }
}

.yh-asterism {
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.6em;
  color: #94a3b8;
  margin: 3rem 0;
  padding-left: 0.6em;
}

.yh-read-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 50;
  pointer-events: none;
}
.yh-read-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 60ms linear;
}

.comparison-wrapper { position: relative; overflow: hidden; user-select: none; touch-action: pan-y; cursor: grab; }
.comparison-wrapper:active { cursor: grabbing; }
.comparison-before { width: 100%; height: 100%; object-fit: cover; display: block; }
.comparison-after {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(0 50% 0 0); will-change: clip-path; display: block;
}
.comparison-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 2px; background: #fff; z-index: 10; pointer-events: none;
}
.comparison-handle-btn {
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 44px; z-index: 11;
  background: transparent; border: 0; padding: 0; margin: 0; font: inherit;
  pointer-events: auto; cursor: ew-resize;
}
.comparison-handle-btn::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: #fff;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
}
.comparison-handle-btn:focus-visible {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
  border-radius: 4px;
}
.comparison-circle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #0f172a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15); transition: transform 0.2s;
  pointer-events: none;
}
.comparison-wrapper:hover .comparison-circle { transform: translate(-50%, -50%) scale(1.05); }

/* ---------- SCROLLBAR CUSTOM ----------
   Discret sur mobile (auto), visible sur desktop.
   Inactif sur tablette tactile. */
@media (hover: hover) and (pointer: fine) {
  /* WebKit / Chromium / Safari */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--yh-slate-200);
    border-radius: 999px;
    border: 2px solid var(--yh-paper);
    transition: background 180ms var(--yh-ease-soft);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--yh-green);
  }
  ::-webkit-scrollbar-thumb:active {
    background: var(--yh-green-soft);
  }
  ::-webkit-scrollbar-corner {
    background: transparent;
  }

  /* Firefox — fallback natif */
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--yh-slate-200) transparent;
  }
  html:hover {
    scrollbar-color: var(--yh-green) transparent;
  }
}

/* Respect prefers-reduced-motion — supprimer la transition de couleur */
@media (prefers-reduced-motion: reduce) {
  ::-webkit-scrollbar-thumb { transition: none; }
}
