/* ============================================================================
   RARA · marea.css — Autenticidad ONLY: The Threshold + Living Caustics +
   The Acta Assembly. "The Colonnade = the institution, where what the world
   gives becomes certified." A full-bleed band opens the page before the
   existing copy section; the h1 moves onto it. Isolated file (autenticidad-
   only load, ?v=3) so the shared about.css/home.css sheets stay untouched.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   The Threshold — full-bleed colonnade band, breakout from any .wrap ancestor
   via the standard vw/margin trick (robust regardless of nesting depth).
   flex + align-items:flex-end anchors the h1 to the band's lower edge; the
   left gutter is re-contained to --wrap so it lines up with .wrap sections
   below it, same technique as home.css's video-hero bottom-left anchor.
   --------------------------------------------------------------------------- */
/* 100vw includes the scrollbar on Windows, so the breakout overflows the viewport by
   ~15px and summons a horizontal scrollbar; clip the page's x-axis instead of shaving
   the band (this sheet loads only on /autenticidad/, so the guard is page-scoped). */
body{overflow-x:clip}
.aut-threshold{
  position:relative;
  width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
  min-height:62dvh;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
}
.aut-threshold-media{position:absolute;inset:0;overflow:hidden}
.aut-threshold-img{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;object-position:center;display:block;
}

/* Legibility scrim (hard law): 8 EASED stops, never a 2-stop linear — banding
   is a named cheap tell (see home.css's own paper-wash precedent). Panel is
   rooted at the text's lower-left corner via a "to top right" diagonal and
   fades out well before the wine-silk column (~33% in from the left on the
   source plate), so the mist never has to fight the accent for attention.
   .82 at the root over white marble comfortably clears the 4.5:1 body-text
   floor even in the least-forgiving case (dark floor reflection underneath —
   alpha-weighted composite still lands >10:1 against #1A1518 ink). */
.aut-threshold-scrim{
  position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(to top right,
    rgba(238,240,234,.82) 0%,
    rgba(238,240,234,.80) 8%,
    rgba(238,240,234,.74) 18%,
    rgba(238,240,234,.62) 30%,
    rgba(238,240,234,.46) 44%,
    rgba(238,240,234,.28) 60%,
    rgba(238,240,234,.12) 78%,
    rgba(238,240,234,0)   100%);
}

/* The h1, moved off the copy column and onto the band. #1A1518 pinned literal
   per the legibility hard law (matches var(--ink) — kept literal so this rule
   reads correct on its own even if --ink's value ever drifts). Tight max-width
   + left gutter keeps the short ES/EN copy ("100% originales."/"100% original.")
   clear of the wine-silk column at every width where object-fit:cover crops
   horizontally (tablet/mobile). */
.aut-threshold-h1{
  position:relative;z-index:1;
  font-weight:500;
  font-size:clamp(32px,4.6vw,58px);
  line-height:1.05;
  letter-spacing:-.01em;
  color:#1A1518;
  max-width:13ch;
  margin:0;
  padding-inline-start:max(clamp(20px,4vw,48px), calc(50% - var(--wrap) / 2));
  padding-inline-end:clamp(20px,4vw,48px);
  padding-block-start:clamp(72px,16vh,140px);  /* keeps the scrim's ~3x-text-height reach off the archway above */
  padding-block-end:clamp(32px,6vh,60px);
}

/* ---------------------------------------------------------------------------
   Living Caustics — the page's ONE ambient touch. Two feTurbulence fields
   (near-orthogonal baseFrequency orientations) screen-blended into a woven
   noise, then luminance→alpha + a steep gamma carve the peaks into sparse
   white filaments (the SVG defs do the shaping; here we only size/place/blend
   the result). Sits over the water-mirror floor, the band's lower third.
   --------------------------------------------------------------------------- */
.aut-caustics{
  position:absolute;left:0;right:0;bottom:0;
  width:100%;height:36%;
  pointer-events:none;
  mix-blend-mode:screen;
  opacity:.12;
}
/* Two variants, toggled by display (SMIL <animate> ignores prefers-reduced-
   motion, so the swap itself IS the reduce mechanism — see reduce block). */
.aut-caustics--static{display:none}

/* ---------------------------------------------------------------------------
   The Acta Assembly — Apple scroll-scrub pattern, dressed in intaglio. As the
   real Acta specimen (shared _acta.html, rendered inside .loupe-target — the
   accessible plate, NOT the aria-hidden magnified copy in .loupe-glass-inner,
   which is deliberately left untouched below) scrolls into view it composes
   itself: (1) the hairline frame draws in [.acta-plate, a left-to-right
   clip-path wipe — its overflow:hidden already crops it, so no new stacking
   context risk], (2) the field rows stamp in one by one [.acta-row, ink-on-
   paper: translateY 6px + opacity], (3) the wax seal strikes last [.acta-wax,
   scale 1.18->1 — the ONE sanctioned overshoot easing on this page].

   .acta-assembly is a plain class added to the EXISTING .loupe-target div in
   autenticidad.html (no new DOM, _acta.html itself stays untouched). The
   named view-timeline is declared on .acta-assembly .acta and inherits down
   to its descendants — this is deliberate, NOT cosmetic: .acta-plate has
   overflow:hidden (intaglio.css), which is itself a scroll container, so an
   unnamed `animation-timeline:view()` set directly on .acta-row would resolve
   its nearest-ancestor-scroller to .acta-plate (which never scrolls) and
   freeze dead. Naming the timeline on .acta and consuming it on the
   descendants sidesteps that entirely: every stage reads progress off the
   SAME source (.acta's own entry into the viewport), which is what gives the
   stagger its precise, designed ranges instead of relying on incidental row
   spacing. Progressive enhancement: @supports-gated; unsupported browsers
   render every stage at its natural, fully-visible, static state (identical
   to pre-assembly markup) — nothing here is a base style.

   Loupe-compat: loupe.js reads target.getBoundingClientRect() where target IS
   .acta (not .acta-plate/.acta-row/.acta-wax) — clip-path and transform never
   touch .acta itself, and none of clip-path/translateY(6px)/scale+rotate here
   affect layout flow (paint-only), so .acta's box is geometrically stable
   through every stage; .acta:hover's own translateY(-3px) lift (intaglio.css)
   is on a different element and untouched. Each keyframe's end state resolves
   to a real identity value (clip-path:none, transform:none, or — for the wax,
   which carries an ambient transform:rotate(-8deg) at rest — the exact same
   rotate(-8deg) the unanimated rule already sets), so nothing lingers.
   --------------------------------------------------------------------------- */
@supports (animation-timeline: view()){
  .acta-assembly .acta{view-timeline-name:--acta-assembly}

  @keyframes actaFrameIn{
    from{opacity:0;clip-path:inset(0 100% 0 0)}
    to{opacity:1;clip-path:none}
  }
  .acta-assembly .acta-plate{
    animation:actaFrameIn linear both;
    animation-timeline:--acta-assembly;
    animation-range:entry 0% entry 16%;
  }

  @keyframes actaRowIn{
    from{opacity:0;transform:translateY(6px)}
    to{opacity:1;transform:none}
  }
  .acta-assembly .acta-row{
    animation:actaRowIn linear both;
    animation-timeline:--acta-assembly;
  }
  .acta-assembly .acta-row:nth-child(1){animation-range:entry 14% entry 28%}
  .acta-assembly .acta-row:nth-child(2){animation-range:entry 23% entry 37%}
  .acta-assembly .acta-row:nth-child(3){animation-range:entry 32% entry 46%}
  .acta-assembly .acta-row:nth-child(4){animation-range:entry 41% entry 55%}
  .acta-assembly .acta-row:nth-child(5){animation-range:entry 50% entry 64%}
  .acta-assembly .acta-row:nth-child(6){animation-range:entry 59% entry 73%}

  /* The one sanctioned stamp-strike moment: a back-out overshoot, not a bounce. */
  @keyframes actaWaxStrike{
    from{opacity:0;transform:rotate(-8deg) scale(1.18)}
    to{opacity:1;transform:rotate(-8deg) scale(1)}
  }
  .acta-assembly .acta-wax{
    animation:actaWaxStrike cubic-bezier(.34,1.56,.64,1) both;
    animation-timeline:--acta-assembly;
    animation-range:entry 72% entry 92%;
  }
}

/* ONE-ambient-motion-per-viewport law: the Living Caustics (auto-looping,
   ambient) sit in the lower 36% of .aut-threshold, directly above this
   section. On short viewports the tail of a 48-62dvh threshold and the top of
   the acta card can both be on-screen at once, which would put the assembly's
   scroll-scrub in the same band as the caustics' ambient loop. This margin is
   the only guard the acta section needs — the assembly's own ranges already
   don't fire until the card is genuinely entering, so pushing entry a little
   later on short screens is enough to keep the two bands from ever coinciding. */
@media(max-height:700px){
  .about-hero--split{margin-top:clamp(20px,10vh,72px)}
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media(max-width:760px){
  .aut-threshold{min-height:48dvh}
  .aut-threshold-h1{
    font-size:clamp(28px,7.2vw,40px);
    max-width:11ch;
    padding-block-start:clamp(56px,26vh,96px);
    padding-block-end:24px;
  }
}

/* ---------------------------------------------------------------------------
   Reduced motion — the caustics were the page's only ambient touch before the
   Acta Assembly; both reduce contracts live here now. Caustics: static
   variant is already a frozen mid-point frame (baseFrequency fixed at the
   animation's midpoint in the template's SVG defs), never a blank/hidden
   overlay. Assembly: every stage renders in its fully-visible, finished
   state, instantly — no travel, no stagger, no wax strike; transforms/clip-
   path are cleared explicitly rather than relying on animation:none alone,
   since the wax's own rest state still needs its ambient rotate(-8deg) (left
   alone here, untouched, exactly as intaglio.css already sets it).
   --------------------------------------------------------------------------- */
@media(prefers-reduced-motion:reduce){
  .aut-caustics--motion{display:none}
  .aut-caustics--static{display:block}

  .acta-assembly .acta-plate{animation:none!important;opacity:1!important;clip-path:none!important}
  .acta-assembly .acta-row{animation:none!important;opacity:1!important;transform:none!important}
  .acta-assembly .acta-wax{animation:none!important;opacity:1!important}
}
