/* ==========================================================================
   Fabvideo – carte de visite
   CSS moderne, sans framework. Réglages de couleurs et de tailles : :root
   ========================================================================== */

/* Thème : par défaut celui de l'appareil. Le bouton du site force « light » ou « dark »
   en posant data-theme sur <html>. Chaque couleur s'écrit light-dark(clair, sombre). */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

:root {
  /* Palette « Plateau » : bleu nuit et orange chaud, comme un étalonnage cinéma. Le clair reprend la même teinte, très atténuée.
     Anciennes valeurs (gris neutre), au cas où : bg #eceff3 / #0d1117, card #fff / #161b22, soft #f6f7f9 / #1c232c,
     ink #1f2933 / #e6edf3, muted #52606d / #a8b3bf, line #e4e7eb / #2d3743, accent #b83c0a / #fb923c. */
  --bg:           light-dark(#e4edef, #0a1a20);
  --card:         light-dark(#fff, #0f242b);
  --soft:         light-dark(#eef4f5, #143039);
  --ink:          light-dark(#0e2329, #e9f1f2);
  --muted:        light-dark(#46636b, #9db6bb);
  --line:         light-dark(#d1e0e3, #1f3d47);
  --accent:       light-dark(#b83c0a, #f08a3c);   /* orange « caméra » */
  --accent-ink:   light-dark(#fff, #1b1008);      /* texte sur un bouton orange */
  --field:        light-dark(#fff, #0a1a20);
  --field-border: light-dark(#6b8a92, #7a979e);   /* contour des champs : 3:1 minimum (WCAG 1.4.11) */
  --glass:        light-dark(rgb(255 255 255 / .96), rgb(15 36 43 / .96));
  --ok:           light-dark(#067647, #47cd89);
  --err:          light-dark(#b42318, #f97066);
  --sh1:          light-dark(rgb(10 40 50 / .07), rgb(0 0 0 / .45));
  --sh2:          light-dark(rgb(10 40 50 / .11), rgb(0 0 0 / .55));

  --radius: 16px;
  --nav-w: 96px;
  --shadow: 0 1px 2px var(--sh1), 0 12px 40px var(--sh2);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);       /* titres : police hébergée sur le site (fonts/), repli système */
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;   /* durées et timecode */
}

/* Bricolage Grotesque (SIL Open Font License, texte dans fonts/OFL.txt). Sous-ensemble latin : accents français inclus. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 700 800; font-style: normal; font-display: swap;
}

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

/* Taille du texte : 18 px au lieu de 16 px. Tout le reste est en rem et suit ce réglage
   (et celui que le visiteur a choisi dans son navigateur). Pour grossir ou réduire : changer ce pourcentage. */
html { -webkit-text-size-adjust: 100%; font-size: 112.5%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

body {
  margin: 0;
  min-height: 100dvh;
  font: 1rem/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--accent); }
a:hover { text-decoration: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.skip {
  position: absolute; left: -999px; top: .5rem; z-index: 20;
  background: var(--card); padding: .5rem 1rem; border-radius: 8px;
}
.skip:focus { left: .5rem; }

/* ---------- Carte ---------- */

.card {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  width: min(1120px, calc(100% - 2rem));          /* garde 1 rem de marge de chaque côté, aussi sur tablette */
  min-height: min(700px, calc(100dvh - 4rem));
  margin: clamp(1rem, 6vh, 4rem) auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

/* ---------- Bouton thème clair / sombre ---------- */

.theme-toggle {
  position: absolute; top: .9rem; right: .9rem; z-index: 5;
  display: none; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--muted); background: var(--card);
  border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.js .theme-toggle { display: grid; }          /* sans JavaScript, le bouton ne servirait à rien */
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }

/* ---------- Navigation ---------- */

.nav {
  background: var(--soft);
  border-right: 1px solid var(--line);
  padding: 1.5rem 0;
}
.nav ul { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .85rem .25rem;
  font-size: .8rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a:active { background: var(--line); }
.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--card);
  border-left-color: var(--accent);
}

.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Sections ---------- */

.panels { padding: clamp(1.5rem, 4vw, 3rem); }

.panel { animation: enter .35s ease both; }
.panel + .panel { margin-top: 3.5rem; }                 /* sans JavaScript */
.js .panel { display: none; margin-top: 0; }
.js .panel.is-active { display: block; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

h2 { font: 700 clamp(1.5rem, 3vw, 1.9rem)/1.2 var(--display); letter-spacing: -.01em; margin-bottom: 1.25rem; }
h3 { font-size: 1.05rem; line-height: 1.3; }
.muted { color: var(--muted); margin-bottom: 1.5rem; }

/* Accueil */
.hero { padding-block: clamp(1rem, 8vh, 4rem); }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.hero-text { min-width: 0; }

/* ---------- Viseur : cadre de caméra autour d'une image ----------
   Quatre coins de cadrage (comme à l'écran d'une caméra), et sur la photo d'accueil une mire au centre,
   un témoin REC et un timecode qui compte le temps passé sur la page. Tout ce décor est caché des lecteurs d'écran. */
.vf { position: relative; margin: 10px; }               /* marge : les coins dépassent de 9 px, ils ne doivent pas être rognés */
.vf-img { position: absolute; inset: 0; overflow: hidden; background: var(--soft); }
.vf-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vf::before, .vf::after, .vf-ui::before, .vf-ui::after {
  content: ""; position: absolute; z-index: 2; width: 22px; height: 22px;
  border: 0 solid var(--accent); pointer-events: none;
}
.vf::before { left: -9px; top: -9px; border-left-width: 3px; border-top-width: 3px; }
.vf::after { right: -9px; top: -9px; border-right-width: 3px; border-top-width: 3px; }
.vf-ui { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.vf-ui::before { left: -9px; bottom: -9px; border-left-width: 3px; border-bottom-width: 3px; }
.vf-ui::after { right: -9px; bottom: -9px; border-right-width: 3px; border-bottom-width: 3px; }

.vf-cross {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%);
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round;
  filter: drop-shadow(0 0 2px rgb(0 0 0 / .75));          /* lisible sur une photo claire comme sombre */
}
.vf-rec {
  position: absolute; left: 10px; top: 10px; display: flex; align-items: center; gap: .4rem;
  padding: .25rem .5rem; border-radius: 3px; background: rgb(0 0 0 / .62); color: #fff;
  font: 600 .72rem/1 var(--mono); letter-spacing: .04em;
}
.vf-rec i { width: .6rem; height: .6rem; border-radius: 50%; background: #ff3b30; }
.vf-badge {
  position: absolute; right: 8px; bottom: 8px; padding: .12rem .45rem; border-radius: 2px;
  background: rgb(0 0 0 / .72); color: #fff; font: 600 .75rem/1.4 var(--mono);
}
.is-playing .vf-badge { display: none; }                /* la durée ne doit pas masquer les commandes du lecteur */
.vf-cap { margin-top: 1rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Photo d'accueil : cadre 4:5 */
.portrait { flex: none; width: clamp(160px, 22vw, 240px); aspect-ratio: 4 / 5; margin: 10px 1.25rem 10px 10px; }
.portrait .vf-img img { transform: scale(1.18); transform-origin: 50% 32%; }   /* recadrage : le visage au centre du cadre */

.eyebrow { font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.wordmark { font: 800 clamp(2.75rem, 9vw, 5rem)/1 var(--display); letter-spacing: -.03em; margin: .5rem 0 1.25rem; }
.wordmark span { color: var(--accent); }
.lead { max-width: 34rem; font-size: 1.2rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.25rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--accent-ink); background: var(--accent);
  border: 2px solid var(--accent); border-radius: 999px;
  transition: filter .15s, background-color .15s;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); filter: brightness(.92); }         /* retour visible quand on appuie (tactile) */
.btn:disabled { opacity: .6; cursor: wait; }
.btn .icon { width: 20px; height: 20px; }
.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { filter: none; background: var(--soft); }

/* Accueil : dernière réalisation */
.latest {
  display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 1.75rem; align-items: center;
  margin-top: 2.25rem; color: var(--ink); text-decoration: none;
}
.latest .vf { margin: 10px; aspect-ratio: 16 / 9; }
.latest-txt small { display: block; margin-bottom: .25rem; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.latest-txt strong { font: 700 1.15rem/1.25 var(--display); }
.latest:hover .latest-txt strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.latest:active { opacity: .85; }

/* À propos */
.about { display: flex; gap: 1.5rem; align-items: flex-start; }
.about p + p { margin-top: .75rem; }
.portrait.portrait--small { width: 112px; margin: 10px 14px 10px 10px; }   /* version réduite, page « À propos » : coins seulement */
.about + .group.about-group { margin: 2rem 0 .75rem; }
.about-group + .services { margin-top: 0; }
.services {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem;
  margin-top: 2rem;
}
.services li { padding: 1rem; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.services strong { display: block; margin-bottom: .25rem; }
.services span { font-size: .9rem; color: var(--muted); }
/* À propos : définition, histoire, « ce que ce n'est pas », questions fréquentes, références */
.lead { font-size: 1.1rem; margin-bottom: 1.25rem; max-width: 62ch; }
.group.about-more { margin: 2rem 0 .75rem; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.history li { padding: .75rem 1rem; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.history strong { margin-right: .5rem; }
.notbox { padding: 1rem; border: 1px dashed var(--field-border); border-radius: 12px; max-width: 62ch; }
.faq { display: grid; gap: .5rem; }
.faq details { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 0 1rem; }
.faq summary { cursor: pointer; list-style: none; padding: .85rem 2rem .85rem 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .55rem; font-size: 1.4rem; line-height: 1.3; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 .9rem; margin: 0; }
.refs { margin: 0; }
.refs span { color: var(--muted); }
.reviewed { margin: 1rem 0 0; font-size: .9rem; }

.side-project {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line); color: var(--muted);
}

/* Réalisations */
.more { margin-top: 1.75rem; font-weight: 600; }
.more a { display: inline-flex; align-items: center; gap: .4rem; padding-block: .6rem; }   /* zone tactile ≥ 44 px */
.more .icon { width: 18px; height: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.video--featured { grid-column: 1 / -1; max-width: 480px; }   /* une seule vidéo : on la montre en grand */
.video .video-note { margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.video--featured h3 { font: 700 1.25rem/1.25 var(--display); margin-top: .5rem; }
.video--featured p { font-size: 1rem; }
.next { margin: 1.5rem 0 0; }
.video p { font-size: .9rem; color: var(--muted); }
.video h3 { margin: .65rem 0 .15rem; }
.video-media {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0;
  border: 0; border-radius: 2px; overflow: hidden; cursor: pointer;      /* coins nets : le cadre de viseur fait le reste */
  background: linear-gradient(135deg, #2a3441, #4a5568) center / cover no-repeat;
  color: #fff;
}
.video-media:disabled { cursor: default; }
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-media:not(:disabled):active .play { transform: scale(.94); }
.video-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-media .play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; padding: 14px;
  fill: currentColor; stroke: none;
  background: rgb(0 0 0 / .55); border-radius: 50%;
  transition: transform .15s, background-color .15s;
}
.video-media:not(:disabled):hover .play { transform: scale(1.08); background: var(--accent); }
.video-media .soon {
  position: absolute; left: .6rem; bottom: .5rem;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85;
}
.video-media:not(:disabled) .soon { display: none; }

/* Avis clients */
.avis-vide {
  max-width: 34rem; padding: 1.5rem;
  background: var(--soft); border: 1px dashed var(--field-border); border-radius: 12px;
}
.avis-vide p + p { margin-top: .5rem; color: var(--muted); }
.avis-vide .actions { margin-top: 1.25rem; }
.avis-note { max-width: 34rem; margin: 1.25rem 0 0; }
.reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.review { margin: 0; padding: 1.25rem; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.review blockquote { margin: 0 0 .85rem; }
.review blockquote p { font-size: 1.05rem; }
.review figcaption { font-size: .85rem; color: var(--muted); }
.review figcaption strong { color: var(--ink); }

/* Liens */
.group { margin: 1.5rem 0 .75rem; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group:first-of-type { margin-top: 0; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.link-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 100%; padding: .9rem 1.1rem;
  color: var(--ink); text-decoration: none;
  background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, transform .15s;
}
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-card:active { transform: translateY(0); background: var(--line); }
.link-card strong { display: block; }
.link-card small { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.link-card .icon { color: var(--accent); width: 20px; height: 20px; }
.link-card .txt { flex: 1; min-width: 0; }

/* pastille de logo : la couleur vient de --c, définie sur chaque lien */
.badge {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--fg); background: color-mix(in srgb, var(--c) 12%, var(--card));
}
.link-card .badge .icon { color: inherit; width: 24px; height: 24px; }

/* rangée d'icônes sur l'accueil */
/* en sombre, la couleur de marque est éclaircie pour rester lisible */
.badge, .social a { --fg: light-dark(var(--c), color-mix(in srgb, var(--c) 60%, #fff)); }
.social { display: flex; gap: .6rem; margin-top: 2rem; }
.social a {
  display: grid; place-items: center; width: 44px; height: 44px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 50%;
  transition: color .15s, border-color .15s, transform .15s;
}
.social a:hover { color: var(--fg); border-color: var(--fg); transform: translateY(-2px); }

/* Contact */
form { max-width: 36rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1rem; }
label { display: block; margin-bottom: .3rem; font-size: .9rem; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; padding: .65rem .8rem;
  font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--field-border); border-radius: 10px;
}
textarea { resize: vertical; min-height: 8rem; }
input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input:user-invalid, textarea:user-invalid { border-color: var(--err); }
.note { margin-bottom: 1rem; font-size: .9rem; color: var(--muted); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#form-status { font-weight: 600; }
#form-status.ok { color: var(--ok); }
#form-status.error { color: var(--err); }

/* Mentions légales */
.legal { max-width: 46rem; }
.legal h3 { margin: 1.75rem 0 .5rem; font-size: 1.05rem; }
.legal p + p, .legal ul + p { margin-top: .75rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal li { margin-bottom: .35rem; }
.legal dl { display: grid; grid-template-columns: 13rem 1fr; gap: .35rem 1.25rem; margin: 0; }
.legal dt { font-weight: 600; }
.legal dd { margin: 0; }
#stats-status { margin-top: .75rem; font-weight: 600; }
/* champ à compléter : surligné pour ne pas passer inaperçu */
.todo { padding: 0 .3em; border-radius: 4px; background: #fde68a; color: #1f2933; }

/* Pied de page */
.foot { padding: 0 1rem 2rem; text-align: center; font-size: .85rem; color: var(--muted); }
.foot a { display: inline-block; padding: .7rem .5rem; }                      /* zone tactile ≥ 44 px */

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .card {
    display: block; width: auto; min-height: 100dvh; margin: 0;
    border-radius: 0; box-shadow: none;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .nav {
    position: fixed; inset: auto 0 0 0; z-index: 10;
    padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(8px);
  }
  /* la barre fixe du bas ne doit jamais cacher un champ qui reçoit le focus (WCAG 2.4.11) */
  html { scroll-padding-bottom: 6rem; }
  .nav ul { flex-direction: row; gap: 0; }
  .nav li { flex: 1; }
  .nav a { padding: .55rem .15rem .45rem; font-size: .7rem; border-left: 0; border-top: 3px solid transparent; }   /* 6 entrées : libellés un peu plus petits */
  .nav a[aria-current="page"] { border-left-color: transparent; border-top-color: var(--accent); }

  .panels { padding: 1.5rem 1rem; }                 /* gouttière latérale de 16 px */
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 1.5rem; }   /* photo au-dessus du texte */
  .portrait { width: 140px; margin: 10px; }
  .vf-rec { left: 7px; top: 7px; padding: .2rem .4rem; font-size: .62rem; }
  .vf-cross { width: 34px; height: 34px; }
  .latest { grid-template-columns: 1fr; gap: .5rem; margin-top: 1.5rem; }
  .about { flex-direction: column; gap: 1rem; }
  .legal dl { grid-template-columns: 1fr; gap: 0; }
  .legal dd { margin-bottom: .6rem; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .foot { padding-bottom: 5.5rem; }

  /* Pendant la saisie dans le formulaire, le clavier du téléphone prend déjà la moitié de l'écran :
     on retire la barre du bas pour laisser la place au champ. */
  .card:has(#contact-form :is(input, textarea):focus-within) .nav { display: none; }   /* champs seulement, pas le bouton Envoyer */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
