/* ============================================================
   ETHRAEON EUDS - Motion: the Parallax Fibonacci Spring
   The estate's canonical motion and rhythm system, merged into
   EUDS. Fibonacci rhythm + spring physics + parallax depth.
   Values reconciled from the live estate token file
   (spring stiffness 180, damping 24, entrance cubic-bezier).
   Reduced-motion is always respected.
   ============================================================ */
:root {
  /* -- Fibonacci rhythm scale (px). The editorial + hero cadence.
        Use alongside the 4px UI grid, not instead of it. -- */
  --phi-1: 4px;
  --phi-2: 8px;
  --phi-3: 13px;
  --phi-4: 21px;
  --phi-5: 34px;
  --phi-6: 55px;
  --phi-7: 89px;
  --phi-8: 144px;
  --phi-9: 233px;
  --phi-ratio: 1.618; /* @kind other */

  /* -- Spring physics (the ETHRAEON spring). -- */
  --spring-stiffness: 180; /* @kind other */
  --spring-damping: 24; /* @kind other */
  /* CSS approximation of the spring for transitions/transforms */
  --spring: cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
  --spring-soft: cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --spring-tight: cubic-bezier(0.34, 1.12, 0.42, 1); /* @kind other */

  /* -- Durations tuned to the spring -- */
  --motion-instant: 90ms; /* @kind other */
  --motion-fast: 160ms; /* @kind other */
  --motion-base: 260ms; /* @kind other */
  --motion-slow: 420ms; /* @kind other */
  --motion-entrance: 640ms; /* @kind other */

  /* -- Parallax depth scale. Multiply scroll delta by these.
        depth-0 is the pinned plane; higher = further back, slower. -- */
  --parallax-0: 0; /* @kind other */
  --parallax-1: 0.06; /* @kind other */
  --parallax-2: 0.12; /* @kind other */
  --parallax-3: 0.22; /* @kind other */
  --parallax-4: 0.38; /* @kind other */
  --parallax-5: 0.6; /* @kind other */
}

/* -- Spring entrance: base state is the visible end-state; animate FROM hidden.
      Gate on [data-eu-inview] so print/no-JS/reduced-motion show content. -- */
@media (prefers-reduced-motion: no-preference) {
  .eu-rise {
    opacity: 0;
    transform: translateY(var(--phi-4));
    transition: opacity var(--motion-entrance) var(--spring),
                transform var(--motion-entrance) var(--spring);
    will-change: opacity, transform;
  }
  .eu-rise[data-eu-inview] { opacity: 1; transform: none; }

  .eu-spring-press { transition: transform var(--motion-fast) var(--spring-tight); }
  .eu-spring-press:active { transform: scale(0.97); }
}

/* Parallax layers read --parallax-y set by the reference controller (JS). */
.eu-parallax { will-change: transform; }
/* Displacement clamp. The reference controller emits an uncapped --parallax-y
   (-center * depth), which on a long page reaches hundreds of px and drags a
   layer over its neighbours. 48px is the estate's own proven bound, carried
   from the earlier engine's MAX_SHIFT. Keeps every layer inside its region. */
.eu-parallax[data-depth] { transform: translate3d(0, clamp(-48px, var(--parallax-y, 0px), 48px), 0); }

/* Overlap guard: parallax-translated H1s must not collide with their sibling
   badge/subtitle. Tight clamp (+/-8px) preserves motion at reduced intensity
   while enforcing subtitle clearance. Line-height 1.2 keeps ascenders in-box.
   Fixes L-PRODUCT-TEMPLATE-H1-SUBTITLE-OVERLAP-FIX (Manual-QA Chunk 2 rows
   16 art-workflow, 17 cross-border, 18 fraud-finder, 20 bubble,
   21 enterprise-suite; also unblocks nexus-grid / mythos / tracelet-1qa /
   journey / products-index hero collisions). */
h1.eu-parallax[data-depth],
.header h1.eu-parallax[data-depth],
.hero h1.eu-parallax[data-depth] {
  transform: translate3d(0, clamp(-8px, var(--parallax-y, 0px), 8px), 0);
  line-height: 1.2;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .eu-rise { opacity: 1 !important; transform: none !important; }
  .eu-parallax[data-depth] { transform: none !important; }
}


/* ===== EUDS Wave C responsive containment (SD19 V12 P1/P18) =====
   Shared-layer guarantee: no horizontal overflow and a usable layout at
   336 / 393 / 430 / 768 / 1440 CSS-px and at 200% zoom. Containment only -
   EUDS palette, type (Cinzel/Cormorant/Archivo), parchment default and
   forest/gold are untouched. Appended last so containment wins the cascade. */
html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
img, svg, video, canvas, iframe, embed, object { max-width: 100%; }
img, svg, video, canvas { height: auto; }
pre { max-width: 100%; overflow-x: auto; }
pre, code, kbd, samp { overflow-wrap: break-word; }
table { max-width: 100%; }
/* wrap link rows and language/theme control rows so neither forces page overflow (P1) */
header nav, .nav, .navbar, .site-nav, .topnav, .toolbar, .controls { flex-wrap: wrap; }
/* 1440 and wider: global body containment above keeps content within the viewport;
   EUDS .container caps at 1200px and centers, so no horizontal overflow at desktop. */
/* phone + small-tablet band (<=768, covers 336/393/430): wide tables become an
   accessible horizontal scroller instead of pushing the page sideways. */
@media (max-width: 768px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* small-phone band (336 / 393 / 430): collapse multi-column grids to one column
   and let every layout track shrink (min-width:0), per mobile-footer-overflow-fix. */
@media (max-width: 430px) {
  [style*="grid-template-columns"], .footer-grid, .euf-grid,
  .grid, [class*="cols-"], [class*="columns"] {
    grid-template-columns: 1fr !important;
    min-width: 0;
  }
  .container, .container-narrow, main, section, article, .card, .panel {
    min-width: 0;
    max-width: 100%;
  }
}
/* ===== end EUDS Wave C responsive containment ===== */
