/* MediArt — page Portfolio « La galaxie MediArt » */
.pf-body { overflow: hidden; height: 100vh; height: 100dvh; }
.pf-body[data-view="grid"] { overflow: auto; height: auto; }

/* ---------- En-tête ---------- */
.pf-header { gap: 20px; }
.pf-title { margin-right: auto; display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid var(--line); }
.pf-title h1 { margin: 0; font: 600 18px/1.1 var(--display); font-stretch: 118%; }
.pf-title h1 em { font-style: normal; color: var(--violet-hi); }
.pf-title p { margin: 0; font: 500 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-views { display: flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.pf-views button { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: background .3s, color .3s; }
.pf-views button[aria-pressed="true"] { background: var(--off); color: #000; }
.pf-views svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; }

/* ---------- Galaxie ---------- */
.galaxy { position: fixed; inset: 0; z-index: 1; overflow: hidden; cursor: grab; touch-action: none; outline: none; }
.galaxy.is-dragging { cursor: grabbing; }
.galaxy-plane { position: absolute; inset: 0; }
.tile {
  position: absolute; left: 0; top: 0; width: var(--tw); height: var(--th);
  border-radius: 16px; overflow: hidden; background: #0d0c12;
  box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
  will-change: transform; contain: layout paint;
  transition: opacity .5s var(--ease), filter .5s, box-shadow .4s;
}
.tile-inner { position: absolute; inset: 0; transition: transform .6s var(--ease); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.tile video { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.tile video.is-playing { opacity: 1; }
.tile:hover { box-shadow: 0 30px 70px rgba(0,0,0,.7), 0 0 0 1px rgba(169,142,230,.6), 0 0 50px rgba(141,114,199,.25); }
.tile:hover .tile-inner { transform: scale(1.04); }
.tile-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  transform: translateY(8px); opacity: 0; transition: opacity .35s, transform .35s var(--ease);
}
.tile:hover .tile-meta, .tile:focus-visible .tile-meta { opacity: 1; transform: none; }
.tile-meta b { display: block; font: 600 14px/1.2 var(--display); font-stretch: 110%; }
.tile-meta span { font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tile-badge {
  position: absolute; z-index: 2; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
  font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.tile-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--violet)); box-shadow: 0 0 8px var(--c, var(--violet)); }
.tile-count { position: absolute; z-index: 2; top: 10px; right: 10px; padding: 5px 8px; border-radius: 999px; background: rgba(0,0,0,.6); font: 500 10px/1 var(--mono); }
.tile[data-type="video"] .tile-play { position: absolute; z-index: 2; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; transition: transform .3s var(--ease); }
.tile[data-type="video"] .tile-play::after { content: ""; margin-left: 3px; border-left: 11px solid #000; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.tile:hover .tile-play { transform: scale(1.12); }
/* Carte NFC : recto / verso au survol */
.tile[data-kind="card"] { perspective: 900px; background: transparent; box-shadow: none; overflow: visible; }
.tile[data-kind="card"] .tile-inner { transform-style: preserve-3d; transition: transform .8s var(--ease); border-radius: 14px; }
.tile[data-kind="card"] .face { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; backface-visibility: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08); }
.tile[data-kind="card"] .face.back { transform: rotateY(180deg); }
.tile[data-kind="card"]:hover .tile-inner { transform: rotateY(180deg); }
.tile[data-kind="card"] .tile-meta { border-radius: 0 0 14px 14px; }
/* Landing : la page défile dans la vignette au survol */
.tile[data-kind="landing"] img { object-position: top; }
.tile[data-kind="landing"] .scroll-img { position: absolute; inset: 0 0 auto; height: auto; transform: translateY(0); transition: transform 6s linear; }
.tile[data-kind="landing"]:hover .scroll-img { transform: translateY(calc(-100% + var(--th))); }
.tile[data-kind="landing"]:hover .tile-inner { transform: none; }
/* Filtre */
.tile.is-dim { opacity: .07; filter: grayscale(1); pointer-events: none; }

.galaxy-hint {
  position: fixed; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 14px; padding: 26px 30px; border-radius: 24px; text-align: center;
  background: rgba(6,6,9,.78); backdrop-filter: blur(14px); border: 1px solid var(--line);
  pointer-events: none; transition: opacity .6s, transform .6s var(--ease);
}
.galaxy-hint.is-gone { opacity: 0; transform: translate(-50%, -40%); }
.galaxy-hint p { margin: 0; font-size: 15px; }
.galaxy-hint small { color: var(--muted); font-size: 12.5px; }
.hint-hand { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--off); position: relative; animation: hintMove 2.4s var(--ease) infinite; }
.hint-hand::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--violet-hi); box-shadow: 0 0 20px var(--violet-hi); }
@keyframes hintMove { 0%, 100% { transform: translate(-26px, 10px); } 50% { transform: translate(26px, -10px); } }

/* ---------- Filtres ---------- */
.pf-filters {
  position: fixed; z-index: 30; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; max-width: calc(100vw - 32px); overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(6,6,9,.82); backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.pf-filters::-webkit-scrollbar { display: none; }
.pf-filters button { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background .3s, color .3s; white-space: nowrap; }
.pf-filters button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pf-filters button small { font: 500 10px/1 var(--mono); opacity: .6; }
.pf-filters button[aria-pressed="true"] { background: var(--off); color: #000; }

/* ---------- Mini-carte ---------- */
.pf-minimap { position: fixed; z-index: 30; right: var(--gutter); bottom: 92px; width: 92px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: rgba(6,6,9,.7); backdrop-filter: blur(10px); overflow: hidden; }
.pf-minimap i { position: absolute; border: 1.5px solid var(--violet-hi); border-radius: 3px; box-shadow: 0 0 10px rgba(169,142,230,.5); }
.pf-body[data-view="grid"] .pf-minimap { display: none; }

/* ---------- Grille ---------- */
.pf-grid { position: relative; z-index: 1; padding: 110px var(--gutter) 120px; columns: 4 260px; column-gap: 16px; }
.pf-grid .tile { position: relative; width: 100%; height: auto; aspect-ratio: var(--ar); margin-bottom: 16px; break-inside: avoid; transform: none !important; display: block; }
.pf-grid .tile[data-kind="card"] { aspect-ratio: var(--ar); }
.pf-grid .tile.is-dim { display: none; }

/* ---------- Visionneuse ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.viewer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.86); backdrop-filter: blur(16px); animation: fadeIn .3s; }
.viewer-panel { position: relative; width: min(1320px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); display: grid; grid-template-columns: 1fr 360px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); background: #08070c; animation: viewerIn .5s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes viewerIn { from { opacity: 0; transform: translateY(30px) scale(.97); } }
.viewer-stage { position: relative; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; /* piste définie : les max-height en % s’appliquent */ background: radial-gradient(60% 60% at 50% 50%, #17131f, #050407); overflow: hidden; }
.viewer-stage > img, .viewer-stage > video { max-width: calc(100% - 48px); max-height: calc(100% - 48px); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); object-fit: contain; }
.viewer-stage > video { background: #000; }
.v-arrow { position: absolute; top: 50%; z-index: 3; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: rgba(0,0,0,.5); border: 1px solid var(--line); font-size: 20px; backdrop-filter: blur(8px); }
.v-arrow.prev { left: 16px; } .v-arrow.next { right: 16px; }
.v-arrow:hover { background: rgba(255,255,255,.12); }
.v-counter { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.55); font: 500 11px/1 var(--mono); letter-spacing: .1em; }
/* Landing : défilement dans un navigateur */
.v-browser { width: min(92%, 760px); height: calc(100% - 48px); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.v-browser-bar { flex: none; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #1a1920; }
.v-browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #444; }
.v-browser-bar span { margin-left: 10px; font: 11px/1 var(--mono); color: var(--muted); }
.v-browser-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.v-browser-body img { width: 100%; display: block; }
/* Carte NFC 3D */
.v-card { width: min(80%, 560px); aspect-ratio: var(--ar); perspective: 1400px; cursor: pointer; }
.v-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.v-card.is-flipped .v-card-inner { transform: rotateY(180deg); }
.v-card .face { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; backface-visibility: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.1); }
.v-card .face img { width: 100%; height: 100%; object-fit: cover; }
.v-card .back { transform: rotateY(180deg); }
.v-card-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* Image très haute (planche) */
.v-scroll { width: 100%; height: 100%; overflow-y: auto; display: grid; justify-items: center; padding: 24px; overscroll-behavior: contain; }
.v-scroll img { width: min(100%, 820px); height: auto; border-radius: 12px; }

.viewer-info { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 34px 28px 26px; border-left: 1px solid var(--line); overflow-y: auto; }
.v-cat { margin: 0; display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.v-cat i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.viewer-info h2 { margin: 0; font: 600 30px/1.05 var(--display); font-stretch: 118%; letter-spacing: -.01em; }
.v-client { margin: -6px 0 0; color: var(--violet-hi); font-size: 15px; }
.v-desc { margin: 0; color: var(--muted); font-size: 15px; }
.v-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.v-thumbs button { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1.5px solid transparent; opacity: .55; transition: opacity .3s, border-color .3s; }
.v-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--violet-hi); }
.v-thumbs button:hover { opacity: 1; }
.v-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.v-thumbs small { position: absolute; left: 4px; bottom: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.7); font: 500 9px/1.2 var(--mono); }
.v-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.v-nav .pill { min-height: 42px; padding: 0 12px; font-size: 13px; }
.viewer-info > .pill-light { width: 100%; }
.v-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.55); border: 1px solid var(--line); font-size: 24px; line-height: 1; backdrop-filter: blur(8px); }
.pf-noscript { position: relative; z-index: 2; padding: 140px var(--gutter); }

@media (max-width: 960px) {
  .pf-header .header-cta { display: none; }
  .viewer-panel { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: calc(100dvh - 20px); width: calc(100vw - 20px); border-radius: 22px; }
  .viewer-info { border-left: 0; border-top: 1px solid var(--line); max-height: 42dvh; padding: 20px; gap: 10px; }
  .viewer-info h2 { font-size: 22px; }
  .v-thumbs { grid-template-columns: repeat(6, 1fr); }
  .v-nav { display: none; }
}
@media (max-width: 640px) {
  .pf-title { display: none; }
  .pf-views { margin-left: auto; }
  .pf-views span { display: none; }
  .pf-minimap { display: none; }
  .pf-filters { bottom: 14px; }
  .pf-filters button { padding: 9px 13px; font-size: 13px; }
  .pf-grid { columns: 2 150px; column-gap: 10px; padding-top: 90px; }
  .pf-grid .tile { margin-bottom: 10px; border-radius: 12px; }
  .v-arrow { width: 40px; height: 40px; margin-top: -20px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile[data-kind="landing"] .scroll-img { transition: none; }
}

/* Sites web : fenêtre de navigateur (vignette) et duo ordinateur + mobile (visionneuse) */
.tile[data-kind="site"] .tile-inner { display: flex; flex-direction: column; background: #16161d; }
.tile-bar { flex: none; display: flex; gap: 4px; align-items: center; height: 16px; padding: 0 8px; background: #1d1d25; }
.tile-bar i { width: 5px; height: 5px; border-radius: 50%; background: #4a4a55; }
.tile-page { --ph: calc(var(--th) - 16px); position: relative; flex: 1; overflow: hidden; background: #fff; }
.tile[data-kind="site"] .scroll-img { position: absolute; inset: 0 0 auto; width: 100%; height: auto; object-fit: initial; transform: translateY(0); transition: transform 7s cubic-bezier(.45, 0, .55, 1); }
.tile[data-kind="site"]:hover .scroll-img { transform: translateY(calc(-100% + var(--ph))); }
.tile[data-kind="site"]:hover .tile-inner { transform: none; }
.v-site { position: relative; width: calc(100% - 48px); height: calc(100% - 48px); display: flex; align-items: center; justify-content: center; }
.v-site .v-browser { width: min(84%, 860px); height: 100%; }
.v-phone { position: absolute; right: 2%; bottom: 0; width: clamp(130px, 19%, 230px); aspect-ratio: 390 / 844; max-height: 82%; padding: 6px; border-radius: 28px; background: #111116;
  box-shadow: 0 30px 70px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.14); }
.v-phone-body { height: 100%; border-radius: 22px; overflow-y: auto; overscroll-behavior: contain; background: #fff; scrollbar-width: none; }
.v-phone-body::-webkit-scrollbar { display: none; }
.v-phone-body img { width: 100%; display: block; }
.viewer-info > .v-site-link { width: 100%; }
[dir="rtl"] .v-phone { right: auto; left: 2%; }
@media (max-width: 640px) {
  .v-site .v-browser { width: 100%; }
  .v-phone { width: 34%; right: -4px; bottom: -10px; padding: 4px; border-radius: 18px; }
  .v-phone-body { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .tile[data-kind="site"] .scroll-img { transition: none; } }
.tile[data-kind="site"] .tile-badge { top: 24px; }
