/* OA identity: one ASCII field, driven by scroll. */
.ascii-ident {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none !important;
  margin: 0;
  padding: 0;
  overflow: visible;
}

/* Neutralize the legacy hero container: the ASCII stage owns its own
   full-width geometry and should meet the surrounding rules directly. */
.identity-news .hero-logo.ascii-ident {
  display: block;
  padding: 0;
  /* The ASCII controller owns this section's motion. Neutralize the older
     generic entrance/parallax transform so the reel and logo cannot drift. */
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.ascii-ident-stage {
  --ascii-overscan: 0px;
  --ascii-aperture-clip: inset(0 50%);
  --ascii-logo-left: var(--pad, clamp(1.2rem, 2.5vw, 2.4rem));
  --ascii-logo-width: min(
    calc(100vw - (2 * var(--ascii-logo-left))),
    max(54vw, calc(43.2vw + 11.875rem))
  );
  position: relative;
  left: 50%;
  display: block;
  width: 100vw;
  max-width: none;
  /* The moving reel owns the full field. The final wordmark is a precisely
     placed object inside it, rather than stretching to become the field. */
  height: clamp(10rem, 18vw, 21rem);
  aspect-ratio: auto;
  margin-left: -50vw;
  overflow: hidden;
  color: var(--ink, #101010);
  background: var(--paper, #f2f1ed);
  transition: color .12s linear, background-color .12s linear;
  contain: layout paint;
  isolation: isolate;
}

.ascii-ident-readout,
.ascii-ident-wordmark,
.ascii-ident-artifacts,
.ascii-ident .ascii-ident-logo {
  position: absolute;
  inset: 0;
}

.ascii-ident-readout,
.ascii-ident-wordmark,
.ascii-ident-artifacts {
  z-index: 1;
  top: calc(0px - var(--ascii-overscan, 0px));
  bottom: calc(0px - var(--ascii-overscan, 0px));
  width: 100%;
  height: auto;
  margin: 0;
  padding-top: var(--ascii-pad-y, 0);
  box-sizing: border-box;
  overflow: hidden;
  color: inherit;
  background: transparent;
  -webkit-text-fill-color: currentColor;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: var(--ascii-font-size, 8px);
  font-weight: 500;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  letter-spacing: 0;
  line-height: .82;
  white-space: pre;
  opacity: 0;
  user-select: none;
  pointer-events: none;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
  transition: color .12s linear;
}

.ascii-ident-readout {
  opacity: 1;
}

.ascii-ident-wordmark {
  z-index: 2;
  opacity: 0;
  /* The source SVG is cropped to the exact painted bounds. Keep its requested
     left anchor and scale while the surrounding ASCII continues full-bleed. */
  -webkit-mask-image: url("/work/logo-master.svg?v=3");
  mask-image: url("/work/logo-master.svg?v=3");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: var(--ascii-logo-left) 50%;
  mask-position: var(--ascii-logo-left) 50%;
  -webkit-mask-size: var(--ascii-logo-width) auto;
  mask-size: var(--ascii-logo-width) auto;
}

/* In the negative-space payoff, ASCII glyphs build the surrounding field and
   the OA silhouette is made from untouched paper—not a black panel or blend. */
.ascii-ident.is-ascii-negative .ascii-ident-wordmark {
  -webkit-mask-image: none;
  mask-image: none;
}

/* The transformation is rendered by one full-density ASCII layer. The exact
   vector remains opaque paper and is revealed by a stepped, scroll-driven
   aperture; it never cross-fades over the live footage. */
.ascii-ident-stage::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: calc(0px - var(--ascii-overscan, 0px));
  right: 0;
  bottom: calc(0px - var(--ascii-overscan, 0px));
  left: 0;
  pointer-events: none;
  -webkit-mask-image: url("/work/logo-master.svg?v=3");
  mask-image: url("/work/logo-master.svg?v=3");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: var(--ascii-logo-left) 50%;
  mask-position: var(--ascii-logo-left) 50%;
  -webkit-mask-size: var(--ascii-logo-width) auto;
  mask-size: var(--ascii-logo-width) auto;
  opacity: 1;
  -webkit-clip-path: var(--ascii-aperture-clip);
  clip-path: var(--ascii-aperture-clip);
  transform: translate3d(0, var(--ascii-parallax-y, 0), 0);
  transform-origin: center center;
  will-change: transform;
  background-color: var(--paper, #f2f1ed);
}

.ascii-ident-aperture-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ascii-ident-readout,
.ascii-ident-wordmark,
.ascii-ident-artifacts {
  transform: translate3d(0, var(--ascii-parallax-y, 0), 0);
  transform-origin: center center;
  will-change: transform;
}

.ascii-ident-wordmark,
.ascii-ident-artifacts {
  -webkit-clip-path: inset(var(--ascii-vertical-wipe, 0%) 0);
  clip-path: inset(var(--ascii-vertical-wipe, 0%) 0);
  will-change: transform, clip-path;
}

.ascii-ident-artifacts {
  z-index: 3;
  opacity: 0;
}

/* The current payoff is intentionally rendered by the single live PRE plus
   the exact paper mask. Retire the two legacy compositing layers completely
   instead of leaving invisible full-width surfaces on the GPU. */
.ascii-ident-wordmark,
.ascii-ident-artifacts {
  display: none !important;
  will-change: auto;
}

.ascii-ident.is-ascii-live .ascii-ident-readout,
.ascii-ident.is-ascii-morphing .ascii-ident-readout,
.ascii-ident.is-ascii-resolved .ascii-ident-readout,
.ascii-ident.is-ascii-live .ascii-ident-wordmark,
.ascii-ident.is-ascii-morphing .ascii-ident-wordmark,
.ascii-ident.is-ascii-resolved .ascii-ident-wordmark,
.ascii-ident.is-ascii-live .ascii-ident-artifacts,
.ascii-ident.is-ascii-morphing .ascii-ident-artifacts,
.ascii-ident.is-ascii-resolved .ascii-ident-artifacts {
  visibility: visible;
}

.ascii-ident .ascii-ident-logo {
  z-index: 0;
  display: block;
  inset: auto;
  top: 50%;
  left: var(--ascii-logo-left);
  width: var(--ascii-logo-width) !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0);
  opacity: 0 !important;
  animation: none !important;
  transform: translateY(-50%) !important;
  visibility: hidden;
  pointer-events: none;
}

.ascii-ident:not(.is-static-fallback) .ascii-ident-logo {
  display: block !important;
}

.ascii-ident-source,
.ascii-ident-sampler {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ascii-ident.is-static-fallback .ascii-ident-readout,
.ascii-ident.is-static-fallback .ascii-ident-wordmark,
.ascii-ident.is-static-fallback .ascii-ident-artifacts,
.ascii-ident.is-static-fallback .ascii-ident-source,
.ascii-ident.is-static-fallback .ascii-ident-sampler {
  display: none !important;
}

.ascii-ident.is-static-fallback .ascii-ident-stage::after {
  display: none !important;
}

.ascii-ident.is-static-fallback .ascii-ident-logo {
  z-index: 1;
  display: block !important;
  opacity: 1 !important;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .ascii-ident-stage {
    background: var(--paper, #f2f1ed);
    transition: none;
  }

  .ascii-ident-readout,
  .ascii-ident-wordmark,
  .ascii-ident-artifacts,
  .ascii-ident-source,
  .ascii-ident-sampler,
  .ascii-ident-stage::after {
    display: none !important;
  }

  .ascii-ident:not(.is-static-fallback) .ascii-ident-logo,
  .ascii-ident.is-static-fallback .ascii-ident-logo {
    z-index: 1;
    display: block !important;
    opacity: 1 !important;
    visibility: visible;
    filter: brightness(0) !important;
    clip-path: none !important;
    animation: none !important;
  }
}

@media print {
  .ascii-ident-readout,
  .ascii-ident-wordmark,
  .ascii-ident-artifacts,
  .ascii-ident-source,
  .ascii-ident-sampler,
  .ascii-ident-stage::after {
    display: none !important;
  }

  .ascii-ident:not(.is-static-fallback) .ascii-ident-logo,
  .ascii-ident.is-static-fallback .ascii-ident-logo {
    z-index: 1;
    display: block !important;
    opacity: 1 !important;
    visibility: visible;
  }
}

/* Cover Safari's occasional subpixel seam between the ASCII field and the
   adjoining reel band without changing either section's measured height. */
@media (max-width: 760px), (hover: none), (pointer: coarse) {
  .ascii-ident-stage {
    margin-bottom: -1px;
  }

  .ascii-ident + .reel-cta {
    position: relative;
    z-index: 5;
  }
}
