/* Lightweight site polish for psymetrics pkgdown */

:root {
  --psymetrics-blue: #1187dd;
  --psymetrics-blue-dark: #0c6fbb;
  --psymetrics-orange: #ef6c1a;
  --psymetrics-teal: #18bc9c;
  --psymetrics-teal-dark: #13967d;
  --psymetrics-ink: #1f2d3d;
  --psymetrics-soft: #eef5fb;
  --psymetrics-dark-bg: #0b1120;
  --psymetrics-dark-surface: #121c31;
  --psymetrics-dark-surface-2: #1a2742;
  --psymetrics-dark-ink: #e6edf7;
  --psymetrics-dark-muted: #b9c5d8;
  --psymetrics-dark-line: rgba(126, 160, 206, 0.18);
}

body,
.navbar,
.navbar .form-control,
.navbar .dropdown-menu,
.btn-copy-ex.btn,
.tooltip .tooltip-inner,
mark,
.mark {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.navbar.bg-primary {
  background: linear-gradient(90deg, var(--psymetrics-blue-dark), var(--psymetrics-blue)) !important;
  box-shadow: 0 8px 24px rgba(12, 58, 98, 0.18);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar .nav-link {
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active,
.navbar .nav-link.show {
  color: #ffffff;
}

.nav-text.text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.navbar .form-control {
  border-radius: 0.8rem;
  border: 1px solid rgba(24, 188, 156, 0.42);
  background-color: rgba(255, 255, 255, 0.97);
  color: var(--psymetrics-ink);
  box-shadow: 0 0 0 1px rgba(24, 188, 156, 0.08);
}

.navbar .form-control::placeholder {
  color: rgba(31, 45, 61, 0.68);
}

.navbar .form-control:focus {
  background-color: #ffffff;
  border-color: rgba(24, 188, 156, 0.72);
  box-shadow: 0 0 0 0.2rem rgba(24, 188, 156, 0.16);
}

.navbar .dropdown-menu,
.navbar .algolia-autocomplete .aa-dropdown-menu {
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(233, 245, 255, 0.98));
  border: 1px solid rgba(17, 135, 221, 0.18);
  box-shadow: 0 14px 32px rgba(12, 58, 98, 0.16);
  backdrop-filter: blur(10px);
}

.navbar .dropdown-header,
.navbar .dropdown-item,
.navbar .algolia-autocomplete .aa-suggestion {
  color: var(--psymetrics-ink);
}

.navbar .dropdown-header {
  color: var(--psymetrics-blue-dark);
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus,
.navbar .algolia-autocomplete .aa-suggestion:hover {
  background-color: rgba(17, 135, 221, 0.12);
  color: var(--psymetrics-blue-dark);
}

.navbar .dropdown-item.active,
.navbar .dropdown-item:active,
.navbar .dropdown-item[aria-pressed="true"] {
  background-color: rgba(17, 135, 221, 0.18);
  color: var(--psymetrics-blue-dark);
  font-weight: 600;
}

.navbar .dropdown-divider {
  border-top-color: rgba(12, 111, 187, 0.12);
}

.btn-copy-ex.btn {
  border-color: rgba(17, 135, 221, 0.22);
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(232, 244, 255, 0.98));
  color: var(--psymetrics-blue-dark);
  box-shadow: 0 10px 20px rgba(12, 58, 98, 0.12);
}

.btn-copy-ex.btn:hover,
.btn-copy-ex.btn:focus,
.btn-copy-ex.btn:active {
  border-color: rgba(24, 188, 156, 0.5);
  background: linear-gradient(180deg, rgba(235, 247, 255, 1), rgba(223, 241, 255, 1));
  color: var(--psymetrics-teal-dark);
  box-shadow: 0 12px 24px rgba(12, 58, 98, 0.16);
}

.btn-copy-ex.btn i {
  color: inherit;
}

.tooltip .tooltip-inner {
  border: 1px solid rgba(17, 135, 221, 0.16);
  background: rgba(31, 45, 61, 0.96);
  box-shadow: 0 10px 24px rgba(12, 58, 98, 0.2);
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: rgba(31, 45, 61, 0.96);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: rgba(31, 45, 61, 0.96);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-left-color: rgba(31, 45, 61, 0.96);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-right-color: rgba(31, 45, 61, 0.96);
}

mark,
.mark {
  background: linear-gradient(100deg, rgba(117, 220, 255, 0.55), rgba(73, 205, 239, 0.66) 58%, rgba(73, 205, 239, 0.26) 84%, rgba(73, 205, 239, 0.08) 100%);
  color: #04131d;
  border-radius: 0.18rem;
  box-shadow: inset 0 -1px 0 rgba(18, 119, 157, 0.24);
}

.template-home .page-header h1 {
  font-size: clamp(2.35rem, 4.4vw, 3.85rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  max-width: 16ch;
}

.template-home .page-header .home-brand {
  color: var(--psymetrics-blue);
}

.template-home p,
.template-home li {
  color: var(--psymetrics-ink);
  font-size: 1.08rem;
}

.template-home code {
  border-radius: 0.5rem;
}

.template-home .home-logo {
  width: min(230px, 36vw);
  margin-top: 0.5rem;
  filter: drop-shadow(0 10px 18px rgba(17, 135, 221, 0.16));
}

.template-home aside > div {
  margin-bottom: 2rem;
}

.template-home aside h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.template-home aside ul li {
  margin-bottom: 0.45rem;
}

.template-home .links ul li > a,
.template-home .license ul li > a,
.template-home .citation ul li > a {
  display: inline-block;
  color: var(--psymetrics-teal);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(24, 188, 156, 0.35);
  transition: color 0.15s ease, text-decoration-color 0.15s ease, transform 0.15s ease;
}

.template-home .license ul li small a,
.template-home .developers a {
  color: var(--psymetrics-teal-dark);
  text-decoration-color: rgba(19, 150, 125, 0.3);
}

.template-home .links ul li > a:hover,
.template-home .license ul li > a:hover,
.template-home .license ul li small a:hover,
.template-home .citation ul li > a:hover,
.template-home .developers a:hover {
  color: var(--psymetrics-teal-dark);
  text-decoration-color: currentColor;
  transform: translateX(2px);
}

#toc {
  border-radius: 1rem;
}

#toc .nav-link {
  border-radius: 0.6rem;
}

[data-bs-theme="dark"] body {
  color: var(--psymetrics-dark-ink);
  background-color: var(--psymetrics-dark-bg);
  background-image:
    radial-gradient(circle at 16% 0%, rgba(17, 135, 221, 0.18), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(24, 188, 156, 0.1), transparent 24%),
    linear-gradient(180deg, #11182c 0%, #0f1728 48%, #0b1120 100%);
  background-attachment: fixed;
}

[data-bs-theme="dark"] .navbar.bg-primary {
  background: linear-gradient(90deg, rgba(10, 15, 29, 0.96), rgba(20, 31, 53, 0.98), rgba(17, 36, 66, 0.96)) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

[data-bs-theme="dark"] .navbar .nav-link,
[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .navbar .dropdown-toggle,
[data-bs-theme="dark"] .navbar .nav-link span {
  color: rgba(237, 244, 255, 0.88);
}

[data-bs-theme="dark"] .navbar .nav-link:hover,
[data-bs-theme="dark"] .navbar .nav-link:focus,
[data-bs-theme="dark"] .navbar .nav-link.active,
[data-bs-theme="dark"] .navbar .nav-link.show,
[data-bs-theme="dark"] .navbar .dropdown-toggle:hover,
[data-bs-theme="dark"] .navbar .dropdown-toggle:focus,
[data-bs-theme="dark"] .navbar .dropdown-toggle.show {
  color: #ffffff;
  background-color: rgba(125, 201, 255, 0.08);
  border-radius: 0.55rem;
}

[data-bs-theme="dark"] .nav-text.text-muted {
  color: rgba(214, 225, 242, 0.72) !important;
}

[data-bs-theme="dark"] .navbar .form-control {
  border-color: rgba(124, 221, 201, 0.22);
  background-color: rgba(11, 18, 33, 0.76);
  color: #f3f8ff;
  box-shadow: 0 0 0 1px rgba(17, 135, 221, 0.12);
}

[data-bs-theme="dark"] .navbar .form-control::placeholder {
  color: rgba(220, 232, 246, 0.58);
}

[data-bs-theme="dark"] .navbar .form-control:focus {
  background-color: rgba(13, 21, 38, 0.96);
  border-color: rgba(124, 221, 201, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(24, 188, 156, 0.14);
}

[data-bs-theme="dark"] .navbar .dropdown-menu,
[data-bs-theme="dark"] .navbar .algolia-autocomplete .aa-dropdown-menu {
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.98), rgba(23, 36, 61, 0.98));
  border-color: rgba(125, 201, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .navbar .dropdown-header,
[data-bs-theme="dark"] .navbar .dropdown-item,
[data-bs-theme="dark"] .navbar .algolia-autocomplete .aa-suggestion {
  color: var(--psymetrics-dark-ink);
}

[data-bs-theme="dark"] .navbar .dropdown-header {
  color: #8dcbff;
}

[data-bs-theme="dark"] .navbar .dropdown-item:hover,
[data-bs-theme="dark"] .navbar .dropdown-item:focus,
[data-bs-theme="dark"] .navbar .algolia-autocomplete .aa-suggestion:hover {
  background-color: rgba(125, 201, 255, 0.12);
  color: #ffffff;
}

[data-bs-theme="dark"] .navbar .dropdown-item.active,
[data-bs-theme="dark"] .navbar .dropdown-item:active,
[data-bs-theme="dark"] .navbar .dropdown-item[aria-pressed="true"] {
  background-color: rgba(125, 201, 255, 0.18);
  color: #f4f8ff;
  font-weight: 600;
}

[data-bs-theme="dark"] .navbar .dropdown-divider {
  border-top-color: rgba(125, 201, 255, 0.1);
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6 {
  color: #f4f8ff;
}

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] li,
[data-bs-theme="dark"] dt,
[data-bs-theme="dark"] dd,
[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .small,
[data-bs-theme="dark"] .roles {
  color: var(--psymetrics-dark-ink);
}

[data-bs-theme="dark"] hr,
[data-bs-theme="dark"] .page-header {
  border-color: var(--psymetrics-dark-line);
}

[data-bs-theme="dark"] a {
  color: #8dd0ff;
  text-decoration-color: rgba(141, 208, 255, 0.35);
}

[data-bs-theme="dark"] a:hover,
[data-bs-theme="dark"] a:focus {
  color: #70dbc6;
  text-decoration-color: currentColor;
}

[data-bs-theme="dark"] code {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f5fbff;
}

[data-bs-theme="dark"] pre,
[data-bs-theme="dark"] div.sourceCode {
  background: linear-gradient(180deg, rgba(20, 31, 53, 0.98), rgba(10, 17, 32, 0.97));
  border-color: rgba(125, 201, 255, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

[data-bs-theme="dark"] pre code {
  color: #edf6ff;
}

[data-bs-theme="dark"] pre code span.co,
[data-bs-theme="dark"] pre code span.an,
[data-bs-theme="dark"] pre code span.cv,
[data-bs-theme="dark"] pre code span.do,
[data-bs-theme="dark"] pre code span.in,
[data-bs-theme="dark"] pre code span.wa {
  color: #9fb0c9;
}

[data-bs-theme="dark"] pre code span.fu,
[data-bs-theme="dark"] pre code span.im,
[data-bs-theme="dark"] pre code span.at,
[data-bs-theme="dark"] pre code span.ot,
[data-bs-theme="dark"] pre code span.va {
  color: #8dd0ff;
}

[data-bs-theme="dark"] pre code span.kw,
[data-bs-theme="dark"] pre code span.cf,
[data-bs-theme="dark"] pre code span.op,
[data-bs-theme="dark"] pre code span.dt {
  color: #70dbc6;
}

[data-bs-theme="dark"] pre code span.st,
[data-bs-theme="dark"] pre code span.ch,
[data-bs-theme="dark"] pre code span.ss,
[data-bs-theme="dark"] pre code span.vs {
  color: #b8f28c;
}

[data-bs-theme="dark"] pre code span.cn,
[data-bs-theme="dark"] pre code span.fl,
[data-bs-theme="dark"] pre code span.dv,
[data-bs-theme="dark"] pre code span.bn {
  color: #ffd38a;
}

[data-bs-theme="dark"] blockquote {
  border-left-color: rgba(141, 208, 255, 0.35);
}

[data-bs-theme="dark"] .btn-copy-ex.btn {
  border-color: rgba(141, 208, 255, 0.2);
  background: linear-gradient(180deg, rgba(19, 30, 50, 0.96), rgba(15, 24, 42, 0.96));
  color: #dff6ff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

[data-bs-theme="dark"] .btn-copy-ex.btn:hover,
[data-bs-theme="dark"] .btn-copy-ex.btn:focus,
[data-bs-theme="dark"] .btn-copy-ex.btn:active {
  border-color: rgba(112, 219, 198, 0.4);
  background: linear-gradient(180deg, rgba(24, 41, 67, 0.98), rgba(17, 31, 53, 0.98));
  color: #70dbc6;
}

[data-bs-theme="dark"] .tooltip .tooltip-inner {
  border-color: rgba(141, 208, 255, 0.12);
  background: rgba(16, 26, 45, 0.96);
  color: #edf5ff;
}

[data-bs-theme="dark"] .bs-tooltip-top .tooltip-arrow::before,
[data-bs-theme="dark"] .bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: rgba(16, 26, 45, 0.96);
}

[data-bs-theme="dark"] .bs-tooltip-bottom .tooltip-arrow::before,
[data-bs-theme="dark"] .bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: rgba(16, 26, 45, 0.96);
}

[data-bs-theme="dark"] .bs-tooltip-start .tooltip-arrow::before,
[data-bs-theme="dark"] .bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-left-color: rgba(16, 26, 45, 0.96);
}

[data-bs-theme="dark"] .bs-tooltip-end .tooltip-arrow::before,
[data-bs-theme="dark"] .bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-right-color: rgba(16, 26, 45, 0.96);
}

[data-bs-theme="dark"] mark,
[data-bs-theme="dark"] .mark {
  background: linear-gradient(100deg, rgba(100, 222, 255, 0.64), rgba(56, 205, 236, 0.74) 58%, rgba(56, 205, 236, 0.34) 84%, rgba(56, 205, 236, 0.1) 100%);
  color: #021019;
  box-shadow: inset 0 -1px 0 rgba(108, 230, 255, 0.28);
}

[data-bs-theme="dark"] .template-home .page-header .home-brand {
  color: #7dc9ff;
}

[data-bs-theme="dark"] .template-home p,
[data-bs-theme="dark"] .template-home li,
[data-bs-theme="dark"] main p,
[data-bs-theme="dark"] main li {
  color: var(--psymetrics-dark-ink);
}

[data-bs-theme="dark"] .template-home .home-logo {
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.28));
}

[data-bs-theme="dark"] img.r-plt,
[data-bs-theme="dark"] pre .r-plt.img img,
[data-bs-theme="dark"] .cell-output-display img,
[data-bs-theme="dark"] .html-widget,
[data-bs-theme="dark"] .no-invert-dark-mode img.r-plt,
[data-bs-theme="dark"] .no-invert-dark-mode pre .r-plt.img img,
[data-bs-theme="dark"] .no-invert-dark-mode .cell-output-display img,
[data-bs-theme="dark"] .no-invert-dark-mode .html-widget {
  filter: none !important;
  opacity: 1;
}

[data-bs-theme="dark"] .template-home .links ul li > a,
[data-bs-theme="dark"] .template-home .license ul li > a,
[data-bs-theme="dark"] .template-home .citation ul li > a,
[data-bs-theme="dark"] .template-home .license ul li small a,
[data-bs-theme="dark"] .template-home .developers a {
  color: #70dbc6;
  text-decoration-color: rgba(112, 219, 198, 0.35);
}

[data-bs-theme="dark"] #toc {
  background: rgba(15, 24, 42, 0.7);
  border: 1px solid rgba(125, 201, 255, 0.12);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
  padding: 0.35rem;
}

[data-bs-theme="dark"] #toc .nav-link {
  color: rgba(230, 237, 247, 0.82);
}

[data-bs-theme="dark"] #toc .nav-link.active,
[data-bs-theme="dark"] #toc .nav-link:hover {
  background-color: rgba(125, 201, 255, 0.12);
  color: #ffffff;
}

[data-bs-theme="dark"] .navbar-toggler {
  border-color: rgba(141, 208, 255, 0.24);
  box-shadow: none;
}

[data-bs-theme="dark"] .navbar-toggler:hover,
[data-bs-theme="dark"] .navbar-toggler:focus {
  background-color: rgba(125, 201, 255, 0.08);
}

@media (max-width: 991.98px) {
  .template-home .page-header h1 {
    max-width: none;
  }

  .template-home .home-logo {
    float: none;
    display: block;
    margin: 1rem auto 1.5rem auto;
  }

  [data-bs-theme="dark"] .navbar-collapse {
    background: rgba(10, 15, 29, 0.88);
    border: 1px solid rgba(125, 201, 255, 0.12);
    border-radius: 1rem;
    margin-top: 0.8rem;
    padding: 0.8rem 0.9rem 1rem;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
  }
}





