/* ============================================================
   Core Animations & Scroll Reveals
   RK Cosmetic Expert — Motion System
   ============================================================ */

/* ── Reduced-motion gate — must come first ── */
@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .reveal-in,
  .reveal-left,
  .reveal-right,
  .hero-eyebrow,
  .hero-title,
  .hero-subtitle,
  .hero-actions,
  .hero-panel-image img,
  .hero-annotation,
  .svc-strip,
  .svc-connector-line,
  .about-preview-image-wrap {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* Stagger delays — 80ms increments (kept for any custom logic if needed) */
.delay-100 { transition-delay: 80ms; }
.delay-200 { transition-delay: 160ms; }
.delay-300 { transition-delay: 240ms; }
.delay-400 { transition-delay: 320ms; }
.delay-500 { transition-delay: 400ms; }

/* Active state applied by JS */
.is-revealed {
  opacity: 1;
  transform: translate(0, 0);
}

/* ── Hero Ken Burns effect — desktop only, respects prefers-reduced-motion ── */
@keyframes ken-burns {
  0%   { transform: scale(1.00); }
  100% { transform: scale(1.04); }
}

/* Only activate on screens ≥768px AND when motion is allowed */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .hero-panel-image > img,
  .hero-panel-image > .hero-image-clip > img {
    animation: ken-burns 12s ease-in-out infinite alternate;
    will-change: transform;
    transform-origin: center center;
  }
}

.hero-annotation-label {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-link);
  margin-bottom: 0.2rem;
}

/* ── Hero annotation panels: layout & visual (no animation) ── */
.hero-annotation {
  position: absolute;
  z-index: 10;
  background-color: rgba(245, 239, 230, 0.92);
  border-left: 2px solid var(--color-accent);
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #2C1F10;
  box-shadow: 0 4px 18px rgba(44, 31, 16, 0.14);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.hero-annotation-1 {
  bottom: 22%;
  left: 5%;
}

.hero-annotation-2 {
  top: 18%;
  right: 6%;
}

/* ── 5. Service strip: animations delegated to AOS ── */

/* ── 6. SVG line-draw connector ── */
.svc-connector {
  display: block;
  margin: 0 auto 0.5rem auto;
  overflow: visible;
}

.svc-connector-line {
  stroke: var(--color-accent);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  transition: stroke-dashoffset 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

.svc-connector-dot {
  fill: var(--color-accent);
  opacity: 0;
  transition: opacity 400ms ease 700ms;
}

.svc-connector.is-drawn .svc-connector-line {
  stroke-dashoffset: 0;
}

.svc-connector.is-drawn .svc-connector-dot {
  opacity: 1;
}

/* ── 4. About preview: parallax image moves slower ── */
.about-preview-image-wrap {
  will-change: transform;
  transition: transform 0ms linear; /* updated by JS rAF */
}

/* ── Image hover & elevation (Micro-interactions) ── */
.hover-elevate {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

@media (hover: hover) {
  .hover-elevate:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hover-elevate:hover {
    transform: none;
  }
}

/* ── Card image scale on hover ── */
.card-image-wrap {
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.image-scale-hover {
  transition: transform var(--transition-fast);
}

@media (hover: hover) {
  .card:hover .image-scale-hover {
    transform: scale(1.02); /* Subtle scale instead of 1.04 */
  }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover .image-scale-hover {
    transform: none;
  }
}

/* ── 7. Button: refined hover — color only, no scale, no jump ── */
.btn {
  transition: background-color 220ms ease,
              color 120ms ease,
              border-color 220ms ease,
              box-shadow 220ms ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: none;
}

/* Nav CTA — keep its own transition (overrides above intentionally) */
.nav-links a.nav-item.btn-primary {
  transition: background-color 200ms ease, color 120ms ease;
}

/* ── Focus-visible for interactive elements not covered in global.css ── */
.faq-item summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

select.form-control:focus-visible {
  outline: 2px solid var(--color-herbal-green);
  outline-offset: 2px;
}

/* Fix: hero annotation panels — hide on mobile (white-space:nowrap + absolute
   positioning causes clipping/overflow when the hero stacks to single column) */
@media (max-width: 900px) {
  .hero-annotation {
    display: none;
  }
}

/* ── Parallax background (kept for other pages) ── */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
