/* medhi.be — « La carte de nuit » */
:root {
  --nuit: #071430;       /* fond : la carte la nuit */
  --nuit-2: #0B1D44;     /* panneaux */
  --route: #DCE6F5;      /* texte, routes */
  --brume: #9DB0CF;      /* texte secondaire, 7,6:1 sur --nuit */
  --signal: #F6C400;     /* itinéraire, actions */
  --panneau: #1D4F9C;    /* panneaux de direction */
  --font: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--nuit); color: var(--route);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--signal); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 30; background: var(--nuit-2); padding: .5em 1em; }

#carte { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }

/* En-tête */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 18px var(--gutter) 28px;
  background: linear-gradient(var(--nuit) 35%, rgba(7, 20, 48, 0));
}
.wordmark { font-weight: 800; font-size: 1.2rem; color: var(--route); text-decoration: none; letter-spacing: -.01em; }
.site-head nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-head nav a { color: var(--brume); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-head nav a:hover, .site-head nav a[aria-current="true"] { color: var(--route); }
.site-head nav a[aria-current="true"] { box-shadow: 0 2px 0 var(--signal); }

main { position: relative; z-index: 2; }
.vue {
  min-height: 100vh; display: flex; align-items: center;
  padding: 96px var(--gutter) 48px; pointer-events: none;
}
.vue a, .vue button, .panneau, .hero-texte { pointer-events: auto; }
.chapitre { min-height: 150vh; }

/* Accueil */
.hero-texte { max-width: 40rem; }
.hero h1 {
  font-size: clamp(3rem, 8.4vw, 7.6rem); line-height: .9; font-weight: 900;
  letter-spacing: -.04em; margin: 0 0 .35em; max-width: 9ch;
}
.ligne { display: block; overflow: hidden; padding-bottom: .06em; }
.ligne > span { display: inline-block; }
.hero p { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--brume); max-width: 30ch; margin: 0 0 2.2rem; }
.indice { display: inline-flex; align-items: center; gap: 14px; color: var(--brume); font-weight: 600; font-size: .95rem; }
.indice i { width: 2px; height: 42px; background: rgba(220, 230, 245, .18); position: relative; overflow: hidden; }
.indice i::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--signal); }

/* Chapitres : un panneau par application */
.panneau {
  max-width: 31rem; padding: 30px 32px 28px; border-radius: 16px;
  background: rgba(11, 29, 68, .84);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(220, 230, 245, .16), 0 30px 80px rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .7s ease;
}
.panneau.vu { opacity: 1; }
.lieu {
  display: inline-flex; align-items: center; gap: .5em; margin: 0 0 1rem;
  background: var(--panneau); color: #fff; font-weight: 700; font-size: .9rem;
  padding: .35em .85em .3em; border-radius: 7px;
  box-shadow: inset 0 0 0 2px var(--panneau), inset 0 0 0 4px #fff;
}
.lieu svg { width: 14px; height: 14px; }
.panneau h2 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1; letter-spacing: -.03em; font-weight: 900; margin: 0 0 .45em; }
.panneau p { margin: 0 0 1rem; }
.panneau ul { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.panneau li { position: relative; padding-left: 1.4em; margin: .4em 0; color: var(--brume); }
.panneau li::before { content: ""; position: absolute; left: 0; top: .62em; width: .7em; height: 2px; background: var(--signal); }
.note { color: var(--brume); font-size: .92rem; margin: 1rem 0 0 !important; }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--signal); color: #14110A; font-weight: 800; text-decoration: none;
  padding: .8em 1.35em .72em; border-radius: 999px; transition: transform .2s ease, background-color .2s;
}
.btn:hover { background: #FFD633; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

/* Côté du panneau : la carte montre le lieu de l'autre côté */
.chapitre.droite { justify-content: flex-end; }

/* Fin : toutes les applications */
.fin { flex-direction: column; justify-content: flex-end; text-align: center; padding-bottom: 9vh; }
.fin h2 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.03em; font-weight: 900; line-height: 1; margin: 0 0 1.5rem; }
.panneaux {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); width: min(1180px, 100%);
}
.panneaux li { display: flex; }
.sign {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left;
  background: var(--panneau); color: #fff; text-decoration: none; padding: 16px 18px 14px 20px; border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--panneau), inset 0 0 0 5px #fff; transition: transform .2s ease, background-color .2s;
}
.sign:hover { background: #2660B8; box-shadow: inset 0 0 0 3px #2660B8, inset 0 0 0 5px #fff; transform: translateY(-3px); }
.sign b { display: block; font-size: 1.2rem; line-height: 1.1; }
.sign small { display: block; opacity: .85; font-size: .88rem; margin-top: .15em; }
.sign svg { width: 30px; height: 30px; flex: none; }

.site-foot {
  position: relative; z-index: 2; padding: 28px var(--gutter) 40px; color: var(--brume); font-size: .9rem;
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  background: linear-gradient(rgba(7, 20, 48, 0), var(--nuit) 40%);
}

/* L'ouverture : une seule séquence orchestrée au chargement */
@media (prefers-reduced-motion: no-preference) {
  .ligne > span { transform: translateY(105%); animation: monte 1s cubic-bezier(.2, .8, .2, 1) forwards; }
  .ligne:nth-child(2) > span { animation-delay: .12s; }
  .ligne:nth-child(3) > span { animation-delay: .24s; }
  .hero p, .indice { opacity: 0; animation: apparait .8s ease .9s forwards; }
  .indice i::after { animation: glisse 1.8s cubic-bezier(.6, 0, .4, 1) 2s infinite; }
  @keyframes monte { to { transform: none; } }
  @keyframes apparait { to { opacity: 1; } }
  @keyframes glisse { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
}
@media (prefers-reduced-motion: reduce) { .panneau { opacity: 1; transition: none; } }

@media (max-width: 760px) {
  .site-head { flex-direction: column; align-items: flex-start; gap: .4rem; padding-bottom: 20px; }
  .site-head nav { gap: .8rem; }
  .site-head nav a { font-size: .85rem; }
  .vue { padding-top: 120px; }
  .hero { align-items: flex-start; }
  /* La carte occupe le haut de l'écran, la fiche le bas */
  .chapitre, .chapitre.droite { display: block; padding-top: 70vh; }
  .panneau { max-width: none; width: 100%; padding: 20px 20px 22px; }
  .panneau h2 { font-size: 2.1rem; }
  .panneau ul, .panneau .note { display: none; }
  .lieu { margin-bottom: .7rem; }
}
