/* ============================================================
   Yann Darwin — Newsletter · version SOFT & COSMIQUE
   landing minimale + formulaire + merci, sur fond canvas interactif
   ============================================================ */

/* Police de titre auto-hébergée + préchargée (voir <link rel="preload">
   dans index.html). font-display:block => le titre ne s'affiche jamais
   dans une fausse police : pas de flash au refresh. */
@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("fonts/anton-latin.woff2") format("woff2");
}

:root {
  --space: #05060a;
  --space-2: #0a0c14;
  --fg: #eef0f7;
  --fg-dim: #aab0c4;
  --fg-faint: #717691;
  --line: rgba(180, 190, 230, 0.14);
  --line-2: rgba(180, 190, 230, 0.26);
  --accent: #aab4ff;             /* tweakable */
  --title-font: "Instrument Serif", Georgia, serif;  /* tweakable */
  --body-font: "Archivo", system-ui, sans-serif;
  --mono-font: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--space); }
#root { min-height: 100vh; }

/* fond canvas fixe derrière tout */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; display: block;
  width: 100vw; height: 100vh;
}
/* vignette douce + voile pour la lisibilité du texte */
.bg-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(72% 58% at 50% 46%, rgba(5,6,10,0.62) 0%, rgba(5,6,10,0.30) 52%, transparent 80%),
    radial-gradient(135% 100% at 50% 50%, transparent 52%, rgba(5,6,10,0.62) 100%),
    linear-gradient(180deg, rgba(5,6,10,0.42) 0%, transparent 20%, transparent 66%, rgba(5,6,10,0.55) 100%);
}

.cosmos {
  position: relative; z-index: 2;
  min-height: 100vh; color: var(--fg);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 clamp(22px, 6vw, 40px); }

/* ---------- chrome minimal ---------- */
.topbar { position: relative; z-index: 3; }
.topbar-in {
  max-width: 1100px; margin: 0 auto; padding: 26px clamp(22px, 6vw, 44px);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); display: block; }
.brand span {
  font-family: var(--mono-font); font-size: 12.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--fg);
}
.topbar .sub {
  font-family: var(--mono-font); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--fg-faint);
}

/* ---------- primitives ---------- */
.eyebrow {
  font-family: var(--mono-font); font-size: 11.5px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--fg-dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 90%, transparent);
  animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.5;transform:scale(.85);} 50%{opacity:1;transform:scale(1.15);} }

.display {
  font-family: var(--title-font); font-weight: 400; line-height: 1.02;
  letter-spacing: -0.01em; color: var(--fg); margin: 0; text-wrap: balance;
}
.cosmos[data-tf="grotesk"] .display { font-weight: 600; letter-spacing: -.025em; }
.cosmos[data-tf="anton"] .display { font-family: "Anton", system-ui, sans-serif; text-transform: uppercase; letter-spacing: .005em; line-height: 1.04; }
.accent-text { color: var(--accent); }
.glow-text { text-shadow: 0 0 32px color-mix(in oklab, var(--accent) 55%, transparent); }

.lede { color: var(--fg-dim); line-height: 1.62; text-wrap: pretty; text-shadow: 0 1px 18px rgba(5,6,10,0.85); }
/* lisibilité : on détache le contenu du fond */
.hero .display, .hero .lede, .hero .eyebrow, .hero-meta, .hero .finehint { text-shadow: 0 2px 22px rgba(5,6,10,0.9); }
.finehint { font-family: var(--mono-font); font-size: 11.5px; letter-spacing: .04em; color: var(--fg-faint); }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 54px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--body-font); font-size: 15px; font-weight: 600; letter-spacing: .01em;
  color: #07070c; background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 60%, transparent),
              0 14px 40px -10px color-mix(in oklab, var(--accent) 70%, transparent);
  transition: transform .14s ease, box-shadow .2s ease, filter .2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 0 0 1px var(--accent), 0 22px 54px -10px color-mix(in oklab, var(--accent) 80%, transparent); }
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform .16s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-ghost {
  background: transparent; color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); color: #fff; filter: none; }
.linkish {
  background: none; border: 0; cursor: pointer; color: var(--fg-dim);
  font-family: var(--mono-font); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; padding: 0; transition: color .15s;
}
.linkish:hover { color: var(--fg); }

/* champ + glass */
.field {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 999px;
  background: rgba(12, 14, 22, 0.6); border: 1px solid var(--line-2);
  color: var(--fg); font-family: var(--body-font); font-size: 15px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  outline: none; transition: border-color .16s, box-shadow .16s;
}
.field::placeholder { color: var(--fg-faint); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
textarea.field { height: auto; min-height: 54px; padding: 14px 18px; border-radius: 18px; resize: vertical; }

/* ---------- HERO landing ---------- */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: clamp(40px, 9vh, 110px) 0 clamp(48px, 8vh, 90px);
  min-height: calc(100vh - 84px);
}
.hero .display { font-size: clamp(46px, 8.5vw, 104px); margin-top: 26px; }
.hero .lede { font-size: clamp(17px, 2.2vw, 21px); max-width: 540px; margin: 26px auto 0; }

/* mini formulaire inline du hero */
.hero-cta { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.hero-cta .finehint { margin-top: 10px; }
.inline-form { display: flex; gap: 10px; width: 100%; max-width: 460px; }
.inline-form .field { flex: 1; }
.inline-form .btn { flex: 0 0 auto; padding: 0 22px; }

.hero-meta { margin-top: 34px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.hero-meta .pellet { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-dim); font-size: 13px; }
.hero-meta .pellet svg { color: var(--accent); }

/* ---------- pages centrées (form + merci) ---------- */
.center-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(40px,8vh,90px) 0; }
.card {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: rgba(9, 11, 18, 0.82); border: 1px solid var(--line-2); border-radius: 24px;
  padding: clamp(28px, 5vw, 44px);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
}
.card .back { display: flex; width: fit-content; margin-bottom: 26px; }
.card h1 { font-family: var(--title-font); font-weight: 400; font-size: clamp(32px, 5vw, 46px); line-height: 1.3; margin: 14px 0 0; }
.cosmos[data-tf="grotesk"] .card h1 { font-weight: 600; letter-spacing: -.02em; }
.cosmos[data-tf="anton"] .card h1 { font-family: "Anton", sans-serif; text-transform: uppercase; }
.card .lede { font-size: 15.5px; margin: 16px 0 28px; }

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field-label { font-family: var(--mono-font); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 8px; display: block; }
.consent { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--fg-dim); cursor: pointer; }
.consent input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border: 1px solid var(--line-2); border-radius: 5px; background: rgba(12,14,22,.6); cursor: pointer; position: relative; transition: .15s; }
.consent input:checked { background: var(--accent); border-color: var(--accent); }
.consent input:checked::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #07070c; font-size: 12px; font-weight: 700; }
.consent a { color: var(--fg); }
.err { color: #ff8a9b; }

/* récap minimal sous le formulaire */
.mini-recap { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 11px; }
.mini-recap .row { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--fg-dim); }
.mini-recap .row .tick { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in oklab, var(--accent) 20%, transparent); color: var(--accent); display: grid; place-items: center; font-size: 10px; font-weight: 700; }

/* ---------- merci ---------- */
.thanks-badge {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 50%;
  background: var(--accent); color: #07070c; display: grid; place-items: center; font-size: 34px; font-weight: 700;
  box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent) 14%, transparent),
              0 0 60px color-mix(in oklab, var(--accent) 60%, transparent);
  animation: pop .55s cubic-bezier(.2,1.3,.5,1) both;
}
@keyframes pop { from { transform: scale(.5); } to { transform: scale(1); } }
.card.center { text-align: center; }
.card.center h1 { margin-top: 24px; }
.thanks-share { margin-top: 26px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.copy-inline { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 2px; cursor: pointer; color: var(--accent); vertical-align: middle; transition: color .15s, transform .12s; }
.copy-inline svg { width: 15px; height: 15px; display: block; }
.copy-inline:hover { color: var(--fg); transform: translateY(-1px); }

/* ---------- footer minimal ---------- */
.foot { position: relative; z-index: 3; padding: 26px 0 34px; }
.foot-in { max-width: 1100px; margin: 0 auto; padding: 0 clamp(22px, 6vw, 44px); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.social-row { display: flex; align-items: center; gap: 12px; }
.social-link { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(12,14,22,.5); color: var(--fg-dim); transition: .16s; text-decoration: none; }
.social-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social-link svg { width: 17px; height: 17px; }
.foot .finehint { max-width: 360px; font-size: clamp(10px, 2.4vw, 11.5px); line-height: 1.55; }

/* entrée d'écran */
.route-anim { animation: routein .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes routein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .route-anim, .thanks-badge, .eyebrow .dot { animation: none; } }

/* ============================================================
   RESPONSIVE / MOBILE  — les 3 écrans
   ============================================================ */

/* tablette */
@media (min-width: 701px) and (max-width: 1000px) {
  .topbar-in { padding: 20px clamp(18px, 5vw, 32px); }
  .hero { min-height: calc(100svh - 72px); padding: clamp(24px, 5vh, 60px) clamp(24px, 5vw, 40px) clamp(36px, 6vh, 70px); }
  .center-page { padding: clamp(40px,8vh,90px) clamp(24px, 5vw, 40px); }
  .foot-in { padding: 0 clamp(18px, 5vw, 32px); }
}

/* mobile / téléphone */
@media (max-width: 700px) {
  .wrap { padding: 0 30px; }

  /* formulaire inline du héro : champ + bouton empilés */
  .inline-form { flex-direction: column; }
  .inline-form .btn { width: 100%; }

  /* barre du haut : marque seule, on cache le sous-titre */
  .topbar-in { padding: 16px 30px; }
  .brand span { font-size: 11.5px; letter-spacing: .18em; }
  .topbar .sub { display: none; }

  /* hero : titre adapté, moins d'air, alignements */
  .hero { padding: 18px 30px 32px; min-height: calc(100svh - 64px); justify-content: center; }
  .hero .display { font-size: clamp(38px, 13vw, 58px); margin-top: 20px; line-height: 1.0; }
  .hero .lede { font-size: 16px; margin-top: 18px; }
  .eyebrow { font-size: 10.5px; letter-spacing: .18em; }

  /* CTA + champ : pleine largeur, bouton plus fin mais soigné */
  .hero-cta { margin-top: 28px; gap: 12px; }
  .inline-form { max-width: 270px; margin: 0 auto; }
  .btn { height: 48px; font-size: 14.5px; width: 100%; padding: 0 18px; }
  .inline-form .field, .form-stack .field { height: 50px; }

  /* stats : sur une ligne compacte, centrées */
  .hero-meta { margin-top: 26px; gap: 14px 18px; }
  .hero-meta .pellet { font-size: 12px; }

  /* cartes (inscription / merci) */
  .center-page { padding: 28px 30px; align-items: flex-start; }
  .card { border-radius: 20px; padding: 28px 26px; }
  .card h1 { font-size: clamp(28px, 8vw, 38px); }
  .card .lede { font-size: 15px; margin: 14px 0 24px; }
  .card .back { margin-bottom: 22px; }
  .form-stack { gap: 14px; }
  .field { height: 50px; font-size: 16px; }   /* 16px évite le zoom auto iOS */
  .mini-recap .row { font-size: 13px; }

  /* merci */
  .thanks-badge { width: 68px; height: 68px; font-size: 30px; }
  .thanks-share { flex-wrap: wrap; gap: 6px; font-size: 12px; }

  /* footer : empilé et centré */
  .foot { padding: 22px 0 30px; }
  .foot-in { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 0 30px; }
  .foot .finehint { max-width: none; font-size: clamp(9.5px, 3vw, 11px); order: 2; }
  .social-row { order: 1; gap: 14px; }
  .social-link { width: 42px; height: 42px; }   /* cible tactile ≥ 42px */
}

/* très petits écrans */
@media (max-width: 360px) {
  .hero .display { font-size: clamp(32px, 12vw, 46px); }
  .hero-meta { gap: 12px; }
  .hero-meta .pellet { font-size: 11.5px; }
}
