﻿/* â€”â€”â€”â€”â€” Vertical â€” dark-only, design assumÃ© â€”â€”â€”â€”â€” */
:root {
  --bg:        #050508;
  --panel:     #0b0b10;
  --panel-edge:rgba(255,255,255,0.07);
  --ink:       #f2f1ec;
  --ink-2:     #a5a49c;
  --ink-3:     #6b6a64;
  --up:        #ff6b35;   /* pÃ´le montÃ©e  */
  --down:      #38b6ff;   /* pÃ´le descente */
  --mid:       #4a4a48;   /* midpoint neutre */
  --mono: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
}

#stage {
  position: fixed; inset: 0;
}
body.loaded #stage { inset: 0 320px 0 0; }
#gl { width: 100%; height: 100%; display: block; }

/* â€”â€”â€”â€”â€” Ã©cran d'accueil â€”â€”â€”â€”â€” */
#dropzone {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(56,182,255,0.045), transparent 60%),
              var(--bg);
  z-index: 10;
  transition: opacity .6s ease;
}
#dropzone.drag { outline: 1px dashed var(--ink-3); outline-offset: -24px; }
#dropzone.hidden { opacity: 0; pointer-events: none; }

.drop-inner { text-align: center; max-width: 480px; padding: 24px; }
.drop-inner h1 {
  font-size: 44px; font-weight: 200; letter-spacing: 0.55em;
  margin: 0 0 8px; padding-left: 0.55em; /* compense le tracking du dernier caractÃ¨re */
  background: linear-gradient(90deg, var(--down), var(--ink) 50%, var(--up));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.tagline { color: var(--ink-2); font-weight: 300; margin: 0 0 40px; line-height: 1.6; }
.drop-hint { color: var(--ink-3); font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.drop-hint b { color: var(--ink-2); font-weight: 600; }

.btn {
  display: inline-block; cursor: pointer;
  padding: 9px 22px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.05);
  color: var(--ink); font-size: 13.5px;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.btn:hover { background: rgba(255,255,255,0.11); border-color: rgba(255,255,255,0.4); }
.btn.ghost { border-color: rgba(255,255,255,0.12); background: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); border-color: rgba(255,255,255,0.3); }
.btn.small { padding: 5px 14px; font-size: 12px; }

.demo-row { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.status { margin-top: 26px; color: var(--ink-2); font-size: 13px; min-height: 1.2em; }
.status.error { color: #e66767; }

/* â€”â€”â€”â€”â€” profil altimÃ©trique â€”â€”â€”â€”â€” */
#profile-wrap {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 118px; padding: 0 18px 10px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5,5,8,0.9) 55%);
}
#profile {
  width: 100%; height: 100%; display: block;
  pointer-events: auto; cursor: crosshair;
  touch-action: none; /* gestes rÃ©servÃ©s au zoom/Ã©pinglage, pas au dÃ©filement */
}
#profile-reset {
  position: absolute; top: 2px; right: 18px;
  pointer-events: auto;
  background: rgba(10,10,18,0.75);
}

/* â€”â€”â€”â€”â€” Ã©tiquettes de lieux (CSS2DRenderer) â€”â€”â€”â€”â€” */
#labels { z-index: 1; }
/* Les Ã©tiquettes sont ancrÃ©es au relief (toujours sombre, jour comme nuit) :
   texte clair + halo sombre appuyÃ©, lisible dans les deux ambiances. */
.map-label {
  font-family: var(--mono);
  color: rgba(244,246,250,0.85);
  text-shadow: 0 1px 5px rgba(0,0,12,1), 0 0 3px rgba(0,0,12,1), 0 0 1px rgba(0,0,12,1);
  white-space: nowrap;
  letter-spacing: 0.05em;
  font-size: 11px;
  user-select: none;
}
.map-label.city { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; }
.map-label.town { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; }
.map-label.village { font-size: 10.5px; color: rgba(244,246,250,0.66); }
.map-label.peak { font-size: 10.5px; color: rgba(255,214,150,0.85); font-style: italic; }
.map-label.pass { font-size: 10.5px; color: rgba(178,218,255,0.82); font-style: italic; }
.map-label.hut { font-size: 10px; color: rgba(214,204,172,0.78); font-style: italic; }

/* â€”â€”â€”â€”â€” panneau latÃ©ral â€”â€”â€”â€”â€” */
#panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 320px;
  background: linear-gradient(180deg, #0c0c12, #08080c);
  border-left: 1px solid var(--panel-edge);
  display: flex; flex-direction: column;
  padding: 22px 22px 14px;
  overflow-y: auto;
}
#panel[hidden] { display: none; }

#panel header { margin-bottom: 18px; }
/* surtitre « marque parente » : le nom du site est le lien, sans ornement */
.eyebrow {
  display: inline-block;
  color: #55544e;
  text-decoration: none;
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.3em; text-transform: uppercase;
  transition: color .15s;
}
.eyebrow:hover, .eyebrow:focus-visible { color: var(--ink); }
#panel .eyebrow { margin-bottom: 7px; }
.drop-inner .eyebrow {
  font-size: 12px; letter-spacing: 0.4em;
  padding-left: 0.4em; /* compense le tracking du dernier caractère */
  margin-bottom: 18px;
}
.brand { font-size: 13px; font-weight: 300; letter-spacing: 0.5em; color: var(--ink-3); }
.track-name {
  margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--ink);
  overflow-wrap: anywhere;
}

/* totaux */
.totals {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--panel-edge);
  border-bottom: 1px solid var(--panel-edge);
}
.tot .v { font-size: 22px; font-weight: 200; font-variant-numeric: tabular-nums; }
.tot .v.up { color: var(--up); }
.tot .v.down { color: var(--down); }
.tot .l { display: block; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 1px; }

/* lÃ©gende + sÃ©lecteur de mÃ©trique */
.legend { padding: 16px 0 4px; }
.metric-select {
  width: 100%; margin-bottom: 9px;
  background: #12121a;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 7px;
  color: var(--ink);
  font-family: inherit; font-size: 11.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 8px;
  cursor: pointer;
}
.metric-select:hover { border-color: rgba(255,255,255,0.3); }
.metric-select option { background: #12121a; color: var(--ink); text-transform: none; letter-spacing: normal; }
.legend-bar { height: 8px; border-radius: 4px; }
.legend-ticks {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--ink-3); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* hover */
#hover-info { flex: 1; padding-top: 18px; }
.hover-hint { color: var(--ink-3); font-size: 13px; font-style: italic; }
.hover-hint small { font-size: 11px; opacity: 0.8; }
.pin-note { color: var(--ink-2); font-size: 11.5px; margin-bottom: 10px; }

.vam-hero {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  margin: 18px 0 14px; text-align: center;
}
.vam-value { font-size: 68px; font-weight: 200; font-variant-numeric: tabular-nums; line-height: 1; }
.vam-unit { color: var(--ink-3); font-size: 15px; }
.vam-arrow { font-size: 30px; line-height: 1; }

/* contrÃ´les */
.controls { padding: 14px 0; border-top: 1px solid var(--panel-edge); display: flex; flex-direction: column; gap: 10px; }
.ctl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.ctl input[type=range] { width: 100%; accent-color: var(--ink-2); }
.ctl b { color: var(--ink); font-weight: 600; }
.controls .btn { align-self: flex-start; margin-top: 2px; }

#panel footer { font-size: 10.5px; color: var(--ink-3); padding-top: 10px; line-height: 1.5; }
#panel footer b { color: var(--ink-2); }

/* scrollbar discret */
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: 4px; }

/* â€”â€”â€”â€”â€” smartphone & tablette (disposition empilÃ©e) â€”â€”â€”â€”â€” */
@media (max-width: 900px) {
  body.loaded #stage { inset: 0 0 42vh 0; inset: 0 0 42dvh 0; }
  #panel {
    top: 58vh; top: 58dvh; left: 0; right: 0; bottom: 0; width: auto;
    border-left: none; border-top: 1px solid var(--panel-edge);
    padding: 14px 18px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  #panel header { margin-bottom: 8px; }
  .brand { font-size: 11px; }
  .track-name { font-size: 13.5px; margin-top: 3px; }

  /* le paramÃ¨tre sÃ©lectionnÃ© d'abord, le rÃ©sumÃ© (compact) ensuite */
  #panel header { order: 0; }
  .legend { order: 1; padding: 8px 0 2px; }
  #hover-info { order: 2; flex: none; padding-top: 8px; }
  .totals { order: 3; }
  .controls { order: 4; }
  #panel footer { order: 5; }

  .totals {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px;
    padding: 9px 0 10px;
  }
  .tot { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
  .tot .v { font-size: 13px; font-weight: 400; }
  .tot .l { display: inline; font-size: 8px; letter-spacing: 0.03em; margin-top: 0; }

  .vam-hero { margin: 14px 0 10px; }
  .vam-value { font-size: 64px; }
  .vam-arrow { font-size: 26px; }
  .vam-unit { font-size: 14px; }
  .controls { padding: 10px 0; gap: 8px; }
  #profile-wrap { height: 86px; padding: 0 10px 6px; }
  #profile-reset { right: 10px; }
  .drop-inner h1 { font-size: 30px; }
  .drop-inner { padding: 16px; }
  .tagline { margin-bottom: 24px; }
}

