/* demo layer: the watermark, the «opened outside the site» screen and light hurdles on images */
.demo-layer-watermark {
  --logo-width: clamp(84px, 24vw, 132px);
  --period: calc(2.1 * var(--logo-width));
  --row-pitch: 96px;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  overflow: hidden;
  pointer-events: none;
}
/*
 * The turned sheet is only as big as it must be: it rasters at the screen's density (about 7 MPx
 * at 3x on a 390×844 phone, not the 18 of a sheet as long as the diagonal). Turned by 24°, the
 * viewport's box in the sheet's own axes is 100vw·cos 24° + 100vh·sin 24° wide and
 * 100vw·sin 24° + 100vh·cos 24° tall (cos 24° ≈ 0.9135, sin 24° ≈ 0.4067; constants rather than
 * cos() and sin() for older Safari). One period more of width lets it drift a whole period, from
 * half a period right to half a period left, without uncovering an edge; 2 px spare the
 * antialiased rim.
 */
.demo-layer-watermark-tiles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100vw * 0.9135 + 100vh * 0.4067 + var(--period) + 2px);
  height: calc(100vw * 0.4067 + 100vh * 0.9135 + 2px);
  background-image: url('watermark.svg');
  background-size: var(--period) calc(2 * var(--row-pitch));
  transform: translate(-50%, -50%) rotate(-24deg) translateX(calc(0.5 * var(--period)));
  /* one period every 48 s along the rows: a recording cannot be cleaned with a fixed mask */
  animation: demo-layer-drift 48s linear infinite;
}
@keyframes demo-layer-drift {
  to {
    transform: translate(-50%, -50%) rotate(-24deg) translateX(calc(-0.5 * var(--period)));
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-layer-watermark-tiles {
    animation: none;
  }
}

/*
 * Fails closed: the page stays hidden, on the screen's paper, unless the script has run and found
 * a frame around it (it marks <html> with data-demo-layer-framed at once, from the end of <head>,
 * before the first paint). No script (JavaScript off, the file blocked or missing) means no
 * invitation: opened alone, the static notice inside <noscript> shows instead.
 */
html:not([data-demo-layer-framed]),
html:not([data-demo-layer-framed]) body {
  overflow: hidden;
}
html:not([data-demo-layer-framed]) {
  background: #f2f0eb;
}
html:not([data-demo-layer-framed]) body {
  visibility: hidden;
}
.demo-layer-gate {
  --gate-paper: #f2f0eb;
  --gate-ink: #1f1f1d;
  visibility: visible;
  color-scheme: light;
  position: fixed;
  inset: 0;
  /* above everything where the browser has no top layer (no showModal) */
  z-index: 2147483647;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 32px 24px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: var(--gate-paper);
  color: var(--gate-ink);
  text-align: center;
}
dialog.demo-layer-gate:not([open]) {
  display: none;
}
/* the dialog takes the focus only so a screen reader starts there: it is no control, so no ring */
.demo-layer-gate:focus {
  outline: none;
}
.demo-layer-gate::backdrop {
  background: #f2f0eb;
}
.demo-layer-gate,
.demo-layer-gate * {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.demo-layer-gate-logo {
  display: block;
  width: 176px;
  height: auto;
  color: var(--gate-ink);
}
.demo-layer-gate-text {
  margin: 0;
  max-width: 24ch;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 400;
  text-wrap: balance;
  color: var(--gate-ink);
}
.demo-layer-gate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--gate-ink);
  color: var(--gate-paper);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  text-decoration: none;
}
.demo-layer-gate-link:focus-visible {
  outline: 3px solid var(--gate-ink);
  outline-offset: 3px;
}

img,
video,
canvas {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* a demo is neither printed nor saved as PDF, alone or inside the site's dialog */
@media print {
  html {
    display: none;
  }
}
