/* Purchased-book ownership presentation. The existing catalog cards remain the semantic source of truth. */
.owned-shelf-experience {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 8vw, 7.5rem) clamp(1.25rem, 6vw, 7rem) clamp(5rem, 9vw, 8rem);
  background:
    radial-gradient(circle at 80% 15%, rgba(184,94,56,.14), transparent 28%),
    linear-gradient(180deg, #15100e, #0d0a09 72%);
  color: #f7efe9;
  scroll-margin-top: 82px;
}

.owned-shelf-heading {
  width: min(1260px, 100%);
  margin: 0 auto clamp(2.8rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, .68fr);
  gap: 2rem 5rem;
  align-items: end;
}

.owned-shelf-heading h2 {
  margin: 0;
  max-width: 11ch;
  font: 500 clamp(2.8rem, 5.8vw, 5.4rem)/.95 Georgia, 'Times New Roman', serif;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.owned-shelf-heading > p {
  margin: 0;
  color: #aa9a91;
  line-height: 1.75;
}

.owned-shelf-stage {
  position: relative;
  width: min(1260px, 100%);
  margin: auto;
  padding: 2rem 1rem 3.4rem;
  perspective: 1500px;
}

.owned-shelf-books {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
  gap: clamp(1.2rem, 3vw, 2.2rem);
  align-items: end;
  justify-content: start;
}

.owned-shelf-book {
  min-width: 0;
}

.owned-shelf-cover {
  position: relative;
  width: 100%;
  aspect-ratio: .67;
  padding: 0;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 4px 13px 13px 4px;
  background: #1a1210;
  color: inherit;
  box-shadow:
    -5px 7px 12px rgba(0,0,0,.32),
    16px 20px 46px rgba(0,0,0,.34);
  transform-origin: bottom center;
  transition: transform 220ms cubic-bezier(.22,1,.36,1), box-shadow 220ms ease;
}

.owned-shelf-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.owned-shelf-cover > span {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 17%, transparent 82%, rgba(0,0,0,.15)),
    linear-gradient(180deg, transparent 72%, rgba(0,0,0,.12));
  mix-blend-mode: soft-light;
}

html[data-aasta-motion]:not([data-aasta-motion="minimal"]) .owned-shelf-cover:hover,
html[data-aasta-motion]:not([data-aasta-motion="minimal"]) .owned-shelf-cover:focus-visible {
  transform: translateY(-10px) rotateY(-4deg) rotateX(1.5deg);
  box-shadow:
    -8px 11px 17px rgba(0,0,0,.34),
    22px 30px 60px rgba(0,0,0,.42);
}

.owned-shelf-copy {
  padding: 1rem .1rem 0;
}

.owned-shelf-copy strong,
.owned-shelf-copy small {
  display: block;
}

.owned-shelf-copy strong {
  font: 500 1.1rem/1.2 Georgia, 'Times New Roman', serif;
  text-wrap: balance;
}

.owned-shelf-copy small {
  margin-top: .35rem;
  color: #8f8078;
  font-size: .72rem;
}

.owned-shelf-copy button {
  min-height: 38px;
  margin-top: .8rem;
  padding: 0 .9rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: transparent;
  color: #fff4ed;
  font-weight: 760;
}

.owned-shelf-plank {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 1.35rem;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #5e3928, #24130e 72%);
  box-shadow:
    0 14px 28px rgba(0,0,0,.45),
    inset 0 1px rgba(255,255,255,.08);
}

.owned-shelf-3d-mount {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

.ownership-success-panel {
  position: fixed;
  z-index: 2147483001;
  inset: 0;
  padding: max(18px, var(--safe-top)) max(18px, var(--safe-right)) max(18px, var(--safe-bottom)) max(18px, var(--safe-left));
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(11,8,7,.2);
  backdrop-filter: blur(6px);
}

.ownership-success-panel[hidden] {
  display: none !important;
}

.ownership-success-card {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(2rem, 5vw, 3.2rem);
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 80% 10%, rgba(191,96,59,.16), transparent 28%),
    #171210;
  color: #fff6ef;
  box-shadow: 0 32px 90px rgba(0,0,0,.5);
  animation: ownershipSuccessIn 420ms cubic-bezier(.22,1,.36,1) both;
}

.ownership-success-card > p {
  margin: 0 0 .8rem;
  color: #d5754e;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .16em;
}

.ownership-success-card > strong {
  display: block;
  max-width: 12ch;
  font: 500 clamp(2.4rem, 6vw, 4rem)/.95 Georgia, 'Times New Roman', serif;
  letter-spacing: -.04em;
}

.ownership-success-card > span {
  display: block;
  margin-top: 1rem;
  color: #b9aaa2;
}

.ownership-success-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.7rem;
}

.ownership-success-card > div button {
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: transparent;
  color: #fff5ed;
  font-weight: 780;
}

.ownership-success-card > div button:first-child {
  border-color: transparent;
  background: #c76540;
  color: #fff;
}

.ownership-success-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
}

@keyframes ownershipSuccessIn {
  from { opacity: 0; transform: translateY(16px) scale(.975); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .owned-shelf-heading {
    grid-template-columns: 1fr;
  }

  .owned-shelf-books {
    grid-auto-flow: column;
    grid-auto-columns: minmax(132px, 42vw);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: .8rem;
    scrollbar-width: thin;
  }

  .owned-shelf-plank {
    bottom: 2.1rem;
  }

  .ownership-success-panel {
    align-items: end;
  }

  .ownership-success-card {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .owned-shelf-cover,
  .ownership-success-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
