/* =====================================================================
   CPBKO — Expertise Immobilière
   Design tokens : bordeaux / noir / blanc (charte du cabinet)
   ===================================================================== */

:root{
  /* ---- Light theme (default) ---- */
  --bg: #FAF7F3;
  --bg-alt: #F1E7E2;
  --surface: #FFFFFF;
  --surface-2: #F6F1EC;
  --text: #1B1512;
  --text-muted: #5C534D;
  --border: rgba(26,20,18,.12);

  --bordeaux: #7A1F2B;
  --bordeaux-dark: #4A121C;
  --bordeaux-tint: #F3E3E1;
  --gold: #A9812E;

  --shadow-sm: 0 1px 2px rgba(26,20,18,.06);
  --shadow-md: 0 12px 30px -12px rgba(26,20,18,.18);
  --shadow-lg: 0 24px 60px -20px rgba(26,20,18,.28);

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --header-h: 84px;
  color-scheme: light;
}

html[data-theme="dark"]{
  --bg: #15100F;
  --bg-alt: #1D1613;
  --surface: #221A17;
  --surface-2: #271E1A;
  --text: #F4ECE6;
  --text-muted: #B9ACA3;
  --border: rgba(244,236,230,.12);

  --bordeaux: #C8495C;
  --bordeaux-dark: #7A1F2B;
  --bordeaux-tint: #2E1A1C;
  --gold: #CDA85F;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 12px 30px -12px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 70px -20px rgba(0,0,0,.65);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}
img, svg{ display:block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin:0; padding:0; }
h1,h2,h3,h4{ font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--text); }
p{ margin: 0 0 1em; color: var(--text-muted); }
button{ font-family: inherit; }

.container{ width: min(1180px, 92%); margin-inline: auto; }

.skip-link{
  position:absolute; left:-999px; top:0; background:var(--bordeaux); color:#fff;
  padding:.8em 1.2em; z-index:999; border-radius: 0 0 8px 0;
}
.skip-link:focus{ left:0; }

:focus-visible{ outline: 2.5px solid var(--gold); outline-offset: 3px; }

/* ---------------------------------------------------------------- eyebrow / headings */
.eyebrow{
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bordeaux);
  margin: 0 0 .9em;
  font-weight: 500;
}
.eyebrow.center{ text-align:center; }
.section-title{ font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); max-width: 30ch; }
.section-title.center{ text-align:center; margin-inline:auto; }
.section-lead{ max-width: 56ch; font-size: 1.05rem; }
.section-lead.center{ margin-inline:auto; text-align:center; }

/* ---------------------------------------------------------------- buttons */
.btn{
  display: inline-flex; align-items:center; justify-content:center; gap:.5em;
  padding: .95em 1.7em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary{ background: var(--bordeaux); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover{ background: var(--bordeaux-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost{ background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover{ border-color: var(--bordeaux); color: var(--bordeaux); transform: translateY(-2px); }
.btn-small{ padding: .65em 1.3em; font-size: .85rem; }
.btn-full{ width: 100%; }

/* ================================================================== HEADER */
.site-header{
  position: fixed; inset-inline: 0; top:0; z-index: 500;
  height: var(--header-h);
  display:flex; align-items:center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: height .3s ease, border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled{
  height: 66px;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner{
  width: min(1240px, 94%); margin-inline:auto;
  display:flex; align-items:center; justify-content:space-between; gap: 1.5rem;
}

.brand{ display:flex; align-items:center; gap:.7rem; flex-shrink:0; }
.brand-mark{ color: var(--bordeaux); flex-shrink:0; }
.brand-text{ display:flex; flex-direction:column; line-height:1.05; }
.brand-name{ font-family: var(--font-display); font-weight:700; font-size:1.28rem; letter-spacing:.02em; }
.brand-sub{ font-family: var(--font-mono); font-size:.62rem; letter-spacing:.1em; text-transform:uppercase; color: var(--text-muted); }

.main-nav ul{ display:flex; gap: 2rem; }
.main-nav a{
  font-size: .93rem; font-weight:500; color: var(--text); position:relative; padding: .3em 0;
}
.main-nav a::after{
  content:""; position:absolute; left:0; right:100%; bottom:-2px; height:2px; background: var(--bordeaux);
  transition: right .25s ease;
}
.main-nav a:hover::after{ right:0; }

.header-actions{ display:flex; align-items:center; gap: .9rem; }

.theme-toggle{
  width: 40px; height:40px; border-radius:50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0;
  transition: border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover{ border-color: var(--bordeaux); transform: translateY(-1px); }
.theme-toggle svg{ fill:none; stroke:currentColor; stroke-width:1.7; }
.theme-toggle .icon-sun circle{ fill: currentColor; stroke:none; }
.theme-toggle .icon-moon{ display:none; }
.theme-toggle .icon-moon path{ fill: currentColor; stroke:none; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }

.nav-toggle{
  display:none; flex-direction:column; justify-content:center; gap:5px;
  width: 40px; height:40px; border-radius:8px; border:1px solid var(--border); background:var(--surface);
  cursor:pointer;
}
.nav-toggle span{ display:block; height:2px; width:20px; background: var(--text); margin-inline:auto; transition: transform .3s ease, opacity .3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ================================================================== HERO */
.hero{
  position:relative;
  padding: calc(var(--header-h) + 4.5rem) 0 5rem;
  overflow:hidden;
}
.hero-grid{
  position:absolute; inset:0; z-index:0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 45%, transparent 100%);
  opacity:.6;
}
.hero-inner{
  position:relative; z-index:1;
  width: min(1180px, 92%); margin-inline:auto;
  display:grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items:center;
}
.hero-title{ font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.6rem); max-width: 15ch; }
.hero-title em{ font-style: italic; color: var(--bordeaux); }
.hero-lead{ font-size: 1.12rem; max-width: 46ch; }
.hero-actions{ display:flex; flex-wrap:wrap; gap: 1rem; margin: 1.8rem 0 3rem; }

.hero-stats{ display:flex; gap: 2.4rem; flex-wrap:wrap; margin:0; }
.hero-stats dt{ font-family: var(--font-display); font-size: 1.7rem; font-weight:600; color: var(--bordeaux); }
.hero-stats dd{ margin:0; font-size: .82rem; color: var(--text-muted); max-width: 14ch; }

.hero-visual{ display:flex; align-items:center; justify-content:center; }
.seal{
  width: min(320px, 82vw); aspect-ratio:1;
  color: var(--bordeaux);
  filter: drop-shadow(0 20px 45px rgba(122,31,43,.18));
  animation: seal-float 7s ease-in-out infinite;
}
@keyframes seal-float{ 0%,100%{ transform: translateY(0) rotate(0deg);} 50%{ transform: translateY(-10px) rotate(1deg);} }
.seal svg{ width:100%; height:100%; }
.seal-ring-outer{ fill:none; stroke: currentColor; stroke-width:1.4; }
.seal-ring-inner{ fill:none; stroke: currentColor; stroke-width:1; }
.seal-ring-dash{ fill:none; stroke: var(--gold); stroke-width:1; stroke-dasharray: 2 5; transform-origin: 120px 120px; animation: seal-spin 40s linear infinite; }
@keyframes seal-spin{ to{ transform: rotate(360deg); } }
.seal-arc-text{ font-family: var(--font-mono); font-size: 8.6px; letter-spacing: 2px; fill: currentColor; }
.seal-center-main{ font-family: var(--font-display); font-size: 20px; font-weight:600; fill: currentColor; }
.seal-center-sub{ font-family: var(--font-display); font-size: 13px; letter-spacing:3px; fill: var(--gold); }
.seal-rule{ stroke: currentColor; stroke-width:.7; opacity:.5; }
.seal-center-num{ font-family: var(--font-mono); font-size: 9px; fill: currentColor; opacity:.8; }

/* ================================================================== ABOUT */
.about{ padding: 5.5rem 0; background: var(--bg-alt); }
.about-grid{ display:grid; grid-template-columns: 1.3fr .9fr; gap: 3.5rem; align-items:start; }
.about-text h2{ font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); max-width: 22ch; }
.about-badges{ display:flex; flex-wrap:wrap; gap:.7rem; margin-top: 1.2rem; }
.about-badges li{
  font-family: var(--font-mono); font-size:.74rem; letter-spacing:.03em;
  padding: .5em 1em; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted);
  background: var(--surface);
}
.about-figures{ display:grid; gap: 1rem; }
.figure-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem; display:flex; flex-direction:column; gap:.3rem; box-shadow: var(--shadow-sm);
}
.figure-num{ font-family: var(--font-display); font-size: 2rem; color: var(--bordeaux); font-weight:600; }
.figure-label{ font-size: .85rem; color: var(--text-muted); }

/* ================================================================== SERVICES */
.services{ padding: 6rem 0; }
.services-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 3.2rem;
}
.service-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service-card:hover{ transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--bordeaux); }
.service-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width: 52px; height:52px; border-radius: 14px; margin-bottom: 1.3rem;
  background: var(--bordeaux-tint); color: var(--bordeaux);
}
.service-icon svg{ width:26px; height:26px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.service-card h3{ font-size: 1.15rem; margin-bottom:.5em; }
.service-card p{ font-size: .93rem; margin:0; }

/* ================================================================== PROCESS */
.process{ padding: 6rem 0; background: var(--bg-alt); }
.process-list{ margin-top: 3.2rem; display:grid; gap: 0; }
.process-step{
  display:grid; grid-template-columns: 90px 1fr; gap: 1.6rem; align-items:start;
  padding: 1.8rem 0; border-top: 1px solid var(--border);
}
.process-step:last-child{ border-bottom: 1px solid var(--border); }
.step-num{ font-family: var(--font-mono); font-size: 1.6rem; color: var(--gold); font-weight:500; }
.process-step h3{ font-size: 1.2rem; margin-bottom:.3em; }
.process-step p{ margin:0; max-width: 60ch; }

/* ================================================================== TEAM */
.team{ padding: 6rem 0; }
.team-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; margin-top: 3.2rem; }
.team-card{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem 1.6rem; text-align:center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.team-card:hover{ transform: translateY(-5px); box-shadow: var(--shadow-md); }
.team-avatar{
  width: 74px; height:74px; border-radius:50%; margin: 0 auto 1.1rem;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(150deg, var(--bordeaux), var(--bordeaux-dark));
  color:#fff; font-family: var(--font-display); font-weight:600; font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.team-card h3{ font-size: 1.02rem; margin-bottom:.2em; }
.team-role{ color: var(--bordeaux); font-size: .82rem; font-weight:600; margin-bottom:.7em; }
.team-meta{ font-size: .8rem; color: var(--text-muted); margin:0; }

/* ================================================================== GALLERY */
.gallery{ padding: 6rem 0; background: var(--bg-alt); }
.gallery-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 3.2rem;
}
.gallery-item{
  margin:0; position:relative; aspect-ratio: 4/3.1;
  border-radius: var(--radius-md); overflow:hidden;
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery-item:hover{ transform: rotate(var(--tilt)) scale(1.02); box-shadow: var(--shadow-md); }
.gallery-item svg{
  width: 40%; height:40%; color: var(--bordeaux); opacity:.85;
  fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;
}
.gallery-item figcaption{
  position:absolute; left:0; right:0; bottom:0;
  padding: .9rem 1.1rem;
  font-family: var(--font-mono); font-size:.78rem; letter-spacing:.04em;
  background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 100%);
  color:#fff;
}
html[data-theme="dark"] .gallery-item figcaption{ background: linear-gradient(0deg, rgba(0,0,0,.7), transparent 100%); }

/* ================================================================== CONTACT */
.contact{ padding: 6.5rem 0; }
.contact-grid{ display:grid; grid-template-columns: .85fr 1.15fr; gap: 3.5rem; align-items:start; }
.contact-info h2{ font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
.contact-list{ margin-top: 2rem; display:grid; gap: 1.2rem; }
.contact-list li{ display:flex; gap: .9rem; align-items:flex-start; font-size: .93rem; color: var(--text-muted); }
.contact-icon{
  flex-shrink:0; width: 34px; height:34px; border-radius:50%;
  background: var(--bordeaux-tint); color: var(--bordeaux);
  display:flex; align-items:center; justify-content:center;
}
.contact-icon svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; }

.contact-form{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2.2rem; box-shadow: var(--shadow-sm);
  display:flex; flex-direction:column; gap: 1.2rem;
}
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.field{ display:flex; flex-direction:column; gap:.4rem; }
.field label{ font-size: .82rem; font-weight:600; color: var(--text); }
.field input, .field select, .field textarea{
  font-family: var(--font-body); font-size: .95rem; color: var(--text);
  background: var(--bg); border: 1.4px solid var(--border); border-radius: var(--radius-sm);
  padding: .8em .9em; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus{
  outline:none; border-color: var(--bordeaux); box-shadow: 0 0 0 4px var(--bordeaux-tint);
}
.field textarea{ resize: vertical; min-height: 100px; }
.form-status{ margin:0; font-size: .87rem; min-height: 1.2em; }
.form-status.ok{ color: #2E7D4F; }
.form-status.err{ color: #B3352A; }

/* ================================================================== FOOTER */
.site-footer{ background: var(--bordeaux-dark); color: #F3E7E4; padding: 4.5rem 0 0; }
.footer-grid{ display:grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer-brand .brand-name{ font-size: 1.3rem; color:#fff; }
.footer-brand .brand-sub{ color: rgba(255,255,255,.6); }
.footer-brand p{ color: rgba(255,255,255,.65); margin-top: 1rem; font-size: .88rem; max-width: 26ch; }
.footer-col h4{ color:#fff; font-family: var(--font-mono); font-size:.78rem; letter-spacing:.08em; text-transform:uppercase; font-weight:500; margin-bottom: 1.1rem; }
.footer-col ul{ display:grid; gap:.7rem; }
.footer-col a, .footer-col li{ color: rgba(255,255,255,.7); font-size: .88rem; }
.footer-col a:hover{ color:#fff; }
.social-row{ display:flex; gap:.7rem; }
.social-row a{
  width:36px; height:36px; border-radius:50%; border:1px solid rgba(255,255,255,.25);
  display:flex; align-items:center; justify-content:center; transition: background-color .2s ease, border-color .2s ease;
}
.social-row a:hover{ background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.social-row svg{ width:16px; height:16px; fill: rgba(255,255,255,.85); }
.footer-bottom{ border-top: 1px solid rgba(255,255,255,.15); padding: 1.4rem 0; }
.footer-bottom p{ margin:0; font-size: .8rem; color: rgba(255,255,255,.55); text-align:center; }

/* ================================================================== TO TOP */
.to-top{
  position: fixed; right: 1.6rem; bottom: 1.6rem; z-index: 400;
  width: 46px; height:46px; border-radius:50%;
  background: var(--bordeaux); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-md);
  opacity:0; transform: translateY(12px); pointer-events:none;
  transition: opacity .3s ease, transform .3s ease, background-color .2s ease;
}
.to-top.visible{ opacity:1; transform: translateY(0); pointer-events:auto; }
.to-top:hover{ background: var(--bordeaux-dark); }

/* ================================================================== RESPONSIVE */
@media (max-width: 980px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ order:-1; }
  .seal{ width: min(240px, 60vw); }
  .about-grid, .contact-grid{ grid-template-columns: 1fr; }
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
  .team-grid{ grid-template-columns: repeat(2, 1fr); }
  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px){
  :root{ --header-h: 68px; }
  .main-nav{
    position: fixed; inset: 68px 0 0 0; z-index: 480;
    background: var(--bg);
    padding: 2rem 6%;
    transform: translateY(-8px);
    opacity:0; visibility:hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  }
  .main-nav.open{ opacity:1; visibility:visible; transform: translateY(0); }
  .main-nav ul{ flex-direction:column; gap: 0; }
  .main-nav a{ display:block; padding: 1rem 0; font-size: 1.15rem; border-bottom: 1px solid var(--border); }
  .nav-toggle{ display:flex; }
  .header-actions .btn-small{ display:none; }

  .hero{ padding-top: calc(var(--header-h) + 3rem); }
  .hero-stats{ gap: 1.6rem; }
  .services-grid{ grid-template-columns: 1fr; }
  .team-grid{ grid-template-columns: 1fr 1fr; }
  .gallery-grid{ grid-template-columns: 1fr 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr; gap: 2rem; text-align:left; }
  .process-step{ grid-template-columns: 50px 1fr; gap: 1rem; }
}

@media (max-width: 460px){
  .team-grid, .gallery-grid{ grid-template-columns: 1fr; }
  .hero-actions{ flex-direction:column; align-items:stretch; }
  .hero-stats{ flex-direction:column; gap: 1rem; }
}
