/* Redmill Technologies — collection « Visions » : illustrations animées + vidéo (29/10/2026) */

/* ─── Figure animée ─── */
.rmi { position: relative; margin: 0; --py: 0; --rx: 0deg; --ry: 0deg; --ox: 50%; --oy: 50%; }
.rmi-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px;
  background: #05060a;
  border: 1px solid rgba(var(--particle-color), .18);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .02) inset, 0 0 60px -20px rgba(var(--particle-color), .35);
  transform: perspective(1200px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s cubic-bezier(.16, 1, .3, 1), box-shadow .6s;
  clip-path: inset(0 round 3px);
}
.rmi-par { position: absolute; inset: -6%; transform: translate3d(0, calc(var(--py) * 22px), 0); will-change: transform; }
.rmi-move { position: absolute; inset: 0; transform-origin: var(--ox) var(--oy); animation: rmi-kb 26s ease-in-out infinite alternate; }
.rmi-move img { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes rmi-kb { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.09) translate(-1.2%, -.8%); } }

/* halo magique posé sur l'orbe */
.rmi-halo { position: absolute; left: var(--ox); top: var(--oy); width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: screen; }
.rmi-halo::before, .rmi-halo::after { content: ''; position: absolute; inset: 0; border-radius: 50%; }
.rmi-halo::before {
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(0, 229, 255, .9) 10%, transparent 14% 38%, rgba(123, 47, 255, .9) 41%, transparent 45% 70%, rgba(255, 0, 102, .8) 72%, transparent 75%);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
          mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
  animation: rmi-spin 9s linear infinite; opacity: .85;
}
.rmi-halo::after { background: radial-gradient(circle, rgba(0, 229, 255, .30), rgba(0, 229, 255, 0) 62%); animation: rmi-breathe 4.2s ease-in-out infinite; }
@keyframes rmi-spin { to { transform: rotate(360deg); } }
@keyframes rmi-breathe { 0%, 100% { transform: scale(.85); opacity: .55; } 50% { transform: scale(1.25); opacity: 1; } }

/* étincelles qui montent de l'orbe */
.rmi-spark { position: absolute; left: var(--ox); top: var(--oy); width: 0; height: 0; pointer-events: none; }
.rmi-spark i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #bff6ff; box-shadow: 0 0 8px 2px rgba(0, 229, 255, .8); opacity: 0; animation: rmi-rise 5.5s ease-out infinite; }
.rmi-spark i:nth-child(1) { left: -40px; animation-delay: 0s; }
.rmi-spark i:nth-child(2) { left: 22px; animation-delay: 1.1s; background: #e7d6ff; box-shadow: 0 0 8px 2px rgba(123, 47, 255, .8); }
.rmi-spark i:nth-child(3) { left: -8px; animation-delay: 2.3s; }
.rmi-spark i:nth-child(4) { left: 46px; animation-delay: 3.2s; background: #ffd0e2; box-shadow: 0 0 8px 2px rgba(255, 0, 102, .7); }
.rmi-spark i:nth-child(5) { left: -60px; animation-delay: 4.1s; }
@keyframes rmi-rise { 0% { transform: translate(0, 10px) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(10px, -110px) scale(1.1); opacity: 0; } }

/* balayage lumineux */
.rmi-sweep { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(190, 245, 255, .16) 48%, rgba(255, 255, 255, .28) 50%, rgba(190, 245, 255, .16) 52%, transparent 65%); transform: translateX(-120%); mix-blend-mode: screen; }
.rmi.is-in .rmi-sweep { animation: rmi-sweep 1.6s .35s cubic-bezier(.4, 0, .2, 1) forwards, rmi-sweep 1.8s 9s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes rmi-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* lignes de balayage HUD très légères */
.rmi-frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }

/* coins — la griffe Redmill */
.rmi-corners { position: absolute; inset: 10px; pointer-events: none; z-index: 2; }
.rmi-corners i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--accent-cyan); opacity: 0; transform: scale(.4); transition: opacity .6s .5s, transform .8s .5s cubic-bezier(.16, 1, .3, 1); }
.rmi-corners i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; transform-origin: 0 0; }
.rmi-corners i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; transform-origin: 100% 0; }
.rmi-corners i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; transform-origin: 0 100%; }
.rmi-corners i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; transform-origin: 100% 100%; border-color: var(--accent-magenta); }
.rmi.is-in .rmi-corners i { opacity: .9; transform: scale(1); }

/* apparition */
.rmi.rmi-js .rmi-frame { clip-path: inset(12% 10% 12% 10% round 3px); opacity: 0; filter: blur(6px) saturate(1.4); }
.rmi.rmi-js.is-in .rmi-frame { clip-path: inset(0 round 3px); opacity: 1; filter: none; transition: clip-path 1.2s cubic-bezier(.16, 1, .3, 1), opacity .8s, filter 1.2s, transform .6s cubic-bezier(.16, 1, .3, 1); }
.rmi:hover .rmi-frame { box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 90px -16px rgba(var(--particle-color), .55); }

/* pause hors écran */
.rmi:not(.is-vis) .rmi-move, .rmi:not(.is-vis) .rmi-halo::before, .rmi:not(.is-vis) .rmi-halo::after, .rmi:not(.is-vis) .rmi-spark i { animation-play-state: paused; }

/* légende */
.rmi figcaption { display: flex; gap: .75rem; align-items: baseline; margin-top: .9rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
.rmi-n { color: var(--accent-cyan); white-space: nowrap; }
.rmi-n::after { content: ''; display: inline-block; width: 26px; height: 1px; margin-left: .75rem; vertical-align: middle; background: linear-gradient(90deg, var(--accent-cyan), transparent); }

/* ─── Variante héros (pages intérieures) ─── */
@media (min-width: 1100px) {
  .hero-page.has-rmi .hero-content { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 34vw, 580px); column-gap: clamp(2.5rem, 4vw, 5rem); align-items: center; }
  .hero-page.has-rmi .hero-content > *:not(.rmi) { grid-column: 1; }
  .hero-page.has-rmi .hero-content > .rmi { grid-column: 2; grid-row: 1 / span 12; align-self: center; }
  .hero-page.has-rmi .hero-title { font-size: clamp(2.4rem, 4vw, 4.4rem); }
}
.rmi--hero { animation: rmi-float 9s ease-in-out infinite; opacity: 0; animation-name: rmi-in, rmi-float; animation-duration: 1.2s, 9s; animation-delay: .6s, 1.8s; animation-iteration-count: 1, infinite; animation-fill-mode: forwards, none; animation-timing-function: cubic-bezier(.16, 1, .3, 1), ease-in-out; }
.rmi--hero::before { content: ''; position: absolute; inset: -18% -12%; z-index: -1; background: radial-gradient(closest-side, rgba(var(--particle-color), .22), transparent 70%), radial-gradient(closest-side at 70% 70%, rgba(123, 47, 255, .18), transparent 70%); filter: blur(10px); pointer-events: none; }
@media (min-width: 1100px) { .rmi--hero .rmi-frame { --rx: 4deg; --ry: -12deg; } }
@media (max-width: 1099px) { .rmi--hero { margin-top: 2.5rem; max-width: 680px; } }
@keyframes rmi-in { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes rmi-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ─── Bloc image + texte ─── */
.rmi-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; margin-top: clamp(3.5rem, 7vw, 6rem); }
.rmi-split--rev > .rmi, .rmi-split--rev > .rmi-stack { order: 2; }
.rmi-split--top { margin-top: 0; }
.rmi-aside { max-width: 460px; }
.rmi-kicker { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-cyan); margin-bottom: 1.1rem; }
.rmi-kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-cyan); box-shadow: 0 0 0 0 rgba(0, 229, 255, .5); animation: pulse 2s infinite; }
.rmi-h { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 2.8vw, 2.5rem); line-height: 1.05; letter-spacing: -.02em; margin-bottom: 1.1rem; }
.rmi-h em { font-style: normal; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rmi-aside p { color: var(--text-secondary); line-height: 1.7; font-size: 1rem; margin-bottom: 1.6rem; }
.rmi-cta { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-primary); text-decoration: none; padding: .85rem 1.3rem; border: 1px solid rgba(var(--particle-color), .35); background: rgba(var(--particle-color), .05); transition: background .3s, border-color .3s, gap .3s; }
.rmi-cta:hover, .rmi-cta:focus-visible { background: rgba(var(--particle-color), .14); border-color: var(--accent-cyan); gap: 1rem; }
.rmi-cta .arrow { color: var(--accent-cyan); }
@media (max-width: 900px) {
  .rmi-split { grid-template-columns: 1fr; }
  .rmi-split--rev > .rmi, .rmi-split--rev > .rmi-stack { order: 0; }
  .rmi-aside { max-width: none; }
}

/* duo : grande image + mobile flottant */
.rmi-stack { position: relative; padding-bottom: 6%; }
.rmi--float { position: absolute; width: 44%; right: -4%; bottom: -10%; z-index: 3; animation: rmi-float 7s ease-in-out infinite; }
.rmi--float .rmi-frame { box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(var(--particle-color), .35), 0 0 50px -10px rgba(123, 47, 255, .55); }
.rmi--float figcaption { display: none; }
@media (max-width: 600px) { .rmi--float { width: 52%; right: -2%; bottom: -14%; } }

/* trio */
.rmi-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); margin-top: 3rem; }
.rmi-trio .rmi:nth-child(2) { transform: translateY(2.2rem); }
@media (max-width: 900px) { .rmi-trio { grid-template-columns: 1fr; } .rmi-trio .rmi:nth-child(2) { transform: none; } }

/* pages légales : bandeau discret */
.rmi--legal { max-width: 560px; }

/* ─── Vidéo « Visions » ─── */
.rmv { position: relative; margin: 0; }
.rmv-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: #05060a; border: 1px solid rgba(var(--particle-color), .2); box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .85), 0 0 80px -20px rgba(var(--particle-color), .4); }
.rmv-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.rmv-ui { position: absolute; left: 16px; bottom: 16px; z-index: 3; display: flex; gap: .5rem; }
.rmv-ui button { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #e8f6ff; background: rgba(5, 6, 10, .62); border: 1px solid rgba(0, 229, 255, .4); padding: .6rem .9rem; cursor: pointer; backdrop-filter: blur(8px); transition: background .3s, border-color .3s; }
.rmv-ui button:hover, .rmv-ui button:focus-visible { background: rgba(0, 229, 255, .18); border-color: #00e5ff; }
.rmv-ui svg { width: 14px; height: 14px; fill: currentColor; }
.rmv .rmi-corners i { opacity: .9; transform: none; }
.rmv-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
.rmv-meta b { color: var(--accent-cyan); font-weight: 400; }

/* ─── Mouvement réduit ─── */
@media (prefers-reduced-motion: reduce) {
  .rmi-move, .rmi-halo::before, .rmi-halo::after, .rmi-spark i, .rmi--hero, .rmi--float, .rmi-kicker::before { animation: none !important; }
  .rmi--hero { opacity: 1; }
  .rmi-spark, .rmi-sweep { display: none; }
  .rmi-par { transform: none !important; }
  .rmi.rmi-js .rmi-frame { clip-path: inset(0 round 3px); opacity: 1; filter: none; }
  .rmi-frame { transform: none !important; }
  .rmi-corners i { opacity: .9; transform: none; transition: none; }
}

/* ─── Navigation à six liens (page Modules, 29/10/2026) ─── */
.nav-links a { white-space: nowrap; }
@media (max-width: 1560px) { .nav-links { gap: 1.6rem; } .nav-links a { font-size: .78rem; letter-spacing: .05em; } }
@media (max-width: 1280px) { .nav-links { display: none; } .hamburger { display: flex; } .mobile-menu { display: flex; } }
.mod-search:focus-within { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.mod-search input:focus-visible { outline: none !important; }
@media (max-height: 860px) { .mobile-menu { justify-content: flex-start; padding-top: 6.5rem; padding-bottom: 2rem; overflow-y: auto; } }
