/* Le baptême de Mathias · design "Papier Antemoro".
   Luxury stationery: a card printed on Antemoro paper (the Malagasy
   handmade paper with pressed flowers), one typeface (Garamond), a
   powder-blue envelope, and an edge-to-edge photograph.
   Mobile first; the desktop layout starts at 900px. */

@font-face {
  font-family: "EB Garamond";
  src: url(assets/fonts/eb-garamond-roman-latin.woff2) format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url(assets/fonts/eb-garamond-italic-latin.woff2) format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --blanc: #FCFBF8;
  --papier: #F4EFE5;
  --brume: #CBD9E5;
  --brume-pale: #EAF0F5;
  --bleu: #526A82;
  --encre: #2A2E33;
  --gris: #5E6266;
  --filet: rgba(42, 46, 51, .18);
  --trait: #8C8A84; /* field underline, 3:1 against the page */
  --erreur: #9A3B2E;

  --serif: "EB Garamond", "Garamond", "Iowan Old Style", Georgia, serif;
  --g: clamp(20px, 6vw, 72px);
  color-scheme: only light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--blanc); color: var(--encre); font: 400 1.18rem/1.6 var(--serif); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 1px solid var(--bleu); outline-offset: 4px; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10; text-decoration: none;
  background: var(--encre); color: var(--blanc); padding: .6rem 1rem;
}
.skip:focus { top: calc(1rem + env(safe-area-inset-top)); }
.caps { font: 500 .78rem/1.4 var(--serif); letter-spacing: .32em; text-transform: uppercase; }
.mono {
  width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(82, 106, 130, .55);
  border: 1px solid color-mix(in srgb, var(--bleu) 55%, transparent);
  outline: 1px solid rgba(82, 106, 130, .25);
  outline: 1px solid color-mix(in srgb, var(--bleu) 25%, transparent); outline-offset: 3px;
  font: italic 400 2.2rem/1 var(--serif); color: var(--bleu); padding-top: .15rem;
}
.filet { display: block; width: 3rem; height: 1px; background: var(--encre); opacity: .45; margin: 1.8rem auto; }

/* ---------- Hero: the card ---------- */
.hero {
  position: relative; display: grid; min-height: 100vh; min-height: 100svh;
  padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
}
.enveloppe { display: none; }
.carte {
  position: relative; display: grid; align-content: center; justify-items: center; text-align: center;
  background: url(assets/img/antemoro.svg) center / cover, var(--papier);
  padding: 3rem 1.6rem 4rem;
  box-shadow: 0 1px 2px rgba(42, 46, 51, .06), 0 18px 40px -26px rgba(42, 46, 51, .35);
}
.carte::after { content: ""; position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px; border: 1px solid rgba(82, 106, 130, .3); pointer-events: none; }
.carte .caps { color: var(--bleu); }
.carte .accroche { margin: 2.2rem 0 1.4rem; }
.carte h1 .pre { display: block; font-style: italic; font-size: 1.35rem; }
.carte h1 .nom { display: block; font-size: 4.2rem; font-size: clamp(3.6rem, 18vw, 6.4rem); line-height: 1; font-style: italic; letter-spacing: -.01em; margin-top: .2rem; }
.carte .date { margin-top: .4rem; font-size: 1.8rem; font-size: clamp(1.6rem, 6.8vw, 2.1rem); line-height: 1.2; }
.carte .dans { margin-top: 1.6rem; font-style: italic; color: var(--bleu); }
.descendre {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 1;
  min-width: 44px; min-height: 44px; display: grid; place-items: center;
  color: var(--bleu); text-decoration: none; font-size: 1.4rem; line-height: 1;
}

.photo {
  padding-top: 5rem;
}

.photo figure {
  margin: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;

  background: var(--brume-pale);
}

.photo figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem var(--g) 0;
  color: var(--bleu);
}

.photo .mot {
  margin: 3.4rem auto 0;
  padding-inline: var(--g);
  max-width: 34rem;
  text-align: center;
  font: italic 400 clamp(1.55rem, 6.2vw, 2.1rem)/1.35 var(--serif);
  text-wrap: balance;
}

.photo .signature {
  margin-top: 1rem;
  text-align: center;
  color: var(--gris);
}
/* ---------- RSVP ---------- */
.rsvp { padding: 6rem var(--g) 0; }
.colonne { max-width: 31rem; margin: 0 auto; }
.rsvp .tete { text-align: center; }
.rsvp .tete .caps { color: var(--bleu); }
.rsvp h2 { margin-top: .9rem; font-style: italic; font-size: 2.6rem; font-size: clamp(2.4rem, 10vw, 3.3rem); line-height: 1.05; }
form, .merci { margin-top: 3rem; }
form { display: grid; gap: 2rem; }
.champ { display: grid; gap: .3rem; }
.champ > label, legend { font: 500 .78rem/1.4 var(--serif); letter-spacing: .3em; text-transform: uppercase; color: var(--bleu); }
.tel { display: flex; align-items: flex-end; gap: .9rem; }
.tel input { flex: 1; min-width: 0; }
.tel select {
  flex: none; max-width: 46%; font: 400 1.05rem/1.4 var(--serif); color: var(--encre);
  background: transparent; border: 0; border-bottom: 1px solid var(--trait); border-radius: 0;
  padding: .45rem 1.3rem .55rem 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--bleu) 50%), linear-gradient(-45deg, transparent 50%, var(--bleu) 50%);
  background-position: right .5rem center, right .2rem center; background-size: .3rem .3rem; background-repeat: no-repeat;
}
.tel select:focus { outline: none; border-bottom: 2px solid var(--bleu); padding-bottom: calc(.55rem - 1px); }
.facultatif { letter-spacing: .04em; text-transform: none; font-style: italic; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], textarea {
  width: 100%; font: 400 1.25rem/1.4 var(--serif); color: var(--encre); background: transparent;
  border: 0; border-bottom: 1px solid var(--trait); border-radius: 0; padding: .4rem 0 .5rem;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 4.5rem; }
input::placeholder, textarea::placeholder { color: #75736C; font-style: italic; opacity: 1; }
input:focus, textarea:focus { outline: none; border-bottom: 2px solid var(--bleu); padding-bottom: calc(.5rem - 1px); }
input[aria-invalid="true"] { border-bottom-color: var(--erreur); }
small { font-size: .95rem; font-style: italic; color: var(--gris); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: .7rem; }
legend { margin-bottom: .7rem; }
.option {
  position: relative; display: grid; grid-template-columns: 1.2rem 1fr; gap: 1rem; align-items: center; cursor: pointer;
  border: 1px solid var(--trait); padding: 1.05rem 1.2rem; font-size: 1.22rem; line-height: 1.3; font-style: italic;
  transition: background .25s, border-color .25s;
}
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.losange { width: .62rem; height: .62rem; border: 1px solid var(--encre); transform: rotate(45deg); justify-self: center; transition: background .2s; }
.option.coche { background: var(--brume-pale); border-color: var(--bleu); }
.option.coche .losange { background: var(--bleu); border-color: var(--bleu); }
.option:has(input:checked) { background: var(--brume-pale); border-color: var(--bleu); }
.option:has(input:checked) .losange { background: var(--bleu); border-color: var(--bleu); }
.option:has(input:focus-visible) { outline: 1px solid var(--bleu); outline-offset: 4px; }
.option input:focus-visible + .losange { outline: 2px solid var(--bleu); outline-offset: 4px; }
@media (forced-colors: active) {
  .option.coche { border: 3px solid Highlight; }
}
[data-when-yes] { display: grid; gap: 2rem; }
[data-when-yes]:not([hidden]) { animation: fond .5s ease both; }
@keyframes fond { from { opacity: 0; } }
.stepper { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--trait); width: fit-content; }
.stepper button { width: 2.75rem; height: 2.75rem; border: 0; background: none; color: var(--bleu); font: 400 1.5rem var(--serif); cursor: pointer; touch-action: manipulation; }
.stepper input {
  width: 2.6rem; align-self: stretch; text-align: center; border: 0; padding: .2rem 0; background: none;
  font: 400 1.5rem var(--serif); color: var(--encre); -moz-appearance: textfield; appearance: textfield;
}
.stepper input:focus-visible { outline: 1px solid var(--bleu); outline-offset: 2px; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.envoyer {
  min-height: 3.4rem; font: 500 .8rem/1 var(--serif); letter-spacing: .34em; text-transform: uppercase;
  background: transparent; color: var(--encre); border: 1px solid var(--encre); padding: 1.3rem 1rem; cursor: pointer;
  transition: background .25s, color .25s;
}
.envoyer:hover { background: var(--encre); color: var(--blanc); }
.envoyer[aria-disabled="true"] { cursor: progress; opacity: .6; }
.statut { padding: .9rem 1.1rem; font-size: 1.02rem; line-height: 1.45; background: #FBEDE8; color: var(--erreur); border: 1px solid rgba(154, 59, 46, .25); }
.rgpd { text-align: center; font-size: .98rem; font-style: italic; line-height: 1.5; color: var(--gris); }
.merci { text-align: center; padding: 2.6rem 1.4rem; border: 1px solid var(--filet); }
.merci:focus { outline: none; }
.merci .mono { margin: 0 auto 1.4rem; width: 3.4rem; height: 3.4rem; font-size: 1.8rem; }
.merci h3 { font-style: italic; font-size: 2.4rem; line-height: 1.1; }
.merci p { margin: .8rem auto 1.6rem; max-width: 28ch; }
.merci button {
  min-height: 44px; font: 500 .78rem var(--serif); letter-spacing: .3em; text-transform: uppercase;
  background: none; border: 0; border-bottom: 1px solid var(--filet); padding: .6rem 0 .3rem; color: var(--bleu); cursor: pointer;
}
.prenom { white-space: nowrap; }

/* ---------- À suivre ---------- */
.suite { padding: 6rem var(--g) 0; text-align: center; }
.suite .filet { margin: 0 auto 2.4rem; }
.suite h2 { font-style: italic; font-size: clamp(1.8rem, 7.4vw, 2.4rem); }
.suite p { margin: .8rem auto 0; max-width: 32ch; }
.agenda {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 2rem; min-height: 44px; padding: .6rem 1.2rem;
  font: 500 .78rem var(--serif); letter-spacing: .3em; text-transform: uppercase; color: var(--bleu); text-decoration: none;
  border: 1px solid rgba(82, 106, 130, .45);
}
.agenda-alt { margin-top: .6rem; font-style: italic; }
.agenda-alt a { display: inline-block; padding: .6rem .3rem; color: var(--bleu); text-underline-offset: .25em; }
.agenda:hover { border-color: var(--bleu); }
.agenda svg { width: 1.1rem; height: 1.1rem; }

/* ---------- Pied de page ---------- */
.pied { display: grid; justify-items: center; gap: 1rem; padding: 6rem var(--g) calc(3rem + env(safe-area-inset-bottom)); text-align: center; color: var(--bleu); }
.pied .mono { width: 3rem; height: 3rem; font-size: 1.5rem; }
.donnees { margin-top: 1rem; max-width: 34rem; font-size: 1rem; text-align: left; color: var(--encre); }
.donnees summary { cursor: pointer; width: fit-content; margin: 0 auto; padding: .7rem .4rem; color: var(--bleu); font-style: italic; text-decoration: underline; text-underline-offset: .3em; }
.donnees p { margin-top: .8rem; line-height: 1.55; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .hero { padding: 4rem var(--g); place-items: center; min-height: min(100svh, 980px); }
  .enveloppe {
    display: block; position: absolute; width: min(40rem, 62vw); aspect-ratio: 7 / 5; background: var(--brume);
    left: 50%; top: 58%; transform: translate(-50%, -50%) rotate(-4deg);
    box-shadow: 0 30px 60px -36px rgba(42, 46, 51, .45);
  }
  .enveloppe::before {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(to bottom right, transparent calc(50% - 1px), rgba(82, 106, 130, .25) 50%, transparent calc(50% + 1px)),
                linear-gradient(to bottom left, transparent calc(50% - 1px), rgba(82, 106, 130, .25) 50%, transparent calc(50% + 1px));
  }
  .carte { width: min(32rem, 100%); aspect-ratio: 5 / 7; padding: 3rem 2.6rem; }
  .descendre { bottom: .6rem; }
  .photo { padding-top: 7rem; }
  .photo img { width: min(100%, 900px); height: auto; margin: 0 auto; }
  .photo .mot { font-size: 2.4rem; max-width: 40rem; }
  .rsvp, .suite { padding-top: 8rem; }
}

/* Short landscape phones: let the card grow with its content. */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-when-yes]:not([hidden]) { animation: none; }
}
