/**
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

@layer demo {
  ::view-transition {
    pointer-events: none;
  }
  ::view-transition-group(*) {
    animation-duration: 2s;
    animation-timing-function: ease;
  }
  #box-normal {
    view-transition-name: box-normal;
  }
  #box-optimized {
    view-transition-name: box-optimized;
  }

  #debug {
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0.5;
    font-family: monospace;
    padding: 0.2rem;
    white-space: pre-wrap;
  }
}

@layer jank {
  html.jank {
    background-color: rgb(255 0 0 / 0.2);
    
    &::after {
      content: "JANK!";
      display: inline-block;
      position: fixed;
      left: 50%;
      top: 50%;
      translate: -50% -50%;
      font-size: 2rem;
      color: red;
      font-weight: 700;
    }
  }
}

@layer demo.support {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  }

  select, input {
    font-family: inherit;
  }

  html, body {
    height: 100%;
  }
  .box {
    aspect-ratio: 1;
    inline-size: 20vmin;
    background: dodgerblue;
    
    color: white;
    display: grid;
    place-content: center;

    &.bigger {
      inline-size: 30vmin;
    }
  }
  
  body {
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: space-between;
    padding: 1em;
    gap: 1em;
  }
  
  html {
    view-transition-name: none;
  }
}