/* Marlène & Simon — papier, linogravure, azulejos peints */
/* Polices hébergées sur le site (Fontshare, licence libre) : Telma Black pour les titres, Clash Display pour le reste */
@font-face { font-family: 'Telma'; src: url('../fonts/Telma-Black.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/ClashDisplay-Variable.woff2') format('woff2'); font-weight: 200 700; font-style: normal; font-display: swap; }

:root {
  --blue: #051793;
  --ink: #051793;
  --cream: #fff;
  --paper: #fff;
  --yellow: #ffd413;
  --soft: #18a9fa;
  --err: #B3261E;
  --line: 1.5px;
  --display: 'Telma', Georgia, 'Times New Roman', serif;   /* titres : Telma Black */
  --script: var(--display);                                /* ancien nom */
  --sans: 'Clash Display', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans);   /* ancien nom, encore utilisé dans l'espace admin */
  --pixel: var(--sans);   /* ancien nom : plus de police pixel */
  --soft-shadow: 0 14px 40px rgba(11, 23, 102, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 112.5%; }   /* 18 px : tout le texte en Clash Display grandit de 12,5 % ; les titres Telma sont compensés ci-dessous */
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* grain de papier */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  opacity: 0; display: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .15  0 0 0 0 .45  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid rgba(232, 181, 46, .8); outline-offset: 2px; }
svg { display: block; }

/* petites étiquettes en capitales espacées */
.lbl { font: 600 .74rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .2em; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(32px + env(safe-area-inset-top)) 16px 48px;
  overflow: hidden;
  background: #E6DAC0;
}
@supports (height: 100lvh) {
  /* toute la hauteur, même quand la barre du navigateur est repliée ; la carte reste centrée sur la partie visible */
  .hero { min-height: 100lvh; padding-bottom: calc(48px + 100lvh - 100svh); }
}
#mosaic { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-card {
  position: relative;
  width: min(100%, 620px);
  transform-style: preserve-3d;
  transform: perspective(1800px) rotateY(0deg);
  transition: transform .95s cubic-bezier(.3, .7, .2, 1);
  animation: card-in .9s .5s cubic-bezier(.2, .9, .3, 1) backwards;
}
.hero-card.flipped { transform: perspective(1800px) rotateY(180deg); }
@keyframes card-in { from { opacity: 0; transform: perspective(1800px) translateY(18px); } to { opacity: 1; transform: perspective(1800px); } }

.card-face {
  position: relative;
  background: var(--paper);
  border: var(--line) solid var(--blue);
  border-radius: 3px;
  box-shadow: var(--soft-shadow);
  padding: clamp(28px, 5vw, 52px) clamp(20px, 4vw, 44px) clamp(30px, 5vw, 48px);
  text-align: center;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.card-face.card-front::before { border: 3px solid var(--yellow); }   /* le filet intérieur de la carte, en jaune et plus épais */
.card-face::before {            /* le filet intérieur, comme sur un faire-part */
  content: ''; position: absolute; inset: 11px;
  border: 1px solid rgba(5, 23, 147, .35); border-radius: 2px; pointer-events: none;
}
.card-back {
  position: absolute; inset: 0; transform: rotateY(180deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--yellow); color: var(--ink);
}
.card-back::before { border-color: rgba(5, 23, 147, .4); }
.card-back .ico { color: var(--blue); }
.card-back .tag { margin: 0; color: var(--blue); }
.card-back h2 { font: 400 clamp(1.69rem, 5.5vw, 2.49rem)/1.08 var(--display); margin: 0; max-width: 13ch; text-wrap: balance; }
.card-back p { margin: 0; }
.card-back .btn { margin-top: 12px; }
.hero-card.flipped .card-front { pointer-events: none; }
.hero-card:not(.flipped) .card-back { pointer-events: none; }
/* Chaque face est aussi masquée par « visibility », à mi-retournement : certains navigateurs (Safari) laissent
   transparaître les éléments superposés de la face cachée malgré backface-visibility. */
.card-front { visibility: visible; transition: visibility 0s linear .45s; }
.hero-card.flipped .card-front { visibility: hidden; }
.card-back { visibility: hidden; transition: visibility 0s linear .45s; }
.hero-card.flipped .card-back { visibility: visible; }

h1 {
  font: 400 clamp(3.02rem, 11.5vw, 6.2rem)/1.46 var(--display);   /* interligne large : le « & » jaune passe entre les deux prénoms */
  margin: 0; color: var(--blue); letter-spacing: -.01em;
}
h1 { position: relative; }
h1 .n1, h1 .n2 { position: relative; z-index: 1; display: block; }   /* les prénoms passent devant le « & » */
.amp {                      /* le « & » jaune, grand, au centre entre les deux prénoms, derrière les lettres */
  position: absolute; left: 50%; top: 50%; z-index: 0; transform: translate(-50%, -50%);
  font-size: 1.7em; line-height: 1; color: var(--yellow); pointer-events: none;
}
.date { margin: clamp(18px, 3vw, 28px) 0 4px; color: var(--ink); font-size: .84rem; letter-spacing: .32em; text-transform: uppercase; font-weight: 600; }
.where { margin: 0 0 24px; font-size: 1.02rem; color: var(--ink); opacity: .9; }

.btn {
  display: inline-block; cursor: pointer;
  font: 500 .98rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; text-align: center;
  background: var(--blue); color: var(--paper);
  border: var(--line) solid var(--blue);
  padding: 15px 28px; border-radius: 999px;
  box-shadow: 0 8px 18px rgba(5, 23, 147, .28);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px rgba(5, 23, 147, .32); }
.btn:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(5, 23, 147, .3); }
.btn.small { padding: 10px 18px; font-size: .9rem; box-shadow: 0 4px 12px rgba(5, 23, 147, .22); }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; }
.btn.ghost:hover { background: var(--blue); color: var(--paper); transform: none; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- frises d'azulejos ---------- */
.band { display: block; height: 84px; overflow: hidden; background: #E6DAC0; }
.band canvas { display: block; }

/* ---------- sections ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 72px 16px; }
.wrap.narrow { max-width: 720px; }
.section-title {
  font: 400 clamp(2.04rem, 6.5vw, 3.29rem)/1.05 var(--display); letter-spacing: -.01em;
  color: var(--blue); margin: 0 0 28px; text-align: center; text-wrap: balance;
}
.lead { text-wrap: balance; font-size: 1.08rem; margin: -6px auto 28px; max-width: 56ch; text-align: center; }

.cell {
  position: relative;
  background: var(--paper);
  border: var(--line) solid var(--blue);
  border-radius: 3px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--soft-shadow);
}
.cell::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(5, 23, 147, .28); border-radius: 2px; pointer-events: none; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 26px 8px; border-top: 1px solid rgba(5, 23, 147, .22);
}
.timeline li:first-child { border-top: 0; }
.timeline .ico { order: 0; color: var(--blue); opacity: .75; }
.timeline .when {            /* l'heure en Telma, soulignée d'un trait de surligneur jaune */
  order: 1; font: 400 1.75rem/1.1 var(--display); letter-spacing: -.01em; color: var(--blue);
  background: linear-gradient(transparent 62%, var(--yellow) 62%); padding: 0 8px; margin: 2px 0 4px;
}
.timeline li > div { order: 2; }
.timeline strong { font-weight: 600; font-size: 1.08rem; }

/* ---------- formulaire ---------- */
.card {
  position: relative;
  background: var(--paper); border: var(--line) solid var(--blue); border-radius: 3px;
  box-shadow: var(--soft-shadow); padding: clamp(22px, 4vw, 42px);
}
.card::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(5, 23, 147, .25); border-radius: 2px; pointer-events: none; }
.card > * { position: relative; }
.field { margin: 0 0 20px; }
label { font-weight: 600; display: block; margin-bottom: 7px; font-size: .96rem; }
legend { font: 400 1.42rem/1.15 var(--display); color: var(--blue); padding: 14px 0 0; margin-bottom: 26px; width: 100%; text-align: center; text-wrap: balance; }
legend .hl, .success h3 .hl { background: linear-gradient(transparent 62%, var(--yellow) 62%); padding: 0 8px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
label small, legend small, .check small { font-weight: 400; opacity: .7; }
fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=text], input[type=email], input[type=number], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: var(--line) solid var(--blue); border-radius: 3px;
  padding: 12px 14px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #8591c2; }
input:focus, textarea:focus { outline: 3px solid rgba(232, 181, 46, .6); outline-offset: 0; }
.invalid { border-color: var(--err) !important; }
.field-err { color: var(--err); font-size: .88rem; font-weight: 500; margin: 6px 0 0; }
.field-err:empty { display: none; }
.form-err { color: var(--err); font-weight: 600; margin: 14px 0 0; }
.form-err:empty { display: none; }
.hint { font-size: .92rem; margin: 0 0 14px; opacity: .85; }

.presence { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.presence legend { grid-column: 1 / -1; }
.presence .field-err { grid-column: 1 / -1; }
.choice { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: grid; place-items: center; text-align: center; min-height: 64px; padding: 12px;
  border: var(--line) solid var(--blue); border-radius: 3px; background: #fff; font-weight: 600;
  transition: background .15s, color .15s;
}
.choice.small span { min-height: 0; padding: 10px 14px; display: block; text-align: left; margin-bottom: 8px; font-weight: 500; }
.choice input:checked + span { background: var(--blue); color: var(--paper); }
.choice input:focus-visible + span { outline: 3px solid rgba(232, 181, 46, .8); outline-offset: 2px; }

/* moments : tuiles à toucher ; la tuile cochée passe en bleu, avec une pastille jaune */
.check { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: center; margin: 0 0 10px; font-weight: 400; cursor: pointer; padding: 14px 16px; border-radius: 6px; transition: background .2s, color .2s, border-color .2s; }
.check input { order: 0; }
.check > span { order: 1; }
.moments .check { grid-template-columns: 1fr 28px; }
.moments .check > span { order: 0; }
.moments .check input { order: 1; }
.moments .check { border: var(--line) solid rgba(5, 23, 147, .3); background: #fff; }
.moments .check:hover { border-color: var(--blue); }
.moments .check:has(input:checked) { border-color: var(--blue); background: var(--blue); color: var(--paper); }
.moments .check:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.check strong { font-weight: 600; }
.check small { display: block; }
.check input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border: var(--line) solid var(--blue); background: #fff; border-radius: 50%; cursor: pointer; position: relative; transition: background .2s, border-color .2s; }
.moments .check:has(input:checked) input { background: var(--yellow); border-color: var(--yellow); }
.check input:checked::after { content: ''; position: absolute; left: 8px; top: 3px; width: 6px; height: 11px; border: solid var(--blue); border-width: 0 3px 3px 0; transform: rotate(45deg); }
/* compteur : une pilule de la largeur du champ, rond bleu à chaque bout, chiffre centré */
.stepper { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 260px; height: 56px; padding: 0 6px; border: var(--line) solid var(--blue); border-radius: 999px; background: #fff; }
.stepper button { flex: none; width: 42px; height: 42px; border-radius: 50%; font: 500 1.4rem/1 var(--sans); color: var(--paper); background: var(--blue); border: 0; cursor: pointer; display: grid; place-items: center; padding: 0 0 2px; transition: background .15s, color .15s; }
.stepper button:hover { background: var(--yellow); color: var(--blue); }
.stepper button:active { transform: scale(.94); }
.stepper input { flex: 1; min-width: 0; width: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; font: 600 1.4rem/1 var(--sans); color: var(--blue); padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit { width: 100%; margin-top: 12px; font-size: 1.05rem; padding: 17px; }

.edit-banner { background: #FFF3BF; border: var(--line) solid var(--yellow); padding: 12px 14px; margin: 0 0 24px; font-weight: 500; border-radius: 3px; }

.success { text-align: center; }
.success .ico { color: var(--blue); display: grid; place-items: center; margin: 0 auto 6px; }
.success h3 { font: 400 clamp(1.78rem, 6vw, 2.49rem)/1.05 var(--display); color: var(--blue); margin: 0 0 10px; }
.linkbox { background: #fff; border: 1px dashed rgba(5, 23, 147, .5); padding: 16px; margin: 22px 0; text-align: left; border-radius: 3px; }
.linkbox p { margin: 0 0 10px; }
.linkrow { display: flex; gap: 10px; }
.linkrow input { font-size: .9rem; }
.dev-note { font-size: .82rem; opacity: .7; margin: 10px 0 0 !important; }

/* ---------- pied de page ---------- */
.footer { position: relative; background: var(--cream); text-align: center; padding: 44px 16px 72px; }
.footer .names { font: 400 1.87rem/1.1 var(--display); color: var(--blue); margin: 6px 0 4px; }
.footer .names .amp-f { color: var(--yellow); }
.footer .lbl { margin: 0 0 14px; color: var(--ink); }
.footer .small { font-size: .9rem; opacity: .75; margin: 0; }
.sunmini { display: grid; place-items: center; color: var(--yellow); }

/* ---------- message flottant ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 160;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px;
  font-weight: 500; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- apparition ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- mobile ---------- */
@media (max-width: 780px) {
  body { font-size: .97rem; }
  .wrap { padding: 52px 16px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .presence { grid-template-columns: 1fr; }
  .timeline .when { font-size: 1.5rem; }
  .card-back { padding: 18px 14px; gap: 4px; }
  .card-back .btn { margin-top: 6px; }
  .linkrow { flex-direction: column; }
  .band { height: 60px; }
  /* sur mobile : la carte blanche est plus petite, pour laisser la place aux azulejos */
  .hero { padding-top: calc(24px + env(safe-area-inset-top)); }
  .hero-card { width: min(86%, 344px); }
  .card-face { padding: 22px 16px 24px; }
  .card-face::before { inset: 7px; }
  h1 { font-size: clamp(2.3rem, 12.5vw, 3.2rem); }
  .date { font-size: .64rem; letter-spacing: .2em; margin: 14px 0 3px; }
  .where { font-size: .88rem; margin: 0 0 16px; }
  .hero .btn { padding: 12px 16px; font-size: .84rem; white-space: nowrap; }
  .card-back h2 { font-size: clamp(1.02rem, 5.6vw, 1.29rem); max-width: none; }
  .card-back .ico svg { width: 34px; height: 34px; }
  .card-back .btn { padding: 9px 16px; }
  .card-back p { font-size: .88rem; line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-card, .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .hero-card.flipped { transform: none; }
  .hero-card.flipped .card-front { display: none; }
  .hero-card.flipped .card-back { position: relative; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; }
}

/* ---------- intro M ♥ S ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#intro {
  display: none; position: fixed; left: 0; top: 0; z-index: 180; width: 100%; height: 100vh;
  background: #051793; touch-action: none; cursor: crosshair;
}
@supports (height: 100lvh) { #intro { height: 100lvh; } }
html.intro #intro, #intro.leaving { display: block; }
html.intro, html.intro body { overflow: hidden; }
html.intro { background: #051793; }
/* pendant l'intro, on ne voit rien d'autre que le mur */
html.intro body > :not(#intro):not(#intro-ui):not(#confetti) { visibility: hidden; }
/* hero verrouillé : on joue avec les carreaux, le scroll ne se débloque qu'au clic sur « Découvrir le programme » */
html.hero-lock, html.hero-lock body { overflow: hidden; overscroll-behavior: none; }
html.hero-lock .hero { touch-action: none; }
html.intro .hero-card { animation: none; opacity: 0; }

.intro-ui { position: fixed; inset: 0; z-index: 185; pointer-events: none; color: var(--blue); transition: opacity .5s; }
.intro-ui[hidden] { display: none; }
.intro-ui.out { opacity: 0; }
.intro-ui button { pointer-events: auto; }
.intro-hint {
  position: absolute; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); margin: 0; text-align: center;
  background: var(--paper); border: var(--line) solid var(--blue); border-radius: 999px;
  padding: 9px 18px; box-shadow: 0 8px 20px rgba(11, 23, 102, .22);
  opacity: 0; transition: opacity .6s;
}
.intro-hint.show { opacity: 1; }
.intro-skip {
  position: absolute; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); color: var(--blue); background: var(--paper);
  border: var(--line) solid var(--blue); border-radius: 999px; padding: 9px 16px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 23, 102, .2);
}
.intro-skip:hover { background: var(--blue); color: var(--paper); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 190; pointer-events: none; }

/* Telma Black ajoute des fioritures aux fins de mots : superbes sur le nom et les grands titres,
   brouillonnes sur les petits titres et les phrases. À placer APRÈS les « font: » (le raccourci les remet à zéro). */
legend, .success h3, .footer .names, .card-back h2 { font-feature-settings: 'calt' 0, 'liga' 0, 'dlig' 0; }

.section-title, .success h3 { text-wrap: balance; }
.success h3 { padding-top: 10px; margin-bottom: 22px; }
.consent { padding-left: 0; padding-right: 0; }
.consent input:checked { background: var(--yellow); }
.consent { align-items: start; } .consent input { margin-top: 4px; }
/* compteurs : libellé et pilule centrés dans leur colonne */
.field:has(.stepper) { text-align: center; }
.field:has(.stepper) .stepper { margin: 0 auto; }
/* plus d'air au-dessus des titres de la carte */
fieldset.moments, fieldset.lodging { margin-top: 52px; }
/* libellés : interligne serré, même quand la précision passe à la ligne */
label { line-height: 1.3; }
label small { line-height: 1.3; }
/* pas de zoom au double-tap sur les boutons + / − (iOS) */
button, .stepper, .choice, .check, a { touch-action: manipulation; }
.stepper button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
