/* ==========================================================================
   Fabrique — Encre & Lin
   Design tokens: a real modular type scale (rem, rooted at the 16px browser
   default so user font-size preferences are respected) and an 8px-derived
   spacing scale, used everywhere instead of ad hoc values.
   ========================================================================== */

:root {
  /* ---- palette (kept exactly from the validated Direction A proposal) ---- */
  --paper: #f6f1e7;
  --paper-alt: #efe6d5;
  --card: #fbf8f2;
  --ink: #2b2620;
  --ink-soft: #6b6156;
  /* Darkened from the original #9a8f80 — that value measured 2.56-2.99:1
     against paper/card/paper-alt, failing WCAG AA's 4.5:1 for the real
     microcopy it carries (field hints, char counts, footer note). Same
     hue/saturation, stepped lightness until it cleared AA on all three
     (4.55-5.32:1). */
  --ink-faint: #706659;
  --line: rgba(43, 38, 32, 0.14);
  --line-soft: rgba(43, 38, 32, 0.08);
  --accent: #5b6b4f;
  --accent-soft: #5b6b4f1a;
  --accent-ink: #4a5840;
  /* Semantic, not brand-derived — a muted rust rather than a pure red so it
     still sits inside the warm palette. Checked at 5.19-6.07:1 against
     paper/card/paper-alt, clears AA with margin on all three. */
  --color-error: #a13f2e;

  /* ---- type families ---- */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", -apple-system, "Segoe UI", sans-serif;

  /* ---- type scale — hand-tuned editorial rhythm, not a flat default ---- */
  --text-micro: 0.75rem;    /* 12px  — legal, micro-labels */
  --text-xs: 0.8125rem;     /* 13px  — kickers, nav */
  --text-sm: 0.9375rem;     /* 15px  — captions, small ui */
  --text-base: 1.0625rem;   /* 17px  — body */
  --text-md: 1.1875rem;     /* 19px  — lead paragraphs */
  --text-lg: 1.375rem;      /* 22px  — card/step titles */
  --text-xl: 1.75rem;       /* 28px  — small section heading */
  --text-2xl: 2.125rem;     /* 34px  — pricing tier names, sub-heads */
  --text-3xl: 2.625rem;     /* 42px  — section headings */
  --text-hero: 3.75rem;     /* 60px  — hero display */

  /* ---- spacing scale (rem, base 16px, 8px rhythm) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 4px;
  --radius: 7px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 2px rgba(43,38,32,.05), 0 8px 24px -12px rgba(43,38,32,.18);
  --shadow-card-hover: 0 4px 6px rgba(43,38,32,.06), 0 20px 34px -16px rgba(43,38,32,.30);

  --ease-out: cubic-bezier(.16,.8,.3,1);
  --ease-draw: cubic-bezier(.25,.75,.25,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain — a felt texture, not a decoration announcing itself */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><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>");
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--space-8); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

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

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

header.site {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,241,231,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-8);
  max-width: 1160px; margin: 0 auto;
}
.logo {
  display: flex; align-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
}
.logo em { font-style: normal; color: var(--accent); }
.logo-img { height: 26px; width: auto; display: block; }
.logo-fallback { display: none; }

.navlinks { display: flex; gap: var(--space-8); font-size: var(--text-sm); }
.navlinks li { position: relative; }
.navlinks a {
  text-decoration: none; color: var(--ink-soft);
  padding-bottom: 4px; display: inline-block;
  border-bottom: 1.5px solid transparent;
  transition: color .2s ease, border-color .3s ease;
}
.navlinks a:hover { color: var(--ink); }
.navlinks li.active a { color: var(--ink); border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--sans); font-weight: 600; font-size: var(--text-sm);
  padding: 0.75rem 1.375rem; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper); text-decoration: none;
  cursor: pointer; transition: transform .3s var(--ease-out), background .3s ease, box-shadow .3s var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 10px 24px -10px rgba(43,38,32,.4); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .12s; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 0.625rem 1.125rem; font-size: var(--text-xs); }

/* Pending/loading state — CSS hook only, no fetch behind it yet. Alpine
   (or whatever Day 7 wires) toggles this class during a real submit. */
.btn.is-pending { pointer-events: none; opacity: .7; }
.btn.is-pending::after {
  content: ""; width: 14px; height: 14px; margin-left: var(--space-1);
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: btn-spin .6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-pending::after { animation: none; opacity: .5; }
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* aria-disabled, not the native disabled attribute — kept focusable and
   hoverable on purpose so a keyboard/touch user can still discover *why*
   via the paired reason tooltip (native disabled buttons are unreachable
   by keyboard and fire hover/focus events inconsistently across browsers). */
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: none; }

/* ==========================================================================
   Motion system — one considered load sequence, restrained scroll reveals,
   all disabled cleanly under prefers-reduced-motion.
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(22px) scale(.98); transition: opacity .85s var(--ease-out), transform .85s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0) scale(1); }

.reveal-stagger > * { opacity: 0; transform: translateY(20px) scale(.97); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0) scale(1); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: .02s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: .11s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: .20s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: .29s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: .38s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: .47s; }

/* the pricing plants "grow" in — a bottom-anchored rise-and-scale, echoing
   the hero's own drawn-in moment (same --ease-draw curve) without literally
   reusing its stroke mechanism (these are raster illustrations now, not
   vector paths). Deliberately opacity+transform only, not clip-path: a
   clip-path reveal on this element was tested and found to make the
   scroll IntersectionObserver silently never re-fire in this engine (the
   image would stay permanently invisible for real users) — confirmed via
   a clean A/B swap to plain .reveal on the same element/DOM position. */
.grow-in {
  opacity: 0; transform: translateY(28px) scale(.88); transform-origin: bottom center;
  transition: opacity .6s ease, transform 1.1s var(--ease-draw);
}
.grow-in.in { opacity: 1; transform: translateY(0) scale(1); }

.sketch-draw { stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000); transition: stroke-dashoffset 1.4s var(--ease-draw); }
.sketch-draw.drawn { stroke-dashoffset: 0; }

@keyframes gentle-pulse {
  0%, 100% { opacity: .78; }
  50% { opacity: 1; }
}
.pulse { animation: gentle-pulse 3.6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > *, .grow-in, html { transition: none !important; scroll-behavior: auto !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
  .grow-in { opacity: 1 !important; transform: none !important; }
  .sketch-draw { stroke-dashoffset: 0 !important; transition: none !important; }
  .pulse, .parallax { animation: none !important; }
  [data-parallax] { transform: none !important; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: var(--space-24) 0 var(--space-16); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--space-16); align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: var(--space-6);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

.hero h1 {
  font-size: var(--text-hero); line-height: 1.05; letter-spacing: -0.02em;
  max-width: 640px; font-variation-settings: "opsz" 144;
}
.hero h1 .hl { position: relative; white-space: nowrap; display: inline-block; color: var(--ink); }
.hero h1 .hl svg { position: absolute; left: -2px; bottom: -10px; width: calc(100% + 4px); height: 20px; overflow: visible; }

.hero p.lead {
  margin-top: var(--space-6); font-size: var(--text-md); line-height: 1.6;
  color: var(--ink-soft); max-width: 30em;
}
.hero .ctas { margin-top: var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

.hero-illustration { position: relative; }
.hero-illustration img { width: 100%; height: auto; overflow: visible; }
.hero-illustration .float-note {
  position: absolute; top: -8%; right: 6%;
  font-family: var(--serif); font-size: var(--text-sm);
  color: var(--ink-faint); transform: rotate(-3deg);
}

/* ==========================================================================
   Section rhythm
   ========================================================================== */

section { padding: var(--space-24) 0; position: relative; }
section.alt { background: var(--paper-alt); }
section.tight { padding: var(--space-20) 0; }

.section-head { max-width: 640px; margin-bottom: var(--space-16); }
.section-head .kicker {
  font-size: var(--text-xs); letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: var(--space-4); display: block;
}
.section-head h2 {
  font-size: var(--text-3xl); letter-spacing: -0.015em; line-height: 1.15;
  font-variation-settings: "opsz" 60;
}
.section-head p { margin-top: var(--space-4); color: var(--ink-soft); font-size: var(--text-md); max-width: 34em; }

/* stitched divider — the recurring "bound linen" motif marking every
   section boundary; each instance draws a slightly different curve so the
   thread never feels like a copy-pasted rule. */
.stitch-divider { display: block; width: 100%; height: 26px; overflow: hidden; }
.stitch-divider path { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 7 7; opacity: .22; fill: none; }
.stitch-divider circle { fill: var(--accent); opacity: .55; }

/* ==========================================================================
   Steps (dedicated illustrated vignettes, not generic icons)
   ========================================================================== */

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-10); }
.step { position: relative; }
.step .num {
  font-family: var(--serif); font-size: var(--text-sm);
  color: var(--ink-faint); margin-bottom: var(--space-5); letter-spacing: .02em;
}
.step .vignette { width: 100%; max-width: 220px; height: auto; margin-bottom: var(--space-6); }
.step h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); letter-spacing: -0.008em; }
.step p { color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.6; max-width: 26em; }

.step-thread {
  position: absolute; top: 144px; left: calc(100% + 6px); width: calc(var(--space-10) - 12px);
  height: 8px; display: none;
}
/* must match (not just approximate) the 980px breakpoint where .steps
   itself collapses to a single column — below that, "100% + 6px" measures
   against a full-width stacked step, not a column, and bleeds off-screen. */
@media (min-width: 981px) {
  .step-thread { display: block; }
}

/* ==========================================================================
   Modules
   ========================================================================== */

.modules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.module-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-8) var(--space-6); box-shadow: var(--shadow-card);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.module-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.module-card .module-icon {
  width: 56px; height: 56px; margin-bottom: var(--space-5); object-fit: contain; object-position: left bottom;
  transition: transform .35s var(--ease-out); transform-origin: left bottom;
}
.module-card:hover .module-icon { transform: scale(1.08); }
.module-card h3 { font-size: 1.125rem; margin-bottom: var(--space-2); letter-spacing: -0.005em; }
.module-card p { color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.55; max-width: 24em; }

/* ==========================================================================
   Pricing
   ========================================================================== */

.pricing-lede { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-10); margin-bottom: var(--space-16); }
.pricing-lede .growth-illustration { width: 210px; height: auto; flex-shrink: 0; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); align-items: stretch; }
.price-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-7); display: flex; flex-direction: column;
  box-shadow: var(--shadow-card); transition: box-shadow .35s var(--ease-out), transform .35s var(--ease-out);
}
.price-card:hover { transform: translateY(-3px) scale(1.008); box-shadow: var(--shadow-card-hover); }
.price-card.featured { border: 1.5px solid var(--ink); position: relative; }
.price-card.featured::before {
  content: "Le plus choisi"; position: absolute; top: -13px; left: var(--space-7);
  background: var(--ink); color: var(--paper); font-size: var(--text-micro); font-weight: 600;
  padding: 5px 12px; border-radius: 999px; letter-spacing: .04em;
}
.price-card .tier-name { font-family: var(--serif); font-size: var(--text-2xl); margin-bottom: var(--space-1); font-variation-settings: "opsz" 40; }
.price-card .tier-sub { color: var(--ink-soft); font-size: var(--text-sm); margin-bottom: var(--space-6); min-height: 3.3em; }
.price-card .tier-price {
  font-size: var(--text-sm); color: var(--ink-faint); margin-bottom: var(--space-6);
  font-weight: 600; font-family: var(--serif); display: flex; align-items: center; gap: var(--space-2);
}
.price-card .tier-price::before { content: ""; width: 14px; height: 1.5px; background: var(--line); display: inline-block; }
.price-card ul { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; margin-bottom: var(--space-7); }
.price-card li { font-size: var(--text-sm); color: var(--ink-soft); padding-left: var(--space-6); position: relative; }
.price-card li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 11px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* ==========================================================================
   Prospection
   ========================================================================== */

.prospection { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); gap: var(--space-16); align-items: center; }
.prospection .icon-big { width: 100%; max-width: 360px; }
.tag-addon {
  display: inline-block; font-size: var(--text-xs); font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px; margin-bottom: var(--space-5);
}
.prospection h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; margin-bottom: var(--space-4); font-variation-settings: "opsz" 60; }
.prospection .lead { color: var(--ink-soft); font-size: var(--text-md); line-height: 1.6; max-width: 30em; }

/* ==========================================================================
   FAQ — native <details>/<summary>: no JS required, keyboard/focus behaviour
   comes free, and :focus-visible already covers it via the global rule.
   ========================================================================== */

.faq-list { max-width: 46em; display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }

.faq-item summary {
  list-style: none; cursor: pointer; position: relative;
  padding: var(--space-6) var(--space-10) var(--space-6) 0;
  font-family: var(--serif); font-size: var(--text-lg); font-weight: 600;
  letter-spacing: -0.006em; color: var(--ink);
  transition: color .2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: var(--space-2); top: 50%;
  width: 11px; height: 11px; transform: translateY(-50%) rotate(45deg);
  border-right: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent);
  transition: transform .3s var(--ease-out);
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq-item summary:hover { color: var(--accent-ink); }

.faq-item p {
  margin: 0 0 var(--space-6); padding-right: var(--space-10);
  color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.65; max-width: 42em;
}

/* ==========================================================================
   CTA
   ========================================================================== */

.cta-section { text-align: center; }
.cta-box { max-width: 640px; margin: 0 auto; position: relative; }
.cta-box .cta-illustration { width: 160px; margin: 0 auto var(--space-6); }
.cta-box h2 { font-size: var(--text-3xl); letter-spacing: -0.015em; margin-bottom: var(--space-4); font-variation-settings: "opsz" 60; }
.cta-box p.lead { color: var(--ink-soft); font-size: var(--text-md); margin-bottom: var(--space-8); }

/* ==========================================================================
   Footer
   ========================================================================== */

footer { border-top: 1px solid var(--line-soft); padding: var(--space-12) 0 var(--space-8); }
.foot-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--space-5); }
.foot-logo { font-family: var(--serif); font-size: var(--text-lg); }
.foot-note { font-size: var(--text-micro); color: var(--ink-faint); max-width: 26em; line-height: 1.6; margin-top: var(--space-2); }
.foot-links { display: flex; gap: var(--space-6); font-size: var(--text-sm); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  /* minmax(0, 1fr), not bare 1fr — a bare fr track's implicit minimum is
     `auto`, which floors it at the min-content width of whatever it
     contains; if any child's intrinsic min-content (long copy, a fixed-size
     SVG) exceeds the viewport, the whole grid blows out past the wrap and
     the page gains horizontal scroll. minmax(0, 1fr) lets the track
     actually shrink to the container. */
  .hero-grid, .prospection { grid-template-columns: minmax(0, 1fr); }
  .hero-illustration { order: -1; max-width: 420px; margin: 0 auto; }
  .prospection .icon-big { max-width: 260px; margin: 0 auto; }
  .steps, .modules-grid, .pricing-grid { grid-template-columns: minmax(0, 1fr); }
  .pricing-lede { grid-template-columns: minmax(0, 1fr); }
  .pricing-lede .growth-illustration { display: none; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 2.5rem; }
  .section-head h2 { font-size: 1.75rem; }
  .nav { padding: var(--space-4) var(--space-5); }
  .navlinks { display: none; }
  .wrap { padding: 0 var(--space-5); }
  .hero { padding: var(--space-16) 0 var(--space-10); }
  section { padding: var(--space-16) 0; }
  .price-card.featured::before { left: var(--space-5); }
}
