/* ==========================================================================
   Beetracking — site vitrine (projet Aprogsys)
   ========================================================================== */

:root {
  --honey: #f0ad1c;
  --honey-deep: #c98a0a;
  --honey-soft: #fbe9bf;
  --bark: #2b2108;
  --ink: #1f1a0e;
  --muted: #6b624d;
  --cream: #fbf7ee;
  --paper: #ffffff;
  --line: #e9dfc8;
  --ok: #3a7d44;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 33, 8, 0.08);
  --max: 1140px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--honey-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--bark); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
li { margin-bottom: .35em; }
strong { color: var(--bark); }
.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Eyebrow / labels --- */
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--honey-deep);
  margin-bottom: .6rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--honey); color: var(--bark); box-shadow: 0 6px 18px rgba(240, 173, 28, .35); }
.btn-primary:hover { background: #f5bb3a; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-outline { border-color: var(--bark); color: var(--bark); }
.btn-outline:hover { background: var(--bark); color: #fff; }

/* --- Archive notice --- */
.notice {
  background: var(--bark);
  color: #f3e9cf;
  font-size: .9rem;
  text-align: center;
  padding: .5rem 1rem;
}
.notice a { color: var(--honey); font-weight: 600; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 247, 238, .94);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--bark); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand svg { width: 38px; height: 38px; }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: .15rem; }
.nav > a, .nav-item > a { display: block; color: var(--bark); font-weight: 600; padding: .55rem .85rem; border-radius: 999px; font-size: .95rem; white-space: nowrap; }
.nav > a:hover, .nav-item > a:hover, .nav > a[aria-current="page"], .nav-item.is-active > a { background: var(--honey-soft); text-decoration: none; }
.nav .btn { padding: .55rem 1.1rem; margin-left: .5rem; }
.nav-item { position: relative; }
.nav-item > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.sub {
  list-style: none; margin: 0; padding: .5rem;
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 270px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.sub li { margin: 0; }
.sub a { display: block; padding: .55rem .8rem; border-radius: 8px; color: var(--bark); font-size: .93rem; }
.sub a:hover, .sub a[aria-current="page"] { background: var(--honey-soft); text-decoration: none; }
.nav-item:hover > .sub, .nav-item:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; color: var(--bark); flex-shrink: 0; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px auto; transition: transform .2s, opacity .2s; }

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: stretch;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: .75rem 1.25rem 1.25rem; gap: .1rem;
    max-height: calc(100vh - 72px); overflow-y: auto;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav > a, .nav-item > a { padding: .75rem .9rem; white-space: normal; }
  .nav-item > a::after { display: none; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 .5rem 1rem; }
  .sub a { padding: .5rem .9rem; color: var(--muted); }
  .nav .btn { margin: .75rem 0 0; justify-content: center; }
  .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; color: #fff; overflow: hidden;
  background: var(--bark);
  min-height: min(78vh, 760px);
  display: flex; align-items: center;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .55; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(43,33,8,.92) 0%, rgba(43,33,8,.65) 50%, rgba(43,33,8,.25) 100%);
}
.hero .container { position: relative; z-index: 1; padding: 5rem 0; }
.hero h1 { color: #fff; max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--honey); }
.hero p { font-size: 1.2rem; max-width: 40rem; color: rgba(255,255,255,.85); }
.hero .eyebrow { color: var(--honey); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.2); }
.hero-meta div { font-size: .85rem; color: rgba(255,255,255,.7); }
.hero-meta strong { display: block; font-size: 1.15rem; color: #fff; }

.page-hero { background: var(--bark); color: #fff; padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255,255,255,.8); font-size: 1.15rem; max-width: 44rem; }
.page-hero .eyebrow { color: var(--honey); }
.page-hero::before {
  content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,3 93,27 93,73 50,97 7,73 7,27' fill='none' stroke='%23f0ad1c' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .25;
}

/* --- Sections --- */
.section { padding: 5rem 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--bark); color: #efe6d0; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--honey); }
.section-dark p { color: rgba(255,255,255,.8); }
.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.section-head.center { margin-inline: auto; }

/* --- Grid & cards --- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: .25rem; }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--honey-soft); color: var(--honey-deep); margin-bottom: 1rem;
}
.card .icon svg { width: 26px; height: 26px; }

.card-product { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-product img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-product .body { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.card-product .body .btn { margin-top: auto; align-self: flex-start; }

/* --- Split (text + image) --- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3.5rem; align-items: center; }
.split.reverse > :first-child { order: 2; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split figure { margin: 0; }
.split figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; text-align: center; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .split.reverse > :first-child { order: 0; }
}

/* --- Steps --- */
.steps { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bark); color: var(--honey); font-weight: 800; margin-bottom: 1rem;
}
.step img { border-radius: 8px; border: 1px solid var(--line); margin-bottom: 1rem; width: 100%; }
.step h3 { font-size: 1.05rem; }
.step p { font-size: .95rem; color: var(--muted); margin: 0; }

/* --- Stats --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat strong { display: block; font-size: 2.2rem; color: var(--honey); line-height: 1.1; }
.stat span { color: rgba(255,255,255,.75); font-size: .95rem; }

/* --- Feature list --- */
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.features li { display: flex; gap: .8rem; align-items: flex-start; }
.features li::before {
  content: ""; flex: 0 0 22px; height: 22px; margin-top: .15rem; border-radius: 50%;
  background: var(--honey-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c98a0a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center / 14px;
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { padding: .85rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--honey-soft); color: var(--bark); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td img { width: 120px; border-radius: 8px; }
.table-wrap caption { caption-side: top; text-align: left; font-weight: 700; padding: 1rem 1rem .5rem; color: var(--bark); }

/* --- Timeline --- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 2.5rem; margin-bottom: 1.6rem; }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: .35rem; width: 16px; height: 16px; border-radius: 50%;
  background: var(--honey); border: 3px solid var(--cream); box-shadow: 0 0 0 2px var(--honey);
}
.timeline time { display: block; font-weight: 800; color: var(--honey-deep); font-size: .9rem; letter-spacing: .05em; }
.timeline p { margin: 0; color: var(--muted); }
.timeline strong { display: block; }

/* --- FAQ / objections --- */
details { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 1.25rem; margin-bottom: .75rem; }
summary { cursor: pointer; padding: 1rem 0; font-weight: 600; color: var(--bark); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--honey-deep); font-weight: 800; font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { padding-bottom: 1rem; margin: 0; color: var(--muted); }
details cite { font-style: italic; }

/* --- Gallery --- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }
.gallery img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* --- Partners --- */
.partners { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 3rem; align-items: center; }
.partners a { display: block; opacity: .85; transition: opacity .15s; }
.partners a:hover { opacity: 1; }
.partners img { max-height: 60px; width: auto; }

/* --- Tech tags --- */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.tags li { margin: 0; padding: .35rem .8rem; border-radius: 999px; background: var(--honey-soft); color: var(--bark); font-size: .85rem; font-weight: 600; }
.section-dark .tags li { background: rgba(255,255,255,.1); color: #fff; }

/* --- CTA --- */
.cta { background: linear-gradient(135deg, var(--honey) 0%, #f7c65a 100%); color: var(--bark); border-radius: 24px; padding: 3rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.cta h2 { color: var(--bark); }
.cta p { margin-bottom: 0; }
.cta .actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }
.cta .btn-outline { background: rgba(255,255,255,.35); }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; padding: 2rem; } .cta .actions { justify-content: flex-start; } }

/* --- Footer --- */
.site-footer { background: #1a1405; color: rgba(255,255,255,.7); padding: 3.5rem 0 2rem; font-size: .93rem; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 760px) { .site-footer .container { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .brand { color: #fff; margin-bottom: .75rem; }
.site-footer .brand small { color: rgba(255,255,255,.55); }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem; margin-top: .5rem; font-size: .82rem; color: rgba(255,255,255,.5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* --- Error page --- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.error-page strong { font-size: 6rem; color: var(--honey); line-height: 1; display: block; }

/* --- Reveal on scroll (progressive enhancement) --- */
/* Les éléments ne sont masqués que si le JS tourne (classe html.js), avec un
   filet de sécurité côté JS qui révèle tout après 1,5 s. Sans JS : tout visible. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
  html.js .reveal.is-visible { opacity: 1; transform: none; }
}

/* --- Contenu de page (rubriques) --- */
.page-hero .breadcrumb { font-size: .85rem; color: rgba(255,255,255,.6); margin-bottom: 1rem; }
.page-hero .breadcrumb a { color: rgba(255,255,255,.8); }
.prose { max-width: 48rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }
.prose img { border-radius: var(--radius); }
.prose ul { padding-left: 1.3em; }
.prose blockquote, .quote { margin: 0 0 1.5rem; padding: 1.25rem 1.5rem; border-left: 4px solid var(--honey); background: var(--honey-soft); border-radius: 0 12px 12px 0; font-style: italic; color: var(--bark); }
.quote p:last-child { margin: 0; }
.aside { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.aside h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--honey-deep); }
.aside ul { list-style: none; padding: 0; margin: 0; }
.aside li { padding: .45rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.aside li:last-child { border-bottom: 0; }
.aside a { color: var(--bark); font-weight: 600; }
.aside a[aria-current="page"] { color: var(--honey-deep); }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; align-items: start; }
.with-aside .aside { position: sticky; top: 92px; }
@media (max-width: 900px) { .with-aside { grid-template-columns: 1fr; } .with-aside .aside { position: static; } }
.summary-list { columns: 2; column-gap: 2rem; padding-left: 1.2em; }
@media (max-width: 700px) { .summary-list { columns: 1; } }
.summary-list li { break-inside: avoid; }
.page-head-link { font-size: .85rem; text-align: right; margin-top: -.5rem; }
.float-right { float: right; margin: 0 0 1rem 1.5rem; max-width: 45%; }
.float-left { float: left; margin: 0 1.5rem 1rem 0; max-width: 45%; }
.clearfix::after { content: ""; display: block; clear: both; }
@media (max-width: 600px) { .float-right, .float-left { float: none; max-width: 100%; margin: 0 0 1rem; } }

/* --- Album / lightbox --- */
.album { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; padding: 0; margin: 1rem 0 1.5rem; list-style: none; }
@media (max-width: 700px) { .album { grid-template-columns: repeat(2, 1fr); } }
.album li { margin: 0; }
.album a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.album img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.album a:hover img { transform: scale(1.04); }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps-list > li { position: relative; padding-left: 3.25rem; margin-bottom: 2rem; }
.steps-list > li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bark); color: var(--honey); font-weight: 800; }
.steps-list h3 { margin-top: .35rem; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1100px); max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(20, 15, 4, .88); }
dialog.lightbox img { max-width: min(96vw, 1100px); max-height: 88vh; width: auto; height: auto; border-radius: 10px; margin: 0 auto; }
dialog.lightbox figcaption { color: #fff; text-align: center; padding: .75rem; font-size: .95rem; }
dialog.lightbox button { position: absolute; top: .5rem; right: .5rem; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--bark); font-size: 1.4rem; cursor: pointer; }

/* --- Cartes de rubrique (pages liées) --- */
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.related a { display: block; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--bark); font-weight: 600; transition: border-color .15s, transform .15s; }
.related a:hover { border-color: var(--honey); transform: translateY(-2px); text-decoration: none; }
.related a span { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: .3rem; }

/* --- Coordonnées --- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.contact-grid .card p { margin-bottom: .5rem; }
.depPres { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; }
.depPres img { max-height: 90px; width: auto; }
