/* Shared stylesheet for Ynelys legal / sub pages.
   Themed via data-theme="light|dark" on <html>. Lang via data-lang="fr|en". */

:root {
  --g100: #DDF4B2;
  --g200: #C4EA8E;
  --g300: #A6D966;
  --g400: #89CC46;
  --g500: #5BB83A;
  --g600: #3FA23A;
  --g700: #238840;
  --g800: #1A6A34;
  --g900: #0E4A24;
}

html[data-theme="light"] {
  --bg: #F2EDE1;
  --surface: #FFFFFF;
  --fg: #0E1109;
  /* Contrastes relevés pour AA strict (4.5:1) sur fond ivoire */
  --fg-muted: rgba(14, 17, 9, 0.78);
  --fg-faint: rgba(14, 17, 9, 0.55);
  --border: rgba(14, 17, 9, 0.1);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --accent: var(--g700);
  --accent-soft: rgba(35, 136, 64, 0.08);
  --nav-bg: rgba(244, 243, 237, 0.8);
  --footer-bg: #F7F6EE;
  --footer-fg: rgba(14, 17, 9, 0.75);
  --footer-faint: rgba(14, 17, 9, 0.5);
}

html[data-theme="dark"] {
  --bg: #050704;
  --surface: rgba(255, 255, 255, 0.03);
  --fg: #F0EFE8;
  --fg-muted: rgba(240, 239, 232, 0.78);
  --fg-faint: rgba(240, 239, 232, 0.55);
  --border: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --accent: var(--g200);
  --accent-soft: rgba(137, 204, 70, 0.08);
  --nav-bg: rgba(5, 7, 4, 0.7);
  --footer-bg: #020301;
  --footer-fg: rgba(255, 255, 255, 0.75);
  --footer-faint: rgba(255, 255, 255, 0.45);
}

* { box-sizing: border-box; }
/* iOS Safari : fontSize ≥16px sur les inputs empêche le zoom auto au focus */
input, textarea, select { font-size: 16px; }

/* Filigrane Instrument Serif géant en arrière-plan des heros secondaires.
   Le mot-clé de la page (lu via data-watermark sur le hero) s'affiche en italique 180px,
   opacity ~0.04, comme une marque d'eau. Signature Vercel/Apple. */
.has-watermark { position: relative; }
.has-watermark::before {
  content: attr(data-watermark);
  position: absolute;
  top: 50%; right: -2%;
  transform: translateY(-50%);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(120px, 22vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}
html[data-theme="dark"] .has-watermark::before { opacity: 0.07; }
.has-watermark > * { position: relative; z-index: 1; }
@media (max-width: 720px) {
  .has-watermark::before { font-size: clamp(80px, 26vw, 160px); right: -8%; opacity: 0.04; }
}
@media print { .has-watermark::before { display: none; } }

/* Édition numérotée Bottega-style : signature éditoriale en bas à droite */
.edition-mark {
  position: fixed; bottom: 16px; right: 16px;
  z-index: 99;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--fg-faint);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 12px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-feature-settings: 'tnum';
  pointer-events: none; user-select: none;
}
@media (max-width: 640px) {
  .edition-mark { bottom: 12px; right: 12px; padding: 5px 10px; font-size: 9px; }
}
@media print { .edition-mark { display: none; } }

/* Page-progress rail — 1px en haut, gradient vert, se remplit au scroll.
   Signature éditoriale (It's Nice That, magazines design). */
.page-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--g500), var(--g300));
  z-index: 100;
  transition: width 80ms linear;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .page-progress { transition: none; }
}
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Manrope variants stylistiques + chiffres tabulaires (cohérent avec landing) */
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  font-size: 16px; line-height: 1.6;
  scroll-behavior: smooth;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav-bg); -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 32px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.nav a.back {
  color: var(--fg-muted); text-decoration: none; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--surface);
  transition: all .15s;
}
.nav a.back:hover { color: var(--fg); border-color: var(--border); }
.nav-wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  line-height: 1;
}
.nav-wordmark .glyph {
  height: 28px; width: auto; display: block;
}
.nav-wordmark .wm-text {
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--fg);
}
/* Swap glyph based on theme */
.nav-wordmark .logo-light { display: block; }
.nav-wordmark .logo-dark { display: none; }
html[data-theme="dark"] .nav-wordmark .logo-light { display: none; }
html[data-theme="dark"] .nav-wordmark .logo-dark { display: block; }
.nav-tools { display: flex; gap: 8px; align-items: center; }
.nav-tools button {
  border: 1px solid var(--border-subtle); background: var(--surface);
  color: var(--fg-muted);
  padding: 7px 12px; border-radius: 999px;
  /* WCAG 2.5.8 : cible tactile minimale */
  min-height: 36px; min-width: 36px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px;
  letter-spacing: 1.2; text-transform: uppercase;
  cursor: pointer; transition: all .15s;
}
.nav-tools button:hover { color: var(--fg); }
.nav-tools button.active {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
}

/* Hero block */
main { max-width: 860px; margin: 0 auto; padding: 64px 32px 120px; }
.kicker {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent); padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
h1 {
  font-family: Manrope, sans-serif;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02; font-weight: 500;
  letter-spacing: -0.04em; margin: 20px 0 16px;
}
h1 em {
  font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400;
  color: var(--accent);
}
.lede {
  font-size: 19px; color: var(--fg-muted);
  margin: 0 0 8px; max-width: 640px; line-height: 1.55;
}
.meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 24px;
  border-top: 1px dashed var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--fg-faint);
}

/* Cards : shadow douce + hover translateY (à la Stripe Press / Linear)
   Appliqué automatiquement à toutes les cartes des pages produits / fondateur / presse. */
.founder-card,
.universe,
.plan,
.logo-card,
.key-fact,
.cta-col,
.cta-final,
.cta-press,
.rm-cta {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 12px 32px -16px rgba(14, 17, 9, 0.10),
    0 2px 8px -4px rgba(14, 17, 9, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
html[data-theme="dark"] .founder-card,
html[data-theme="dark"] .universe,
html[data-theme="dark"] .plan,
html[data-theme="dark"] .logo-card,
html[data-theme="dark"] .key-fact,
html[data-theme="dark"] .cta-col,
html[data-theme="dark"] .cta-final,
html[data-theme="dark"] .cta-press,
html[data-theme="dark"] .rm-cta {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 32px -16px rgba(0, 0, 0, 0.5),
    0 2px 8px -4px rgba(0, 0, 0, 0.3);
}
.universe:hover,
.plan:hover,
.logo-card:hover,
.key-fact:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 20px 44px -16px rgba(14, 17, 9, 0.14),
    0 4px 12px -4px rgba(14, 17, 9, 0.08);
}
html[data-theme="dark"] .universe:hover,
html[data-theme="dark"] .plan:hover,
html[data-theme="dark"] .logo-card:hover,
html[data-theme="dark"] .key-fact:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 44px -16px rgba(0, 0, 0, 0.6),
    0 4px 12px -4px rgba(0, 0, 0, 0.4);
}

/* CTA premium réutilisable — gradient + inset highlight + ombre colorée
   Cohérent avec le bouton hero du landing React. */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  background: linear-gradient(135deg, var(--g500), var(--g700));
  color: #fff; text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: 0.01em;
  font-family: inherit; border: none; cursor: pointer;
  white-space: nowrap;
  box-shadow:
    0 10px 30px color-mix(in srgb, var(--g600) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px color-mix(in srgb, var(--g600) 45%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  filter: brightness(1.05);
}
.btn:active { transform: translateY(0); transition-duration: 0.05s; }
html[data-theme="dark"] .btn {
  background: linear-gradient(135deg, var(--g400), var(--g600));
  color: var(--bg);
  box-shadow:
    0 10px 30px color-mix(in srgb, var(--g500) 30%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
html[data-theme="dark"] .btn:hover {
  box-shadow:
    0 14px 36px color-mix(in srgb, var(--g500) 40%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.meta span b { font-weight: 600; color: var(--fg-muted); }

/* Content */
.content {
  margin-top: 56px;
  font-size: 16px; line-height: 1.75; color: var(--fg);
}
.content h2 {
  font-family: Manrope, sans-serif;
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.025em; margin: 48px 0 12px;
  padding-top: 20px; border-top: 1px solid var(--border-subtle);
}
.content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.content h3 {
  font-size: 16px; font-weight: 600; margin: 28px 0 8px;
  color: var(--fg);
}
.content p { margin: 0 0 14px; color: var(--fg-muted); }
.content ul { margin: 8px 0 14px; padding-left: 20px; color: var(--fg-muted); }
.content ul li { margin-bottom: 6px; }
.content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content a:hover { text-decoration-thickness: 2px; }
.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--accent-soft); padding: 2px 6px; border-radius: 4px;
  color: var(--accent);
}
.content .callout {
  margin: 24px 0; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  font-size: 14px; color: var(--fg-muted);
}

/* Footer */
footer.legal-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--footer-bg); color: var(--footer-fg);
  padding: 48px 32px 32px;
  /* iOS safe area : pas de bande noire sous le notch / home indicator */
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
}
footer.legal-footer .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
}
footer.legal-footer a { color: var(--footer-fg); text-decoration: none; }
footer.legal-footer a:hover { color: var(--accent); }
footer.legal-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Lang-specific hide/show */
[data-lang-block="fr"], [data-lang-block="en"] { display: none; }
html[data-lang="fr"] [data-lang-block="fr"] { display: block; }
html[data-lang="en"] [data-lang-block="en"] { display: block; }
html[data-lang="fr"] [data-lang="en"],
html[data-lang="en"] [data-lang="fr"] { display: none; }

/* Hide inline lang spans contextually */
span[data-lang] { display: none; }
html[data-lang="fr"] span[data-lang="fr"],
html[data-lang="en"] span[data-lang="en"] { display: inline; }

/* Responsive — mobile (≤ 640px) — bloc unique pour 7 pages */
@media (max-width: 640px) {
  /* Nav */
  .nav { padding: 10px 14px; }
  .nav-inner { gap: 8px; }
  .nav-wordmark .wm-text { font-size: 14px; }
  .nav a.back { font-size: 12px; padding: 7px 10px; }
  .nav-tools button { padding: 7px 9px; font-size: 10px; }

  /* Main : padding latéral plus serré, garder vertical confortable */
  main { padding: 40px 18px 80px; }

  /* Hero typo */
  h1 { font-size: clamp(36px, 9vw, 56px); }
  .lede { font-size: 16px; }

  /* Content */
  .content { font-size: 15px; }
  .content h2 { font-size: 22px; margin-top: 36px; padding-top: 16px; }
  .content h3 { font-size: 15px; }

  /* Footer */
  footer.legal-footer { padding: 28px 18px; }
  footer.legal-footer .inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  footer.legal-footer nav { gap: 14px; font-size: 10px; }
}

/* Respect motion preferences — WCAG 2.3.3 */
@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;
  }
}
