.album__main {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 1.4rem;
  max-width: 34rem;
  min-height: 100svh;
  margin: 0 auto;
  padding: 2rem 1.25rem max(3rem, env(safe-area-inset-bottom));
  text-align: center;
  align-content: start;
}

.album__back {
  justify-self: start;
  color: var(--parchment-dim);
  font-family: var(--script);
  font-size: 1.6rem;
  text-decoration: none;
}

.album__header { display: grid; justify-items: center; gap: .8rem; animation: rise 1.4s var(--ease-out) both; }

.album__title {
  margin: .4rem 0 0;
  font-weight: 500;
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.album__header .lede { margin-bottom: 0; }

.album__status { color: var(--parchment-dim); font-style: italic; font-size: 1.2rem; }

.gate, .uploader {
  display: grid;
  gap: .9rem;
  width: 100%;
  animation: rise 1.2s var(--ease-out) both;
}

.gate[hidden], .uploader[hidden] { display: none; }

.gate__intro { margin: 0 0 .6rem; font-size: 1.15rem; line-height: 1.5; }

.field__label {
  justify-self: start;
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--parchment-dim);
}

.field__label span { letter-spacing: .05em; text-transform: none; font-style: italic; }

.field__input {
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid rgba(185, 171, 152, .35);
  border-radius: 10px;
  background: rgba(11, 8, 7, .55);
  color: var(--parchment);
  font: inherit;
  font-size: 1.2rem;
}

.field__input--code { text-align: center; letter-spacing: .35em; text-transform: uppercase; font-size: 1.5rem; }

.form-error { min-height: 1.4em; margin: 0; color: #ff9a8f; font-style: italic; }

.gate.is-shaking { animation: shake .5s ease; }

.dropzone {
  display: grid;
  justify-items: center;
  gap: .5rem;
  margin-top: .6rem;
  padding: 2.2rem 1rem;
  border: 1.5px dashed rgba(185, 171, 152, .5);
  border-radius: 18px;
  background: rgba(11, 8, 7, .45);
  cursor: pointer;
  transition: border-color .3s ease, background-color .3s ease, transform .3s var(--ease-out);
}

.dropzone:hover, .dropzone.is-dragging { border-color: var(--ember); background: rgba(217, 106, 43, .08); transform: scale(1.01); }
#photo-input:focus-visible + .dropzone { outline: 1px solid var(--ember); outline-offset: 4px; }

.dropzone__icon { width: 52px; fill: none; stroke: var(--parchment); stroke-width: 1.6; stroke-linejoin: round; }
.dropzone__title { font-size: 1.4rem; letter-spacing: .2em; text-transform: uppercase; }
.dropzone__hint { color: var(--parchment-dim); font-style: italic; }

.uploader__count { min-height: 1.4em; margin: 0; font-size: 1.15rem; }

.uploads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.upload {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #1a1311;
  animation: pop .6s var(--ease-out) both;
}

.upload img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .6s ease; }
.upload.is-done img { opacity: 1; }

.upload__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: calc(var(--progress, 0) * 100%);
  background: linear-gradient(90deg, var(--blood), var(--ember));
  transition: width .2s linear;
}

.upload__badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c3262d, #7c0d13 60%, #45050a);
  color: #f7e9e2;
  font-size: .8rem;
  transform: scale(0);
  transition: transform .5s var(--ease-out);
}

.upload.is-done .upload__badge { transform: scale(1); }
.upload.is-done .upload__bar { opacity: 0; transition: opacity .4s ease .2s; }

.upload__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .3rem;
  padding: .4rem;
  background: rgba(11, 8, 7, .82);
  font-size: .8rem;
  line-height: 1.3;
}

.upload__retry {
  padding: .2rem .6rem;
  border: 1px solid rgba(185, 171, 152, .5);
  border-radius: 99px;
  background: none;
  color: var(--parchment);
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}

@keyframes rise { from { opacity: 0; transform: translateY(20px); filter: blur(6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.7) rotate(-6deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
