@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url(polices/fredoka-600.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400 700; font-display: swap; src: url(polices/nunito.woff2) format("woff2"); }

:root {
  --sapin: #17432f; --rouge: #c8322a; --rouge-survol: #a92820; --texte: #17241d; --doux: #56625c; --trait: #e5e9e6; --fond: #ffffff;
  --v-fond: #ffffff; --v-texte: #17241d; --v-survol: #f1f4f2; --accent: #c8322a;
  --rayon: 22px; --ecart: clamp(14px, 1.6vw, 24px);
  --titre: "Fredoka", "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: "Nunito", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
img, video { display: block; }

.page { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) clamp(48px, 8vw, 96px); }

.barre { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; }
.marque { margin: 0; font-family: var(--titre); font-weight: 600; font-size: 22px; color: var(--rouge); }
.date { margin: 0; font-size: 15px; font-weight: 600; color: var(--doux); }

/* Le village au matin, la neige tombe */
.hero { position: relative; height: min(70vh, 680px); min-height: 460px; border-radius: 28px; overflow: hidden; background: #dfe8f1 url(img/village-matin.webp) center 75% / cover; }
.neige { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: #fff; }
.hero-texte { position: relative; z-index: 1; padding: clamp(28px, 5vw, 64px); }
h1 { margin: 0 0 12px; font-family: var(--titre); font-weight: 600; font-size: clamp(42px, 6.2vw, 92px); line-height: 1.02; color: var(--sapin); text-wrap: balance; }
.sous-titre { margin: 0; max-width: 36ch; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; color: #22352b; text-wrap: balance; }
.dodos { display: inline-flex; margin: 24px 0 0; padding: 12px 22px; border-radius: 999px; background: var(--rouge); color: #fff; font-size: 17px; font-weight: 700; white-space: nowrap; }

h2 { margin: clamp(40px, 6vw, 72px) 0 20px; font-family: var(--titre); font-weight: 600; font-size: clamp(28px, 3vw, 40px); color: var(--sapin); }

/* Les caméras : la première prend la place d'honneur */
.grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ecart); }
.carte { display: flex; flex-direction: column; padding: 10px; border: 0; border-radius: var(--rayon); background: #fff; outline: 1px solid var(--trait); text-align: left; transition: outline-color 0.2s; }
button.carte:hover { outline: 2px solid var(--rouge); }
.carte-une { grid-column: span 2; grid-row: span 2; }
.apercu { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: calc(var(--rayon) - 8px); overflow: hidden; background: #e9edf0; }
.carte-une .apercu { flex: 1; aspect-ratio: auto; min-height: 0; }
.apercu video, .apercu img { width: 100%; height: 100%; object-fit: cover; }
.carte-texte { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px 6px; }
.carte-num { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rouge); }
.carte-nom { font-family: var(--titre); font-weight: 600; font-size: 20px; line-height: 1.25; color: var(--sapin); }
.carte-etat { font-size: 15px; line-height: 1.35; color: var(--doux); }

.direct { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 999px; background: var(--rouge); color: #fff; font-size: 13px; font-weight: 700; }
.direct::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: clignote 1.4s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0.25; } }

.carte-verrou .apercu::after { content: ""; position: absolute; inset: 0; background: rgba(8, 12, 24, 0.5); }
.verrou { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.verrou svg { width: 44px; fill: #fff; }

/* La caméra en grand, la liste des caméras sur le côté */
.visionneuse {
  --pad: clamp(12px, 2.4vw, 32px);
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: var(--pad); border: 0; background: var(--v-fond); color: var(--v-texte);
  grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 290px); gap: var(--pad); align-items: center;
}
.visionneuse[open] { display: grid; }
.visionneuse::backdrop { background: var(--v-fond); }
.v-ecran { position: relative; justify-self: center; width: min(100%, calc((100dvh - 2 * var(--pad)) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: var(--rayon); overflow: hidden; background: #1b2620; }
.v-ecran video { width: 100%; height: 100%; object-fit: cover; }

.osd { position: absolute; inset: 0; padding: clamp(12px, 2vw, 28px); pointer-events: none; color: #fff; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(12px, 1.25vw, 18px); line-height: 1.35; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 0 3px rgba(0, 0, 0, 0.9); font-variant-numeric: tabular-nums; }
.osd p { margin: 0; display: flex; flex-direction: column; }
.osd-haut { display: flex; justify-content: space-between; gap: 1.5em; }
.osd-haut p:first-child { min-width: 0; }
.osd-droite { align-items: flex-end; flex: none; }
.osd-bas { position: absolute; left: clamp(12px, 2vw, 28px); right: clamp(12px, 2vw, 28px); bottom: clamp(12px, 2vw, 28px); }
.rec { display: inline-flex; align-items: center; gap: 0.5em; }
.rec::before { content: ""; width: 0.7em; height: 0.7em; border-radius: 50%; background: #ff3b30; animation: clignote 1.2s steps(1) infinite; }

.v-liste { display: flex; flex-direction: column; gap: 10px; align-self: center; }
.v-item { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: calc(var(--rayon) - 4px); background: transparent; text-align: left; font-size: 15px; font-weight: 700; line-height: 1.25; outline: 2px solid transparent; outline-offset: -2px; }
.v-item img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--rayon) - 10px); }
.v-item:hover { background: var(--v-survol); }
.v-item[aria-current="true"] { outline-color: var(--accent); background: var(--v-survol); }
.v-fermer { position: absolute; top: calc(var(--pad) / 2 + 4px); right: calc(var(--pad) / 2 + 4px); z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--v-survol); }
.v-fermer svg { width: 22px; fill: currentColor; }
.v-fermer:hover { background: var(--rouge); color: #fff; }
:is(.carte, .v-item, .v-fermer):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 1024px) {
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .visionneuse { grid-template-columns: 1fr; align-content: center; }
  .v-ecran { width: 100%; }
  .v-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .v-item { grid-template-columns: 1fr; gap: 6px; font-size: 14px; }
  .v-item img { width: 100%; }
  .v-fermer { top: 8px; right: 8px; }
}
@media (max-width: 640px) {
  .barre .date { display: none; }
  .hero { height: 62vh; min-height: 420px; background-position: 40% 80%; }
  .hero-texte { padding: 24px 20px; }
  .dodos { padding: 10px 16px; font-size: 15px; }
  .grille { grid-template-columns: 1fr; }
  .carte-une { grid-column: auto; grid-row: auto; }
  .carte-une .apercu { aspect-ratio: 16 / 9; }
  .v-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v-item { font-size: 13px; padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { .direct::before, .rec::before { animation: none; } }
