/* =========================================================
   Buonamico et Pizzotti — style.css
   Industrial premium · light · subtle animated gradients
   ========================================================= */

:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --ink: #1a1714;
  --ink-soft: #57514a;
  --line: #e4ded6;
  --accent: #d97524;       /* amber industrial */
  --accent-2: #b4541a;     /* deep ember */
  --accent-soft: #fbeede;
  --dark: #15110d;
  --radius: 14px;
  --maxw: 1140px;
  --shadow: 0 1px 2px rgba(21, 17, 13, .05), 0 12px 32px -16px rgba(21, 17, 13, .25);
  --grad: linear-gradient(100deg, var(--accent), var(--accent-2));
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.container.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 200;
  background: var(--dark); color: #fff; padding: .6rem 1rem; border-radius: 8px;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  --pad: .85rem 1.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: var(--pad); border-radius: 999px; font-weight: 600; font-size: .98rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  will-change: transform;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px var(--accent-2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-color: var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--dark); color: var(--accent); font-weight: 800; font-size: .9rem; letter-spacing: .02em;
}
.brand-text { font-size: 1.02rem; letter-spacing: -.01em; }
.brand-text em { font-style: normal; color: var(--ink-soft); font-weight: 500; }

.nav-list { list-style: none; display: flex; align-items: center; gap: .35rem; margin: 0; padding: 0; }
.nav-list a {
  text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: 8px; transition: color .2s, background .2s;
}
.nav-list a:hover { color: var(--ink); background: var(--surface); }
.nav-cta { color: #fff !important; background: var(--grad); padding: .55rem 1.1rem !important; }
.nav-cta:hover { filter: brightness(1.05); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
  position: relative; z-index: 97; /* au-dessus du panneau (95) et du fond (90) */
}
.nav-toggle-bar { width: 20px; height: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(21,17,13,.45); z-index: 90; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; top: 0; right: 0; height: 100dvh; width: min(82vw, 340px);
    background: var(--surface); box-shadow: -20px 0 50px -20px rgba(21,17,13,.4);
    transform: translateX(105%); transition: transform .32s cubic-bezier(.4,.0,.2,1);
    padding: 5rem 1.5rem 2rem; z-index: 95; overflow-y: auto;
  }
  body.nav-open .nav { transform: translateX(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: .25rem; }
  .nav-list a { padding: .85rem 1rem; font-size: 1.05rem; }
  .nav-cta { text-align: center; margin-top: .5rem; }
  body.nav-open .nav-toggle .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle .nav-toggle-bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-bg {
  position: absolute; inset: -20% -10% auto -10%; height: 70%; z-index: 0;
  background:
    radial-gradient(40% 60% at 80% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(40% 60% at 10% 20%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
  filter: blur(8px); animation: float 14s ease-in-out infinite alternate;
}
@keyframes float { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(0,-3%,0) scale(1.06); } }

.hero-grid { position: relative; z-index: 1; display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 3rem; } }

.eyebrow {
  display: inline-block; margin: 0 0 .9rem; font-size: .8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2);
}
.hero-title { font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 1rem; }
.hero-lead { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--ink-soft); margin: 0 0 1.8rem; max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.2rem; }
.hero-meta { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; flex-wrap: wrap; }
.hero-meta li { display: flex; flex-direction: column; }
.hero-meta strong { font-size: 1.5rem; }
.hero-meta span { font-size: .82rem; color: var(--ink-soft); }

.hero-figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3/2; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; position: relative; }
.section.alt { background: var(--surface); }
.section-skew { position: relative; }
.section-skew.alt::before, .section-skew.alt::after {
  content: ""; position: absolute; left: 0; right: 0; height: 5vw; max-height: 70px; background: var(--surface);
}
.section-skew.alt::before { top: 0; transform: skewY(-2deg); transform-origin: top left; }
.section-skew.alt::after { bottom: 0; transform: skewY(-2deg); transform-origin: bottom right; }

.section-head { max-width: 640px; margin: 0 auto clamp(2rem, 4vw, 3rem); text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.02em; margin: 0 0 .6rem; line-height: 1.1; }
.section-sub { color: var(--ink-soft); margin: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.section.alt .card { background: var(--bg); }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card h3 { margin: .4rem 0 .5rem; font-size: 1.2rem; }
.card p { margin: 0; color: var(--ink-soft); }

.benefit-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 1.1rem;
}

/* Features */
.features .feature-row {
  border-top: 2px solid var(--ink); padding: 1.4rem 0;
}
.features .feature-row h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
.features .feature-row p { margin: 0; color: var(--ink-soft); }

/* Gallery */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery-item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 1.2rem 1rem .9rem;
  color: #fff; font-weight: 600; font-size: .95rem;
  background: linear-gradient(transparent, rgba(21,17,13,.78));
}

/* Testimonials */
.testimonial { display: flex; flex-direction: column; gap: 1rem; }
.testimonial p { font-size: 1.02rem; color: var(--ink); }
.testimonial footer { display: flex; flex-direction: column; }
.testimonial strong { font-size: .95rem; }
.testimonial span { font-size: .82rem; color: var(--ink-soft); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: .75rem; }
.faq-item {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.section.alt .faq-item { background: var(--surface); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.1rem 1.25rem; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-2); transition: transform .25s ease; line-height: 1; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 1.25rem 1.2rem; color: var(--ink-soft); }
.faq-body p { margin: 0; }

/* Map */
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-wrap iframe { width: 100%; height: 420px; border: 0; }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; transition: opacity .5s ease, transform .5s ease; }
.form.is-sent { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.form-row { display: grid; gap: 1.1rem; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field textarea {
  font: inherit; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 120px; }
.field.invalid input, .field.invalid textarea { border-color: #c0392b; box-shadow: 0 0 0 3px #f7d9d4; }
.error { color: #c0392b; font-size: .82rem; min-height: 1em; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; display: none;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .8; }
.btn[disabled] { opacity: .7; cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-status { margin: 0; font-weight: 600; font-size: .95rem; }
.form-status.success { color: #1e7a45; }
.form-status.error { color: #c0392b; }

.success-message {
  text-align: center; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--accent-soft); animation: fadeUp .5s ease both;
}
.success-message h3 { margin: 0 0 .5rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #d9d2c8; padding: 3rem 0 1.5rem; margin-top: 0; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.brand--footer { color: #fff; }
.brand--footer .brand-text em { color: #a89c8c; }
.brand--footer .brand-mark { background: #221b14; }
.footer-tag { color: #a89c8c; margin: .9rem 0 0; font-size: .92rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-links a, .footer-contact a { color: #d9d2c8; text-decoration: none; }
.footer-links a:hover, .footer-contact a:hover { color: var(--accent); }
.footer-contact p { margin: 0 0 .5rem; font-size: .92rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
  border-top: 1px solid #2a2119; margin-top: 2.5rem; padding-top: 1.25rem;
  font-size: .85rem; color: #8a7f70;
}
.footer-bottom a { color: #8a7f70; text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
