/* TapsAI — base : reset, typographie, mise en page */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* Texture de grain très légère */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .09  0 0 0 0 .09  0 0 0 0 .08  0 0 0 .055 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
body > *:not(dialog):not(.site-header):not(.skip) { position: relative; z-index: 1; }
.site-header { z-index: 50; }

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
em { font-style: italic; }
kbd { font-family: var(--font-mono); font-size: .72rem; }
::selection { background: var(--accent); color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible { outline-color: var(--bg); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; transition: top var(--t-fast); }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }
.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Display */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: .96; }
.display em, .sh__title em, .phead__title em, .cta-band__title em { color: var(--accent-ink); font-style: italic; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }

/* Eyebrow */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow__n { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding-inline: 6px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); background: var(--surface); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.eyebrow:has(.eyebrow__n)::before { display: none; }

/* Section head */
.sh { max-width: 62ch; display: grid; gap: 18px; }
.sh__title { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: .98; letter-spacing: -.02em; text-wrap: balance; }
.sh__lead { font-size: var(--fs-md); color: var(--text-2); max-width: 54ch; text-wrap: pretty; }
.sh--center { margin-inline: auto; text-align: center; justify-items: center; }

/* Page head (pages internes) */
.phead { padding-top: calc(var(--header-h) + clamp(40px, 7vw, 96px)); padding-bottom: clamp(40px, 6vw, 80px); position: relative; overflow: hidden; }
.phead__grid { display: grid; gap: clamp(32px, 5vw, 72px); grid-template-columns: minmax(0, 1fr); align-items: end; }
.phead__main { min-width: 0; }
.phead__title { font-family: var(--font-display); font-size: var(--fs-3xl); line-height: .92; letter-spacing: -.025em; margin-block: 22px 26px; text-wrap: balance; max-width: min(15ch, 100%); overflow-wrap: anywhere; }
.phead__lead { font-size: var(--fs-lg); color: var(--text-2); max-width: 46ch; line-height: 1.5; text-wrap: pretty; }
.phead__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.phead__aside { min-width: 0; display: grid; justify-items: start; gap: 18px; }
.phead__visual { width: min(100%, 520px); margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-2); }
.phead__visual img { display: block; width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; }
@media (min-width: 960px) {
  .phead__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
  .phead__aside { justify-items: end; }
}
@media (max-width: 520px) {
  .phead {
    padding-top: calc(var(--header-h) + 28px);
  }
  .phead__title {
    font-size: clamp(2.35rem, 14vw, 3.25rem);
    line-height: 0.96;
    letter-spacing: 0;
    max-width: 100%;
  }
  .phead__lead {
    font-size: 1.12rem;
  }
  .phead__actions {
    align-items: stretch;
  }
  .phead__actions .btn {
    max-width: 100%;
  }
}

.stack > * + * { margin-top: var(--stack, 1em); }

/* Révélation au scroll */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Lien utilitaire à champ coloré */
.to-fill { background: var(--accent-soft); color: var(--accent-ink); padding: 1px 8px; border-radius: 6px; font-size: .9em; font-family: var(--font-mono); border: 1px dashed var(--accent); }

@media (max-width: 899px) { .hide-md { display: none !important; } }
@media (max-width: 599px) { .hide-sm { display: none !important; } }
@media (min-width: 900px) { .show-md-only { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
