:root {
  --ink: #12170f;
  --panel: rgba(16, 21, 13, 0.88);
  --text: #ece7d2;
  --muted: #bdb797;
  --khaki: #c9b26b;
  --olive: #4b5320;
  --discord: #5865f2;
  --display: 'Saira Stencil One', Impact, 'Arial Narrow Bold', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--olive);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- Fond camouflage animé ---------- */
.camo, .shade { position: fixed; inset: 0; z-index: -2; }
.camo-a, .camo-b { position: absolute; inset: 0; }
.camo-a {
  background-color: var(--olive);
  background-image: var(--camo-a);
  background-size: 1000px 1000px;
  animation: drift-a 110s linear infinite;
}
.camo-b {
  background-image: var(--camo-b);
  background-size: 1300px 1300px;
  animation: drift-b 150s linear infinite;
}
@keyframes drift-a { to { background-position: 1000px 1000px; } }
@keyframes drift-b { to { background-position: -1300px 1300px; } }

.shade {
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.45) 80%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
}

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem clamp(1rem, 4vw, 3rem);
  background: rgba(12, 16, 9, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--khaki);
}
.brand {
  font-family: var(--display); font-size: 1.6rem;
  color: var(--khaki); text-decoration: none;
}
.topbar nav { display: flex; align-items: center; gap: clamp(0.8rem, 2.5vw, 1.8rem); }
.topbar nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.topbar nav a:not(.btn):hover { color: var(--khaki); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  background: var(--discord); color: #fff;
  font-weight: 600; font-size: 1.05rem; text-decoration: none;
  border-radius: 4px; border: 2px solid #fff3;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: #4752c4; transform: translateY(-2px); }
.btn-small { padding: 0.4rem 1rem; font-size: 0.95rem; }

a:focus-visible, .btn:focus-visible { outline: 3px solid var(--khaki); outline-offset: 3px; }

/* ---------- Hero ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 3rem; }

.hero { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 3rem 0; }
.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 11vw, 8.5rem); line-height: 0.95;
  color: var(--text);
  text-shadow: 0 4px 0 var(--ink), 0 0 40px rgba(0, 0, 0, 0.7);
}
.hero-text { max-width: 34ch; margin: 0 0 1.8rem; font-size: 1.25rem; text-shadow: 0 1px 6px #000; }

/* ---------- Sections ---------- */
.panel {
  margin-bottom: 2rem; padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--panel);
  border-left: 6px solid var(--khaki);
  border-radius: 2px;
}
.panel h2 { margin: 0 0 0.8rem; font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); color: var(--khaki); }
.panel p { max-width: 65ch; margin: 0 0 0.8rem; }
.lead { font-size: 1.25rem; font-weight: 600; }

/* Régiments */
.regiments { list-style: none; margin: 0; padding: 0; }
.regiments li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem 2rem; align-items: baseline;
  padding: 1rem 0; border-top: 1px solid rgba(201, 178, 107, 0.3);
}
.regiments li:first-child { border-top: 0; }
.regiments h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.regiments p { margin: 0; color: var(--muted); }

/* Spécialités */
.plaques { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.plaque { padding: 1.2rem 1.3rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(201, 178, 107, 0.35); }
.plaque h3 { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--khaki); }
.plaque p { margin: 0; color: var(--text); }

.closing p { margin-bottom: 1.4rem; }

.foot { padding: 1.5rem; text-align: center; color: var(--muted); background: rgba(12, 16, 9, 0.85); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .regiments li { grid-template-columns: 1fr; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .camo-a, .camo-b { animation: none; }
  .btn { transition: none; }
}

/* ---------- Ambiance : chars, flash d'explosion, contrôle du son ---------- */
.tank {
  position: fixed; left: 0; bottom: 72px; z-index: 5;
  width: clamp(170px, 24vw, 300px);
  pointer-events: none; will-change: transform;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55));
}
.tank svg { display: block; width: 100%; height: auto; overflow: visible; }
.tank .tread { stroke-dasharray: 7 7; animation: tread 0.5s linear infinite; }
@keyframes tread { to { stroke-dashoffset: -14; } }
.tank .flash { opacity: 0; transition: opacity 0.12s; }
.tank .barrel { transition: transform 0.55s ease-out; }
.tank.fire .flash { opacity: 1; transition: none; }
.tank.fire .barrel { transform: translateX(-13px); transition: none; }
.tank.reverse .tread { animation-direction: reverse; }
.tank .puff circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.tank.smoke .puff circle { animation: puff 0.9s ease-out; }
@keyframes puff {
  0% { opacity: 0.8; transform: translateX(0) scale(0.5); }
  100% { opacity: 0; transform: translateX(28px) scale(2.4); }
}

.shell {
  position: fixed; left: 0; top: 0; z-index: 6; width: 26px; height: 4px;
  border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffe9a8);
  box-shadow: 0 0 10px 2px rgba(255, 190, 90, 0.7);
}
.spark {
  position: fixed; z-index: 6; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff3c4, #ffb347 40%, transparent 70%);
  animation: spark 0.45s ease-out forwards;
}
@keyframes spark { from { opacity: 1; transform: scale(0.3); } to { opacity: 0; transform: scale(1.8); } }

.boom-flash {
  position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at var(--bx, 50%) 60%, rgba(255, 190, 90, 0.55), rgba(255, 140, 40, 0.12) 40%, transparent 70%);
}
.boom-flash.go { animation: boom 0.7s ease-out; }
@keyframes boom { 0% { opacity: 0; } 10% { opacity: 0.35; } 100% { opacity: 0; } }

.sound-ctl {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 20;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.5rem 0.8rem;
  background: rgba(12, 16, 9, 0.92);
  border: 2px solid var(--khaki); border-radius: 4px;
  font-size: 0.95rem;
}
.sound-btn {
  padding: 0.4rem 0.9rem; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--text); background: transparent;
  border: 2px solid var(--khaki); border-radius: 3px;
}
.sound-btn:hover { background: rgba(201, 178, 107, 0.2); }
.sound-btn.on { background: var(--khaki); color: var(--ink); }
.sound-btn:not(.on) { animation: hint 2s ease-in-out infinite; }
@keyframes hint { 50% { box-shadow: 0 0 0 5px rgba(201, 178, 107, 0.35); } }
.sound-vol { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.sound-vol input { width: 90px; accent-color: var(--khaki); }
.sound-btn:focus-visible, .sound-vol input:focus-visible { outline: 3px solid var(--khaki); outline-offset: 3px; }

@media (max-width: 640px) {
  .sound-vol span { display: none; }
  .sound-vol input { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .tank, .boom-flash, .shell, .spark { display: none; }
  .sound-btn:not(.on) { animation: none; }
}

/* ---------- Catégories ---------- */
[hidden] { display: none !important; }

.topbar nav a[aria-current="page"]:not(.btn) { color: var(--khaki); box-shadow: 0 2px 0 var(--khaki); }
.brand[aria-current] { color: var(--khaki); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.tile {
  display: block; padding: 1.6rem 1.8rem; text-decoration: none; color: var(--text);
  background: var(--panel); border-left: 6px solid var(--khaki);
  transition: transform 0.15s, background 0.15s;
}
.tile:hover { transform: translateY(-4px); background: rgba(28, 36, 22, 0.94); }
.tile h2 { margin: 0 0 0.3rem; font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.6rem); color: var(--khaki); }
.tile p { margin: 0; color: var(--muted); }
.tile:focus-visible { outline: 3px solid var(--khaki); outline-offset: 3px; }

.hero { min-height: 58vh; }
.sky-space { height: 40vh; }

/* ---------- Avions et hélicoptères ---------- */
.aircraft {
  position: fixed; left: 0; top: 0; z-index: 5;
  pointer-events: none; will-change: transform;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.4));
}
.aircraft svg { display: block; width: 100%; height: auto; overflow: visible; }
.aircraft.jet { width: clamp(120px, 15vw, 200px); }
.aircraft.heli { width: clamp(130px, 17vw, 220px); }
.aircraft .burner { animation: burn 0.12s linear infinite alternate; }
@keyframes burn { from { opacity: 1; } to { opacity: 0.55; } }
.aircraft .rotor ellipse, .aircraft .trotor ellipse {
  transform-box: fill-box; transform-origin: center;
  animation: spinrotor 0.14s linear infinite;
}
.aircraft .trotor ellipse { animation-name: spintail; }
@keyframes spinrotor { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.15); } }
@keyframes spintail { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.15); } }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 0.4rem; }
  .brand { font-size: 1.3rem; }
  .topbar nav { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .topbar nav a { font-size: 0.95rem; }
  .sky-space { height: 36vh; }
}
@media (prefers-reduced-motion: reduce) {
  .aircraft { display: none; }
}

/* ---------- Soldats (Spécialités) ---------- */
.soldier {
  --u: #4b5320;
  position: fixed; left: 0; top: 0; z-index: 5;
  width: clamp(64px, 8vw, 110px);
  pointer-events: none; will-change: transform;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}
.soldier.b { --u: #7a6a3f; }
.soldier svg { display: block; width: 100%; height: auto; overflow: visible; }
.soldier .pose-kneel { display: none; }
.soldier.kneel .pose-stand { display: none; }
.soldier.kneel .pose-kneel { display: inline; }
.soldier .flash { opacity: 0; }
.soldier.fire .flash { opacity: 1; }

.tracer {
  position: fixed; left: 0; top: 0; z-index: 6; width: 20px; height: 2px;
  transform-origin: 100% 50%; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffe9a8);
  box-shadow: 0 0 6px 1px rgba(255, 190, 90, 0.6);
}
.spark.small { width: 22px; height: 22px; margin: -11px 0 0 -11px; animation-duration: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .soldier, .tracer { display: none; }
}

/* ---------- Boutons : recrutement, compteur Discord ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn-form { background: var(--khaki); color: var(--ink); }
.btn-form:hover { background: #dcc781; }
.online { position: relative; margin-left: 0.5rem; padding-left: 1rem; font-weight: 500; font-size: 0.9em; }
.online::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 0.6rem; height: 0.6rem;
  margin-top: -0.3rem; border-radius: 50%; background: #3ba55d;
}

/* ---------- Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.shot {
  padding: 0; margin: 0; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 16 / 10; background: #000;
  border: 2px solid rgba(201, 178, 107, 0.35);
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.shot:hover { border-color: var(--khaki); }
.shot:hover img { transform: scale(1.05); }
.shot:focus-visible { outline: 3px solid var(--khaki); outline-offset: 3px; }

.lightbox {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 1rem; background: rgba(6, 8, 4, 0.95);
}
.lightbox figure { margin: 0; max-width: 84vw; text-align: center; }
.lightbox img { max-width: 100%; max-height: 78vh; border: 2px solid var(--khaki); }
.lightbox figcaption { margin-top: 0.6rem; color: var(--muted); }
.lb-btn {
  flex: none; width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; cursor: pointer;
  color: var(--text); background: rgba(12, 16, 9, 0.9); border: 2px solid var(--khaki); border-radius: 4px;
}
.lb-btn:hover { background: var(--khaki); color: var(--ink); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { position: absolute; top: 1rem; right: 1rem; }
body.lb-open { overflow: hidden; }

/* ---------- Avion de transport et parachutistes ---------- */
.aircraft.transport { width: clamp(200px, 26vw, 340px); }
.aircraft .prop ellipse {
  transform-box: fill-box; transform-origin: center;
  animation: spinprop 0.06s linear infinite;
}
@keyframes spinprop { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.3); } }

.para {
  --c: #a39468;
  position: fixed; left: 0; top: 0; z-index: 5; width: clamp(38px, 4.5vw, 64px);
  transform-origin: 50% 20%; pointer-events: none; will-change: transform;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.45));
  transition: opacity 0.7s;
}
.para svg { display: block; width: 100%; height: auto; overflow: visible; }
.para .canopy { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0.08); transition: transform 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.para .lines { opacity: 0; transition: opacity 0.3s; }
.para.open .canopy { transform: scale(1); }
.para.open .lines { opacity: 1; }
.para.landed { opacity: 0; }
.para.landed .canopy { transform: scale(1, 0.2); transition-duration: 0.4s; }

@media (max-width: 640px) {
  .topbar nav { flex-wrap: wrap; }
  .lightbox { padding: 0.5rem; gap: 0.4rem; }
  .lightbox figure { max-width: 78vw; }
  .lb-btn { width: 2.4rem; height: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .para { display: none; }
}
