/* ----- This is all the styling you need ----- */

body {
  --bg-color: 186 230 253;
  background-color: rgb(var(--bg-color));
}

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  top: -80px;
  height: 80px;
  overflow: hidden;
  z-index: 100;
}

.statusbar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 150%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgb(var(--bg-color) / 0.6);
}

/* ----- Demo color swapping (:has selector is amazing) ----- */

body:has(input[value='red']:checked) {
  --bg-color: 254 205 211;
}

body:has(input[value='green']:checked) {
  --bg-color: 167 243 208;
}

body:has(input[value='white']:checked) {
  --bg-color: 255 255 255;
}

body:has(input[value='black']:checked) {
  --bg-color: 12 10 9;
  color: #f8fafc;
}

body:has(input[value='black']:checked) fieldset {
  border: 1px solid rgb(255 255 255 / 0.15);
}

/* ----- Toggling the effect ----- */

body:has(input[name='disabled']:checked) .statusbar {
  display: none;
}

/* ----- Purely cosmetic demo styles ----- */

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 1.25rem;
  color: #09090b;
  padding: 30px;
  line-height: 1.4;
}

main {
  max-width: 500px;
  margin: 0 auto;
}

main > *,
p {
  margin-bottom: 1rem;
}

h1,
h2 {
  line-height: 1;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 3rem;
}

fieldset {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.75rem;
  border: 1px solid rgb(0 0 0 / 0.1);
  border-radius: 8px;
}

legend {
  font-size: 0.875rem;
  font-weight: 500;
  padding-inline: 0.5rem;
}

label {
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

p {
  opacity: 0.7;
}

a {
  color: inherit;
}

a:hover {
  transform: translateY(-1px);
}

.dummy {
  opacity: 0.5;
}
