/* ==========================================================================
   Taysir Voyages — démo en direct : l'écran de l'agence (chambrage) et le
   téléphone de la pèlerine, côte à côte (ordinateur) ou l'un après l'autre
   (téléphone). Aucun mode d'emploi : on touche, ça arrive de l'autre côté.
   ========================================================================== */

:root { --bg: #0b2324; --bg-2: #15393a; --s: 1; --v: 0; --drag: 0px; --agw: 580px; --gap: clamp(18px, 2.6vw, 44px); }
html { overflow-x: clip; }
body.du { min-height: 100vh; background: radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg) 62%); color: var(--paper); isolation: isolate; }
body.du::before { content: ""; position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--khatam-light) 0 0 / 96px 96px; opacity: .06; mask-image: radial-gradient(70% 60% at 50% 45%, transparent 35%, #000); -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, transparent 35%, #000); pointer-events: none; }

/* ---------- Bandeau du haut ------------------------------------------------- */
.top { position: relative; z-index: 20; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 20px; border-bottom: 1px solid rgba(251, 248, 242, .08); }
.top__brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--paper); white-space: nowrap; }
.top__brand svg { width: 26px; height: 26px; flex: none; }
.top__brand span { font-family: var(--serif); font-size: 22px; line-height: 1; }
.top__tag { padding: 3px 10px; border: 1px solid rgba(251, 248, 242, .18); border-radius: 999px; color: rgba(251, 248, 242, .66); font: 400 12.5px/1.4 var(--p-display); text-decoration: none; white-space: nowrap; }
.top__tag b { color: var(--paper); font-weight: 600; }
.top__links { display: flex; gap: 18px; margin-left: auto; }
.top__links a { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-2); font-size: 13.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.top__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.top__links svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Scène ------------------------------------------------------------ */
.duo { display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 52px); padding: 14px 20px 22px; overflow-x: clip; }
.track { display: grid; grid-template-columns: auto minmax(200px, 300px) auto; justify-content: center; align-items: start; gap: var(--gap); min-width: 0; }

.dev { position: relative; margin: 0; width: calc(390px * var(--s)); height: calc(820px * var(--s) + 34px); }
.dev--agence { width: calc(var(--agw) * var(--s)); }
.dev__frame { position: absolute; top: 0; left: 0; width: 390px; height: 820px; padding: 11px; border-radius: 58px; background: #061314; box-shadow: 0 0 0 1.5px #2b4a4a, 0 50px 90px -40px rgba(0, 0, 0, .85); transform: scale(var(--s)); transform-origin: top left; transition: box-shadow .5s var(--ease); }
.dev--agence .dev__frame { width: var(--agw); padding: 14px; border-radius: 34px; }
.dev__screen { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 47px; background: var(--sb, var(--sand)); transition: background-color .3s; }
.dev--agence .dev__screen { border-radius: 21px; }
.dev__screen iframe { flex: 1; width: 100%; min-height: 0; border: 0; display: block; background: var(--sand); }

.dev__status { flex: none; display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; height: 46px; padding: 0 26px 0 34px; color: var(--paper); font-family: var(--sans); }
.dev--agence .dev__status { height: 30px; padding: 0 20px; grid-template-columns: 1fr 40px 1fr; color: var(--ink); }
.dev__status time { font-weight: 700; font-size: 15px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dev--agence .dev__status time { font-size: 13px; }
.dev__island { justify-self: center; width: 112px; height: 32px; border-radius: 20px; background: #061314; }
.dev__cam { justify-self: center; width: 8px; height: 8px; border-radius: 50%; background: #061314; box-shadow: 0 0 0 2px rgba(6, 19, 20, .25); }
.dev__icons { justify-self: end; display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.dev__icons span { align-self: center; margin-right: 8px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.dev__icons i { width: 3px; border-radius: 1px; background: currentColor; }
.dev__icons i:nth-of-type(1) { height: 5px; } .dev__icons i:nth-of-type(2) { height: 8px; } .dev__icons i:nth-of-type(3) { height: 11px; }
.dev__icons b { width: 22px; height: 11px; margin-left: 6px; border: 1.5px solid currentColor; border-radius: 3.5px; background: linear-gradient(90deg, currentColor 70%, transparent 70%) content-box; padding: 1.5px; opacity: .9; }
.dev__screen.is-light .dev__status { color: var(--ink); }

.dev figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 8px; color: rgba(251, 248, 242, .62); font-size: 12.5px; white-space: nowrap; }
.dev__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); }
.dev--pelerin .dev__dot { background: #6fd3a5; }
.dev__shield { display: none; }

.dev.is-ping .dev__frame { animation: ping 1.3s var(--ease); }
@keyframes ping {
  0% { box-shadow: 0 0 0 1.5px #2b4a4a, 0 0 0 0 rgba(212, 180, 106, .6), 0 50px 90px -40px rgba(0, 0, 0, .85); }
  100% { box-shadow: 0 0 0 1.5px #2b4a4a, 0 0 0 28px rgba(212, 180, 106, 0), 0 50px 90px -40px rgba(0, 0, 0, .85); }
}

/* Colonne du milieu */
.mid { display: flex; flex-direction: column; justify-content: space-between; height: calc(820px * var(--s)); padding: 6px 0 2px; }
.mid__title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 2.8vw, 42px); line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.mid__title em { display: block; margin-top: 4px; color: var(--gold-2); }

.wire { position: relative; height: 64px; margin: 0 calc(-1 * var(--gap)); }
.wire__line { position: absolute; left: 0; right: 0; top: 50%; height: 0; border-top: 1.5px dashed rgba(212, 180, 106, .3); }
.wire__line::before, .wire__line::after { content: ""; position: absolute; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: rgba(212, 180, 106, .5); }
.wire__line::before { left: -3px; } .wire__line::after { right: -3px; }
.wire__pulse { position: absolute; left: -8px; top: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 5px rgba(212, 180, 106, .25), 0 0 24px 6px rgba(212, 180, 106, .55); opacity: 0; pointer-events: none; }
.wire__chip { position: absolute; left: 50%; bottom: calc(50% + 12px); display: inline-flex; align-items: center; gap: 7px; max-width: calc(100% - 30px); padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); opacity: 0; transform: translate(-50%, 8px) scale(.94); transition: opacity .35s, transform .5s var(--ease); }
.wire__chip.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.wire__chip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wire__chip.is-back svg { stroke: var(--palm); }
.wire__chip span { overflow: hidden; text-overflow: ellipsis; }

.desk { display: block; padding: 14px 16px 16px; border-radius: 18px; background: rgba(251, 248, 242, .05); border: 1px solid rgba(212, 180, 106, .18); color: var(--paper); text-decoration: none; transition: background-color .25s, border-color .25s; }
.desk:hover { background: rgba(251, 248, 242, .09); border-color: rgba(212, 180, 106, .34); }
.desk__head { display: flex; align-items: center; gap: 7px; color: rgba(251, 248, 242, .6); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.desk__head svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desk__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.desk__nums > span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.desk__v { display: flex; align-items: baseline; white-space: nowrap; }
.desk__nums b { display: inline-block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; transition: color .4s; }
.desk__nums i { font-style: normal; font-size: 13px; color: rgba(251, 248, 242, .5); margin-left: 1px; }
.desk__nums small { color: rgba(251, 248, 242, .6); font-size: 11.5px; line-height: 1.25; }
.desk__nums b.is-bump { color: var(--gold-2); animation: bump .6s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Doigt fantôme */
.ghost-layer { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: none; }
.ghost { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(251, 248, 242, .4); box-shadow: 0 0 0 2px rgba(251, 248, 242, .92), 0 8px 22px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; }
.ghost::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold-2); opacity: 0; }
.ghost.is-tap::after { animation: ripple .6s var(--ease); }
@keyframes ripple { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.1); } }

.switch { display: none; }

/* ---------- Tablette : le fil seul ------------------------------------------- */
@media (max-width: 1099px) {
  .duo { padding-left: 14px; padding-right: 14px; }
  .track { grid-template-columns: auto 64px auto; gap: 12px; }
  .mid { justify-content: center; }
  .mid__title, .desk { display: none; }
  .wire { margin: 0 -12px; }
  .mid { position: relative; z-index: 5; }
  .wire__chip { bottom: calc(50% + 14px); max-width: none; }
}

/* ---------- Téléphone : un écran à la fois ---------------------------------- */
@media (max-width: 759px) {
  html, body.du { height: 100%; overflow: hidden; }
  body.du { min-height: 0; }
  .top { height: 48px; padding: 0 14px; gap: 10px; }
  .top__more { display: none !important; }
  .duo { position: relative; display: block; height: calc(100svh - 48px); min-height: 0; padding: 10px 0 calc(78px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
  .track { display: flex; justify-content: flex-start; gap: 10px; height: 100%; padding: 0 20px; transform: translateX(calc(var(--v) * (30px - 100vw) + var(--drag))); transition: transform .6s var(--ease); }
  .duo.is-drag .track { transition: none; }
  .mid { display: none; }
  .dev, .dev--agence { flex: none; width: calc(100vw - 40px); height: 100%; }
  .dev__frame, .dev--agence .dev__frame { position: absolute; inset: 0; width: auto; height: auto; padding: 5px; border-radius: 30px; transform: none; transition: opacity .5s, transform .6s var(--ease), box-shadow .5s; }
  .dev__screen, .dev--agence .dev__screen { border-radius: 25px; }
  .dev__status, .dev figcaption { display: none; }
  .dev:not(.is-on) .dev__frame { opacity: .45; transform: scale(.94); }
  .dev:not(.is-on) .dev__shield { display: block; position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; -webkit-tap-highlight-color: transparent; }

  .switch { position: fixed; z-index: 30; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr 1fr; width: min(300px, calc(100vw - 48px)); padding: 5px; border-radius: 999px; background: rgba(6, 19, 20, .88); border: 1px solid rgba(251, 248, 242, .14); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transform: translateX(-50%); }
  .switch__thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px; background: var(--paper); transform: translateX(calc(var(--v) * 100%)); transition: transform .5s var(--ease); }
  .switch button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border: 0; border-radius: 999px; background: none; color: rgba(251, 248, 242, .72); font-weight: 700; font-size: 15px; -webkit-tap-highlight-color: transparent; transition: color .35s; }
  .switch button[aria-selected="true"] { color: var(--ink); }
  .switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .switch__dot { position: absolute; top: 9px; right: calc(50% - 50px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px rgba(6, 19, 20, .9); }
  .switch__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red); animation: dot 1.4s ease-out infinite; }
  @keyframes dot { 0% { opacity: .8; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.6); } }
}
@media (max-width: 420px) { .top__brand span { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .track, .dev__frame, .switch__thumb, .wire__chip { transition: none !important; }
  .dev.is-ping .dev__frame, .desk__nums b.is-bump, .switch__dot::after { animation: none; }
}
