.digital-library {
  --dl-gold: #f1dab0;
  --dl-text-muted: #abbcbb;
  --dl-border: rgba(241, 218, 176, 0.24);
  --dl-font-display: var(--font-cormorant), Georgia, serif;

  position: relative;
  padding: 152px 0 104px;
  color: #fafafa;
  font-family: var(--font-manrope), system-ui, sans-serif;
  background: radial-gradient(
    ellipse at 50% 0,
    rgba(241, 218, 176, 0.055),
    transparent 65%
  );
}

.dl-hero {
  max-width: 780px;
  margin: 0 auto 56px;
  text-align: center;
}

.dl-hero::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  margin: 28px auto 0;
  background: var(--dl-gold);
  opacity: 0.5;
}

.dl-hero__eyebrow {
  margin-bottom: 18px;
  color: var(--dl-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.dl-hero__title {
  margin: 0 0 20px;
  color: var(--dl-gold);
  font-family: var(--dl-font-display);
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.dl-hero__description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--dl-text-muted);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.dl-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.dl-card {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 32px 28px;
  border: 1px solid var(--dl-border);
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(6, 43, 46, 0.75),
    rgba(1, 20, 21, 0.9)
  );
  scroll-margin-top: 112px;
  transition:
    translate 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

.dl-card .dl-card__image,
.dl-card .dl-card__placeholder svg {
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.dl-card:focus-within {
  border-color: rgba(241, 218, 176, 0.4);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(241, 218, 176, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .dl-card:hover {
    border-color: rgba(241, 218, 176, 0.4);
    box-shadow:
      0 24px 56px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(241, 218, 176, 0.2);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .dl-card:hover {
    translate: 0 -8px;
  }

  .dl-card:hover .dl-card__image,
  .dl-card:hover .dl-card__placeholder svg {
    transform: scale(1.08);
  }

  .dl-card__cta:hover .hero-cta__icon {
    transform: translate(4px, 1px);
  }
}

/* The global section clearfix must not create an extra grid item. */
.dl-card::after {
  content: none;
}

.dl-card__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(241, 218, 176, 0.12);
  border-radius: 16px;
  background: radial-gradient(
    circle at center,
    rgba(241, 218, 176, 0.08),
    transparent 72%
  );
}

.dl-card__image {
  object-fit: cover;
}

.dl-card__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--dl-gold);
}

.dl-card__placeholder::before {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(241, 218, 176, 0.16);
  border-radius: 50%;
}

.dl-card__placeholder svg {
  width: 36px;
  height: 36px;
}

.dl-card__content {
  min-width: 0;
}

.dl-card__label {
  margin-bottom: 10px;
  color: var(--dl-gold);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dl-card__title {
  margin: 0 0 12px;
  color: var(--dl-gold);
  font-family: var(--dl-font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
}

.dl-card__description {
  margin: 0;
  color: var(--dl-text-muted);
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.dl-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--dl-border);
}

.dl-card__price-label {
  color: var(--dl-text-muted);
  font-size: 13px;
}

.dl-card__price-value {
  color: var(--dl-gold);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dl-purchase-note {
  flex-basis: 100%;
  color: var(--dl-gold);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.dl-card__cta {
  grid-column: 1 / -1;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
}

.dl-card__cta span {
  font-size: inherit;
  font-weight: inherit;
}

.dl-card__cta:focus-visible {
  outline: 2px solid var(--dl-gold);
  outline-offset: 4px;
}

.dl-card__cta:disabled,
.dl-card__cta:disabled:hover {
  opacity: 0.85;
  cursor: default;
}

.dl-library-back {
  margin-top: 24px;
  color: var(--dl-gold);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.dl-library-back:focus-visible {
  outline: 2px solid var(--dl-gold);
  outline-offset: 4px;
}

@keyframes dl-rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .dl-hero > .dl-hero__eyebrow,
  .dl-hero__title,
  .dl-hero__description,
  .dl-sections > .dl-card {
    animation: dl-rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .dl-hero > .dl-hero__eyebrow {
    animation-delay: 100ms;
  }

  .dl-hero__title {
    animation-delay: 220ms;
  }

  .dl-hero__description {
    animation-delay: 340ms;
  }

  .dl-sections > .dl-card {
    animation-delay: 460ms;
  }

  .dl-sections > .dl-card:nth-child(2) {
    animation-delay: 540ms;
  }

  .dl-sections > .dl-card:nth-child(3) {
    animation-delay: 620ms;
  }

  .dl-sections > .dl-card:nth-child(4) {
    animation-delay: 700ms;
  }

}

@media (prefers-reduced-motion: reduce) {
  .dl-card,
  .dl-card .dl-card__image,
  .dl-card .dl-card__placeholder svg {
    transition: none;
  }

  .dl-card__cta,
  .dl-card__cta::before {
    animation: none;
    transition: none;
  }

  .dl-card__cta:hover {
    transform: none;
  }
}

@media (max-width: 1199px) {
  .dl-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 20px;
    padding: 28px 24px;
  }
}

@media (max-width: 991px) {
  .dl-sections {
    grid-template-columns: minmax(0, 1fr);
    max-width: 720px;
    margin: 0 auto;
  }
}

@media (max-width: 575px) {
  .digital-library {
    padding: 112px 0 64px;
  }

  .dl-hero {
    margin-bottom: 32px;
  }

  .dl-hero__eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .dl-hero__description {
    font-size: 14px;
    line-height: 1.7;
  }

  .dl-sections {
    gap: 16px;
  }

  .dl-card {
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 24px 18px;
    border-radius: 16px;
  }

  .dl-card__media {
    border-radius: 12px;
  }

  .dl-card__placeholder svg {
    width: 26px;
    height: 26px;
  }

  .dl-card__title {
    font-size: 28px;
  }

  .dl-card__description {
    font-size: 13px;
    line-height: 1.75;
  }
}
