/* ============================================================
   HOPEX — animations.css
   Motion layer only: no new colors, spacing or layout rules.
   Everything here hooks onto existing classes/selectors from
   style.css so no HTML structure had to change.
   ============================================================ */

/* ---------- GLOBAL MOTION SYSTEM ----------
   One shared vocabulary for every animation added in this file.
   The premium ease/durations alias the site's existing tokens so
   new motion reads as part of the same language, not a second one. */
:root {
  --ease-premium: var(--ease);
  --duration-fast: var(--t-fast);
  --duration-normal: var(--t);
  --duration-slow: .7s var(--ease-premium);
  --stagger: 90ms;
}

/* ============================================================
   PAGE LOAD — navbar leads, hero cascades in behind it
   (hero-title/-desc/-actions/-trust/.stage timings live in
   style.css; only the new navbar entrance + title reveal are here)
   ============================================================ */
@keyframes navEnter {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: none; }
}
.navbar { animation: navEnter .6s var(--ease-premium) both; }

/* HERO HEADLINE — masked wipe instead of a plain fade, since this
   is the single strongest beat on the page */
@keyframes heroTitleReveal {
  0%   { opacity: 0; transform: translateY(32px); clip-path: inset(0 0 100% 0); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0);    clip-path: inset(0 0 0% 0); }
}

/* ============================================================
   SCROLL REVEALS — layered on top of the existing .reveal system
   ============================================================ */

/* section headings get their own masked wipe, nested inside the
   parent block's existing opacity/translate reveal */
@keyframes headingReveal { to { clip-path: inset(0 0 0% 0); } }

.section-head.reveal .section-title,
.about-content.reveal .section-title,
.contact-info.reveal .section-title {
  clip-path: inset(0 0 100% 0);
}
.section-head.reveal.visible .section-title,
.about-content.reveal.visible .section-title,
.contact-info.reveal.visible .section-title {
  animation: headingReveal .8s var(--ease-premium) .08s both;
}

/* portfolio screenshots unmask as their card enters the viewport */
@keyframes imgReveal { to { clip-path: inset(0 0 0% 0); } }

.project.reveal .project-thumb--shot img {
  clip-path: inset(0 0 100% 0);
}
.project.reveal.visible .project-thumb--shot img {
  animation: imgReveal .9s var(--ease-premium) .12s both;
}

/* ============================================================
   POINTER-REACTIVE GLOW — desktop only; JS sets --mx/--my
   (falls back to a centred glow if JS never touches it)
   ============================================================ */
.project { position: relative; } /* .card already has position: relative */

.card::after,
.project::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
              rgba(0, 180, 255, .14), transparent 62%);
  transition: opacity var(--duration-normal);
}
.card:hover::after,
.project:hover::after { opacity: 1; }

/* soft light that drifts toward the cursor in the hero */
.hero { isolation: isolate; }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%),
              color-mix(in srgb, var(--scene-a) 20%, transparent), transparent 70%);
  transition: opacity .5s var(--ease-premium);
}
.hero:hover::after { opacity: 1; }

/* ============================================================
   CONTACT — the closing section gets a quiet ambient glow
   ============================================================ */
.contact { position: relative; isolation: isolate; }
.contact::before {
  content: '';
  position: absolute;
  inset: -10% -5% auto -5%;
  height: 70%;
  z-index: -1;
  pointer-events: none;
  opacity: .7;
  filter: blur(54px);
  background: radial-gradient(60% 60% at 50% 0%,
              color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%);
}

/* ============================================================
   PROJECT HOVER — small icon nudge to reinforce the overlay CTA
   ============================================================ */
.project-thumb--shot:hover .thumb-overlay-btn svg,
.project-thumb--shot:focus-visible .thumb-overlay-btn svg {
  transform: translateX(4px);
}
[dir="rtl"] .project-thumb--shot:hover .thumb-overlay-btn svg,
[dir="rtl"] .project-thumb--shot:focus-visible .thumb-overlay-btn svg {
  transform: translateX(-4px);
}
.thumb-overlay-btn svg { transition: transform var(--duration-fast); }

/* ============================================================
   REDUCED MOTION / TOUCH — kill everything added in this file
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .navbar,
  .hero-title,
  .section-head.reveal.visible .section-title,
  .about-content.reveal.visible .section-title,
  .contact-info.reveal.visible .section-title,
  .project.reveal.visible .project-thumb--shot img {
    animation: none !important;
    clip-path: none !important;
  }
  .hero::after,
  .card::after,
  .project::after,
  .contact::before { display: none !important; }
}

@media (hover: none), (pointer: coarse) {
  .hero::after,
  .card::after,
  .project::after { display: none; }
}
