/*
 * CARAVELLI — ARXIV8 visible effects layer
 * Passive CSS only: it extends the single V3 orchestrator; no font, no route,
 * no second renderer and no selector targets the locked Claude entry (index).
 * Content remains above every atmospheric layer.
 */

body.cv3-nonhome {
  --arx-platinum: rgba(234, 230, 219, .78);
  --arx-carrara: rgba(246, 242, 234, .62);
  --arx-amber: rgba(203, 173, 114, .34);
  --arx-obsidian: rgba(7, 10, 13, .84);
}

/* One material field per room: dust, light and a local caustic remain behind copy. */
body.cv3-nonhome .cv3-chapter > .cv3-room-light {
  display: block;
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .72;
  overflow: hidden;
  /* Replace the earlier witness-wide velocity blur with crisp, local material. */
  filter: none;
  transform: none;
  background:
    radial-gradient(50% 72% at 14% 8%, rgba(255,255,255,.14), transparent 72%),
    radial-gradient(38% 50% at 88% 92%, var(--arx-amber), transparent 76%);
  mix-blend-mode: screen;
}

body.cv3-nonhome .cv3-chapter > .cv3-room-light::before,
body.cv3-nonhome .cv3-chapter > .cv3-room-light::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
}

/* Carrara dust: a sparse mineral grain, rather than a UI texture. */
body.cv3-nonhome .cv3-chapter > .cv3-room-light::before {
  /* K3-A : « carrara dust » lu comme de la neige — motif de points supprimé. */
  opacity: 0;
  background-image: none;
  animation: none;
}

/* Platinum continuity: a soft raking highlight crossing only the room background. */
body.cv3-nonhome .cv3-chapter > .cv3-room-light::after {
  opacity: .44;
  background:
    linear-gradient(112deg, transparent 35%, rgba(255,255,255,.18) 48%, transparent 61%),
    repeating-linear-gradient(126deg, transparent 0 46px, rgba(255,255,255,.034) 47px 48px, transparent 49px 94px);
  transform: translate3d(-10%, 0, 0) rotate(-2deg);
  animation: arx-platinum-continuity 18s cubic-bezier(.22,.61,.36,1) infinite alternate;
}

/* Keep all authored content, controls and media captions decisively in front. */
body.cv3-nonhome .cv3-chapter > :not(.cv3-room-light),
body.cv3-nonhome .cv3-chapter .cv3-media > figcaption,
body.cv3-nonhome .cv3-chapter .cv3-media > .caption,
body.cv3-nonhome .cv3-chapter .ba-labels {
  position: relative;
  z-index: 2;
}

/* Glass refraction is restricted to media edges: image stays fully legible. */
body.cv3-nonhome .cv3-media {
  isolation: isolate;
  box-shadow: 0 24px 70px rgba(4, 7, 9, .18);
}

body.cv3-nonhome .cv3-media::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(245, 241, 232, .36);
  box-shadow: inset 0 0 0 1px rgba(35, 40, 42, .18);
  background: transparent;
  mix-blend-mode: normal;
}

/* DUBAI — mineral daylight, aerial perspective and restrained caustics. */
body.cv3-witness-dubai .dxb-hero > .cv3-room-light,
body.cv3-family-dubai .dxb-hero > .cv3-room-light {
  opacity: .9;
  background:
    radial-gradient(68% 80% at 78% 14%, rgba(255,250,239,.36), transparent 68%),
    radial-gradient(46% 62% at 9% 86%, rgba(169,196,198,.18), transparent 76%),
    linear-gradient(112deg, rgba(246,242,233,.10), transparent 46%);
}

body.cv3-witness-dubai .dxb-hero > .cv3-room-light::after,
body.cv3-family-dubai .dxb-hero > .cv3-room-light::after {
  opacity: .56;
  background:
    radial-gradient(ellipse at 69% 21%, rgba(255,255,255,.24) 0 2%, transparent 12%),
    radial-gradient(ellipse at 38% 63%, rgba(234,224,197,.18) 0 3%, transparent 14%),
    linear-gradient(108deg, transparent 32%, rgba(255,255,255,.18) 49%, transparent 66%);
  filter: saturate(.8);
}

body.cv3-witness-dubai .dxb-media,
body.cv3-family-dubai .dxb-media {
  transform-origin: 50% 50%;
}

/* DUBAI — contain the historic LUT output instead of letting its canvases
   become flex items. This keeps the editorial column at full width and uses
   one approved native film per breakpoint for a stable, fluid hero. */
body.cv3-witness-dubai .dxb-hero {
  position: relative !important;
  display: flex !important;
  align-items: flex-end !important;
  overflow: clip !important;
  min-height: 100svh !important;
}

body.cv3-witness-dubai .dxb-hero > :is(.dxb-v16,.dxb-v9,.dxb-veil) {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

body.cv3-witness-dubai .dxb-hero > :is(.dxb-v16,.dxb-v9) {
  object-fit: cover !important;
  opacity: 1 !important;
}

body.cv3-witness-dubai .dxb-hero > .lut9235__toile {
  display: none !important;
}

body.cv3-witness-dubai .dxb-hero > .container {
  position: relative !important;
  z-index: 5 !important;
  flex: 0 0 auto !important;
  width: min(100% - 48px, 1240px) !important;
  max-width: 1240px !important;
  margin-inline: auto !important;
}

@media (min-width: 769px) {
  body.cv3-witness-dubai .dxb-hero > .dxb-v9 { display: none !important; }
  body.cv3-witness-dubai .dxb-hero > .dxb-v16 { display: block !important; }
}

@media (max-width: 768px) {
  body.cv3-witness-dubai .dxb-hero > .dxb-v16 { display: none !important; }
  body.cv3-witness-dubai .dxb-hero > .dxb-v9 { display: block !important; }
  body.cv3-witness-dubai .dxb-hero > .container {
    width: calc(100% - 38px) !important;
  }
}

/* INSTITUTION — silent paper, platinum etching and a long editorial cadence. */
body.cv3-witness-institution .cine > .cv3-room-light,
body.cv3-family-editorial .cine > .cv3-room-light {
  opacity: .64;
  mix-blend-mode: multiply;
  background:
    radial-gradient(62% 72% at 16% 18%, rgba(255,255,255,.84), transparent 68%),
    linear-gradient(90deg, transparent 47%, rgba(102,91,73,.09) 47.3% 47.5%, transparent 47.8%);
}

body.cv3-witness-institution .cine > .cv3-room-light::after,
body.cv3-family-editorial .cine > .cv3-room-light::after {
  opacity: .30;
  background: repeating-linear-gradient(90deg, transparent 0 69px, rgba(73,65,52,.13) 70px, transparent 71px 142px);
}

/* PORTFOLIO — images are the architecture; the etch only clarifies their sequence. */
body.cv3-witness-portfolio .ba,
body.cv3-family-project .ba,
body.cv3-family-project .cp-card,
body.cv3-family-project .v6-inline-portfolio-32 {
  isolation: isolate;
  border-color: rgba(241,236,224,.42);
}

body.cv3-witness-portfolio .ba::after,
body.cv3-family-project .ba::after,
body.cv3-family-project .cp-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(247,244,236,.36);
  background: linear-gradient(135deg, rgba(255,255,255,.13), transparent 22% 75%, rgba(197,165,107,.12));
  mix-blend-mode: screen;
}

body.cv3-witness-portfolio .ba > :not(.cv3-room-light),
body.cv3-family-project .ba > :not(.cv3-room-light),
body.cv3-family-project .cp-card > :not(.cv3-room-light) {
  position: relative;
  z-index: 2;
}

/* PORTALE / LUXURY — ceremonial obsidian, spectral vein and glass, never a colored UI. */
body.cv3-family-portale .stage > .cv3-room-light,
body.cv3-family-portale .private-office > .cv3-room-light,
body.cv3-family-portale .cachet-final > .cv3-room-light {
  opacity: .62;
  background:
    url("../assets/palette02/verre_petrole_1024.webp") 78% 30% / min(62vw,900px) auto no-repeat,
    radial-gradient(36% 52% at 13% 84%, rgba(149,161,158,.14), transparent 78%),
    linear-gradient(132deg, transparent 28%, rgba(207,224,226,.12) 48%, transparent 66%);
}

body.cv3-family-portale .stage > .cv3-room-light::after,
body.cv3-family-portale .private-office > .cv3-room-light::after,
body.cv3-family-portale .cachet-final > .cv3-room-light::after {
  opacity: .52;
  background:
    url("../assets/palette02/caustique_malachite_1024.png") 74% 42% / min(54vw,760px) auto no-repeat,
    linear-gradient(32deg, transparent 63%, rgba(149,161,158,.14) 70%, transparent 77%);
  filter:none;
}

body.cv3-family-portale .property-card,
body.cv3-family-portale .private-office {
  box-shadow: 0 30px 78px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.14);
}

/* CONTACT — a warm sculptural field, while the form itself remains untouched and accessible. */
body.cv3-witness-contact .contact-intake > .cv3-room-light,
body.cv3-family-contact .contact-intake > .cv3-room-light,
body.cv3-witness-contact .contact-offices > .cv3-room-light,
body.cv3-family-contact .contact-offices > .cv3-room-light {
  opacity: .58;
  background:
    url("../assets/palette02/light_sweep_albatre_cold.png") 82% 30% / min(68vw,920px) auto no-repeat,
    url("../assets/palette02/brume_albatre_01.png") 72% 42% / min(64vw,900px) auto no-repeat;
}

body.cv3-witness-contact .contact-intake > :not(.cv3-room-light),
body.cv3-family-contact .contact-intake > :not(.cv3-room-light),
body.cv3-witness-contact .contact-offices > :not(.cv3-room-light),
body.cv3-family-contact .contact-offices > :not(.cv3-room-light) {
  position: relative;
  z-index: 2;
}

/* Fine-pointer material feedback: spatial, short and intentionally absent from touch. */
@media (hover: hover) and (pointer: fine) {
  body.cv3-nonhome .cv3-media,
  body.cv3-nonhome .cp-card,
  body.cv3-nonhome .property-card {
    transition: transform 760ms cubic-bezier(.16,1,.3,1), box-shadow 760ms cubic-bezier(.16,1,.3,1);
  }

  body.cv3-nonhome .cv3-media:hover,
  body.cv3-nonhome .cp-card:hover,
  body.cv3-nonhome .property-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 34px 92px rgba(2,4,6,.25), inset 0 1px 0 rgba(255,255,255,.18);
  }
}

@supports (animation-timeline: view()) {
  body.cv3-nonhome .cv3-chapter > .cv3-room-light::after {
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }

  body.cv3-witness-dubai .dxb-media,
  body.cv3-family-dubai .dxb-media,
  body.cv3-witness-portfolio .cv3-media,
  body.cv3-family-project .cv3-media {
    animation: arx-carrara-relay linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
}

@keyframes arx-carrara-dust {
  from { transform: translate3d(-1.5%, -1%, 0); }
  to { transform: translate3d(1.5%, 1%, 0); }
}

@keyframes arx-platinum-continuity {
  from { transform: translate3d(-13%, -2%, 0) rotate(-2deg); }
  to { transform: translate3d(13%, 2%, 0) rotate(-2deg); }
}

@keyframes arx-carrara-relay {
  0% { transform: translate3d(0, 3.5%, 0) scale(1.012); }
  50% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.008); }
}

/* Mobile is static, luminous and touch-safe: no added moving layer or hover lift. */
@media (max-width: 760px), (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  body.cv3-nonhome .cv3-chapter > .cv3-room-light::before,
  body.cv3-nonhome .cv3-chapter > .cv3-room-light::after,
  body.cv3-nonhome .dxb-media,
  body.cv3-nonhome .cv3-media {
    animation: none !important;
    transform: none !important;
  }

  body.cv3-nonhome .cv3-chapter > .cv3-room-light {
    opacity: .50;
  }

  body.cv3-family-portale .stage > .cv3-room-light,
  body.cv3-family-portale .private-office > .cv3-room-light {
    opacity: .56;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.cv3-nonhome .cv3-media,
  body.cv3-nonhome .cp-card,
  body.cv3-nonhome .property-card {
    transition: none !important;
  }
}
