/* ==========================================================================
   DBMT 3D Studio — portfolio véhicules militaires
   Identité : fond nuit, cyan #22E0DA, violet #9B4DF0, Chakra Petch + Rajdhani
   ========================================================================== */

:root {
  --night: #070B10;
  --panel: #0D141B;
  --panel-2: #111B24;
  --line: #1D2B36;
  --line-strong: #2B3E4C;
  --grid: rgba(34, 224, 218, 0.06);
  --cyan: #22E0DA;
  --cyan-dim: rgba(34, 224, 218, 0.55);
  --violet: #9B4DF0;
  --text: #E4ECEF;
  --muted: #8FA0AB;
  --danger: #FF6B7A;

  --font-display: "Chakra Petch", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --font-body: "Rajdhani", "Segoe UI", system-ui, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-space: clamp(4.5rem, 10vw, 8rem);
  --header-h: 4.25rem;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--cyan);
  color: var(--night);
  font-weight: 600;
}
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--cyan); color: var(--night); }
.btn-primary:hover { background: var(--text); color: var(--night); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(7, 11, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}
.brand b { color: var(--cyan); font-weight: 600; }
.brand-mark { width: 2rem; height: 2rem; color: var(--cyan); }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--text); }
.site-nav .nav-cta {
  color: var(--cyan);
  border-bottom: 1px solid var(--cyan-dim);
}

.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 2px; }
.lang-switch button {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 0.9rem var(--font-display);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--panel-2); color: var(--cyan); }

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.nav-toggle span { display: block; width: 1.2rem; height: 2px; background: var(--text); transition: transform 0.2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--night);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.8rem 0; width: 100%; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { border-bottom-color: var(--line); }
  .lang-switch { margin-top: 1rem; }
}

/* ---------- Hero : la planche ---------- */
.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 6vw, 4.5rem);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  border-bottom: 1px solid var(--line);
}
.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  max-width: 13ch;
}
.hero-intro p { color: var(--muted); max-width: 34rem; font-size: 1.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.sheet {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  background: rgba(7, 11, 16, 0.6);
}
.blueprint { width: 100%; height: auto; overflow: visible; }
.blueprint .draw,
.blueprint .fade circle,
.blueprint .links {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.blueprint .links { stroke-width: 1; stroke-dasharray: 3 5; stroke: var(--cyan-dim); }
.blueprint .fade circle { stroke-width: 1; stroke: var(--cyan-dim); }
.blueprint .dim path { fill: none; stroke: var(--violet); stroke-width: 1; }
.blueprint .dim .ext { stroke-dasharray: 4 4; opacity: 0.6; }
.blueprint .dim text {
  fill: var(--violet);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}

/* L'unique animation d'entrée : le tracé de la planche */
.js .blueprint .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .blueprint .fade { opacity: 0; }
.js .is-drawn .draw { animation: draw 1.3s cubic-bezier(.6,.1,.3,1) calc(var(--i, 0) * 70ms) forwards; }
.js .is-drawn .fade { animation: fade 0.8s ease-out 1.8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

.title-block {
  margin-left: auto;
  margin-top: 1rem;
  width: min(100%, 26rem);
  border: 1px solid var(--line-strong);
}
.title-block dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.title-block div { padding: 0.5rem 0.75rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.title-block div:nth-child(2n) { border-right: 0; }
.title-block div:nth-last-child(-n+2) { border-bottom: 0; }
.title-block dt { color: var(--muted); font-size: 0.85rem; }
.title-block dd { margin: 0; font-family: var(--font-display); font-weight: 600; }

@media (max-width: 52rem) {
  .hero-head { grid-template-columns: 1fr; }
  .title-block { margin-left: 0; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-space); }
.section-alt { background: var(--panel); border-block: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); margin-bottom: 0.75rem; }
.section-head p { color: var(--muted); }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.filters button {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font: 600 0.95rem var(--font-display);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--night); background: var(--cyan); border-color: var(--cyan); }

/* ---------- Grille véhicules ---------- */
.vehicle-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem);
}
.vehicle-grid li.is-featured { grid-column: span 2; grid-row: span 2; }
.vehicle-grid li[hidden] { display: none; }

.vehicle {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vehicle-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.is-featured .vehicle-media { aspect-ratio: auto; flex: 1; min-height: 16rem; }
.vehicle-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.vehicle:hover .vehicle-media img { transform: scale(1.03); }
.vehicle:hover .vehicle-media { border-color: var(--cyan-dim); }

.vehicle-media.no-img {
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
}
.vehicle-media.no-img span { color: var(--muted); font-size: 0.95rem; }

.vehicle-status {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(7, 11, 16, 0.85);
  border: 1px solid var(--line-strong);
}
.vehicle-status[data-status="released"] { color: var(--cyan); border-color: var(--cyan-dim); }
.vehicle-status[data-status="in-progress"] { color: var(--violet); border-color: rgba(155, 77, 240, 0.5); }
.vehicle-status[data-status="planned"] { color: var(--muted); }

.vehicle-meta { padding-top: 0.75rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.vehicle-meta h3 { font-size: 1.35rem; }
.is-featured .vehicle-meta h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.vehicle-meta p { color: var(--muted); white-space: nowrap; }
.vehicle-uses { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.vehicle-uses span {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.05rem 0.45rem;
}

.empty-state { color: var(--muted); padding: 2rem 0; }

@media (max-width: 60rem) {
  .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 36rem) {
  .vehicle-grid { grid-template-columns: 1fr; }
  .vehicle-grid li.is-featured { grid-column: auto; grid-row: auto; }
  .is-featured .vehicle-media { aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- Tableau des services ---------- */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td {
  text-align: left;
  vertical-align: top;
  padding: 1.25rem 1.5rem 1.25rem 0;
  border-bottom: 1px solid var(--line-strong);
}
.spec-table thead th { color: var(--muted); font-weight: 600; font-size: 0.95rem; padding-block: 0.6rem; }
.spec-table tbody th { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; width: 24%; }
.spec-table tbody td:last-child { font-family: var(--font-display); color: var(--cyan); white-space: nowrap; width: 18%; padding-right: 0; }
.spec-table tbody td { max-width: 38rem; }

@media (max-width: 44rem) {
  .spec-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .spec-table, .spec-table tbody, .spec-table tr, .spec-table th, .spec-table td { display: block; width: auto; }
  .spec-table tr { padding-block: 1.25rem; border-bottom: 1px solid var(--line-strong); }
  .spec-table th, .spec-table td { border: 0; padding: 0.2rem 0; }
  .spec-table tbody td:last-child { margin-top: 0.4rem; }
}

.aside-note { margin-top: 2rem; color: var(--muted); max-width: 46rem; }

/* ---------- Étapes ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  counter-reset: step;
  border-top: 1px solid var(--line-strong);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 2.75rem 1.25rem 0 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: -0.85rem;
  left: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  background: var(--night);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font: 600 0.9rem var(--font-display);
}
.steps h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.steps p { color: var(--muted); font-size: 1.05rem; }

@media (max-width: 60rem) {
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-strong); margin-left: 0.85rem; }
  .steps li { padding: 0 0 2rem 2rem; }
  .steps li::before { top: 0; left: -0.85rem; }
}

/* ---------- Commande ---------- */
.section-order { border-top: 1px solid var(--line); }
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(2rem, 6vw, 5rem);
}
.order-intro h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); margin-bottom: 1rem; }
.order-intro > p { color: var(--muted); }
.contact-facts { margin: 2rem 0 0; }
.contact-facts div { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.contact-facts dt { color: var(--muted); font-size: 0.9rem; }
.contact-facts dd { margin: 0; }

.order-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.25rem;
  align-content: start;
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; }
.field small { color: var(--muted); font-weight: 500; }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--text);
  font: 500 1.1rem var(--font-body);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input::placeholder, .field textarea::placeholder { color: #5E6E79; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.1rem) 52%, calc(100% - 0.75rem) 52%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2.2rem; }
.field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }
.field .is-invalid, .field [aria-invalid="true"] { border-color: var(--danger); }

.field-check { flex-direction: row; align-items: flex-start; gap: 0.7rem; }
.field-check input { width: 1.2rem; height: 1.2rem; min-height: 0; margin-top: 0.2rem; accent-color: var(--cyan); flex: none; }
.field-check label { font-weight: 500; color: var(--muted); }

.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-status { color: var(--muted); }
.form-status.is-success { color: var(--cyan); }
.form-status.is-error { color: var(--danger); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 52rem) {
  .order-layout { grid-template-columns: 1fr; }
}
@media (max-width: 36rem) {
  .order-form { grid-template-columns: 1fr; }
}

/* ---------- Fiche véhicule ---------- */
.vehicle-dialog {
  width: min(64rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}
.vehicle-dialog::backdrop { background: rgba(3, 5, 8, 0.82); }
.dlg-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.dlg-media { background: var(--night); min-height: 18rem; display: flex; flex-direction: column; }
.dlg-media img { width: 100%; height: auto; object-fit: contain; }
.dlg-media .dlg-thumbs { display: flex; gap: 0.4rem; padding: 0.5rem; overflow-x: auto; }
.dlg-thumbs button { padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; width: 4.5rem; flex: none; }
.dlg-thumbs button[aria-current="true"] { border-color: var(--cyan); }
.dlg-media.no-img { display: grid; place-items: center; color: var(--muted); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.dlg-body { padding: clamp(1.25rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.dlg-body h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); padding-right: 2.5rem; }
.dlg-body p { color: var(--muted); }
.dlg-specs { margin: 0; width: 100%; }
.dlg-specs div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.dlg-specs dt { color: var(--muted); }
.dlg-specs dd { margin: 0; text-align: right; font-weight: 600; }
.dlg-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--night);
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
}
.dlg-close svg { width: 1.1rem; height: 1.1rem; }
.dlg-close:hover { border-color: var(--cyan); color: var(--cyan); }

@media (max-width: 48rem) {
  .dlg-inner { grid-template-columns: 1fr; }
}

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: 1rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--cyan); }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .blueprint .draw { stroke-dashoffset: 0; }
  .js .blueprint .fade { opacity: 1; }
}

/* Cotes lisibles sur téléphone */
@media (max-width: 36rem) {
  .blueprint .dim text { font-size: 30px; }
}
