/* The FORM background opens over the same graphite field as the page. */
@property --axis-bridge-radius {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

@media (min-width: 768px) and (pointer: fine) {
  #flight[data-form-production] .axis-form-poster { padding: 0; }
}

@supports (animation-timeline: view()) and (width: hypot(3px, 4px)) {
  @media (prefers-reduced-motion: no-preference) {
    html.motion-enabled body[data-axis-graphite] main#main {
      timeline-scope: --axis-form-entry;
    }
    html.motion-enabled #flight[data-form-production] {
      view-timeline-name: --axis-form-entry;
    }
    html.motion-enabled body[data-axis-graphite][data-axis-form-soft]:has(#flight[data-form-production][data-state=ready]) #axis-page-field {
      animation: axis-bridge-points 1ms linear backwards;
      animation-timeline: --axis-form-entry;
      animation-range: entry 0% contain 12%;
    }
    html.motion-enabled #flight[data-form-production]:not([data-state=static]) .axis-form-stage {
      background-color: transparent;
    }
    html.motion-enabled body[data-axis-graphite] #flight[data-form-production]:not([data-state=static]) .axis-form-stage::before {
      content: '';
      position: absolute;
      inset: 0;
      pointer-events: none;
      /* A captured field frame loads as an image, independently of this stylesheet. */
      background: center / cover no-repeat url("assets/form-v119/entry-field-fallback.webp");
      opacity: 1;
    }
    html.motion-enabled body[data-axis-graphite] #flight[data-form-production][data-state=ready] .axis-form-stage::before {
      animation: axis-bridge-fallback-end 1ms linear forwards;
      animation-timeline: --axis-form-entry;
      animation-range: contain 12% contain 12.1%;
    }
    html.motion-enabled body[data-axis-graphite]:has(#axis-page-field[data-drawn=true]) #flight[data-form-production] .axis-form-stage::before {
      opacity: 0;
      transition: opacity 220ms ease-out;
    }
    @media (max-width: 767px), (pointer: coarse) {
      /* Pauses and resizes clear data-drawn. The first-use desktop capture must
         not flash over the softer live mobile field each time it resumes. */
      html.motion-enabled body[data-axis-graphite]:has(#axis-page-field[data-presented=true]:not([data-state=fallback]):not([data-state=context-lost])) #flight[data-form-production] .axis-form-stage::before {
        opacity: 0;
      }
    }
    @keyframes axis-bridge-fallback-end {
      from, to { visibility: hidden; }
    }
    html.motion-enabled #flight[data-form-production]:not([data-state=static]) .axis-form-atmosphere {
      opacity: 0;
    }
    html.motion-enabled #flight[data-form-production][data-state=ready] .axis-form-stage {
      animation: axis-bridge-solid 1ms linear forwards;
      animation-timeline: --axis-form-entry;
      animation-range: contain 12% contain 12.1%;
    }
    html.motion-enabled #flight[data-form-production][data-state=ready] .axis-form-atmosphere {
      --axis-bridge-feather: min(24vmin, 210px);
      mask-image: radial-gradient(circle at 50% 48%,
        #000 max(0px, calc(var(--axis-bridge-radius) - var(--axis-bridge-feather))),
        transparent var(--axis-bridge-radius));
      animation: axis-bridge-circle 1ms ease-in-out both, axis-bridge-clear 1ms linear forwards;
      animation-timeline: --axis-form-entry, --axis-form-entry;
      animation-range: contain 2.5% contain 11.5%, contain 11.6% contain 12%;
    }
    @keyframes axis-bridge-points {
      from, to { filter: none; }
    }
    @keyframes axis-bridge-circle {
      from { --axis-bridge-radius: 0px; opacity: 0; }
      35% { opacity: 1; }
      to {
        --axis-bridge-radius: calc(hypot(50vw, 52svh) + var(--axis-bridge-feather));
        opacity: 1;
      }
    }
    @keyframes axis-bridge-clear {
      from, to { mask-image: none; }
    }
    @keyframes axis-bridge-solid {
      from, to { background-color: var(--studio-base, #262a36); }
    }
  }
  @media (min-width: 1024px) and (min-height: 521px) and (prefers-reduced-motion: no-preference) {
    html.motion-enabled body[data-axis-review].axis-cover-active #approach.axis-editorial-case[data-case-motion=true] + #flight[data-form-production]:not([data-state=static]) {
      position: relative;
      z-index: 1;
      margin-top: calc(0px - min(20svh, 180px));
    }
  }
}
