/* ==========================================================
   EMPIRE ARMY — PUBLIC WIDE EFFECTS & UTILITIES
   (FULL FILE REWRITE)
   Purpose:
   - Unified fade & motion system
   - Scroll animation stabilization
   - Mobile-safe transitions
   - Grid helpers
   - Utility spacing
========================================================== */

/* ----------------------------------------------------------
   FADE & MOTION SYSTEM
---------------------------------------------------------- */

/* Base fade-in behaviour */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

/* Activated state */
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.fade-in.delay-1 { transition-delay: 0.08s; }
.fade-in.delay-2 { transition-delay: 0.16s; }
.fade-in.delay-3 { transition-delay: 0.24s; }
.fade-in.delay-4 { transition-delay: 0.32s; }

/* ----------------------------------------------------------
   SCROLL ACTIVATOR
   (script sets .show when entering viewport)
---------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .scroll-watch {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.6s ease-out,
      transform 0.6s ease-out;
  }

  .scroll-watch.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   SECTION SPACING (Global)
---------------------------------------------------------- */

.section {
  padding: 32px 0;
}

.section-tight {
  padding: 18px 0;
}

/* ----------------------------------------------------------
   GRID UTILITIES
---------------------------------------------------------- */

.grid {
  display: grid;
  gap: 24px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ==========================================================
   RESPONSIVE GRID COLLAPSE
========================================================== */

@media (max-width: 900px) {
  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   TEXT UTILITIES
---------------------------------------------------------- */

.muted {
  color: #b5aa95;
}

.center {
  text-align: center;
}

.upper {
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ----------------------------------------------------------
   FLEX UTILITIES
---------------------------------------------------------- */

.flex {
  display: flex;
}

.flex.center {
  justify-content: center;
  align-items: center;
}

.flex.between {
  justify-content: space-between;
}

.flex.column {
  flex-direction: column;
}

.flex.wrap {
  flex-wrap: wrap;
}

/* ----------------------------------------------------------
   WIDTH UTILITIES
---------------------------------------------------------- */

.wide {
  width: 100%;
}

.max-600 {
  max-width: 600px;
  margin: 0 auto;
}

/* ----------------------------------------------------------
   BUTTON ALIGNMENT
---------------------------------------------------------- */

.actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

/* ----------------------------------------------------------
   HERO & HEADER SAFE SPACING FOR MOBILE
---------------------------------------------------------- */

@media (max-width: 760px) {
  .hero-inner {
    gap: 14px;
  }

  .hero-title {
    font-size: 22px !important;
  }

  .hero-sub {
    font-size: 13px !important;
  }
}

/* ----------------------------------------------------------
   CARD FIXES (Align to new straight-card system)
---------------------------------------------------------- */

/* Ensures cards animate cleanly into place */
.runestone-card.fade-in {
  transform: translateY(20px);
}
.runestone-card.fade-in.show {
  transform: translateY(0);
}

/* Tight hover on mobile disabled */
@media (max-width: 650px) {
  .runestone-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.72);
  }
}

/* ----------------------------------------------------------
   SAFE IMAGE SCALING
---------------------------------------------------------- */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----------------------------------------------------------
   PAGE EDGE PADDING
---------------------------------------------------------- */

.page-edge {
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 600px) {
  .page-edge {
    padding-left: 14px;
    padding-right: 14px;
  }
}

