:root {
  --progress: 0;
  --focus-x: 42%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #000;
  color: #fff;
  font-family: "Segoe UI", "Hiragino Sans", sans-serif;
}

button,
input {
  font: inherit;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 24px;
}

.backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8)),
    url("./assets/library-bg.jpg") var(--focus-x) center / cover no-repeat;
  filter: brightness(0.06) saturate(0.4);
  transform: scale(1.02);
  transition: filter 0.35s ease, transform 0.5s ease;
}

.scene.is-lit .backdrop {
  background:
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.42)),
    url("./assets/library-bg.jpg") var(--focus-x) center / cover no-repeat;
  filter: brightness(1) saturate(1);
  transform: scale(1);
}

.intro,
.login {
  position: relative;
  z-index: 1;
}

.intro {
  display: grid;
  justify-items: center;
  gap: 16px;
  transition: opacity 0.25s ease;
}

.scene.is-lit .intro {
  opacity: 0;
  pointer-events: none;
}

.ring-button {
  position: relative;
  width: 160px;
  height: 160px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.ring-button svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 5;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.3);
}

.ring-progress {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 389.56;
  stroke-dashoffset: calc(389.56 - (389.56 * var(--progress)));
  transition: stroke-dashoffset 0.08s linear;
}

.ring-core {
  position: absolute;
  inset: 45px;
  border: 3px solid #fff;
  border-radius: 50%;
}

.status {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.image-note {
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.login {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease 0.1s;
}

.scene.is-lit .login {
  opacity: 1;
  pointer-events: auto;
}

.login-box {
  width: min(100%, 360px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.login-box h2 {
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form input,
.login-form button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.44);
  color: #fff;
  padding: 14px 16px;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.login-form button {
  background: #fff;
  color: #000;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  :root {
    --focus-x: 38%;
  }

  .ring-button {
    width: 144px;
    height: 144px;
  }

  .ring-core {
    inset: 40px;
  }
}
