/*
  CSS Reset - https://meyerweb.com/eric/tools/css/reset/ 
  Modified to include box-sizing border-box and a few other tweaks
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}
/* End CSS Reset */

html {
  background: #000;
  color: #fff;
}

@media (min-width: 1200px) {

  html,
  body {
    overflow: hidden;
  }
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.sr-only {
  display: block;
  position: absolute;
  block-size: 0;
  inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
}

.btn-rounded {
  position: relative;
  background-color: #000;
  border: 1px solid #ddd;
  padding: 11px 22px;
  border-radius: 40px;
  color: #fff;
  cursor: pointer;
}

.btn-rounded:disabled {
  background-color: #333;
  border-color: #555;
  color: #999;
  cursor: not-allowed;
}

.btn-circle {
  position: relative;
  overflow: hidden;
  background-color: #000;
  border: 2px solid #ddd;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }

  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background-color: white;
  pointer-events: none;
  animation: ripple 0.6s ease-out forwards;
}

.btn-circle[data-is-on="true"] {
  background-color: #ddd;
  color: #000;
}

#screensaver {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: absolute;
  width: 100%;
  height: 100%;
  flex: 1;
  transition: opacity 0.8s ease-in;
}

#screensaver .logo {
  display: flex;
  justify-content: center;
  margin-block-end: 3rem;
}

#screensaver .logo img {
  width: 140px;
}

#screensaver .heading h1 {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.2;
  text-align: center;
}

#screensaver .heading h1 img {
  display: block;
  margin-inline: auto;
  margin-block-end: 1rem;
  width: 3.2em;
}

#screensaver .video {
  display: flex;
  justify-content: center;
  margin-block-end: 2rem;
  /* Focal point sits 5% below the geometric center */
  transform-origin: 50% 55%;
  transition: transform 1.6s ease-in, opacity 1.6s ease-in;

  /* Promotes layer to GPU upfront to prevent runtime allocation freezes */
  will-change: transform, opacity;
  transform: translateZ(0);
  
  /* Applying a minor CSS filter or blending mode revokes MPO overlay privileges */
  filter: opacity(0.999);
}

#screensaver .video video {
  width: 600px;
  height: auto;
  transform: translateZ(0);
}

#screensaver .button {
  display: flex;
  justify-content: center;
  margin-block-end: 3rem;
}

#screensaver.armed .logo,
#screensaver.armed .heading,
#screensaver.armed .button {
  transition: opacity 0.8s ease-in;
  opacity: 0;
}

#screensaver.revealing .video {
  transform: translateY(var(--reveal-y, 0px)) scale(8);
  opacity: 0;
}

#demo {
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  position: absolute;
  width: 100%;
  height: 100%;
  flex: 1;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

#demo.visible {
  opacity: 1;
}

#demo .header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 4rem;
  width: 100%;
  max-width: 1300px;
  margin-inline: auto;
}

#demo .header .banner {
  /* width: 600px; */
  background: rgba(0, 0, 0, 0.01);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px 15px 15px;
  border-bottom-left-radius: .75rem;
  border-bottom-right-radius: .75rem;
}

#demo .header .banner h1 {
  font-size: 3.5rem;
  font-weight: 300;
  text-align: center;
}

#demo .header .banner h1 img {
  display: block;
  margin-inline: auto;
  margin-block-end: 1rem;
  width: 3.2em;
}

#demo .header .logo {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 15px;
  display: flex;
  align-items: center;
  background: rgba(0, 44, 0, 0.01);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: .75rem;
}

#demo .header .logo img {
  width: 140px;
}

#demo .controls {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  padding: 1rem 1rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.4rem;
}

#play-pause-audio-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#play-pause-audio-sample svg {
  width: 50px;
  height: 50px;
  fill: currentColor;
}

#play-pause-audio-sample[data-is-paused="true"] [data-pause] {
  display: none;
}

#play-pause-audio-sample:not([data-is-paused="true"]) [data-play] {
  display: none;
}

#audio-toggle {
  font-size: 1.7rem;
}

#audio-toggle[data-is-on="true"] [data-off] {
  display: none;
}

#audio-toggle:not([data-is-on="true"]) [data-on] {
  display: none;
}

#demo .controls .reset {
  position: absolute;
  left: 0;
  width: 90px;
  height: 90px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

#demo .controls .reset .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#demo .controls .reset img {
  width: 37.5px;
  transform: rotate(-45deg);
}

/* @keyframes reset-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
} */

@keyframes reset-pulse {
  0%, 100% {
    scale: 1;
  }

  50% {
    scale: 1.3;
  }
}

#demo .controls .reset.spinning img {
  animation:
    /* reset-spin 0.5s linear, */
    reset-pulse 0.3s ease-in-out;
}

#demo .controls .debug {
  position: absolute;
  right: 0;
  width: 90px;
  height: 90px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

#demo .controls .debug .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#demo .controls .debug img {
  width: 40px;
}

#demo #animation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

#demo #animation .chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}






/* DEBUG */

#debug-panel {
    position: fixed;
    right: 16px;
    bottom: 80px;
    width: 300px;
    max-height: 72vh;
    overflow-y: auto;
    padding: 10px 14px 14px;
    background: rgba(10, 10, 12, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #eee;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12px;
    z-index: 20;
    display: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
#debug-panel.open {
    display: block;
}
.dbg-group {
    font-weight: 600;
    margin: 12px 0 6px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 10px;
}
.dbg-row {
    display: grid;
    grid-template-columns: 108px 1fr 42px;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}
.dbg-label {
    opacity: 0.85;
}
.dbg-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}
.dbg-row input[type=range] {
    width: 100%;
    accent-color: #fff;
}

#debug-toggle {
  display: none;
}

@media (max-width: 991.98px) {

  .btn-circle {
    width: 50px;
    height: 50px;
  }

  #screensaver .logo {
    margin-block-end: 1rem;
  }

  #screensaver .logo img {
    width: 70px;
  }

  #screensaver .heading h1 {
    font-size: 1.8rem;
  }

  #screensaver .heading h1 img {
    margin-block-end: 1rem;
  }

  #screensaver .video video {
    width: 100%;
    max-width: 400px;
  }

  #demo .header {
    display: block;
    width: 100%;
    max-width: 1300px;
  }

  #demo .header .banner {
    padding-block-start: 0;
  }

  #demo .header .banner h1 {
    font-size: 1.8rem;
  }

  #demo .header .banner h1 img {
    display: block;
    margin-inline: auto;
    margin-block-end: 1rem;
    width: 3.2em;
  }

  #demo .header .logo {
    position: relative;
    right: auto;
    top: auto;
    transform: translateY(0);
    width: 100px;
    margin-inline: auto;
  }

  #demo .header .logo img {
    width: 70px;
  }

  #play-pause-audio-sample svg {
    width: 30px;
    height: 30px;
  }

  #demo .controls {
    gap: 1rem;
  }

  #demo .controls .reset {
    width: 50px;
    height: 50px;
    left: 1rem;
  }

  #audio-toggle {
    font-size: 1.2rem;
  }

  #demo #animation .chip {
    width: 20vw;
  }
}