/* ==========================================================================
   NoobChart Motion System
   Calm, deliberate, disciplined choreography
   ========================================================================== */

:root {
  --ease-shibui: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-precision: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 180ms;
  --dur-panel: 260ms;
  --dur-reveal: 560ms;
}

/* Lightweight Non-Blocking Top Brand Accent Reveal (does not obscure hero) */
.nc-loader-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 1200;
  pointer-events: none;
  background: transparent;
  overflow: hidden;
  opacity: 1;
  transition: opacity 320ms ease;
}

.nc-loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-hover), transparent);
  transform: translateX(-100%);
  animation: nc-loader-sweep 700ms var(--ease-shibui) forwards;
}

.nc-loader-bar.is-done {
  opacity: 0;
}

@keyframes nc-loader-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

/* Hero Staggered Entrance (runs immediately at paint, no layout shift) */
@keyframes nc-hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nc-samurai-enter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.nc-hero-stagger {
  animation: nc-hero-rise 540ms var(--ease-shibui) both;
}

.nc-hero-stagger-1 { animation-delay: 40ms; }
.nc-hero-stagger-2 { animation-delay: 110ms; }
.nc-hero-stagger-3 { animation-delay: 180ms; }
.nc-hero-stagger-4 { animation-delay: 250ms; }
.nc-hero-stagger-5 { animation-delay: 320ms; }

.nc-samurai-enter {
  animation: nc-samurai-enter 640ms var(--ease-shibui) 90ms both;
}

/* Scroll Reveal Sections (Progressive enhancement: visible if script inactive) */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-reveal) var(--ease-shibui),
    transform var(--dur-reveal) var(--ease-shibui);
}

html.nc-anim-ready [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

html.nc-anim-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle Enso Ring Draw */
.nc-enso-ring circle.nc-enso-stroke {
  stroke-dasharray: 880;
  stroke-dashoffset: 880;
  transition: stroke-dashoffset 950ms var(--ease-shibui);
}

.nc-enso-ring.is-drawn circle.nc-enso-stroke {
  stroke-dashoffset: 110;
}

/* Restrained Drifting Cherry Blossom Petals (Pure CSS transform + opacity) */
.nc-petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.nc-petal {
  position: absolute;
  width: 9px;
  height: 6px;
  border-radius: 70% 30% 70% 30%;
  background: rgba(201, 29, 55, 0.34);
  opacity: 0;
  will-change: transform, opacity;
  animation: nc-petal-drift var(--petal-dur, 18s) linear var(--petal-delay, 0s) infinite;
}

html[data-theme="light"] .nc-petal {
  background: rgba(201, 29, 55, 0.24);
}

@keyframes nc-petal-drift {
  0% {
    opacity: 0;
    transform: translate3d(0, -10px, 0) rotate(0deg);
  }
  12% {
    opacity: 0.55;
  }
  85% {
    opacity: 0.32;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--petal-x, -70px), var(--petal-y, 340px), 0) rotate(var(--petal-rot, 165deg));
  }
}

/* Smooth Tab & Modal Animations */
@keyframes nc-panel-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nc-panel-animate {
  animation: nc-panel-enter var(--dur-panel) var(--ease-precision) both;
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .nc-loader-bar,
  .nc-petal {
    display: none !important;
  }
  .nc-hero-stagger,
  .nc-samurai-enter,
  .nc-panel-animate,
  [data-reveal] {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .nc-enso-ring circle.nc-enso-stroke {
    transition: none !important;
    stroke-dashoffset: 110 !important;
  }
}
