/* ============================================================
   Optigrapher — Page d'accueil (design moderne photographe)
   Thème « Bali » : sable clair, terracotta, coucher de soleil
   Typo : Fraunces (titres) + Outfit (texte)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300;1,9..144,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --bg: #faf5ec;
    --bg-soft: #f3ebdd;
    --card: #ffffff;
    --line: rgba(74, 52, 36, 0.14);
    --text: #322a22;
    --muted: rgba(50, 42, 34, 0.62);
    --accent: #e2654a;
    --accent-2: #f0965c;
    --teal: #1e9e96;
    --grad: linear-gradient(135deg, #e2654a, #f0965c);
    --shadow-warm: 0 14px 40px rgba(120, 75, 40, 0.14);
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Outfit', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-weight: 300;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

::selection { background: var(--accent); color: #fff; }

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4em clamp(1.2em, 4vw, 3.5em);
    transition: background 0.35s, backdrop-filter 0.35s, padding 0.35s, border-color 0.35s, box-shadow 0.35s;
    border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
    background: rgba(250, 245, 236, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--line);
    box-shadow: 0 6px 24px rgba(120, 75, 40, 0.08);
    padding-top: 0.9em;
    padding-bottom: 0.9em;
}

/* Au repos (sur le hero sombre) : texte clair ; scrollée : texte foncé */
.nav:not(.is-scrolled) .nav-logo,
.nav:not(.is-scrolled) .nav-links a:not(.btn) { color: #fdfaf4; }

.nav:not(.is-scrolled) .nav-toggle { color: #fdfaf4; }

.nav-logo {
    font-family: var(--serif);
    font-size: 1.35em;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--text);
    transition: color 0.35s;
}

.nav-logo em {
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2em;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.25s;
}

.nav-links a:not(.btn):hover { color: var(--accent); }

.btn {
    display: inline-block;
    padding: 0.9em 2em;
    font-family: var(--sans);
    font-size: 0.85em;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: var(--grad);
    border: none;
    border-radius: 3em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.25s, filter 0.2s;
    box-shadow: 0 8px 26px rgba(226, 101, 74, 0.35);
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 32px rgba(226, 101, 74, 0.45); }

.btn-outline {
    background: transparent;
    border: 1px solid currentColor;
    box-shadow: none;
    color: inherit;
}

.btn-outline:hover { color: var(--accent); border-color: var(--accent); box-shadow: none; }

/* Sur le hero sombre, le bouton outline reste lisible */
.hero .btn-outline { color: #fdfaf4; }
.hero .btn-outline:hover { color: #fff; border-color: #fff; }

.btn-small { padding: 0.65em 1.5em; font-size: 0.78em; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.6em;
    cursor: pointer;
    line-height: 1;
}

/* ---- Hero ---- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    padding: 0 clamp(1.2em, 5vw, 4.5em) clamp(3em, 8vh, 6em);
    isolation: isolate;
}

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

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(1.05);
    animation: heroZoom 14s ease-out forwards;
}

@keyframes heroZoom { to { transform: scale(1); } }

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(28, 20, 14, 0.62) 0%, rgba(28, 20, 14, 0.25) 55%, rgba(28, 20, 14, 0.05) 100%),
        linear-gradient(180deg, rgba(28, 20, 14, 0.45) 0%, transparent 40%, rgba(28, 20, 14, 0.75) 100%);
}

.hero-content { max-width: 900px; color: #fdfaf4; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.9em;
    font-size: 0.72em;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 1.8em;
}

.kicker::before {
    content: '';
    width: 2.6em;
    height: 1px;
    background: var(--accent-2);
}

.hero h1 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(2.6em, 7.5vw, 5.6em);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 0.5em;
    text-shadow: 0 2px 30px rgba(28, 20, 14, 0.4);
}

.hero h1 em {
    font-style: italic;
    background: linear-gradient(135deg, #ff9d76, #ffc46b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 520px;
    font-size: clamp(1em, 1.6vw, 1.15em);
    color: rgba(253, 250, 244, 0.88);
    margin-bottom: 2.4em;
    text-shadow: 0 1px 16px rgba(28, 20, 14, 0.5);
}

.hero-actions { display: flex; gap: 1.1em; flex-wrap: wrap; }

/* ---- Sections communes ---- */
/* Compensation de la barre de navigation fixe pour les ancres */
[id] { scroll-margin-top: 84px; }

.section {
    padding: clamp(4.5em, 10vw, 8em) clamp(1.2em, 5vw, 4.5em);
    max-width: 1300px;
    margin: 0 auto;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2em;
    margin-bottom: clamp(2.5em, 5vw, 4em);
}

.section-head h2 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.9em, 4.5vw, 3.2em);
    line-height: 1.1;
}

.section-head h2 em { font-style: italic; color: var(--accent); }

.section-head .side {
    max-width: 320px;
    color: var(--muted);
    font-size: 0.95em;
}

/* ---- Révélation au scroll ---- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---- Portfolio (catégories) ---- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4em;
}

.pcard {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    text-decoration: none;
    background: var(--bg-soft);
    box-shadow: var(--shadow-warm);
}

.pcard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s;
}

.pcard::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(28, 20, 14, 0.82) 100%);
}

.pcard:hover img { transform: scale(1.06); }

.pcard-label {
    position: absolute;
    left: 1.4em;
    right: 1.4em;
    bottom: 1.3em;
    z-index: 2;
    color: #fdfaf4;
}

.pcard-label .num {
    font-size: 0.72em;
    letter-spacing: 0.3em;
    color: #ffb38a;
    text-transform: uppercase;
}

.pcard-label h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.6em;
    margin: 0.15em 0 0.3em;
}

.pcard-label p {
    font-size: 0.85em;
    color: rgba(253, 250, 244, 0.75);
    line-height: 1.5;
}

/* ---- Galerie (pellicule) ---- */
.gallery-section { background: var(--bg-soft); }

.gallery-wrap { max-width: 1300px; margin: 0 auto; }

.slider-shell { position: relative; }

.gallery-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 0.4em 0.2em;
    -webkit-overflow-scrolling: touch;
}

.gallery-slider::-webkit-scrollbar { display: none; }

.gallery-slider img {
    flex: 0 0 auto;
    height: clamp(260px, 42vw, 420px);
    width: auto;
    max-width: 88vw;
    object-fit: contain;
    border-radius: 12px;
    scroll-snap-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-warm);
    transition: transform 0.35s, box-shadow 0.35s;
}

.gallery-slider img:hover { transform: scale(1.015); box-shadow: 0 20px 50px rgba(120, 75, 40, 0.22); }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 50px;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s, color 0.2s;
    box-shadow: 0 6px 18px rgba(120, 75, 40, 0.15);
}

.slider-shell:hover .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: var(--accent); color: #fff; border-color: transparent; }
.slider-arrow-prev { left: 14px; }
.slider-arrow-next { right: 14px; }

/* ---- Lightbox (sombre par nature : c'est une visionneuse) ---- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 14, 10, 0.92);
    backdrop-filter: blur(8px);
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90vw;
    max-height: 86vh;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 28px;
    font-size: 2.2em;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.7em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }

.lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85em;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.65);
}

/* ---- Témoignages ---- */
.testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4em;
}

.tcard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2em;
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    box-shadow: var(--shadow-warm);
    transition: transform 0.3s, border-color 0.3s;
}

.tcard:hover { transform: translateY(-5px); border-color: rgba(226, 101, 74, 0.45); }

.tcard .quote-mark {
    font-family: var(--serif);
    font-size: 3em;
    line-height: 0.6;
    color: var(--accent-2);
}

.tcard p { font-size: 0.95em; color: rgba(50, 42, 34, 0.85); flex: 1; }

.tcard footer {
    font-size: 0.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 500;
}

.testi-more { text-align: center; margin-top: 3em; }
.testi-more .btn-outline { color: var(--text); }
.testi-more .btn-outline:hover { color: var(--accent); }

/* ---- À propos ---- */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2em, 6vw, 5em);
    align-items: center;
}

.about-photo {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-warm);
}

.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%; }

.about-text h2 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.9em, 4vw, 2.9em);
    line-height: 1.15;
    margin-bottom: 1em;
}

.about-text h2 em { font-style: italic; color: var(--accent); }

.about-text p { color: var(--muted); margin-bottom: 1.2em; max-width: 56ch; }

.about-text strong { color: var(--text); font-weight: 500; }

.about-sign {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.5em;
    color: var(--accent);
    margin-top: 1.4em;
}

/* ---- Services ---- */
.services-section { background: var(--bg-soft); }

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4em;
}

.scard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2em 1.7em;
    box-shadow: var(--shadow-warm);
    transition: transform 0.3s, border-color 0.3s;
}

.scard:hover {
    transform: translateY(-5px);
    border-color: rgba(226, 101, 74, 0.5);
}

.scard .num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.9em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.scard h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.3em;
    margin: 0.7em 0 0.5em;
}

.scard p { font-size: 0.88em; color: var(--muted); }

/* ---- Contact ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(2.5em, 6vw, 5em);
}

.contact-intro h2 {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(1.9em, 4vw, 2.9em);
    line-height: 1.15;
    margin-bottom: 0.8em;
}

.contact-intro h2 em { font-style: italic; color: var(--accent); }

.contact-intro p { color: var(--muted); margin-bottom: 1em; max-width: 44ch; }

.contact-intro a { color: var(--accent); }

.contact-meta {
    margin-top: 2.2em;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    font-size: 0.9em;
    color: var(--muted);
}

.contact-meta span { display: flex; gap: 0.7em; align-items: center; }

.contact-meta a { color: var(--teal); text-decoration: none; }
.contact-meta a:hover { text-decoration: underline; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; }

.field { margin-bottom: 1.2em; }

.field label {
    display: block;
    font-size: 0.72em;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.55em;
}

.field input, .field textarea {
    width: 100%;
    padding: 0.95em 1.1em;
    font-family: var(--sans);
    font-size: 0.95em;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    resize: vertical;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.field input:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226, 101, 74, 0.15);
}

#form-response { margin-top: 1em; font-size: 0.9em; min-height: 1.4em; }
#form-response.ok { color: #2e9e5b; }
#form-response.ko { color: #d64560; }

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    padding: 3em clamp(1.2em, 5vw, 4.5em);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5em;
}

.footer .nav-logo { font-size: 1.1em; }

.footer-links {
    display: flex;
    gap: 1.8em;
    font-size: 0.8em;
    color: var(--muted);
    flex-wrap: wrap;
}

.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

.footer-copy { font-size: 0.78em; color: var(--muted); }

/* ---- Mobile ---- */
@media screen and (max-width: 900px) {
    .nav-toggle { display: block; }

    /* backdrop-filter sur .nav piégerait l'overlay fixed du menu :
       sur mobile on le retire (fond quasi opaque à la place) */
    .nav.is-scrolled {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(250, 245, 236, 0.98);
    }

    .nav-links {
        position: fixed;
        inset: 0;
        z-index: -1;
        flex-direction: column;
        justify-content: center;
        gap: 2.2em;
        background: rgba(250, 245, 236, 0.97);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .nav-links.open { opacity: 1; pointer-events: auto; z-index: 99; }
    .nav-links.open a { color: var(--text) !important; }
    .nav-links a { font-size: 1.1em; }

    /* Logo et bouton ≡/× toujours cliquables au-dessus du menu ouvert */
    .nav-logo, .nav-toggle { position: relative; z-index: 100; }

    .nav-toggle { padding: 0.35em 0.55em; font-size: 1.5em; }

    /* Menu ouvert : texte de la nav en foncé sur l'overlay clair */
    .nav.menu-open .nav-logo,
    .nav.menu-open .nav-toggle { color: var(--text); }

    .portfolio-grid, .testi-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .slider-arrow { display: none; }
    /* Les cartes gardent leur format vertical : recadrage centré identique au desktop */
    .pcard { max-width: 420px; }
}

@media screen and (max-width: 560px) {
    .services-grid, .form-row { grid-template-columns: 1fr; }
    .hero-actions .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-bg img { animation: none; transform: none; }
    html { scroll-behavior: auto; }
}
