:root {
    /* Palette premium et organique */
    --cream: #FCFBF9;
    --sage: #6B7A5D;
    --sage-light: #C0CBB4;
    --earth: #362E2E;
    --earth-muted: #6B6161;
    --gold: #C2A46D;
    --linen: #EFECE4;
    --text: #2A2525;
    --white: #FFFFFF;
    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cream);
    color: var(--text);
    font-family: 'Jost', sans-serif;
    line-height: 1.8;
    /* Plus lisible */
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Rendu plus net sur Mac/iOS */
}

h1,
h2,
h3,
h4 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    color: var(--earth);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5vw;
    /* S'adapte mieux aux écrans */
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
}

img {
    max-width: 100%;
    display: block;
}

.hidden {
    opacity: 0;
    visibility: hidden;
}

/* --- Envelope Intro --- */
.envelope-wrapper {
    position: fixed;
    inset: 0;
    background: var(--linen);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 1.2s cubic-bezier(0.85, 0, 0.15, 1), opacity 1s;
}

.envelope-wrapper.opened {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.envelope {
    position: relative;
    width: 360px;
    height: 250px;
    background: #FAFAFA;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08), 0 10px 20px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
}

.envelope:hover {
    transform: translateY(-12px) scale(1.02);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 180px solid transparent;
    border-right: 180px solid transparent;
    border-top: 135px solid #F3EFE7;
    z-index: 3;
    transform-origin: top;
    transition: transform 0.7s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.opened .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-front {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 180px solid transparent;
    border-right: 180px solid transparent;
    border-bottom: 125px solid #FAFAFA;
    z-index: 4;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #F8F8F8;
    z-index: 1;
}

.envelope-seal {
    position: absolute;
    top: 135px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--sage);
    border-radius: 50%;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-family: 'Cormorant Garamond', serif;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(107, 122, 93, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    transition: opacity 0.3s;
}

.opened .envelope-seal {
    opacity: 0;
}

/* Amélioration de la carte à l'intérieur */
.letter-preview {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    background: var(--white);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--linen);
    box-shadow: inset 0 0 0 8px var(--cream), 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.6s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.opened .letter-preview {
    transform: translateY(-80px);
}

.preview-names {
    display: block;
    font-family: 'Tangerine', cursive;
    font-size: 52px;
    color: var(--earth);
    margin-bottom: 5px;
}

.preview-date {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.25em;
    color: var(--sage);
}

.envelope-hint {
    margin-top: 50px;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--earth-muted);
    opacity: 0.7;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* --- Navigation --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: background 0.4s, padding 0.4s;
    mix-blend-mode: difference;
    color: var(--white);
}

.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    text-decoration: none;
    color: inherit;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    position: relative;
    padding-bottom: 5px;
    opacity: 0.9;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-rsvp {
    font-weight: 500 !important;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: zoomOut 25s infinite alternate ease-in-out;
}

@keyframes zoomOut {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1);
    }
}

/* Overlay assombri progressivement pour lisibilité optimale */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.2) 40%,
            rgba(0, 0, 0, 0.6) 100%);
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 1;
    max-width: 900px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    /* Lisibilité accrue */
}

.hero-eyebrow {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-title {
    font-size: clamp(70px, 12vw, 140px);
    line-height: 0.85;
    margin-bottom: 40px;
    color: var(--white);
}

.hero-title .name {
    display: block;
}

.hero-title .ampersand {
    font-family: 'Tangerine', cursive;
    font-size: 0.7em;
    display: block;
    margin: -15px 0;
    color: var(--gold);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-details {
    margin-bottom: 70px;
}

.hero-date {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-style: italic;
    margin-bottom: 10px;
}

.hero-location {
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.85;
}

/* Countdown Premium */
.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 80px;
}

.cd-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.cd-item span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    line-height: 1;
    margin-bottom: 5px;
}

.cd-item label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.8;
}

.cd-sep {
    font-size: 24px;
    opacity: 0.4;
    margin-top: -15px;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.scroll-hint span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0.7;
}

.scroll-line {
    width: 1px;
    height: 70px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), transparent);
}

/* --- Sections Générales --- */
.section {
    padding: 160px 0;
}

.section-title {
    font-size: 64px;
    text-align: center;
    margin-bottom: 60px;
}

.section-subtitle {
    text-align: center;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sage);
    margin-top: -60px;
    margin-bottom: 80px;
}

.bg-soft {
    background-color: var(--linen);
}

.dark {
    background-color: var(--earth);
    color: var(--linen);
}

.dark .section-title,
.dark h3,
.dark h4 {
    color: var(--linen);
}

/* --- Histoire Section --- */
.histoire-intro {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 100px;
    font-size: 20px;
    color: var(--earth-muted);
}

/* Ligne temporelle améliorée */
.timeline-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto 120px;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 48px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: var(--sage-light);
    opacity: 0.5;
}

.timeline-item {
    display: flex;
    gap: 60px;
    margin-bottom: 70px;
    align-items: flex-start;
    position: relative;
}

.tl-year {
    font-family: 'Cormorant Garamond', serif;
    font-size: 38px;
    color: var(--sage);
    min-width: 100px;
    background: var(--cream);
    padding: 10px 0;
    text-align: center;
    z-index: 2;
    font-style: italic;
}

.tl-content {
    padding-top: 15px;
}

.tl-content h3 {
    font-size: 28px;
    margin-bottom: 15px;
}

.tl-content p {
    font-size: 16px;
    color: var(--earth-muted);
}

/* Galerie style Fine-Art */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    gap: 24px;
}

.gallery-item {
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s;
    filter: grayscale(15%) sepia(10%);
    /* Effet très subtil vintage */
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: grayscale(0%) sepia(0%);
}

/* --- Programme --- */
.programme-list {
    max-width: 800px;
    margin: 0 auto 100px;
}

.prog-item {
    display: flex;
    gap: 60px;
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(239, 236, 228, 0.15);
    /* Couleur linen très transparente */
}

.prog-time {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-style: italic;
    color: var(--gold);
    min-width: 100px;
}

.prog-info h3 {
    font-size: 30px;
    margin-bottom: 10px;
}

.prog-venue {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    opacity: 0.6;
    color: var(--linen);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 80px;
}

.info-card {
    padding: 50px 40px;
    border: 1px solid rgba(239, 236, 228, 0.2);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.info-card h4 {
    font-size: 26px;
    margin-bottom: 20px;
    color: var(--gold);
}

.info-card p {
    color: rgba(239, 236, 228, 0.8);
}

/* --- Villes & Plages --- */
.villes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.v-card {
    padding: 50px 40px;
    background: var(--white);
    border: 1px solid var(--linen);
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.v-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(107, 122, 93, 0.08);
    /* Ombre douce verte */
    border-color: var(--sage-light);
}

.v-card h3 {
    font-size: 28px;
    margin-bottom: 15px;
}

.v-dist {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 25px;
}

.plages-slider {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 30px 20px 60px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Cache la scrollbar sur Firefox */
}

.plages-slider::-webkit-scrollbar {
    display: none;
    /* Cache la scrollbar sur Chrome/Safari */
}

.plage-item {
    flex: 0 0 380px;
    background: var(--white);
    padding: 60px 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
    scroll-snap-align: center;
    transition: transform 0.4s;
}

.plage-item:hover {
    transform: translateY(-5px);
}

.plage-item h3 {
    font-size: 32px;
}

.plage-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
}

.plage-tags span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 6px 16px;
    background: var(--linen);
    color: var(--earth);
    border-radius: 20px;
    /* Un peu de douceur */
}

/* --- RSVP Formulaire Premium --- */
.rsvp-box {
    background: var(--white);
    padding: 100px 80px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.04);
    text-align: center;
    margin-bottom: 80px;
    border: 1px solid var(--linen);
}

.rsvp-subtitle {
    color: var(--earth-muted);
    font-size: 18px;
    margin-top: -40px;
    margin-bottom: 50px;
}

.rsvp-form {
    display: grid;
    gap: 35px;
}

.form-group {
    position: relative;
    text-align: left;
}

/* Floating labels effect */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 0 10px 0;
    border: none;
    border-bottom: 1px solid var(--sage-light);
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: var(--earth);
    outline: none;
    transition: border-color 0.3s;
    resize: none;
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 0;
    font-size: 16px;
    color: var(--earth-muted);
    transition: 0.3s ease all;
    pointer-events: none;
}

/* Animation du label au focus ou si le champ est rempli */
.form-group input:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:focus~label,
.form-group textarea:not(:placeholder-shown)~label {
    top: -10px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sage);
}

.form-group select {
    color: var(--earth-muted);
}

.form-group select:focus {
    color: var(--earth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--sage);
}

.btn-rsvp {
    margin-top: 20px;
    padding: 22px 50px;
    background: var(--earth);
    color: var(--white);
    border: none;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-rsvp:hover {
    background: var(--sage);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(107, 122, 93, 0.2);
}

.contact-footer {
    text-align: center;
    color: var(--earth-muted);
}

.contact-footer p {
    font-size: 14px;
    letter-spacing: 0.1em;
}

.final-note {
    font-family: 'Tangerine', cursive;
    font-size: 46px;
    color: var(--sage);
    margin-top: 40px !important;
}

/* --- Footer --- */
.footer {
    padding: 120px 0 80px;
    background: var(--linen);
    text-align: center;
}

.footer-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    margin-bottom: 20px;
    color: var(--earth);
}

.footer p {
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--earth-muted);
}

/* --- Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.music-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--linen);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
}

.music-toggle.visible {
    opacity: 1;
    visibility: visible;
}

.music-toggle:hover {
    transform: scale(1.1);
    border-color: var(--sage);
}

.music-icon {
    font-size: 18px;
}

.music-toggle.playing .music-icon {
    animation: rotate 4s infinite linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Mobile Queries --- */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-wrapper::before {
        left: 38px;
    }
}

@media (max-width: 768px) {
    .nav-bar {
        padding: 25px 30px;
    }

    .nav-links {
        display: none;
    }

    .section {
        padding: 100px 0;
    }

    .section-title {
        font-size: 48px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 20px;
    }

    .timeline-wrapper::before {
        display: none;
    }

    .tl-year {
        background: transparent;
        text-align: left;
        padding: 0;
        margin-bottom: -10px;
    }

    .prog-item {
        flex-direction: column;
        gap: 15px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .info-card {
        padding: 40px 25px;
    }

    .rsvp-box {
        padding: 50px 30px;
    }

    .plage-item {
        flex: 0 0 280px;
        padding: 40px 25px;
    }
}