:root {
  --nrv-point: #d50f34;
  --nrv-point-dark: #a70d2b;
  --nrv-ink: #20232a;
  --nrv-soft-ink: #3f4650;
  --nrv-muted: #6b7280;
  --nrv-line: #e5e7eb;
  --nrv-panel: #f7f8fa;
  --nrv-dark: #111318;
  --nrv-dark-soft: #1d2129;
  --nrv-accent: #111318;
}

/* Base */
html {
  scroll-padding-top: 96px;
}

body {
  background: #fff;
  color: var(--nrv-ink);
  font-family: Inter, Lato, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--nrv-point-dark);
}

a:hover {
  color: var(--nrv-point);
}

/* Main layout */
.wy-nav-content-wrap {
  background: #fff;
}

.wy-nav-content {
  max-width: 1180px;
  padding: 4.2rem min(5vw, 4rem) 5.5rem;
  background: #fff;
}

.rst-content {
  color: var(--nrv-soft-ink);
}

.rst-content p,
.rst-content li {
  color: var(--nrv-soft-ink);
  font-size: 16px;
  line-height: 1.75;
}

.rst-content p {
  margin-bottom: 1.05rem;
}

/* Headings */
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4 {
  color: var(--nrv-ink);
  font-family: Inter, Lato, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

.rst-content h1 {
  margin: 0 0 2.4rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--nrv-line);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
}

.rst-content h2 {
  margin-top: 2.6rem;
  padding-top: 0.25rem;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
  font-weight: 800;
  line-height: 1.18;
}

.rst-content h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 0.75rem;
  background: var(--nrv-point);
}

.rst-content h3 {
  margin-top: 2rem;
  font-size: 1.28rem;
  font-weight: 800;
}

/* Left navigation */
.wy-nav-side {
  background: var(--nrv-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.wy-side-scroll {
  background: linear-gradient(180deg, #111318 0%, #191d25 100%);
}

.wy-side-nav-search {
  position: relative;
  padding: 1.3rem 1.05rem 0.55rem;
  background: var(--nrv-dark);
}

.wy-side-nav-search::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--nrv-point);
}

.wy-side-nav-search > a,
.wy-side-nav-search .icon {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0;
}

.wy-side-nav-search > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.wy-side-nav-search > a img.logo {
  display: block;
  width: 142px;
  height: auto;
  margin: 0;
}

.wy-side-nav-search > a::after {
  content: "NRVCORP DOCs";
  color: #fff;
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
}

.wy-side-nav-search > a:hover {
  color: #fff;
}

.wy-side-nav-search input[type="text"] {
  height: 42px;
  margin-top: 0.85rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wy-side-nav-search input[type="text"]:focus {
  border-color: rgba(213, 15, 52, 0.72);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  box-shadow: 0 0 0 3px rgba(213, 15, 52, 0.18);
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.wy-menu-vertical {
  padding: 0.35rem 0 2rem;
}

.wy-menu-vertical p.caption {
  position: relative;
  margin: 1.9rem 0rem 0.35rem;
  padding-bottom: 0;
  color: var(--nrv-point);
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.wy-menu-vertical p.caption::before,
.wy-menu-vertical p.caption::after {
  content: none;
}

.wy-menu-vertical p.caption span,
.wy-menu-vertical p.caption .caption-text {
  color: var(--nrv-point);
}

.wy-menu-vertical a {
  min-height: 38px;
  padding: 0.58rem 1.05rem 0.58rem 1.25rem;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.35;
}

.wy-menu-vertical a:hover {
  border-left-color: var(--nrv-point);
  background: rgba(213, 15, 52, 0.12);
  color: var(--nrv-point);
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
  border-left-color: var(--nrv-point);
  border-right: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
}

.wy-menu-vertical li.current {
  background: rgba(255, 255, 255, 0.035);
}

.wy-menu-vertical li.current > ul,
.wy-menu-vertical li.on > ul {
  background: #c9c9c9;
}

.wy-menu-vertical li.current a {
  border-color: transparent;
}

.wy-menu-vertical li.current > a {
  border-left-color: var(--nrv-point);
}

.wy-menu-vertical li.current > a:hover,
.wy-menu-vertical li.on > a:hover {
  border-left-color: var(--nrv-point);
  background: rgba(213, 15, 52, 0.12);
  color: var(--nrv-point);
}

.wy-menu-vertical li.toctree-l2 a,
.wy-menu-vertical li.toctree-l3 a {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.88rem;
}

.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a {
  color: var(--nrv-ink);
}

.wy-menu-vertical li.current > ul a,
.wy-menu-vertical li.on > ul a {
  color: var(--nrv-ink);
}

.wy-menu-vertical li.current > ul a:hover,
.wy-menu-vertical li.on > ul a:hover {
  color: var(--nrv-ink);
}

.wy-menu-vertical li.toctree-l2.current > a:hover,
.wy-menu-vertical li.toctree-l3.current > a:hover {
  color: var(--nrv-ink);
}

/* Mobile top bar */
.wy-nav-top {
  background: var(--nrv-dark);
  color: #fff;
  border-bottom: 3px solid var(--nrv-point);
}

.wy-nav-top a {
  color: #fff;
  font-weight: 800;
}

/* Content links */
.rst-content a {
  color: var(--nrv-point-dark);
  text-decoration-color: rgba(213, 15, 52, 0.28);
}

.rst-content a:hover {
  color: var(--nrv-point);
  text-decoration-color: var(--nrv-point);
}

/* Tables */
.rst-content table.docutils {
  display: table;
  width: auto;
  min-width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid var(--nrv-line);
  border-collapse: collapse;
  box-shadow: 0 14px 38px rgba(17, 19, 24, 0.04);
}

.rst-content table.docutils th {
  border-color: var(--nrv-line);
  background: var(--nrv-panel);
  color: var(--nrv-ink);
  font-weight: 850;
}

.rst-content table.docutils td {
  border-color: var(--nrv-line);
  color: var(--nrv-soft-ink);
}

.rst-content table.docutils tr:nth-child(even) td {
  background: #fafafa;
}

.rst-content table.docutils a {
  color: var(--nrv-point);
  font-weight: 750;
  text-decoration: none;
  border-bottom: 1px solid rgba(213, 15, 52, 0.32);
}

.rst-content table.docutils a:hover {
  color: var(--nrv-point-dark);
  border-bottom-color: var(--nrv-point);
}

/* Code blocks */
.rst-content code {
  border: 1px solid #e7eaee;
  background: #f8fafc;
  color: var(--nrv-point-dark);
  font-size: 0.92em;
}

.rst-content pre {
  border: 1px solid var(--nrv-line);
  background: #f8fafc;
  box-shadow: none;
}

.rst-content pre code {
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
}

/* Admonitions */
.rst-content .admonition,
.rst-content .note,
.rst-content .warning,
.rst-content .important {
  border: 1px solid var(--nrv-line);
  border-left: 4px solid var(--nrv-point);
  background: #fff;
  box-shadow: 0 14px 38px rgba(17, 19, 24, 0.04);
}

.rst-content .admonition-title {
  background: var(--nrv-panel);
  color: var(--nrv-ink);
  font-weight: 850;
}

/* Images and media */
.rst-content img,
.rst-content video {
  max-width: 100%;
  height: auto;
}

.rst-content p > img,
.rst-content p > video {
  display: block;
  margin: 1.25rem 0;
  border: 1px solid var(--nrv-line);
  background: #fff;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--nrv-line);
  color: var(--nrv-muted);
  font-size: 0.9rem;
}

.rst-footer-buttons .btn {
  border: 1px solid var(--nrv-line);
  border-radius: 0;
  background: #fff;
  color: var(--nrv-soft-ink);
  box-shadow: none;
}

.rst-footer-buttons .btn:hover {
  border-color: rgba(213, 15, 52, 0.35);
  background: var(--nrv-point);
  color: #fff;
}

/* Homepage helper classes for later index.md redesign */
.nrv-intro-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.nrv-intro-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.55fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 2.2rem;
  padding: 3rem;
  border: 1px solid var(--nrv-line);
  border-left: 5px solid var(--nrv-point);
  background: linear-gradient(135deg, rgba(213, 15, 52, 0.05), transparent 36%), #fff;
  box-shadow: 0 18px 50px rgba(17, 19, 24, 0.06);
}

.nrv-section-label {
  margin: 0 0 0.6rem;
  color: var(--nrv-point) !important;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: uppercase;
}

.nrv-intro-hero h1 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
}

.nrv-intro-hero h1::before {
  display: none;
}

.nrv-intro-hero p {
  margin: 1.1rem 0 0;
  color: var(--nrv-muted);
  font-size: 1.08rem;
}

.nrv-intro-panel {
  padding: 1.35rem;
  border-left: 4px solid var(--nrv-point);
  background: var(--nrv-panel);
}

.nrv-intro-panel strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--nrv-ink);
  font-size: 1.05rem;
}

.nrv-intro-panel span {
  color: var(--nrv-muted);
  line-height: 1.65;
}

.nrv-sitemap-section {
  margin-top: 2.2rem;
  padding: 2.5rem;
  border: 1px solid #dde3ea;
  background: #f5f7fa;
}

.nrv-sitemap-head {
  margin-bottom: 1.55rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid #d8e0e8;
}

.nrv-sitemap-head h2 {
  margin: 0;
  color: var(--nrv-ink);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.05;
}

.nrv-sitemap-grid,
.nrv-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.nrv-sitemap-card,
.nrv-card {
  position: relative;
  display: block;
  min-height: 170px;
  padding: 1.25rem;
  border: 1px solid #dce2e8;
  border-top: 4px solid var(--nrv-accent);
  background: #fff;
  color: var(--nrv-ink);
  text-decoration: none;
  box-shadow: 0 14px 38px rgba(17, 19, 24, 0.05);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nrv-sitemap-card:hover,
.nrv-card:hover {
  border-color: rgba(213, 15, 52, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(17, 19, 24, 0.1);
}

.nrv-sitemap-card h3,
.nrv-card strong {
  display: block;
  margin: 0 0 0.55rem;
  color: var(--nrv-point);
  font-size: 1.2rem;
  line-height: 1.25;
}

.nrv-sitemap-card p,
.nrv-card span {
  display: block;
  color: var(--nrv-muted);
  line-height: 1.55;
}

.nrv-sdk-card-grid {
  margin-top: 1.8rem;
}

.nrv-sdk-card strong {
  font-size: 1.05rem;
}

.nrv-sdk-card span {
  font-size: 0.88rem;
  line-height: 1.55;
}

.nrv-sitemap-card a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 42px;
  margin-top: 0.45rem;
  padding: 0.56rem 0.72rem;
  border: 1px solid #e0e5ea;
  background: #f9fafb;
  color: var(--nrv-soft-ink);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nrv-sitemap-card a::after {
  content: ">";
  color: var(--nrv-point);
  font-weight: 850;
}

.nrv-sitemap-card a:hover {
  border-color: rgba(213, 15, 52, 0.35);
  background: #fff;
  color: var(--nrv-point);
  transform: translateX(2px);
}

/* API reference */
.nrv-function-title {
  margin: 2.4rem 0 1rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--nrv-line);
  color: var(--nrv-ink);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.25;
}

/* Search page */
.search-results article {
  border-top: 1px solid var(--nrv-line);
}

.search-results article h3 a {
  color: var(--nrv-ink);
  text-decoration: none;
}

.search-results article h3 a:hover {
  color: var(--nrv-point);
}

/* Responsive */
@media screen and (max-width: 768px) {
  .wy-nav-content {
    padding: 3rem 1.15rem 4rem;
  }

  .rst-content h1 {
    font-size: 2.35rem;
  }

  .nrv-intro-hero,
  .nrv-sitemap-grid,
  .nrv-card-grid {
    grid-template-columns: 1fr;
  }

  .nrv-intro-hero,
  .nrv-sitemap-section {
    padding: 1.4rem;
  }

}

@media screen and (max-width: 480px) {
  .rst-content p,
  .rst-content li {
    font-size: 15px;
  }

  .rst-content table.docutils {
    min-width: 100%;
  }

  .wy-side-nav-search {
    padding-top: 1rem;
  }
}
