/* ==========================================================================
   BCP Nexus LLC — site vitrine
   Un style (corporate) x deux thèmes clair/sombre (data-theme), pilotés par js/theme-init.js
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1160px;
  --header-h: 68px;
}

/* Thème clair (valeurs par défaut) */
:root,
html[data-style="corporate"] {
  --bg: #F3F6F7;
  --surface: #FFFFFF;
  --surface-2: #E9EFF1;
  --ink: #0F2A33;
  --muted: #4F626A;
  --line: #D3DDE1;
  --line-strong: #B7C6CC;
  --primary: #17687A;
  --primary-hover: #0F5363;
  --on-primary: #FFFFFF;
  --gold: #B8862A;
  --focus: #17687A;
  --mark-bg: #FFFFFF;
  --radius: 10px;
  --radius-s: 6px;
  --btn-radius: 6px;
  --shadow: none;
  --shadow-hover: 0 12px 32px -14px rgba(15, 42, 51, .30);
  --h-weight: 600;
}
html[data-style="corporate"][data-theme="dark"] {
  --bg: #0A1519;
  --surface: #112028;
  --surface-2: #0D1B21;
  --ink: #E6EFF1;
  --muted: #9BB0B7;
  --line: #1F353D;
  --line-strong: #2C4852;
  --primary: #4FB3C6;
  --primary-hover: #74C6D6;
  --on-primary: #06222A;
  --gold: #D9B15A;
  --focus: #74C6D6;
  --mark-bg: #E8F0F2;
  --shadow-hover: 0 16px 36px -16px rgba(0, 0, 0, .75);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--primary); color: var(--on-primary); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--h-weight);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 1.2rem + 4.6vw, 4.6rem); line-height: 1.03; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.8rem, 1.1rem + 2.4vw, 2.8rem); }
h3 { font-size: 1.4rem; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
ul { margin: 0; padding: 0; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: .7rem 1rem; border-radius: var(--radius-s);
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem;
  font: 600 .98rem/1.1 var(--font-body);
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark {
  display: flex; align-items: center; justify-content: center; flex: none;
  background: var(--mark-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0 8px;
  height: 36px;
}
.brand__mark img { height: 22px; width: auto; max-width: none; }
.brand__name { font: var(--h-weight) 1.3rem/1 var(--font-display); letter-spacing: -0.01em; }

.nav ul { display: flex; gap: .25rem; list-style: none; }
.nav a {
  display: block; padding: .5rem .85rem; border-radius: var(--btn-radius);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }

.site-header__actions { display: flex; gap: .4rem; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--btn-radius);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.icon-btn:hover { border-color: var(--primary); background: var(--surface); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
html[data-theme="dark"] .icon-btn .i-sun { display: block; }
html[data-theme="dark"] .icon-btn .i-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1.25rem, 4vw, 2.5rem) 1rem;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: .8rem .5rem; font-size: 1.05rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(2rem, 5vw, 4rem); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.hero__lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); color: var(--muted); max-width: 52ch; margin-bottom: 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
html.js:not(.is-ready) .hero__copy > * { opacity: 0; }

.nexus { position: relative; width: 100%; aspect-ratio: 1 / .92; min-height: 360px; max-height: 620px; }
.nexus canvas { width: 100%; height: 100%; touch-action: pan-y; }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .nexus { aspect-ratio: auto; height: 400px; }
}

/* ---------- Fils (séparateurs) ---------- */
.thread { display: block; width: 100%; height: 40px; color: var(--primary); overflow: visible; }
.thread path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.thread .thread__gold { stroke: var(--gold); opacity: .9; }
html.js:not(.is-ready) .thread { clip-path: inset(0 100% 0 0); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section__head { max-width: 62ch; margin-bottom: clamp(1.75rem, 3vw, 3rem); }
.section__head h2 { margin-bottom: .4em; }
.section__head p { color: var(--muted); margin: 0; }

/* ---------- Boutiques ---------- */
.brands__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.brand-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.brand-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.brand-card:focus { outline: none; }
.brand-card.is-pinged { animation: ping 1.4s ease; border-color: var(--primary); }
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); }
  70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--primary) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.brand-card__panel {
  --panel-h: 300px;
  display: grid; place-items: center;
  height: var(--panel-h); padding: 1.75rem; overflow: hidden;
  background: var(--panel, var(--surface-2));
  border-bottom: 1px solid var(--line);
}
.brand-card__panel img { max-height: calc(var(--panel-h) - 3.5rem); max-width: 100%; width: auto; height: auto; object-fit: contain; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.brand-card:hover .brand-card__panel img { transform: scale(1.04); }
.brand-card__panel svg { width: 190px; height: auto; color: var(--primary); }
.brand-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.6rem 1.7rem; }
.brand-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .9rem; font-size: .9rem; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--ink);
}
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.badge--live::before { background: #2E9D6B; }
.badge--seasonal::before { background: var(--gold); }
.brand-card h3 { margin-bottom: .3em; }
.brand-card__tagline { font-weight: 600; margin-bottom: .6em; }
.brand-card__desc { color: var(--muted); }
.brand-card__links { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .6rem; }

.brand-card--wide { grid-column: 1 / -1; }
@media (min-width: 821px) {
  .brand-card--wide { flex-direction: row; }
  .brand-card--wide .brand-card__panel { flex: 0 0 38%; height: auto; min-height: 240px; border-bottom: 0; border-right: 1px solid var(--line); }
  .brand-card--wide .brand-card__body { justify-content: center; }
  .brand-card--wide .brand-card__links { margin-top: .6rem; }
}
@media (max-width: 820px) {
  .brands__grid { grid-template-columns: 1fr; }
  .brand-card__panel { --panel-h: 260px; }
}

/* ---------- Fonctionnement ---------- */
.how__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; list-style: none; }
.how__item { padding: .25rem clamp(1rem, 2.5vw, 2rem); border-left: 1px solid var(--line-strong); }
.how__item:first-child { padding-left: 0; border-left: 0; }
.how__item:last-child { padding-right: 0; }
.how__icon { width: 30px; height: 30px; margin-bottom: 1rem; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.how__item h3 { font-size: 1.25rem; margin-bottom: .4em; }
.how__item p { color: var(--muted); margin: 0; }
.how__foot { margin: 2.2rem 0 0; color: var(--muted); max-width: 62ch; }
@media (max-width: 820px) {
  .how__list { grid-template-columns: 1fr; gap: 1.75rem; }
  .how__item, .how__item:first-child, .how__item:last-child { padding: 0 0 0 1.1rem; border-left: 2px solid var(--line-strong); }
}

/* ---------- À propos ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about__text p { max-width: 62ch; }
.about__aside {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.75rem; transition: background-color .3s ease;
}
.about__logo { background: #FFFFFF; border-radius: var(--radius-s); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.about__logo img { width: 100%; max-width: 280px; height: auto; margin-inline: auto; }
.facts { display: grid; margin: 0; }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); font-size: .95rem; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.contact__info address { font-style: normal; color: var(--muted); margin-bottom: 1.4rem; }
.contact__mail { font: var(--h-weight) clamp(1.3rem, 1rem + 1vw, 1.7rem)/1.2 var(--font-display); display: inline-block; margin-bottom: 1.1rem; overflow-wrap: anywhere; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .75rem .9rem;
  font: inherit; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line-strong); border-radius: var(--radius-s);
  transition: border-color .2s ease, background-color .3s ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__note { color: var(--muted); font-size: .92rem; margin: .9rem 0 0; }
.form__status { min-height: 1.5em; margin: .9rem 0 0; font-weight: 600; }
.form__status.is-error { color: #B3261E; }
html[data-theme="dark"] .form__status.is-error { color: #F2B8B5; }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; margin-top: 2rem; transition: background-color .3s ease; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 4rem); }
.footer__brand p { color: var(--muted); max-width: 40ch; margin-bottom: .8rem; }
.footer__brand address { font-style: normal; color: var(--muted); font-size: .96rem; }
.footer__col h2 { font: 700 1rem/1.3 var(--font-body); letter-spacing: 0; margin-bottom: .8rem; }
.footer__col ul { list-style: none; display: grid; gap: .45rem; }
.footer__col a { color: var(--ink); text-decoration: none; }
.footer__col a:hover { color: var(--primary); text-decoration: underline; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.footer__bottom p { margin: 0; }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

/* ---------- Pages légales ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 5rem); }
.legal__head { margin-bottom: 2.5rem; }
.legal__head h1 { font-size: clamp(2.1rem, 1.2rem + 3vw, 3.4rem); margin-bottom: .3em; }
.legal__meta { color: var(--muted); margin: 0; }
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); margin: 2.2em 0 .5em; }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2rem; margin-bottom: 1.1em; }
.prose li { margin-bottom: .4em; }
.prose address { font-style: normal; }
.prose .facts div { grid-template-columns: 11rem 1fr; }
.prose .facts { margin-bottom: 1.5rem; }
.legal__back { margin-top: 3rem; }
@media (max-width: 600px) { .prose .facts div { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- Page 404 ---------- */
.notfound { min-height: 60vh; display: grid; align-items: center; padding-block: 4rem; }
.notfound h1 { font-size: clamp(3rem, 2rem + 6vw, 6.5rem); margin-bottom: .2em; }
.notfound p { color: var(--muted); max-width: 46ch; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .brand-card:hover { transform: none; }
  .brand-card:hover .brand-card__panel img { transform: none; }
  html.js:not(.is-ready) .hero__copy > * { opacity: 1; }
  html.js:not(.is-ready) .thread { clip-path: none; }
}

@media print {
  .site-header, .nexus, .thread, .form { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Liste de secours (sans JavaScript) : masquée dès que le JS est actif */
html.js #brands-fallback { display: none; }
#brands-fallback { grid-column: 1 / -1; padding-left: 1.2rem; }

/* À propos : ligne de signature sous le titre */
.about__baseline { font: 500 clamp(1.15rem, 1rem + .6vw, 1.4rem)/1.35 var(--font-display); color: var(--primary); margin-bottom: 1.4rem; }
