/* ==========================================
   IT-IMPULSE — MODERN LAYER (lean, additive)
   After style.css. Live effects only: reveal, scroll-progress,
   page-transition, scrollbar, to-top. Legacy hero/service-card chrome removed.
   ========================================== */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
}
[data-theme="light"] {
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .scroll-progress, .page-transition__overlay { display: none !important; }
}

[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease-out-expo), transform 700ms var(--ease-out-expo);
}
[data-reveal][data-anim-pending] { opacity: 0; transform: translate3d(0, 28px, 0); }
[data-reveal][data-anim-in] { opacity: 1; transform: none; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, #ff8b95 70%, var(--accent) 100%);
  background-size: 200% 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  box-shadow: 0 0 10px rgba(230,57,70,0.6);
  animation: progress-shimmer 5s linear infinite;
}
@keyframes progress-shimmer { to { background-position: 200% 0; } }

.page-transition__overlay {
  position: fixed; inset: 0;
  z-index: 250;
  background: var(--bg-primary);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 380ms var(--ease-out-expo);
}
.page-transition__overlay.is-active {
  visibility: visible;
}

main {
  transition: opacity 380ms var(--ease-out-expo), transform 380ms var(--ease-out-expo);
}
body.is-leaving main {
  opacity: 0;
  transform: translate3d(0, -24px, 0);
  will-change: opacity, transform;
}
body.is-leaving .page-transition__overlay {
  opacity: 1;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg-primary);
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

html { scroll-behavior: smooth; }
section[id], [id|="chapter"] { scroll-margin-top: 96px; }
body.has-nx-shell [id|="chapter"] { scroll-margin-top: 96px; }

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 95;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated, var(--bg-card));
  color: var(--text-primary);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 250ms ease, visibility 250ms ease, transform 250ms var(--ease-out-expo), border-color 200ms ease, color 200ms ease;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="light"] .to-top { box-shadow: 0 10px 30px -14px rgba(15,23,42,0.25); }
@media (max-width: 767px) {
  .to-top { display: none; }
}
