.binder-demo {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}

.binder-demo h2 { margin: 0 0 1rem; }
.binder-demo fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 28%);
  align-items: center;
  gap: clamp(.8rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  border: 0;
}

.binder-demo-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: clamp(19rem, 42vw, 24rem);
  overflow: hidden;
  border-radius: 1.2rem;
  background: radial-gradient(ellipse at 42% 52%, #efdae8 0%, transparent 59%),
    radial-gradient(ellipse at 70% 60%, #e6ded8 0%, transparent 65%);
}

.binder-demo-scene {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  isolation: isolate;
}

#binder-physical:checked ~ .binder-demo-stage .binder-physical-scene,
#binder-scan:checked ~ .binder-demo-stage .binder-scan-scene,
#binder-album:checked ~ .binder-demo-stage .binder-album-scene { display: grid; }

@media (prefers-reduced-motion: no-preference) {
  .binder-demo-scene { animation: binder-demo-appear 180ms ease-out both; }
  @keyframes binder-demo-appear { from { opacity: 0; } to { opacity: 1; } }
}

.binder-demo-scene > img {
  grid-area: 1 / 1;
  width: clamp(98px, 34%, 156px);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 8.5% / 5.6%;
  box-shadow: 0 20px 34px -14px #47283870, 0 2px 4px #352c4030;
}

.binder-stack-back { transform: translate(-27%, 4%) rotate(-13deg); }
.binder-stack-front { transform: translate(29%, -4%) rotate(8deg); }
.binder-album-original { transform: translate(-37%, 4%) rotate(-12deg); }
.binder-demo-scene .binder-scan-back {
  width: clamp(61px, 21%, 100px);
  transform: translate(78%, 45%) rotate(13deg);
}

.binder-demo .binder-demo-phone {
  grid-area: 1 / 1;
  width: clamp(119px, 30vw, 148px);
  z-index: 1;
}

.binder-album-scene .binder-demo-phone { transform: translate(24%, -1%); }
.binder-scan-scene .binder-demo-phone { transform: translate(-16%, -2%); }

.binder-demo-screen {
  position: relative;
  aspect-ratio: 6 / 13;
  overflow: hidden;
  container-type: inline-size;
  border-radius: 13% / 6%;
  color: #211c22;
  background: #f9f6f3;
  box-shadow: 0 0 0 1px #181519;
  font-family: var(--sans);
}

.binder-demo-camera {
  background: repeating-linear-gradient(101deg, #88574e16 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #c59d89, #f0cbb2 62%, #ac806e);
}

.binder-camera-frame {
  position: absolute;
  inset: 24% 20% 31%;
  display: grid;
  place-items: center;
  background: linear-gradient(white,white) left top / 20% 1px,
    linear-gradient(white,white) left top / 1px 14%,
    linear-gradient(white,white) right top / 20% 1px,
    linear-gradient(white,white) right top / 1px 14%,
    linear-gradient(white,white) left bottom / 20% 1px,
    linear-gradient(white,white) left bottom / 1px 14%,
    linear-gradient(white,white) right bottom / 20% 1px,
    linear-gradient(white,white) right bottom / 1px 14%;
  background-repeat: no-repeat;
}

.binder-demo .binder-camera-frame img {
  width: 82%;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: contain;
  border-radius: 8%;
}

.binder-camera-shutter {
  position: absolute;
  bottom: 8%;
  left: 50%;
  width: 16%;
  transform: translateX(-50%);
  aspect-ratio: 1;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px #977965;
}

.binder-demo-library { padding: 23% 7% 0; }
.binder-library-title {
  display: block;
  font-size: 13cqw;
  line-height: 1.06;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

.binder-library-tabs, .binder-library-dock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2cqw;
  padding: 2cqw;
  border-radius: 999px;
  text-align: center;
  font-size: 5cqw;
  font-weight: 650;
  background: #ede9e8;
}

.binder-library-tabs { margin-top: 9cqw; }
.binder-library-tabs span, .binder-library-dock > * {
  display: grid;
  place-items: center;
  min-height: 10cqw;
  padding: 0 2cqw;
  border-radius: 999px;
}
.binder-library-tabs span:last-child { color: #fff; background: #211d21; }
.binder-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  margin: 9cqw 0 4cqw;
  font-size: 8.5cqw;
}
.binder-library-heading i {
  display: grid;
  place-items: center;
  width: 13cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  font-style: normal;
  color: #fff;
  background: #211d21;
}
.binder-library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; }
.binder-library-grid > div > b {
  display: block;
  margin-top: 3cqw;
  font-size: 5.2cqw;
}
.binder-album-cover {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1 / 1.08;
  border-radius: 3.8cqw;
  background: #f0e2ec;
}
.binder-library-grid > div + div .binder-album-cover { background: #e8e3f3; }
.binder-demo .binder-album-cover img {
  grid-area: 1 / 1;
  width: 49%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 10%;
  box-shadow: 0 3px 4px #49404c33;
  transform: translateX(-19%) rotate(-12deg);
}
.binder-demo .binder-album-cover img + img { transform: translateX(19%) rotate(10deg); }
.binder-library-dock {
  position: absolute;
  bottom: 8cqw;
  inset-inline: 10cqw;
  box-shadow: 0 3px 14px #41384919;
}
.binder-library-dock b { background: #fff; }

.binder-demo-controls {
  display: grid;
  gap: .45rem;
}

.binder-demo-controls label {
  display: grid;
  align-items: center;
  min-block-size: 46px;
  padding: .65rem .8rem;
  border-radius: .6rem;
  font-size: clamp(.8rem, 1.7vw, .95rem);
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
}

.binder-demo-controls label:hover { background: #f0e7ed; }
#binder-physical:checked ~ .binder-demo-controls [for="binder-physical"],
#binder-scan:checked ~ .binder-demo-controls [for="binder-scan"],
#binder-album:checked ~ .binder-demo-controls [for="binder-album"] {
  color: #fff;
  background: #312634;
}

#binder-physical:focus-visible ~ .binder-demo-controls [for="binder-physical"],
#binder-scan:focus-visible ~ .binder-demo-controls [for="binder-scan"],
#binder-album:focus-visible ~ .binder-demo-controls [for="binder-album"] {
  outline: 2px solid #725480;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .binder-demo fieldset { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .binder-demo-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .28rem; }
  .binder-demo-controls label { padding: .55rem .27rem; text-align: center; }
}
