:root {
  --site-radius-sm: 10px;
  --site-radius-md: 14px;
  --site-radius-lg: 18px;
  --site-radius-xl: 28px;
  --site-border-soft: rgba(31, 27, 45, 0.09);
  --site-border-strong: rgba(147, 28, 39, 0.18);
  --site-shadow-sm: 0 8px 24px rgba(17, 18, 38, 0.06);
  --site-shadow-md: 0 14px 32px rgba(17, 18, 38, 0.08);
  --site-shadow-hover: 0 18px 36px rgba(17, 18, 38, 0.12);
  --site-focus-ring: 0 0 0 3px rgba(147, 28, 39, 0.18);
  --site-text-measure: 68ch;
}

html {
  scroll-behavior: smooth;
}

body,
.oa-rp-page {
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-heading {
  line-height: 1.18;
}

p,
li,
dd,
dt {
  line-height: 1.6;
}

.lead {
  line-height: 1.55;
}

.navbar.navbar-dark {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.navbar-dark .navbar-brand {
  gap: 0.15rem;
}

.navbar-dark .navbar-nav {
  gap: 0.1rem;
}

.navbar-dark .navbar-nav .nav-link {
  padding: 0.58rem 0.82rem;
  border-radius: var(--site-radius-sm);
  line-height: 1.2;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus-visible,
.navbar-dark .navbar-nav .active > .nav-link,
.navbar-dark .navbar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: none;
}

.navbar-dark .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 12px;
}

.navbar-dark .navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-menu {
  border: 1px solid rgba(147, 28, 39, 0.12);
  border-radius: var(--site-radius-md);
  padding: 0.45rem;
  box-shadow: 0 18px 36px rgba(17, 18, 38, 0.14);
}

.dropdown-item {
  padding: 0.55rem 0.75rem;
  border-radius: var(--site-radius-sm);
  font-weight: 600;
  color: var(--ink);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
  background: rgba(147, 28, 39, 0.08);
  color: var(--brand-primary-dark);
}

.hero-image,
.hero-oa {
  margin-bottom: 2rem;
  border-radius: 0 0 var(--site-radius-xl) var(--site-radius-xl);
  box-shadow: 0 18px 36px rgba(17, 18, 38, 0.2);
}

.hero-overlay {
  max-width: 880px;
  padding: clamp(1.75rem, 2.6vw, 2.35rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--site-radius-lg);
}

.hero-image h1,
.hero-oa h1 {
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem !important;
}

.hero-image p,
.hero-oa p {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  color: rgba(245, 241, 235, 0.95);
}

.badge-soft {
  padding: 0.4rem 0.85rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.section-heading {
  letter-spacing: 0;
}

.feature-card,
.filter-card,
.content-body,
.result-card,
.book-card,
#oa-rp-journals-list .card,
#oa-rp-articles-list .card {
  border-radius: var(--site-radius-lg);
  border-color: var(--site-border-soft);
  box-shadow: var(--site-shadow-md);
}

.feature-card,
.filter-card,
.content-body {
  padding: clamp(1.3rem, 2.2vw, 1.65rem);
}

.feature-card:hover,
.result-card:hover,
.result-card:focus-within,
.book-card:hover,
.book-card:focus-within,
.content-body:hover,
#oa-rp-journals-list .card:hover,
#oa-rp-articles-list .card:hover {
  transform: translateY(-2px);
  border-color: var(--site-border-strong);
  box-shadow: var(--site-shadow-hover);
}

.callout,
#new-titles-section,
#discovery-search-box,
.results-empty {
  border-radius: var(--site-radius-lg);
}

.callout {
  border-color: rgba(147, 28, 39, 0.12);
  padding: 1.3rem 1.45rem;
}

#new-titles-section,
#discovery-search-box {
  box-shadow: 0 16px 36px rgba(17, 18, 38, 0.1);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  margin-bottom: 0.9rem;
}

.link-arrow {
  gap: 0.45rem;
  text-underline-offset: 0.18em;
}

.btn-custom,
.btn-ghost,
.carousel-btn {
  border-radius: 12px;
  line-height: 1.2;
}

.btn-custom,
.carousel-btn {
  box-shadow: 0 8px 18px rgba(147, 28, 39, 0.16);
}

.btn-sm.btn-custom,
.btn-sm.btn-ghost {
  border-radius: var(--site-radius-sm);
}

.btn-custom:hover,
.btn-ghost:hover,
.carousel-btn:hover {
  transform: translateY(-1px);
}

.btn-custom:hover,
.carousel-btn:hover {
  box-shadow: 0 12px 24px rgba(147, 28, 39, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.96);
}

.hero-image .btn-ghost,
.hero-oa .btn-ghost {
  background: rgba(255, 255, 255, 0.05);
}

.form-control,
.form-select {
  min-height: 3rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border-color: rgba(31, 27, 45, 0.14);
}

.form-control::placeholder {
  color: #7a7886;
}

.form-control:hover,
.form-select:hover {
  border-color: rgba(147, 28, 39, 0.22);
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
.navbar-dark .navbar-nav .nav-link:focus-visible,
.dropdown-item:focus-visible,
.carousel-btn:focus-visible,
.navbar-dark .navbar-toggler:focus {
  border-color: rgba(147, 28, 39, 0.32);
  box-shadow: var(--site-focus-ring);
  outline: none;
}

a:focus-visible {
  outline: 2px solid rgba(147, 28, 39, 0.28);
  outline-offset: 3px;
  border-radius: 4px;
}

.table-responsive {
  border-radius: var(--site-radius-md);
  overflow: hidden;
}

.table-responsive .table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.82rem 0.95rem;
  vertical-align: top;
}

.table-light th,
.table thead th,
.content-body th {
  font-weight: 700;
}

.table tbody tr:hover {
  background: rgba(147, 28, 39, 0.03);
}

.content-body,
.styleguide-copy {
  font-size: 1rem;
}

.content-body p,
.styleguide-copy p {
  max-width: var(--site-text-measure);
}

.content-body ul,
.content-body ol,
.styleguide-copy ul,
.styleguide-copy ol {
  padding-left: 1.2rem;
}

.content-body li,
.styleguide-copy li {
  margin-bottom: 0.35rem;
}

.content-body hr {
  margin: 1.5rem 0;
  border-color: rgba(147, 28, 39, 0.12);
}

.content-body img {
  border-radius: 12px;
}

.list-group-custom {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-group-custom .list-group-item {
  margin-bottom: 0;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
}

.list-group-custom .list-group-item-heading {
  padding: 0.75rem 0.9rem;
}

.list-group-custom .list-group-item-action:hover,
.list-group-custom .list-group-item-action:focus {
  background: rgba(147, 28, 39, 0.05);
  color: var(--brand-primary-dark);
}

.list-group-custom .list-group-item.sub-item {
  padding-left: 1.35rem;
}

.styleguide-outline > li,
.styleguide-resources li {
  margin-bottom: 0.65rem;
}

.result-card {
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.result-title {
  line-height: 1.32;
  text-underline-offset: 0.18em;
}

.result-snippet {
  line-height: 1.55;
}

.results-empty {
  border-width: 1px;
}

.result-url {
  line-height: 1.45;
}

.book-card h5,
#oa-rp-journals-list .card-title,
#oa-rp-articles-list .card-title {
  line-height: 1.28;
}

.carousel-track {
  padding-bottom: 1rem;
}

.carousel-track::-webkit-scrollbar {
  height: 10px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(147, 28, 39, 0.26);
  border-radius: 999px;
}

.carousel-track::-webkit-scrollbar-track {
  background: rgba(147, 28, 39, 0.06);
  border-radius: 999px;
}

.meta-chip,
.muted-chip,
.status-pill {
  font-size: 0.82rem;
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
  line-height: 1.6;
  color: rgba(236, 235, 242, 0.88);
}

footer h5 {
  margin-bottom: 0.85rem;
}

footer a {
  text-underline-offset: 0.16em;
}

@media (max-width: 991.98px) {
  .navbar-dark .navbar-nav {
    gap: 0.2rem;
    padding-top: 0.5rem;
  }

  .navbar-dark .navbar-nav .nav-link {
    padding-inline: 0.7rem;
  }
}

@media (max-width: 767.98px) {
  .hero-image,
  .hero-oa {
    border-radius: 0 0 22px 22px;
  }

  .hero-overlay,
  .callout,
  .feature-card,
  .filter-card,
  .content-body,
  #new-titles-section,
  #discovery-search-box {
    padding: 1.2rem;
  }

  .feature-card,
  .result-card,
  .book-card,
  #oa-rp-journals-list .card,
  #oa-rp-articles-list .card {
    box-shadow: var(--site-shadow-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
