/* ============================================================
   MAISON LEFÈVRE — Boulangerie-Pâtisserie Lyon
   Style global. Cohérent TECH_STANDARDS ALTER PERCEPTION.
   ============================================================ */

/* ---------- 1. DESIGN TOKENS --------------------------------- */
:root {
    /* Couleurs marque */
    --primary:    #5A3A22;      /* terre cuite, croûte foncée */
    --primary-90: #6F4A2F;
    --secondary:  #2A1810;      /* presque-noir chaud */
    --accent:     #C9A55B;      /* or doré, croûte */
    --accent-90:  #D9B872;
    --cream:      #F5EBD9;      /* crème farine */
    --cream-deep: #EADBC0;
    --gradient:   linear-gradient(135deg, var(--primary), var(--accent));

    /* Neutres */
    --white:      #FFFFFF;
    --off-white:  #FAF7F2;
    --black:      #0E0A07;
    --gray-900:   #1F1A14;
    --gray-700:   #4A4138;
    --gray-500:   #8A7E72;
    --gray-300:   #CFC5B8;
    --gray-200:   #E8E0D2;
    --gray-100:   #F2EBDF;

    /* Typographie */
    --font-display:   'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --font-editorial: 'Instrument Serif', Georgia, 'Times New Roman', serif;

    /* Layout */
    --container:   1240px;
    --container-narrow: 980px;
    --radius:      14px;
    --radius-lg:   24px;
    --radius-full: 999px;

    /* Motion */
    --transition:       0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  0.6s cubic-bezier(0.4, 0, 0.2, 1);

    /* Ombres */
    --shadow-sm:  0 2px 8px rgba(42, 24, 16, 0.06);
    --shadow:     0 12px 32px rgba(42, 24, 16, 0.10);
    --shadow-lg:  0 24px 60px rgba(42, 24, 16, 0.14);
}

/* ---------- 2. RESET / BASE ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--off-white);
    overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }

p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

/* Selection */
::selection { background: var(--accent); color: var(--secondary); }

/* Scrollbar */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 6px; border: 2px solid var(--cream); }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* Focus visible accessibilité */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- 3. TYPOGRAPHIE ----------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--secondary);
    margin: 0 0 1rem;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 500; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }

.editorial {
    font-family: var(--font-editorial);
    font-style: italic;
    font-weight: 400;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.2rem;
}
.eyebrow::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--primary);
    vertical-align: middle;
    margin-right: 12px;
    transform: translateY(-2px);
}

.lead {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--gray-700);
    line-height: 1.55;
    max-width: 60ch;
}

/* ---------- 4. LAYOUT ---------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: clamp(4rem, 10vw, 8rem) 0;
}

/* ---------- 5. BOUTONS --------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.6rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.btn-primary {
    background: var(--secondary);
    color: var(--cream);
}
.btn-primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(90, 58, 34, 0.35);
}

.btn-accent {
    background: var(--accent);
    color: var(--secondary);
}
.btn-accent:hover {
    background: var(--accent-90);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(201, 165, 91, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--secondary);
    border: 1px solid currentColor;
}
.btn-ghost:hover {
    background: var(--secondary);
    color: var(--cream);
    transform: translateY(-2px);
}

.btn svg {
    transition: transform var(--transition);
}
.btn:hover svg {
    transform: translateX(4px);
}

/* ---------- 6. NAVBAR ---------------------------------------- */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    padding: 1.1rem 0;
    background: rgba(250, 247, 242, 0.78);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid transparent;
    transition: padding var(--transition), background var(--transition), border-color var(--transition);
}
.navbar.scrolled {
    padding: 0.6rem 0;
    background: rgba(250, 247, 242, 0.92);
    border-bottom-color: var(--gray-200);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--secondary);
    letter-spacing: -0.01em;
}
.nav-logo .logo-mark {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.2rem;
}
.nav-links a {
    font-size: 0.95rem;
    color: var(--gray-700);
    position: relative;
    padding: 0.4rem 0;
    transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary);
}
.nav-links a::after {
    content: "";
    position: absolute;
    inset: auto 50% 0 50%;
    height: 1px;
    background: var(--primary);
    transition: inset var(--transition);
}
.nav-links a:hover::after,
.nav-links a.active::after {
    inset: auto 0 0 0;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: var(--cream);
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-cta:hover {
    background: var(--primary);
    transform: translateY(-1px);
}
.nav-cta svg { width: 16px; height: 16px; }

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 12px;
    border-radius: 10px;
}
.nav-burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
    transform-origin: center;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Overlay menu mobile (caché par défaut) */
.nav-overlay {
    position: fixed;
    inset: 70px 0 0 0;
    background: var(--off-white);
    padding: 3rem 1.5rem;
    transform: translateY(-110%);
    transition: transform var(--transition-slow);
    z-index: 999;
    overflow-y: auto;
}
.nav-overlay.is-open {
    transform: translateY(0);
}
.nav-overlay-links {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}
.nav-overlay-links a {
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 2.2rem;
    color: var(--secondary);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.nav-overlay-links a:last-child {
    border-bottom: 0;
}

/* ---------- 7. HERO ------------------------------------------ */
.hero {
    position: relative;
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 4rem;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--off-white);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 80% at 80% 30%, rgba(201, 165, 91, 0.18), transparent 70%),
        radial-gradient(50% 70% at 10% 80%, rgba(90, 58, 34, 0.10), transparent 70%);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    margin-bottom: 1.5rem;
}
.hero-text h1 .editorial {
    display: block;
    font-size: 0.95em;
    line-height: 1.05;
    margin-top: 0.2em;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}
.hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.hero-meta-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gray-500);
}
.hero-meta-value {
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--secondary);
}

.hero-image {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: var(--cream);
    color: var(--secondary);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow);
}
.hero-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2EAA67;
    box-shadow: 0 0 0 0 rgba(46, 170, 103, 0.7);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 170, 103, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 170, 103, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 170, 103, 0); }
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.2rem;
}

/* ---------- 8. SECTIONS GÉNÉRIQUES --------------------------- */
.section-header {
    max-width: 720px;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-header h2 .editorial {
    display: inline;
}

.section-cream {
    background: var(--cream);
}

/* Cascade pour fond sombre — réutilisable */
.section-dark {
    background: var(--secondary);
    color: var(--cream);
}
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: var(--cream); }
.section-dark .eyebrow { color: var(--accent); }
.section-dark .eyebrow::before { background: var(--accent); }
.section-dark .editorial { color: var(--accent); }
.section-dark .lead { color: rgba(245, 235, 217, 0.78); }

/* ---------- 9. CARDS ----------------------------------------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.card-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--gray-100);
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.card:hover .card-img img {
    transform: scale(1.06);
}
.card-body {
    padding: 1.6rem 1.6rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.card-tag {
    display: inline-block;
    width: fit-content;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    font-weight: 500;
}
.card h3 { margin: 0 0 0.3rem; }
.card p {
    color: var(--gray-700);
    font-size: 0.96rem;
    line-height: 1.55;
    margin: 0;
}

/* ---------- 10. SPLIT (image + texte) ------------------------ */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}
.split-reverse { direction: rtl; }
.split-reverse > * { direction: ltr; }

.split-image {
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.split-image img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.split-text h2 { margin-bottom: 1.5rem; }

/* ---------- 11. KEY FIGURES / STATS -------------------------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem 3rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(245, 235, 217, 0.18);
    border-bottom: 1px solid rgba(245, 235, 217, 0.18);
}
.stat-num {
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.6rem;
}
.stat-label {
    font-size: 0.92rem;
    color: rgba(245, 235, 217, 0.78);
    line-height: 1.4;
}

/* ---------- 12. CTA BAND ------------------------------------- */
.cta-band {
    position: relative;
    padding: clamp(3rem, 8vw, 6rem) 0;
    background: var(--secondary);
    color: var(--cream);
    text-align: center;
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(50% 80% at 50% 0%, rgba(201, 165, 91, 0.18), transparent 70%);
    pointer-events: none;
}
.cta-band-inner {
    position: relative;
    z-index: 1;
}
.cta-band h2 {
    color: var(--cream);
    margin-bottom: 1rem;
}
.cta-band .editorial { color: var(--accent); }

/* ---------- 13. FOOTER --------------------------------------- */
.footer {
    background: var(--black);
    color: rgba(245, 235, 217, 0.7);
    padding: 4rem 0 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}
.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--cream);
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.footer-brand .footer-logo .logo-mark { width: 42px; height: 42px; }
.footer-brand p {
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 340px;
}
.footer h4 {
    color: var(--cream);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 500;
    margin-bottom: 1.2rem;
}
.footer ul {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.footer ul a {
    font-size: 0.94rem;
    color: rgba(245, 235, 217, 0.7);
    transition: color var(--transition);
}
.footer ul a:hover {
    color: var(--accent);
}
.footer-social {
    display: flex;
    gap: 0.7rem;
    margin-top: 1.4rem;
}
.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(245, 235, 217, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.footer-social a:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--secondary);
}
.footer-social svg { width: 16px; height: 16px; }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(245, 235, 217, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.84rem;
}

/* ---------- 14. SOUS-FOOTER AGENCE (DOFOLLOW) ---------------- */
/* Backlink obligatoire ALTER PERCEPTION — TECH_STANDARDS § 8.3 */
.agency-credit {
    padding: 1rem 0;
    background: #000;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.agency-credit p {
    margin: 0;
    line-height: 1.5;
}
.agency-credit a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
}
.agency-credit a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- 15. BACK TO TOP ---------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--cream);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 998;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* ---------- 16. ANIMATIONS / FADE-IN -------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.4,0,0.2,1), transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- 17. RESPONSIVE ----------------------------------- */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .nav-links,
    .nav-cta { display: none; }
    .nav-burger { display: flex; }

    .hero {
        min-height: auto;
        padding-top: 120px;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .hero-image {
        aspect-ratio: 4 / 3;
        order: -1;
    }
    .split,
    .split-reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    .split-image {
        aspect-ratio: 4 / 3;
    }
    body.no-scroll { overflow: hidden; }
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
    .container { padding: 0 1.25rem; }
    .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }
    .hero-cta .btn { width: 100%; }
    .stats { gap: 1.5rem; }
    .nav-overlay-links a { font-size: 1.8rem; }
}
