/*
  Charte graphique — Faire-part Lucie & Valentin
  Palette « sauge & dorures » (eucalyptus / blush neutre) et typographie
  option 1b : Parisienne (script) + EB Garamond (accents) + Jost (texte).
  Reprise fidèle de la maquette Claude Design.
*/

:root {
    --sauge: #9caa8f;        /* vert sauge (accent moyen)  */
    --sauge-fonce: #4f5d43;  /* vert profond (titres)      */
    --creme: #f4efe4;        /* fond crème                 */
    --sable: #c9a877;        /* doré doux (bordures)       */
    --or: #b08d3e;           /* doré soutenu (ornements)   */
    --texte: #2e2a22;
    --texte-clair: #8a8172;
    --blanc: #ffffff;
    --erreur: #b5504f;

    --font-script: 'Parisienne', cursive;
    --font-serif: 'EB Garamond', serif;
    --font-sans: 'Jost', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--texte);
    background: var(--creme);
    -webkit-font-smoothing: antialiased;
}

/* ---------- ORNEMENT DORÉ (ligne · point · ligne) ---------- */

.ornement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0.6rem 0;
}

.ornement__ligne {
    height: 1px;
    width: 28px;
    background: var(--or);
    opacity: 0.8;
}

.ornement__point {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--or);
}

/* ---------- ÉCRAN D'ACCUEIL / CACHET DE CIRE ---------- */

.accueil {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 2rem;
    text-align: center;
    background: var(--creme);
    transition: opacity 0.6s ease 0.1s;
    perspective: 1400px;
}

.accueil.accueil--fermeture {
    opacity: 0;
    pointer-events: none;
}

/* Rabat d'enveloppe : un triangle plein (couleur du fond, invisible au repos)
   + deux traits dont l'ombre portée (feDropShadow) dessine les plis, en
   pointe sur le cachet. Le remplissage n'a pas de filtre (pas d'arête
   d'ombre en haut) ; les deux lignes ouvertes portent l'ombre sans jamais
   déborder au-dessus de « Lucie & Valentin ». Coordonnées posées en px
   réels par main.js.
   L'ombre (filter: drop-shadow) et la rotation 3D sont volontairement sur
   deux éléments séparés : certains Chrome mobiles ne rendent pas un filtre
   SVG sur un élément qui a aussi un transform 3D / backface-visibility
   (mis dans son propre calque de composition) — l'ombre disparaît
   silencieusement. Le calque d'ombre reste plat et s'efface en fondu ;
   seul le triangle plein (sans filtre) pivote.
   Le drop-shadow est posé sur le div HTML .enveloppe-rabat-ombre et non sur
   les <line> : WebKit (Safari + Chrome iOS) n'applique pas les filtres CSS
   aux éléments enfants d'un SVG — l'ombre disparaissait sur iPhone. */
.enveloppe-rabat-ombre,
.enveloppe-rabat {
    position: absolute;
    top: var(--rabat-haut, 20vh);
    left: 0;
    width: 100%;
    height: var(--rabat-hauteur, 25vh);
    pointer-events: none;
    z-index: 0;
}

.enveloppe-rabat-ombre {
    filter: drop-shadow(0 3px 4px rgba(46, 42, 34, 0.16));
    transition: opacity 0.15s ease;
}

.accueil--ouverture .enveloppe-rabat-ombre {
    opacity: 0;
}

.enveloppe-rabat {
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 0.9s cubic-bezier(.6, 0, .35, 1);
    backface-visibility: hidden;
}

.enveloppe-rabat--ouvert {
    transform: rotateX(-160deg);
}

.enveloppe-rabat__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.enveloppe-rabat__forme {
    fill: var(--creme);
}

.enveloppe-rabat__ligne {
    stroke: var(--creme);
    stroke-width: 3px;
    stroke-linecap: butt;
}

.accueil__foyer,
.accueil__accroche,
.accueil__prenoms,
.accueil__date,
.ornement,
.cachet-wrap,
.accueil__consigne,
.accueil__mention {
    position: relative;
    z-index: 1;
}

.accueil__foyer {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--sauge-fonce);
    margin: 0;
    transition: opacity 0.15s ease;
}

.accueil__accroche {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    color: var(--texte-clair);
    margin: 0;
    transition: opacity 0.15s ease;
}

.accueil__prenoms {
    font-family: var(--font-script);
    font-size: clamp(2.75rem, 11vw, 4.25rem);
    font-weight: 400;
    color: var(--sauge-fonce);
    margin: 0;
    transition: opacity 0.15s ease;
}

.accueil__date {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--or);
    margin: 0.1rem 0 0;
    transition: opacity 0.15s ease;
}

.ornement {
    transition: opacity 0.15s ease;
}

.accueil--ouverture .accueil__foyer,
.accueil--ouverture .accueil__accroche,
.accueil--ouverture .accueil__prenoms,
.accueil--ouverture .accueil__date,
.accueil--ouverture .ornement {
    opacity: 0;
}

.cachet-wrap {
    width: clamp(120px, 32vw, 150px);
    height: clamp(120px, 32vw, 150px);
    margin: 0.4rem 0;
}

.cachet {
    position: relative;
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.cachet:active { transform: scale(0.93); }
.cachet:hover { transform: scale(1.04); }
.cachet.cachet--ouvert { pointer-events: none; }

.cachet__svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transition: transform 0.9s cubic-bezier(.6, 0, .35, 1), opacity 0.35s ease;
}

/* Ouverture : le cachet se soulève tout droit vers le haut, en même temps
   que le rabat, plutôt que de se casser en deux. */
.cachet--ouvert .cachet__svg {
    transform: translateY(-70vh);
    opacity: 0;
}

.accueil__consigne {
    font-size: 0.85rem;
    color: var(--texte-clair);
    letter-spacing: 0.03em;
    margin: 0;
    transition: opacity 0.15s ease;
}

.accueil__mention {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--texte-clair);
    margin: 0;
    transition: opacity 0.15s ease;
}

.accueil--ouverture .accueil__consigne,
.accueil--ouverture .accueil__mention {
    opacity: 0;
}

/* ---------- CONTENU ---------- */

.contenu {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: var(--creme);
}

.toggle-musique {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 10;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--sauge);
    color: var(--creme);
    font-size: 1.1rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    opacity: 1;
    transform: scale(1.05);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toggle-musique:hover { transform: scale(1.12); }

.toggle-musique.toggle-musique--coupee {
    opacity: 0.55;
    transform: scale(1);
}

/* ---------- BLOCS + RÉVÉLATION AU SCROLL ---------- */

.bloc {
    padding: 3.25rem 1.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(201, 168, 119, 0.33);
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.reveal--visible {
    opacity: 1;
    transform: none;
}

.bloc__label {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--texte-clair);
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.bloc__titre {
    margin: 0 0 0.5rem;
    color: var(--sauge-fonce);
}

.bloc__titre--script {
    font-family: var(--font-script);
    font-size: clamp(2rem, 8vw, 2.6rem);
    font-weight: 400;
}

.bloc__sous-titre {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--texte-clair);
    margin: 0 0 1.5rem;
}

.bloc__texte {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--texte);
}

.bloc__note {
    font-size: 0.8rem;
    color: var(--texte-clair);
    margin-top: 1.25rem;
}

.bloc__note--type {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--sauge-fonce);
    margin: 0 0 1.5rem;
}

.bloc__lien-maps {
    display: inline-block;
    margin-top: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--or);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.date-bloc {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--texte);
}

.date-bloc__sep { color: var(--sauge); }

/* ---------- PLACEHOLDER FLORAL (avant photos définitives) ---------- */

.floral {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--or);
    background: repeating-linear-gradient(135deg,
        rgba(156, 170, 143, 0.47) 0px, rgba(156, 170, 143, 0.47) 7px,
        rgba(176, 141, 62, 0.33) 7px, rgba(176, 141, 62, 0.33) 12px,
        var(--creme) 12px, var(--creme) 20px);
}

.floral--rect {
    width: 100%;
    height: 150px;
    border-radius: 14px;
    margin: 1.25rem 0;
}

.lieu-photo {
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center 35%;
    border-radius: 14px;
    margin: 1.25rem 0;
    display: block;
    box-shadow: 0 10px 24px -8px rgba(46, 42, 34, 0.35);
    outline: 1px solid var(--or);
    outline-offset: -1px;
}

.floral span {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    color: var(--sauge-fonce);
    text-align: center;
    line-height: 1.3;
    padding: 0 6px;
}

/* ---------- PROGRAMME ---------- */

.programme {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.programme__ligne {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--texte);
    border-bottom: 1px dashed #d8d2c2;
    padding-bottom: 0.5rem;
}

.programme__ligne:last-child { border-bottom: none; }
.programme__ligne[hidden] { display: none; }
.programme__heure { color: var(--texte-clair); }

/* ---------- FORMULAIRE RSVP ---------- */

.form-rsvp__foyer {
    text-align: center;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--sauge-fonce);
    margin: 0.5rem 0 1.25rem;
}

.form-rsvp {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    text-align: left;
    margin-top: 0.5rem;
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.champ--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
}

.champ__label { color: var(--texte); }

.champ__erreur {
    color: var(--erreur);
    font-size: 0.8rem;
}

.champ input[type="number"],
.champ input[type="text"],
.champ textarea {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #d8d2c2;
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
}

.champ input:focus,
.champ textarea:focus {
    outline: none;
    border-color: var(--sauge);
}

.champ input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sauge);
}

.bouton-envoyer {
    margin-top: 0.5rem;
    padding: 0.95rem;
    border: none;
    border-radius: 999px;
    background: var(--sauge);
    color: var(--creme);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.bouton-envoyer:hover { background: var(--sauge-fonce); }
.bouton-envoyer:active { transform: scale(0.98); }

.bouton-envoyer:disabled {
    background: var(--sable);
    cursor: default;
}

.rsvp-merci {
    text-align: center;
    padding: 1.5rem 0;
}

.rsvp-merci p {
    font-size: 1rem;
    color: var(--texte);
}

.lien-texte {
    margin-top: 0.75rem;
    background: none;
    border: none;
    text-decoration: underline;
    color: var(--texte-clair);
    font-size: 0.85rem;
    cursor: pointer;
}

/* ---------- FOOTER ---------- */

.footer {
    padding: 3.5rem 1.75rem 4rem;
    text-align: center;
    background: linear-gradient(180deg, var(--sauge), var(--sauge-fonce));
    color: var(--creme);
    border-top: 2px solid var(--or);
    border-bottom: none;
}

.footer__monogramme {
    font-family: var(--font-script);
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

.footer__prenoms {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin: 0;
}

.footer__date {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0.3rem 0 0;
}

.footer__mot {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .accueil { transition: none; }
}
