/* ==========================================================================
   OPENPRO SARL — Motion layer
   Reveal system driven by GSAP/ScrollTrigger (see assets/js/animations.js).
   CSS defines the *states*; JS toggles the classes/attributes.
   ========================================================================== */

/* ---- Reveal base states (before JS animates them) ---- */
[data-reveal] {
  opacity: 0;
}
[data-reveal="up"] {
  transform: translateY(46px);
}
[data-reveal="fade"] {
  transform: none;
}
[data-reveal="left"] {
  transform: translateX(-46px);
}
[data-reveal="right"] {
  transform: translateX(46px);
}
[data-reveal="scale"] {
  transform: scale(0.92);
}
[data-reveal="zoom"] {
  transform: scale(1.16);
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---- Preloader ---- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.4rem;
}
.preloader .brand {
  font-size: 1.6rem;
  opacity: 0;
}
.preloader-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.preloader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
}
.preloader img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  opacity: 0;
  transform: scale(0.7);
}

/* ---- Hero canvas / gradient orbs ---- */
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
}

.orb-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}
.orb-a {
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, rgba(52, 200, 42, 0.55), transparent 70%);
  top: -12%;
  right: -8%;
  animation: float-a 16s ease-in-out infinite;
}
.orb-b {
  width: 36vw;
  height: 36vw;
  max-width: 480px;
  max-height: 480px;
  background: radial-gradient(circle, rgba(79, 123, 255, 0.5), transparent 70%);
  bottom: -10%;
  left: -6%;
  animation: float-b 20s ease-in-out infinite;
}
.orb-c {
  width: 22vw;
  height: 22vw;
  max-width: 320px;
  max-height: 320px;
  background: radial-gradient(circle, rgba(23, 184, 199, 0.45), transparent 70%);
  top: 40%;
  left: 40%;
  animation: float-c 14s ease-in-out infinite;
}

@keyframes float-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4%, 6%) scale(1.08); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, -5%) scale(1.1); }
}
@keyframes float-c {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-45%, -55%) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; }
}

/* Dotted texture on brand/dark sections (charte v2 uses dots, not a grid) */
.grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.16) 1.1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 30%, #000 42%, transparent 92%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 30%, #000 42%, transparent 92%);
  pointer-events: none;
  animation: dot-drift 24s linear infinite;
}
@keyframes dot-drift {
  from { background-position: 0 0; }
  to { background-position: 24px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .grid-overlay { animation: none; }
}

/* ---- Marquee ---- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 3.5rem;
  animation: marquee 32s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1rem + 1.4vw, 2.1rem);
  color: var(--gray-300);
  opacity: 0.55;
}
.marquee-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.9;
}

/* ---- Number ticking (JS updates textContent; this just adds a subtle pop) ---- */
.count-pop {
  animation: pop 0.4s var(--ease-soft);
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ---- Magnetic buttons wrapper ---- */
.magnetic {
  display: inline-block;
}

/* ---- Custom cursor (desktop only) ---- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  transition: opacity 0.3s;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(52, 200, 42, 0.55);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s, opacity 0.3s;
}
.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: var(--green);
}
@media (hover: none), (max-width: 900px) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---- Draw-in line (SVG path) ---- */
.draw-path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}
.draw-path.is-drawn {
  animation: draw 1.8s var(--ease) forwards;
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ---- Chevron pulse loop (used near CTAs) ---- */
.chevron.animated span {
  animation: chevron-pulse 2.4s ease-in-out infinite;
}
.chevron.animated span:nth-child(2) { animation-delay: 0.15s; }
.chevron.animated span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chevron-pulse {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-7px); opacity: 0.5; }
}

/* ---- Scroll cue ---- */
.scroll-cue {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--silver);
  opacity: 0.7;
  z-index: 2;
}
.scroll-cue .line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--green), transparent);
  overflow: hidden;
  position: relative;
}
.scroll-cue .line::after {
  content: "";
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: 40px;
  background: var(--green-light);
  animation: scroll-cue 2.2s ease-in-out infinite;
}
@keyframes scroll-cue {
  0% { top: -40px; }
  60%, 100% { top: 40px; }
}

/* ---- Tilt card ---- */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---- Blinking status dot (used in contact / footer availability) ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  flex: none;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   Video-zoom / Ken Burns effects
   ========================================================================== */

/* Continuous cinematic zoom on the hero background layers */
.hero-canvas,
.page-hero .grid-overlay,
.hero .grid-overlay {
  will-change: transform;
}
.hero-canvas {
  animation: kenburns-soft 26s ease-in-out infinite alternate;
}
@keyframes kenburns-soft {
  from { transform: scale(1); }
  to { transform: scale(1.14); }
}

/* Project media: perpetual slow zoom, punchier on hover (video feel) */
.project-media {
  overflow: hidden;
}
.project-media::before {
  content: "";
  position: absolute;
  inset: -6%;
  background: inherit;
  z-index: 0;
  animation: kenburns-pan 20s ease-in-out infinite alternate;
  will-change: transform;
}
.project-media > * {
  position: relative;
  z-index: 1;
}
.project-card:hover .project-media::before {
  animation-play-state: paused;
  transform: scale(1.12);
  transition: transform 1.1s var(--ease);
}
@keyframes kenburns-pan {
  0%   { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.16) translate(-2.5%, 2%); }
}

/* Generic zoom-on-hover for media wrappers */
.zoom-media {
  overflow: hidden;
}
.zoom-media img,
.zoom-media .zoom-inner {
  transition: transform 0.9s var(--ease);
  will-change: transform;
}
.zoom-media:hover img,
.zoom-media:hover .zoom-inner {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .hero-canvas,
  .project-media::before {
    animation: none !important;
  }
}

/* ---- Page transition veil ---- */
.page-veil {
  position: fixed;
  inset: 0;
  background: var(--navy-deep);
  z-index: 9997;
  transform: translateY(100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
