/* GRIPEN FUNDING — base layer (Swiss / brutalist) */

body {
  background-color: #F2F0EB;
  color: #0F0F0F;
  -webkit-font-smoothing: antialiased;
}

/* Hide scrollbars on horizontal rails */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Film-grain noise overlay */
.noise-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
}

/* Vertical marginalia */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

/* Blueprint grid */
.bg-grid {
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, rgba(15, 15, 15, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 15, 15, 0.05) 1px, transparent 1px);
}

/* Marquee ticker */
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.animate-ticker { animation: ticker 30s linear infinite; }

/* =========================================
   SCROLL REVEAL
   Fades + lifts + unblurs elements as they enter
   the viewport. Replays every time an element is
   scrolled away from and returned to.
   ========================================= */
@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeSlideInFlat {
  0%   { opacity: 0; transform: translateY(22px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Without JS nothing is hidden, so content is never stranded. */

/* With JS: held hidden, animated on entry. Dropping .in-view returns the
   element to the hidden state, which is what lets the animation replay. */
.js-reveal .reveal { opacity: 0; }

.js-reveal .reveal.in-view {
  animation: fadeSlideIn 1.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--d, 0s);
}

/* Long text blocks skip the blur — cheaper to paint, easier to read */
.js-reveal .reveal-flat.in-view { animation-name: fadeSlideInFlat; }

/* Settled: strip the animation so no compositor layer lingers.
   Must come last to win over the .in-view rules above. */
.js-reveal .reveal.revealed {
  animation: none;
  opacity: 1;
}

/* --- Stagger a grid's direct children from one class on the container --- */
.js-reveal .reveal-stagger > * { opacity: 0; }

.js-reveal .reveal-stagger.in-view > * {
  animation: fadeSlideInFlat 1.14s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.js-reveal .reveal-stagger.in-view > *:nth-child(1)   { animation-delay: 0.05s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(2)   { animation-delay: 0.12s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(3)   { animation-delay: 0.19s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(4)   { animation-delay: 0.26s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(5)   { animation-delay: 0.33s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(6)   { animation-delay: 0.40s; }
.js-reveal .reveal-stagger.in-view > *:nth-child(n+7) { animation-delay: 0.48s; }

.js-reveal .reveal-stagger.revealed > * {
  animation: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal,
  .js-reveal .reveal.in-view,
  .js-reveal .reveal-stagger > *,
  .js-reveal .reveal-stagger.in-view > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .animate-ticker { animation: none !important; }
}
