/* ------------------------------------------------------------------
   Amine Krefa — Portfolio
   Le design vit entièrement dans les SVG exportés de Figma.
   Cette feuille ne fait que : cadrer, mettre à l'échelle, rendre
   cliquable. Aucune règle ne repeint le contenu.
   ------------------------------------------------------------------ */

:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --line: #e2e8f0;
  --accent: #2563eb;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: hidden;
}

/* --- Scène : conteneur de la page-image ------------------------- */

.stage {
  width: 100%;
  background: var(--bg);
}

.canvas {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  aspect-ratio: var(--pw) / var(--ph);
  background: var(--bg);
}

.canvas__art {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.canvas__art.is-ready { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .canvas__art { transition: none; }
}

/* --- Barre de chargement ---------------------------------------- */

.loader {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.3s ease, opacity 0.3s ease 0.2s;
  z-index: 40;
}

.loader.is-active { transform: scaleX(0.7); }
.loader.is-done { transform: scaleX(1); opacity: 0; }

/* --- Zones cliquables ------------------------------------------- */
/* Positionnées en % des coordonnées du SVG : elles suivent
   automatiquement la mise à l'échelle du dessin. */

.hot {
  position: absolute;
  left: calc(var(--x) / var(--pw) * 100%);
  top: calc(var(--y) / var(--ph) * 100%);
  width: calc(var(--w) / var(--pw) * 100%);
  height: calc(var(--h) / var(--ph) * 100%);
  border-radius: 2px;
  text-indent: -9999px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s ease;
}

.hot:hover { background: rgb(37 99 235 / 0.07); }

.hot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgb(37 99 235 / 0.07);
}

/* --- Bascule de langue ------------------------------------------ */

.lang {
  position: fixed;
  left: 24px;
  bottom: 24px;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgb(15 23 42 / 0.08);
  font-size: 11px;
  letter-spacing: 0.08em;
  z-index: 30;
}

.lang a {
  padding: 6px 12px;
  border-radius: 999px;
  color: #64748b;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang a:hover { color: var(--ink); }

.lang a[aria-current="true"] {
  background: var(--ink);
  color: #ffffff;
}

.lang a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Mobile : le dessin fait 1920 px de large, on autorise le
       défilement latéral plutôt que d'écraser la typographie ----- */

@media (max-width: 900px) {
  .stage {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .canvas {
    width: 1180px;
    max-width: none;
  }

  .lang {
    left: 12px;
    bottom: 12px;
  }
}

/* Indication de défilement, affichée une seule fois sur mobile */

.pan-hint {
  position: fixed;
  right: 12px;
  bottom: 12px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  z-index: 30;
}

@media (max-width: 900px) {
  .pan-hint.is-visible { display: inline-flex; }
}

@media print {
  .lang,
  .pan-hint,
  .loader { display: none; }
}
