/* Homepage-specific branded layout and sections. */

body.page-home {
  color: var(--home-ink-strong);
  background:
    radial-gradient(circle at 10% 12%, rgba(231, 183, 255, 0.26), transparent 18%),
    radial-gradient(circle at 84% 10%, rgba(240, 190, 97, 0.22), transparent 22%),
    radial-gradient(circle at 88% 28%, rgba(168, 215, 255, 0.22), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 22%),
    linear-gradient(180deg, var(--home-paper), var(--home-paper-shadow));
}

body.page-home::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0 93%, rgba(111, 96, 81, 0.04) 93% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(111, 96, 81, 0.03) 96% 100%);
  background-size: 100% 18px, 18px 100%;
  pointer-events: none;
  opacity: 0.45;
}

.page-home .page-shell {
  position: relative;
  width: min(1220px, calc(100% - 1.6rem));
  padding-top: clamp(1rem, 2vw, 1.45rem);
  padding-bottom: 4.5rem;
}

.page-home .homepage-main {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.55rem;
}

.homepage-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 1.35rem;
  align-items: start;
}

.homepage-slot {
  min-width: 0;
}

.page-home .library-panel {
  border: var(--home-border-thin) solid var(--home-outline-soft);
  border-radius: var(--home-radius-lg);
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.95), rgba(255, 247, 236, 0.9));
  box-shadow: var(--home-shadow-raised);
  backdrop-filter: none;
}

.page-home .cta-button {
  border-width: var(--home-border-strong);
  border-radius: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-home .brand-tag {
  min-height: 2rem;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-home .brand-tag--outline {
  border-width: var(--home-border-thin);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
}

.page-home .brand-tag--soft {
  background: rgba(19, 111, 99, 0.11);
}

.page-home .brand-tag--search {
  border-width: var(--home-border-thin);
  box-shadow: 4px 4px 0 rgba(19, 111, 99, 0.08);
}

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.2rem;
  border: var(--home-border-strong) solid var(--home-outline-strong);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(251, 244, 232, 0.94));
  box-shadow: var(--home-shadow-lifted);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: -0.2rem auto auto 12%;
  width: 7rem;
  height: 1.1rem;
  border: var(--home-border-strong) solid var(--home-outline-strong);
  border-radius: 16px;
  background: #a8d7ff;
  transform: rotate(-7deg);
}

.site-header__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
}

.site-header__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border: var(--home-border-strong) solid var(--home-outline-strong);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--home-brand-gold), #f8dc7b);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.12);
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  transform: rotate(-4deg);
}

.site-header__eyebrow {
  margin: 0;
  color: var(--home-ink-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-header__title {
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.02;
  text-decoration: none;
}

.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  z-index: 1;
}

.site-header__nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.42rem 0.78rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.2);
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.9);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
  background: rgba(255, 244, 221, 0.92);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.1);
  transform: translateY(-1px) rotate(-1deg);
}

.site-header__action {
  display: flex;
  justify-content: flex-end;
  z-index: 1;
}

.site-header__action .cta-button {
  white-space: nowrap;
}

.homepage-hero {
  display: grid;
  gap: 1.1rem;
}

.homepage-hero__poster {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: clamp(1.5rem, 3.4vw, 2.2rem);
  border: 4px solid var(--home-outline-strong);
  border-radius: 36px;
  background: linear-gradient(135deg, #ddb8ff 0%, #f8dc7b 54%, #a8d7ff 100%);
  box-shadow: 16px 16px 0 rgba(42, 34, 27, 0.16);
  transform: rotate(-2deg);
}

.homepage-hero__poster::before,
.homepage-hero__poster::after {
  content: "";
  position: absolute;
  border: 4px solid var(--home-outline-strong);
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.1);
}

.homepage-hero__poster::before {
  top: 1.1rem;
  left: 12%;
  width: 9rem;
  height: 1rem;
  border-radius: 16px;
  background: #a8d7ff;
  transform: rotate(-8deg);
}

.homepage-hero__poster::after {
  top: 1.4rem;
  right: 1.2rem;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 22px;
  background: #ffb27d;
  transform: rotate(16deg);
}

.homepage-hero__content {
  position: relative;
  z-index: 1;
  max-width: 37rem;
}

.homepage-hero__intro {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.homepage-hero__kicker {
  margin: 0;
  color: rgba(34, 28, 22, 0.68);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.homepage-hero__pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.26rem 0.88rem;
  border: var(--home-border-strong) solid var(--home-outline-strong);
  border-radius: 16px;
  background: rgba(255, 249, 240, 0.92);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.1);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.homepage-hero h1 {
  margin: 1rem 0 0;
  max-width: 10ch;
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 6vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.homepage-hero__copy {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: rgba(34, 28, 22, 0.76);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.78;
}

.homepage-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.homepage-hero__actions .cta-button {
  min-height: 3.15rem;
  padding-inline: 1.25rem;
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.13);
}

.homepage-hero__support {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 1rem;
  align-items: start;
}

.homepage-hero__stack {
  display: grid;
  gap: 1rem;
}

.homepage-hero__panel,
.workflow-card,
.interactive-note,
.feature-card {
  border: 3px solid var(--home-outline-strong);
  border-radius: 28px;
}

.homepage-hero__panel {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  background: rgba(255, 251, 244, 0.94);
  box-shadow: 10px 10px 0 rgba(42, 34, 27, 0.12);
}

.homepage-hero__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.6rem;
  background: linear-gradient(90deg, #a8d7ff, #ffb27d 48%, #bdecc5);
}

.homepage-hero__panel--search {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 244, 228, 0.95));
}

.homepage-hero__panel--stats {
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(239, 248, 245, 0.95));
}

.homepage-hero__panel-kicker {
  margin: 0;
  color: var(--home-ink-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.homepage-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.95rem;
}

.hero-stat {
  padding: 0.95rem 0.85rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.95);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.08);
}

.hero-stat:nth-child(2) {
  transform: translateY(0.35rem);
}

.hero-stat strong {
  display: block;
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 0.28rem;
  color: var(--home-ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.homepage-hero__workflow {
  display: grid;
  gap: 0.8rem;
}

.workflow-card,
.interactive-note {
  position: relative;
  overflow: hidden;
  padding: 1rem 1rem 1rem 1.18rem;
  background: rgba(255, 252, 246, 0.95);
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.1);
}

.workflow-card::before,
.interactive-note::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.7rem;
  border-right: 3px solid var(--home-outline-strong);
  background: linear-gradient(180deg, var(--home-brand-teal), var(--home-brand-gold));
}

.workflow-card span,
.interactive-note span,
.featured-note span {
  display: block;
  color: var(--home-ink-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.workflow-card strong,
.interactive-note strong,
.featured-note strong {
  display: block;
  margin-top: 0.38rem;
  color: var(--home-ink-strong);
  font-size: 1rem;
  line-height: 1.18;
}

.workflow-card p,
.interactive-note p,
.featured-note p,
.search-bar__helper,
.search-bar__feedback,
.feature-card__copy,
.resource-card__description,
.resource-card__note {
  color: var(--home-ink-muted);
  line-height: 1.62;
}

.workflow-card p,
.interactive-note p,
.featured-note p {
  margin: 0.42rem 0 0;
  font-size: 0.92rem;
}

.search-bar {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.search-bar__label {
  display: block;
  color: var(--home-ink-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.search-bar__stamp {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.22rem 0.78rem;
  border: var(--home-border-thin) solid var(--home-outline-strong);
  border-radius: 14px;
  background: rgba(255, 244, 221, 0.92);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-bar__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.search-bar__input {
  min-height: 3.35rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 20px;
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.1);
  color: var(--home-ink-strong);
  font: inherit;
  transition:
    box-shadow 140ms ease,
    transform 140ms ease,
    border-color 140ms ease;
}

.search-bar__input:hover,
.search-bar__input:focus-visible {
  border-color: rgba(19, 111, 99, 0.9);
  box-shadow:
    6px 6px 0 rgba(42, 34, 27, 0.1),
    0 0 0 4px rgba(19, 111, 99, 0.12);
  transform: translateY(-1px);
}

.search-bar__helper {
  margin: 0.72rem 0 0;
  font-size: 0.9rem;
}

.search-bar__feedback {
  min-height: 1.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.search-bar__quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.homepage-section {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 30px;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 12px 12px 0 rgba(42, 34, 27, 0.13);
}

.homepage-section::before {
  content: "";
  position: absolute;
  top: -0.25rem;
  right: 1.4rem;
  width: 6.25rem;
  height: 1rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 16px;
  background: #ffe081;
  transform: rotate(9deg);
}

.homepage-section--routes {
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(237, 248, 245, 0.94));
}

.homepage-section--featured {
  background:
    linear-gradient(180deg, rgba(255, 249, 238, 0.98), rgba(255, 243, 214, 0.95));
}

.homepage-section--interactive {
  background:
    linear-gradient(180deg, rgba(255, 240, 229, 0.98), rgba(255, 247, 241, 0.94));
}

.homepage-section__header--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.homepage-section__badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.24rem 0.8rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 16px;
  background: rgba(255, 251, 245, 0.92);
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feature-card {
  position: relative;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 0.88rem;
  min-height: 100%;
  padding: 1.1rem;
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.1);
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.62rem;
}

.feature-card--lead {
  grid-column: span 6;
  padding: 1.25rem;
}

.feature-card--wide {
  grid-column: span 6;
}

.feature-card--teal {
  background: linear-gradient(180deg, rgba(236, 248, 245, 0.98), rgba(250, 252, 250, 0.94));
}

.feature-card--teal::before {
  background: linear-gradient(90deg, var(--home-brand-teal), #aee4b6);
}

.feature-card--gold {
  background: linear-gradient(180deg, rgba(255, 246, 224, 0.98), rgba(255, 251, 240, 0.94));
}

.feature-card--gold::before {
  background: linear-gradient(90deg, #f0be61, #ffd86e);
}

.feature-card--ink {
  background: linear-gradient(180deg, rgba(241, 239, 234, 0.98), rgba(251, 249, 246, 0.94));
}

.feature-card--ink::before {
  background: linear-gradient(90deg, #8f8475, #cbbfae);
}

.feature-card--rust {
  background: linear-gradient(180deg, rgba(255, 236, 227, 0.98), rgba(255, 248, 243, 0.94));
}

.feature-card--rust::before {
  background: linear-gradient(90deg, var(--home-brand-rust), #ffb27d);
}

.feature-card__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.feature-card__eyebrow,
.resource-card__eyebrow {
  margin: 0;
  color: var(--home-ink-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feature-card__count,
.resource-card__status {
  display: inline-flex;
  align-items: center;
  min-height: 1.95rem;
  padding: 0.24rem 0.7rem;
  border: var(--home-border-thin) solid var(--home-outline-strong);
  border-radius: 14px;
  background: rgba(255, 254, 251, 0.95);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-card h3,
.resource-card h3 {
  margin: 0;
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.feature-card h3 {
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
}

.feature-card--lead h3 {
  font-size: clamp(1.75rem, 2.8vw, 2.45rem);
}

.feature-card__copy,
.resource-card__description {
  margin: 0;
  font-size: 0.94rem;
}

.feature-card__chips,
.feature-card__supporting,
.resource-card__chips,
.resource-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.feature-card__footer {
  margin-top: auto;
}

.page-home .resource-card:not(.resource-card--library) {
  position: relative;
  overflow: hidden;
  gap: 0.88rem;
  border-width: 3px;
  border-color: var(--home-outline-strong);
  border-radius: 26px;
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.1);
}

.page-home .resource-card:not(.resource-card--library)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.62rem;
  background: linear-gradient(90deg, var(--home-brand-teal), #ffe081);
}

.page-home .resource-card--document:not(.resource-card--library) {
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(252, 247, 238, 0.94));
}

.page-home .resource-card--interactive:not(.resource-card--library) {
  border-color: rgba(180, 87, 42, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 238, 227, 0.98), rgba(255, 246, 239, 0.94));
}

.page-home .resource-card--interactive:not(.resource-card--library)::before {
  background: linear-gradient(90deg, var(--home-brand-rust), #ffd86e);
}

.resource-card__header,
.resource-card__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.resource-card__description,
.resource-card__note {
  margin: 0;
}

.resource-card__note,
.resource-card__meta {
  font-size: 0.88rem;
}

.resource-card__meta {
  color: var(--home-ink-muted);
}

.page-home .resource-card:not(.resource-card--library) .resource-card__meta {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.22rem 0.62rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.16);
  border-radius: 14px;
  background: rgba(255, 251, 244, 0.92);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-home .resource-card:not(.resource-card--library) .resource-card__footer {
  margin-top: auto;
  align-items: flex-end;
}

.resource-card--featured-lead {
  min-height: 100%;
  padding: 1.25rem;
  box-shadow: var(--home-shadow-lifted);
  transform: rotate(-1.4deg);
}

.resource-card--featured-lead h3 {
  font-size: clamp(1.8rem, 2.8vw, 2.55rem);
}

.resource-card--featured-lead .resource-card__description,
.resource-card--spotlight .resource-card__description {
  font-size: 0.97rem;
}

.resource-card--featured-stack {
  padding: 1rem 1rem 1.05rem;
}

.resource-card--featured-stack h3 {
  font-size: 1.3rem;
}

.resource-card--spotlight {
  min-height: 100%;
  padding: 1.25rem;
  border-color: rgba(180, 87, 42, 0.7) !important;
  box-shadow: var(--home-shadow-lifted);
}

.resource-card--spotlight h3 {
  font-size: clamp(1.8rem, 2.7vw, 2.35rem);
}

.resource-card--spotlight .resource-card__status {
  background: rgba(255, 231, 215, 0.96);
}

.featured-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.featured-showcase__stack {
  display: grid;
  gap: 1rem;
}

.featured-note {
  padding: 1rem 1rem 1.05rem 1.15rem;
  border: 3px solid var(--home-outline-strong);
  border-radius: 26px;
  background: rgba(255, 246, 222, 0.96);
  box-shadow: 8px 8px 0 rgba(42, 34, 27, 0.1);
}

.interactive-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.92fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.interactive-shell__spotlight,
.interactive-shell__notes {
  min-width: 0;
}

.interactive-shell__notes {
  display: grid;
  gap: 0.8rem;
}

.interactive-note:nth-child(2) {
  transform: translateX(0.3rem);
}

.interactive-note--emphasis {
  background: rgba(255, 246, 238, 0.98);
}

/* Library-specific refinements layered onto the shared branded primitives. */

.homepage-library-panel {
  position: relative;
  overflow: hidden;
  margin-top: clamp(2.3rem, 6vw, 3rem);
  padding: clamp(1.15rem, 3vw, 1.5rem);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(251, 245, 235, 0.94));
  box-shadow: var(--home-shadow-soft);
}

.homepage-library-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.38rem;
  background: linear-gradient(90deg, var(--home-brand-teal), var(--home-brand-gold));
}

.homepage-library-header {
  position: relative;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(42, 34, 27, 0.12);
}

.homepage-library-status {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 0.42rem 0.8rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.16);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.92);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.page-home .panel-header {
  margin-bottom: 1rem;
}

.page-home .filter-helper {
  color: var(--home-ink-muted);
}

.page-home .homepage-library-filters {
  position: relative;
  overflow: hidden;
  gap: 1rem;
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(249, 244, 235, 0.94));
  box-shadow: var(--home-shadow-soft);
}

.page-home .homepage-library-filters::before {
  content: "";
  position: absolute;
  inset: auto -1.5rem -2.5rem auto;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 190, 97, 0.16), transparent 70%);
  pointer-events: none;
}

.page-home .filter-bar {
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.14);
  border-radius: var(--home-radius-md);
  background: rgba(255, 251, 245, 0.88);
  box-shadow: var(--home-shadow-soft);
}

.page-home .filter-field-primary {
  padding: 0.95rem;
  border-color: rgba(42, 34, 27, 0.16);
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.07);
}

.page-home .filter-field-primary[data-active="true"] {
  border-color: rgba(19, 111, 99, 0.32);
  box-shadow: 6px 6px 0 rgba(19, 111, 99, 0.1);
}

.page-home .filter-field-topics {
  padding-top: 0.25rem;
}

.page-home .filter-toolbar {
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(42, 34, 27, 0.08);
}

.page-home .filter-count-chip {
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.16);
  background: rgba(255, 244, 221, 0.88);
  color: var(--home-ink-strong);
}

.page-home .filter-reset {
  color: var(--home-ink-muted);
}

.page-home .filter-reset::before {
  opacity: 0.82;
}

.page-home .filter-topic-summary {
  color: var(--home-ink-strong);
  font-size: 0.95rem;
}

.page-home .filter-tag-list {
  gap: 0.75rem;
}

.page-home .filter-tag-group {
  padding: 0.85rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.72);
}

.page-home .filter-tag-group-secondary {
  padding-top: 0.85rem;
  border-top: var(--home-border-thin) solid rgba(42, 34, 27, 0.1);
}

.page-home .filter-tag-group-title {
  color: var(--home-ink-strong);
}

.page-home .filter-tag-group-copy {
  color: var(--home-ink-muted);
}

.page-home .filter-tag-cluster {
  gap: 0.5rem;
}

.page-home .filter-field-primary,
.page-home .filter-select,
.page-home .filter-tag,
.page-home .filter-toggle {
  border-width: var(--home-border-thin);
  border-radius: 14px;
}

.page-home .filter-select {
  border-color: rgba(42, 34, 27, 0.18);
  background: rgba(255, 254, 251, 0.96);
  color: var(--home-ink-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.page-home .filter-select:hover,
.page-home .filter-select:focus-visible {
  border-color: rgba(19, 111, 99, 0.34);
  box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.1);
}

.page-home .filter-select[data-active="true"] {
  box-shadow: inset 0 3px 0 rgba(213, 93, 53, 0.72);
}

.page-home .filter-tag {
  min-height: 2.45rem;
  padding: 0.5rem 0.8rem;
  background: rgba(255, 254, 251, 0.94);
  color: var(--home-ink-strong);
  box-shadow: none;
}

.page-home .filter-tag-priority {
  background: rgba(255, 252, 246, 0.98);
}

.page-home .filter-tag-secondary {
  background: rgba(243, 248, 246, 0.9);
  color: var(--home-ink-muted);
}

.page-home .filter-tag:hover,
.page-home .filter-tag:focus-visible {
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
}

.page-home .filter-tag[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--home-brand-teal), var(--home-brand-teal-strong));
  box-shadow:
    inset 0 3px 0 rgba(246, 215, 148, 0.8),
    0 14px 20px rgba(19, 111, 99, 0.18);
}

.page-home .filter-tag[aria-pressed="true"] .filter-tag-label {
  color: #f8fffb;
}

.page-home .filter-tag-label {
  font-size: 0.82rem;
}

.page-home .filter-toggle {
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
}

.page-home .filter-toggle:hover,
.page-home .filter-toggle:focus-visible {
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.1);
}

.page-home .library-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.page-home .homepage-library-grid {
  gap: 1rem;
}

.page-home .resource-card--library {
  position: relative;
  overflow: hidden;
  border-width: var(--home-border-thin);
  border-color: rgba(42, 34, 27, 0.18);
  border-radius: 22px;
  padding: 1rem 1rem 1.05rem;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(251, 246, 238, 0.94));
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.08);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.page-home .resource-card--library::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.34rem;
  background: linear-gradient(90deg, var(--home-brand-teal), rgba(240, 190, 97, 0.96));
}

.page-home .resource-card--library:hover,
.page-home .resource-card--library:focus-within {
  transform: translateY(-2px);
  border-color: rgba(19, 111, 99, 0.28);
  box-shadow: 10px 10px 0 rgba(42, 34, 27, 0.1);
}

.page-home .resource-card--library .resource-card__eyebrow {
  color: var(--home-brand-teal-strong);
}

.page-home .resource-card--library h3 {
  font-size: 1.22rem;
  line-height: 1.08;
}

.page-home .resource-card--library .resource-card__description {
  font-size: 0.94rem;
}

.page-home .resource-card--library .resource-card__status {
  background: rgba(255, 244, 221, 0.92);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-home .resource-card--library .brand-tag--outline {
  background: rgba(255, 252, 246, 0.96);
}

.page-home .resource-card--library .brand-tag--soft {
  background: rgba(19, 111, 99, 0.08);
  color: var(--home-ink-muted);
}

.page-home .resource-card--library .resource-card__footer {
  margin-top: auto;
  align-items: flex-end;
}

.page-home .resource-card--library .resource-card__meta {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.6rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.14);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.92);
  color: var(--home-ink-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.page-home .resource-card--library .cta-button {
  border-width: var(--home-border-thin);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
}

.page-home .empty-state--library {
  grid-column: 1 / -1;
  padding: clamp(1.15rem, 3vw, 1.5rem);
  border: var(--home-border-thin) dashed rgba(42, 34, 27, 0.2);
  border-radius: var(--home-radius-md);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(249, 244, 235, 0.94));
  box-shadow: var(--home-shadow-soft);
  color: var(--home-ink-muted);
}

.page-home .empty-state--library strong {
  display: block;
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.05;
}

.page-home .empty-state--library p {
  max-width: 44rem;
  margin: 0.55rem 0 0;
}

.page-home .empty-state--library code {
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(42, 34, 27, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.94);
}

.page-home .empty-state--error {
  border-style: solid;
  border-color: rgba(180, 87, 42, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 244, 237, 0.98), rgba(255, 248, 242, 0.95));
}

/* Document-viewer-specific refinements layered onto the shared branded primitives. */

body.page-document {
  color: var(--home-ink-strong);
  background:
    radial-gradient(circle at top left, rgba(19, 111, 99, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(180deg, #f7eedf, #f2e7d5);
}

.page-document .page-shell {
  width: min(1140px, calc(100% - 1.6rem));
  padding-top: clamp(0.85rem, 2vw, 1.3rem);
  padding-bottom: 3.5rem;
}

.page-document main {
  margin-top: 1.2rem;
}

.page-document .document-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 3vw, 1.55rem);
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.18);
  border-radius: var(--home-radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(250, 244, 235, 0.95));
  box-shadow: var(--home-shadow-soft);
  backdrop-filter: none;
}

.page-document .document-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.34rem;
  background: linear-gradient(90deg, var(--home-brand-teal), rgba(240, 190, 97, 0.92));
}

.page-document .document-hero::after {
  display: none;
}

.page-document .document-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--home-ink-muted);
}

.page-document .document-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.28rem 0.78rem;
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.16);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
  color: var(--home-ink-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.page-document .document-breadcrumb a:hover,
.page-document .document-breadcrumb a:focus-visible {
  transform: translateY(-1px);
  text-decoration: none;
}

.page-document .document-breadcrumb span {
  color: var(--home-ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-document .hero h1 {
  max-width: 15ch;
  margin-top: 0.95rem;
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 4.8vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.page-document .hero-copy {
  max-width: 48rem;
  margin-top: 0.9rem;
  color: var(--home-ink-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.page-document .viewer-meta-row {
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.page-document .viewer-meta-chip {
  min-height: 1.95rem;
  padding: 0.24rem 0.62rem;
  color: var(--home-ink-strong);
}

.page-document .viewer-meta-chip--syllabus {
  border-color: rgba(42, 34, 27, 0.12);
  background: rgba(255, 244, 221, 0.9);
}

.page-document .document-layout {
  grid-template-columns: minmax(0, 285px) minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.35rem;
}

.page-document .viewer-sidebar,
.page-document .viewer-panel {
  border: var(--home-border-thin) solid rgba(42, 34, 27, 0.16);
  border-radius: var(--home-radius-md);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(250, 245, 237, 0.94));
  box-shadow: var(--home-shadow-soft);
  backdrop-filter: none;
}

.page-document .viewer-sidebar {
  top: 0.85rem;
  padding: 1rem 1rem 1.05rem;
}

.page-document .viewer-panel {
  padding: clamp(1.15rem, 3vw, 1.6rem);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 244, 0.96));
}

.page-document .panel-copy {
  color: var(--home-ink-muted);
  font-size: 0.92rem;
}

.page-document .sidebar-section + .sidebar-section {
  border-top-color: rgba(42, 34, 27, 0.1);
}

.page-document .sidebar-summary {
  gap: 0.6rem;
}

.page-document .sidebar-summary::after {
  color: var(--home-ink-muted);
}

.page-document .sidebar-summary:hover::after,
.page-document .sidebar-summary:focus-visible::after {
  color: var(--home-ink-strong);
}

.page-document .sidebar-summary h2 {
  color: var(--home-ink-strong);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.page-document .document-toc {
  margin-top: 0.1rem;
}

.page-document .toc-list li + li {
  margin-top: 0.35rem;
}

.page-document .toc-link {
  display: block;
  padding: 0.34rem 0.55rem;
  border-radius: 12px;
  color: var(--home-ink-muted);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.page-document .toc-link:hover,
.page-document .toc-link:focus-visible {
  background: rgba(19, 111, 99, 0.08);
  color: var(--home-ink-strong);
  transform: translateX(1px);
}

.page-document .toc-link[data-depth="3"] {
  padding-left: 1.15rem;
}

.page-document .document-actions {
  margin-top: 0.85rem;
}

.page-document .secondary-link,
.page-document .doc-link {
  border-width: var(--home-border-thin);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(42, 34, 27, 0.08);
}

.page-document .secondary-link {
  border-color: rgba(42, 34, 27, 0.18);
  background: rgba(255, 252, 246, 0.96);
  color: var(--home-ink-strong);
}

.page-document .secondary-link:hover,
.page-document .secondary-link:focus-visible {
  box-shadow: 6px 6px 0 rgba(42, 34, 27, 0.1);
}

.page-document .doc-link {
  box-shadow: 5px 5px 0 rgba(19, 111, 99, 0.14);
}

.page-document .document-body {
  min-height: 360px;
  color: var(--home-ink-strong);
}

.page-document .document-body article {
  max-width: min(var(--reading-width), 100%);
}

.page-document .empty-state--viewer {
  max-width: min(100%, var(--reading-width));
  padding: clamp(1.15rem, 3vw, 1.45rem);
  border: var(--home-border-thin) dashed rgba(42, 34, 27, 0.18);
  border-radius: var(--home-radius-md);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(249, 244, 235, 0.95));
  box-shadow: var(--home-shadow-soft);
  color: var(--home-ink-muted);
}

.page-document .empty-state--viewer strong {
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.05;
}

.page-document .empty-state--viewer p {
  margin-top: 0.55rem;
}

.page-document .empty-state--viewer.empty-state--error {
  border-style: solid;
  border-color: rgba(180, 87, 42, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 244, 237, 0.98), rgba(255, 248, 242, 0.95));
}

@media (max-width: 1120px) {
  .homepage-stage,
  .homepage-hero__support,
  .featured-showcase,
  .interactive-shell {
    grid-template-columns: 1fr;
  }

  .homepage-section__header--split {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-header__nav {
    justify-content: flex-start;
  }

  .site-header__action {
    justify-content: flex-start;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card,
  .feature-card--lead,
  .feature-card--wide {
    grid-column: span 1;
  }

  .resource-card--featured-lead {
    transform: none;
  }

  .hero-stat:nth-child(2),
  .interactive-note:nth-child(2) {
    transform: none;
  }

  .page-document .document-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .page-document .viewer-sidebar {
    order: 2;
    position: static;
  }

  .page-document .viewer-panel {
    order: 1;
  }
}

@media (max-width: 720px) {
  .page-home .page-shell {
    width: min(100%, calc(100% - 1rem));
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .search-bar__controls {
    grid-template-columns: 1fr;
  }

  .homepage-hero__stats {
    grid-template-columns: 1fr;
  }

  .homepage-hero__poster {
    min-height: 0;
    transform: none;
  }

  .homepage-hero__actions,
  .homepage-section__header--split {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header__nav,
  .site-header__action {
    width: 100%;
  }

  .site-header__nav-link,
  .site-header__action .cta-button,
  .search-bar__submit,
  .search-bar .cta-button,
  .homepage-hero__actions .cta-button,
  .page-home .resource-card__footer .cta-button {
    width: 100%;
  }

  .page-home .resource-card__header,
  .page-home .resource-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .homepage-library-status {
    width: 100%;
  }

  .page-document .document-breadcrumb {
    align-items: flex-start;
  }

  .page-document .document-breadcrumb a,
  .page-document .secondary-link,
  .page-document .doc-link {
    width: 100%;
  }
}

/* Homepage refinement pass: flatten controls, unify J2 surfaces, and rebalance rhythm. */

body.page-home {
  --home-refine-shadow-soft: 0 10px 22px rgba(42, 34, 27, 0.06);
  --home-refine-shadow-card: 0 18px 36px rgba(42, 34, 27, 0.08);
  --home-refine-shadow-hero: 0 24px 44px rgba(42, 34, 27, 0.1);
}

.page-home .homepage-main {
  gap: 1.8rem;
}

.page-home .homepage-stage {
  grid-template-columns: minmax(0, 1.14fr) minmax(350px, 0.86fr);
  gap: 1.5rem;
}

.page-home .cta-button,
.page-home .brand-tag--outline,
.page-home .brand-tag--search,
.page-home .site-header__nav-link,
.page-home .homepage-hero__pill,
.page-home .search-bar__stamp,
.page-home .feature-card__count,
.page-home .resource-card__status,
.page-home .homepage-section__badge,
.page-home .homepage-library-status,
.page-home .resource-card:not(.resource-card--library) .resource-card__meta,
.page-home .resource-card--library .resource-card__meta,
.page-home .filter-toggle,
.page-home .filter-count-chip,
.page-home .resource-card--library .cta-button {
  box-shadow: none;
}

.page-home .cta-button,
.page-home .brand-tag,
.page-home .site-header__nav-link,
.page-home .homepage-hero__pill,
.page-home .search-bar__stamp,
.page-home .feature-card__count,
.page-home .resource-card__status,
.page-home .homepage-section__badge,
.page-home .resource-card:not(.resource-card--library) .resource-card__meta,
.page-home .resource-card--library .resource-card__meta {
  border-radius: 15px;
}

.page-home .cta-button {
  min-height: 2.85rem;
  border-width: var(--home-border-thin);
  padding-inline: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.page-home .cta-button--primary {
  background: linear-gradient(180deg, #167869, #136f63);
}

.page-home .cta-button--secondary {
  background: rgba(255, 251, 245, 0.94);
}

.page-home .cta-button--interactive {
  background: linear-gradient(180deg, #d9683f, #c95a33);
}

.page-home .cta-button:hover,
.page-home .cta-button:focus-visible,
.page-home .site-header__nav-link:hover,
.page-home .site-header__nav-link:focus-visible,
.page-home .brand-tag--link:hover,
.page-home .brand-tag--link:focus-visible {
  transform: none;
  box-shadow: none;
}

.page-home .cta-button:hover,
.page-home .cta-button:focus-visible {
  opacity: 0.92;
}

.page-home .brand-tag {
  min-height: 1.85rem;
  padding-inline: 0.58rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.page-home .brand-tag--outline {
  background: rgba(255, 252, 246, 0.95);
}

.page-home .brand-tag--soft {
  background: rgba(19, 111, 99, 0.09);
}

.page-home .brand-tag--search {
  background: rgba(241, 248, 245, 0.94);
}

.page-home .site-header {
  border-width: 3px;
  border-radius: 30px;
  box-shadow: var(--home-refine-shadow-card);
}

.page-home .site-header::before,
.page-home .homepage-hero__poster::before,
.page-home .homepage-hero__poster::after,
.page-home .homepage-section::before {
  box-shadow: none;
}

.page-home .site-header__mark {
  box-shadow: none;
}

.page-home .site-header__title {
  font-size: 1.38rem;
}

.page-home .site-header__nav-link {
  min-height: 2.15rem;
  background: rgba(255, 251, 245, 0.92);
}

.page-home .site-header__nav-link:hover,
.page-home .site-header__nav-link:focus-visible {
  background: rgba(255, 245, 224, 0.98);
}

.page-home .homepage-hero {
  gap: 1rem;
}

.page-home .homepage-hero__poster {
  min-height: 430px;
  border-width: 3px;
  box-shadow: var(--home-refine-shadow-hero);
  transform: rotate(-1.2deg);
}

.page-home .homepage-hero__content {
  max-width: 34rem;
}

.page-home .homepage-hero h1 {
  max-width: 8.7ch;
  font-size: clamp(3.3rem, 5.8vw, 5.55rem);
  line-height: 0.92;
}

.page-home .homepage-hero__copy {
  max-width: 31rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.7;
}

.page-home .homepage-hero__pill {
  background: rgba(255, 251, 244, 0.95);
}

.page-home .homepage-hero__actions .cta-button {
  min-height: 3rem;
}

.page-home .homepage-hero__panel,
.page-home .workflow-card,
.page-home .interactive-note,
.page-home .feature-card,
.page-home .homepage-section,
.page-home .resource-card:not(.resource-card--library),
.page-home .featured-note,
.page-home .homepage-library-panel,
.page-home .homepage-library-filters,
.page-home .resource-card--library,
.page-home .filter-bar {
  box-shadow: var(--home-refine-shadow-card);
}

.page-home .homepage-hero__panel,
.page-home .workflow-card,
.page-home .interactive-note,
.page-home .feature-card,
.page-home .homepage-section,
.page-home .resource-card:not(.resource-card--library),
.page-home .featured-note {
  border-width: 3px;
}

.page-home .homepage-hero__panel,
.page-home .workflow-card,
.page-home .interactive-note,
.page-home .feature-card,
.page-home .resource-card:not(.resource-card--library) {
  border-radius: 24px;
}

.page-home .homepage-hero__panel {
  padding: 1rem;
}

.page-home .homepage-hero__stats {
  gap: 0.7rem;
}

.page-home .hero-stat {
  border-width: var(--home-border-thin);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: none;
}

.page-home .hero-stat:nth-child(2) {
  transform: none;
}

.page-home .hero-stat strong {
  font-size: 1.35rem;
}

.page-home .workflow-card,
.page-home .interactive-note {
  padding-left: 1rem;
}

.page-home .workflow-card::before,
.page-home .interactive-note::before {
  width: 0.55rem;
}

.page-home .search-bar__header {
  align-items: center;
}

.page-home .search-bar__input {
  border-width: var(--home-border-thin);
  box-shadow: none;
}

.page-home .search-bar__input:hover,
.page-home .search-bar__input:focus-visible {
  transform: none;
  box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.1);
}

.page-home .search-bar__helper {
  max-width: 31rem;
  font-size: 0.86rem;
}

.page-home .section-title h2 {
  font-size: clamp(2.05rem, 3.3vw, 3rem);
  line-height: 0.96;
}

.page-home .section-title__copy {
  max-width: 30rem;
  font-size: 0.92rem;
}

.page-home .homepage-section {
  padding: 1.25rem;
  border-radius: 28px;
}

.page-home .feature-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 1rem;
  align-items: start;
}

.page-home .feature-card {
  gap: 0.72rem;
  min-height: 0;
  padding: 1rem;
}

.page-home .feature-card--lead {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding: 1.3rem;
}

.page-home .feature-card:not(.feature-card--lead):not(.feature-card--wide) {
  grid-column: 2;
}

.page-home .feature-card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 1rem;
  align-items: start;
  padding: 1.15rem 1.2rem;
}

.page-home .feature-card--wide .feature-card__topline,
.page-home .feature-card--wide h3,
.page-home .feature-card--wide .feature-card__copy,
.page-home .feature-card--wide .feature-card__chips,
.page-home .feature-card--wide .feature-card__supporting {
  grid-column: 1;
}

.page-home .feature-card--wide .feature-card__footer {
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: end;
  margin-top: 0;
}

.page-home .feature-card--route-interactive {
  background: linear-gradient(180deg, rgba(255, 236, 227, 0.98), rgba(255, 248, 243, 0.94));
}

.page-home .feature-card--route-interactive .feature-card__count {
  background: rgba(255, 246, 239, 0.96);
}

.page-home .feature-card h3 {
  font-size: clamp(1.34rem, 1.8vw, 1.76rem);
}

.page-home .feature-card--lead h3 {
  font-size: clamp(1.95rem, 3vw, 2.5rem);
}

.page-home .feature-card__copy {
  max-width: 31ch;
  font-size: 0.9rem;
  line-height: 1.56;
}

.page-home .feature-card__chips,
.page-home .feature-card__supporting {
  gap: 0.38rem;
}

.page-home .resource-card:not(.resource-card--library) {
  gap: 0.72rem;
  border-radius: 24px;
}

.page-home .resource-card:not(.resource-card--library) .resource-card__footer {
  margin-top: auto;
}

.page-home .resource-card h3 {
  line-height: 0.98;
}

.page-home .resource-card__description {
  font-size: 0.9rem;
  line-height: 1.55;
}

.page-home .resource-card__note {
  font-size: 0.84rem;
  line-height: 1.45;
}

.page-home .resource-card--featured-lead {
  padding: 1.25rem;
  transform: rotate(-0.6deg);
}

.page-home .resource-card--featured-lead h3 {
  font-size: clamp(1.9rem, 3vw, 2.45rem);
}

.page-home .featured-showcase {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.page-home .featured-showcase__stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.page-home .resource-card--featured-stack {
  padding: 0.95rem;
}

.page-home .resource-card--featured-stack h3 {
  font-size: 1.16rem;
}

.page-home .resource-card--featured-stack .resource-card__description {
  font-size: 0.86rem;
}

.page-home .resource-card--featured-stack .resource-card__note {
  display: none;
}

.page-home .resource-card--featured-stack .resource-card__footer {
  margin-top: 0.1rem;
}

.page-home .featured-note {
  margin-top: 1rem;
  padding: 0.95rem 1rem 1rem;
  border-radius: 22px;
  background: rgba(255, 246, 222, 0.95);
}

.page-home .interactive-shell {
  grid-template-columns: minmax(0, 1.12fr) minmax(240px, 0.88fr);
  gap: 1rem;
}

.page-home .resource-card--spotlight {
  padding: 1.2rem;
}

.page-home .resource-card--spotlight h3 {
  font-size: clamp(1.82rem, 2.5vw, 2.2rem);
}

.page-home .interactive-note--support {
  background: rgba(255, 250, 243, 0.96);
}

.page-home .interactive-note--emphasis {
  background: rgba(255, 243, 233, 0.98);
}

.page-home .homepage-library-panel {
  margin-top: 2rem;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(250, 245, 236, 0.92));
}

.page-home .homepage-library-status,
.page-home .filter-field-primary,
.page-home .filter-toggle,
.page-home .filter-tag:hover,
.page-home .filter-tag:focus-visible,
.page-home .filter-tag[aria-pressed="true"],
.page-home .homepage-library-filters,
.page-home .resource-card--library,
.page-home .resource-card--library:hover,
.page-home .resource-card--library:focus-within {
  transform: none;
}

.page-home .homepage-library-status,
.page-home .filter-field-primary,
.page-home .filter-toggle,
.page-home .resource-card--library .cta-button {
  box-shadow: none;
}

.page-home .homepage-library-filters,
.page-home .filter-bar,
.page-home .resource-card--library,
.page-home .empty-state--library {
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .filter-field-primary[data-active="true"],
.page-home .filter-select[data-active="true"],
.page-home .filter-tag[aria-pressed="true"] {
  box-shadow: none;
}

.page-home .filter-select {
  box-shadow: none;
}

.page-home .filter-select[data-active="true"] {
  border-color: rgba(213, 93, 53, 0.42);
}

.page-home .filter-tag[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--home-brand-teal), var(--home-brand-teal-strong));
}

.page-home .filter-toggle:hover,
.page-home .filter-toggle:focus-visible,
.page-home .resource-card--library:hover,
.page-home .resource-card--library:focus-within {
  box-shadow: var(--home-refine-shadow-soft);
}

@media (max-width: 1120px) {
  .page-home .homepage-stage,
  .page-home .homepage-hero__support,
  .page-home .interactive-shell {
    grid-template-columns: 1fr;
  }

  .page-home .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-home .feature-card,
  .page-home .feature-card--lead,
  .page-home .feature-card--wide,
  .page-home .feature-card:not(.feature-card--lead):not(.feature-card--wide) {
    grid-column: auto;
    grid-row: auto;
  }

  .page-home .feature-card--wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-home .feature-card--wide .feature-card__footer {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.25rem;
  }
}

@media (max-width: 720px) {
  .page-home .homepage-main {
    gap: 1.2rem;
  }

  .page-home #homepage-featured-root {
    order: 2;
  }

  .page-home #homepage-interactive-root {
    order: 3;
  }

  .page-home #library-panel {
    order: 4;
  }

  .page-home #homepage-routes-root {
    order: 5;
  }

  .page-home .site-header {
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 24px;
  }

  .page-home .site-header::before {
    left: 18%;
    width: 5rem;
    height: 0.75rem;
  }

  .page-home .site-header__brand {
    gap: 0.75rem;
  }

  .page-home .site-header__mark {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 16px;
    font-size: 1rem;
  }

  .page-home .site-header__title {
    font-size: 1.16rem;
  }

  .page-home .site-header__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .page-home .site-header__action {
    display: none;
  }

  .page-home .site-header__nav-link {
    justify-content: center;
    min-height: 2rem;
    font-size: 0.68rem;
  }

  .page-home .homepage-stage {
    gap: 1rem;
  }

  .page-home .homepage-hero__poster {
    min-height: 0;
    padding: 1.15rem 1rem 1.05rem;
    border-radius: 28px;
    transform: rotate(-0.8deg);
  }

  .page-home .homepage-hero__poster::before {
    top: 0.8rem;
    width: 5.4rem;
    height: 0.72rem;
  }

  .page-home .homepage-hero__poster::after {
    top: 0.95rem;
    right: 0.85rem;
    width: 3.8rem;
    height: 3.8rem;
  }

  .page-home .homepage-hero h1 {
    max-width: 8.2ch;
    font-size: clamp(2.55rem, 13vw, 3.8rem);
  }

  .page-home .homepage-hero__copy {
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .page-home .homepage-hero__actions {
    gap: 0.6rem;
  }

  .page-home .homepage-hero__actions .cta-button {
    min-height: 2.8rem;
  }

  .page-home .search-bar__controls .cta-button--secondary {
    display: none;
  }

  .page-home .homepage-hero__stack,
  .page-home .search-bar__helper,
  .page-home .search-bar__quick-links,
  .page-home .featured-showcase__stack,
  .page-home .featured-note,
  .page-home .interactive-note--support {
    display: none;
  }

  .page-home .search-bar__header {
    align-items: flex-start;
  }

  .page-home .homepage-section {
    padding: 1.05rem;
    border-radius: 24px;
  }

  .page-home .homepage-section::before {
    right: 1rem;
    width: 4.6rem;
    height: 0.78rem;
  }

  .page-home .section-title h2 {
    font-size: clamp(1.78rem, 9vw, 2.3rem);
  }

  .page-home .resource-card--featured-lead {
    transform: none;
    padding: 1.05rem;
  }

  .page-home .resource-card--featured-lead h3 {
    font-size: 1.72rem;
  }

  .page-home .resource-card--featured-lead .resource-card__description {
    font-size: 0.9rem;
  }

  .page-home .interactive-shell__notes {
    display: grid;
  }

  .page-home .interactive-note--emphasis {
    order: -1;
  }

  .page-home .feature-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .page-home .feature-card:not(.feature-card--lead):not(.feature-card--route-interactive):not(.feature-card--wide) {
    display: none;
  }

  .page-home .feature-card,
  .page-home .feature-card--lead,
  .page-home .feature-card--wide {
    padding: 1rem;
  }

  .page-home .feature-card--wide {
    display: flex;
  }

  .page-home .homepage-library-panel {
    margin-top: 1.2rem;
  }

  .page-home .homepage-library-filters {
    padding: 0.95rem;
  }
}

/* Homepage finishing pass: unify lower sections into editorial surfaces and calm the library handoff. */

.page-home .homepage-main {
  gap: 2rem;
}

.page-home .homepage-section--featured,
.page-home .homepage-section--routes,
.page-home .homepage-library-panel {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.97), rgba(248, 244, 236, 0.93));
}

.page-home .homepage-section--interactive {
  background:
    radial-gradient(circle at 86% 22%, rgba(168, 215, 255, 0.22), transparent 18%),
    linear-gradient(135deg, rgba(255, 240, 229, 0.98), rgba(255, 249, 243, 0.95) 58%, rgba(239, 248, 252, 0.9));
  border-color: rgba(180, 87, 42, 0.46);
}

.page-home .feature-grid--routes {
  align-items: stretch;
}

.page-home .feature-grid--count-3 {
  grid-template-columns: minmax(0, 1.18fr) repeat(2, minmax(0, 0.91fr));
  gap: 0.9rem;
}

.page-home .feature-grid--count-3 .feature-card--lead {
  grid-column: 1;
  grid-row: auto;
  min-height: 100%;
  padding: 1.42rem;
}

.page-home .feature-grid--count-3 .feature-card:not(.feature-card--lead):not(.feature-card--wide) {
  grid-column: auto;
}

.page-home .feature-card,
.page-home .feature-card--teal,
.page-home .feature-card--gold,
.page-home .feature-card--ink,
.page-home .feature-card--rust {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(249, 245, 238, 0.94));
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .feature-card--lead {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(248, 245, 236, 0.95));
}

.page-home .feature-card__topline {
  gap: 0.55rem;
}

.page-home .feature-card__count {
  background: rgba(255, 252, 246, 0.98);
}

.page-home .feature-card--lead .feature-card__copy {
  max-width: 34ch;
}

.page-home .feature-card--lead .feature-card__supporting {
  margin-top: auto;
}

.page-home .resource-card--featured-lead {
  transform: rotate(-0.35deg);
}

.page-home .resource-card--featured-lead .resource-card__description {
  max-width: 31ch;
}

.page-home .featured-showcase {
  gap: 0.85rem;
}

.page-home .featured-showcase__stack-wrap {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.page-home .featured-showcase__stack-label {
  margin: 0;
  color: var(--home-ink-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-home .featured-showcase__stack {
  grid-template-columns: 1fr;
  gap: 0.72rem;
}

.page-home .resource-card--featured-stack {
  gap: 0.56rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border-radius: 20px;
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .resource-card--featured-stack .resource-card__description,
.page-home .resource-card--featured-stack .resource-card__tags,
.page-home .resource-card--featured-stack .resource-card__note,
.page-home .resource-card--featured-stack .resource-card__meta {
  display: none;
}

.page-home .resource-card--featured-stack h3 {
  max-width: 18ch;
  font-size: 1.06rem;
  line-height: 1.02;
}

.page-home .resource-card--featured-stack .resource-card__chips {
  gap: 0.32rem;
}

.page-home .resource-card--featured-stack .resource-card__footer {
  margin-top: 0.2rem;
}

.page-home .featured-note {
  padding: 0.82rem 0.95rem 0.92rem;
  background: rgba(255, 251, 242, 0.94);
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .interactive-shell {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 0.9rem;
}

.page-home .resource-card--spotlight {
  background: linear-gradient(180deg, rgba(255, 242, 233, 0.98), rgba(255, 248, 242, 0.95));
}

.page-home .interactive-shell__notes {
  gap: 0.65rem;
  align-content: start;
}

.page-home .interactive-note--emphasis {
  background: linear-gradient(180deg, rgba(255, 247, 239, 0.98), rgba(255, 239, 228, 0.94));
}

.page-home .interactive-note--support {
  padding: 0.82rem 0.9rem;
  background: rgba(255, 252, 246, 0.94);
}

.page-home .interactive-note--support strong {
  font-size: 1rem;
}

.page-home .interactive-note--support p {
  font-size: 0.82rem;
}

.page-home .homepage-library-panel {
  margin-top: 2.5rem;
  padding: 1.25rem;
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .homepage-library-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: 1rem;
  align-items: start;
  padding-bottom: 0.75rem;
  border-bottom: none;
}

.page-home .homepage-library-header__lead {
  min-width: 0;
}

.page-home .homepage-library-intro {
  display: grid;
  gap: 0.34rem;
  padding: 0.92rem 1rem;
  border: 3px solid rgba(42, 34, 27, 0.18);
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.94);
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .homepage-library-intro span {
  color: var(--home-ink-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-home .homepage-library-intro strong {
  color: var(--home-ink-strong);
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.04;
}

.page-home .homepage-library-intro p {
  margin: 0;
  color: var(--home-ink-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.page-home .homepage-library-status {
  margin-top: 0.35rem;
}

.page-home .homepage-library-filters {
  margin-top: 0.2rem;
  padding: 1rem;
  background: rgba(255, 252, 247, 0.84);
}

.page-home .filter-helper {
  display: none;
}

.page-home .filter-field-topics {
  padding-top: 0;
}

.page-home .filter-toolbar {
  padding-bottom: 0.65rem;
}

.page-home .filter-tag-group {
  background: rgba(255, 253, 248, 0.8);
}

.page-home .homepage-library-grid {
  gap: 0.9rem;
}

.page-home .resource-card--library {
  background: linear-gradient(180deg, rgba(255, 255, 251, 0.96), rgba(251, 247, 240, 0.92));
  box-shadow: none;
}

.page-home .resource-card--library:hover,
.page-home .resource-card--library:focus-within {
  transform: none;
  box-shadow: var(--home-refine-shadow-soft);
}

.page-home .resource-card--library .resource-card__description {
  color: var(--home-ink-muted);
  font-size: 0.89rem;
}

.page-home .resource-card--library .resource-card__chips,
.page-home .resource-card--library .resource-card__tags {
  gap: 0.32rem;
}

@media (max-width: 1120px) {
  .page-home .feature-grid--count-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-home .homepage-library-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-home .homepage-main {
    gap: 1.1rem;
  }

  .page-home .featured-showcase__stack-wrap,
  .page-home .homepage-library-intro p {
    display: none;
  }

  .page-home .interactive-shell {
    gap: 0.8rem;
  }

  .page-home .homepage-library-header {
    gap: 0.65rem;
    padding-bottom: 0.45rem;
  }

  .page-home .homepage-library-intro {
    padding: 0.78rem 0.82rem;
  }

  .page-home .homepage-library-intro strong {
    font-size: 1rem;
  }

  .page-home .homepage-library-filters {
    padding: 0.82rem;
  }

  .page-home .resource-card--library .resource-card__description,
  .page-home .resource-card--library .resource-card__tags,
  .page-home .resource-card--library .resource-card__meta {
    display: none;
  }

  .page-home .resource-card--library .resource-card__chips {
    gap: 0.28rem;
  }
}

html[data-theme="dark"] body.page-home {
  color-scheme: dark;
  --focus-ring: rgba(110, 216, 255, 0.34);
  --home-ink-strong: #f6f2ec;
  --home-ink-muted: rgba(230, 224, 219, 0.7);
  --home-outline-strong: rgba(246, 241, 236, 0.9);
  --home-outline-soft: rgba(246, 241, 236, 0.2);
  --home-brand-teal: #38b2c6;
  --home-brand-teal-strong: #247f96;
  --home-brand-rust: #ff8f63;
  --home-brand-rust-strong: #d86a45;
  --home-brand-gold: #ffd86e;
  --home-shadow-soft: 0 16px 30px rgba(0, 0, 0, 0.34);
  --home-shadow-raised: 0 20px 36px rgba(0, 0, 0, 0.42);
  --home-shadow-lifted: 0 26px 46px rgba(0, 0, 0, 0.5);
  --home-refine-shadow-soft: 0 16px 30px rgba(0, 0, 0, 0.36);
  --home-refine-shadow-card: 0 22px 44px rgba(0, 0, 0, 0.44);
  --home-refine-shadow-hero: 0 28px 58px rgba(0, 0, 0, 0.54);
  --home-dark-surface: #0f1120;
  --home-dark-surface-strong: #101322;
  --home-dark-surface-soft: #151a2b;
  --home-dark-surface-warm: #241a10;
  --home-dark-surface-green: #1a2d20;
  --home-dark-surface-rust: #2b1916;
  --home-dark-surface-violet: #231632;
  --home-dark-cyan: #6ed8ff;
  --home-dark-green: #7cffb2;
  --home-dark-pink: #ff6bde;
  --home-dark-violet: #9b8cff;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 107, 222, 0.18), transparent 18%),
    radial-gradient(circle at 84% 10%, rgba(110, 216, 255, 0.18), transparent 22%),
    radial-gradient(circle at 10% 78%, rgba(124, 255, 178, 0.12), transparent 18%),
    linear-gradient(180deg, #090b14 0%, #101322 52%, #0a0d18 100%);
}

html[data-theme="dark"] body.page-home::before {
  background:
    linear-gradient(transparent 0 93%, rgba(255, 255, 255, 0.038) 93% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(255, 255, 255, 0.028) 96% 100%);
  opacity: 0.42;
}

html[data-theme="dark"] body.page-home .library-panel,
html[data-theme="dark"] body.page-home .homepage-section,
html[data-theme="dark"] body.page-home .homepage-hero__panel,
html[data-theme="dark"] body.page-home .workflow-card,
html[data-theme="dark"] body.page-home .interactive-note,
html[data-theme="dark"] body.page-home .feature-card,
html[data-theme="dark"] body.page-home .resource-card:not(.resource-card--library),
html[data-theme="dark"] body.page-home .featured-note,
html[data-theme="dark"] body.page-home .homepage-library-panel,
html[data-theme="dark"] body.page-home .homepage-library-filters,
html[data-theme="dark"] body.page-home .resource-card--library,
html[data-theme="dark"] body.page-home .filter-bar {
  border-color: var(--home-outline-strong);
}

html[data-theme="dark"] body.page-home .section-title__copy,
html[data-theme="dark"] body.page-home .panel-copy,
html[data-theme="dark"] body.page-home .filter-helper,
html[data-theme="dark"] body.page-home .search-bar__helper,
html[data-theme="dark"] body.page-home .search-bar__feedback,
html[data-theme="dark"] body.page-home .feature-card__copy,
html[data-theme="dark"] body.page-home .resource-card__description,
html[data-theme="dark"] body.page-home .resource-card__note,
html[data-theme="dark"] body.page-home .resource-card__meta,
html[data-theme="dark"] body.page-home .homepage-library-intro p,
html[data-theme="dark"] body.page-home .filter-topic-summary,
html[data-theme="dark"] body.page-home .filter-tag-group-copy {
  color: var(--home-ink-muted);
}

html[data-theme="dark"] body.page-home .cta-button,
html[data-theme="dark"] body.page-home .brand-tag--outline,
html[data-theme="dark"] body.page-home .brand-tag--search,
html[data-theme="dark"] body.page-home .site-header__nav-link,
html[data-theme="dark"] body.page-home .homepage-hero__pill,
html[data-theme="dark"] body.page-home .search-bar__stamp,
html[data-theme="dark"] body.page-home .feature-card__count,
html[data-theme="dark"] body.page-home .resource-card__status,
html[data-theme="dark"] body.page-home .homepage-section__badge,
html[data-theme="dark"] body.page-home .homepage-library-status,
html[data-theme="dark"] body.page-home .resource-card:not(.resource-card--library) .resource-card__meta,
html[data-theme="dark"] body.page-home .resource-card--library .resource-card__meta,
html[data-theme="dark"] body.page-home .filter-count-chip,
html[data-theme="dark"] body.page-home .filter-toggle {
  border-color: rgba(246, 241, 236, 0.24);
  background: rgba(17, 21, 37, 0.92);
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .cta-button--primary {
  background: linear-gradient(180deg, #15263a, #112032);
  color: #f4fbff;
}

html[data-theme="dark"] body.page-home .cta-button--secondary {
  background: rgba(17, 21, 37, 0.92);
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .cta-button--interactive {
  background: linear-gradient(180deg, #2b1916, #231310);
  color: #fff6f0;
}

html[data-theme="dark"] body.page-home .brand-tag--outline {
  background: rgba(15, 17, 32, 0.94);
}

html[data-theme="dark"] body.page-home .brand-tag--soft {
  background: rgba(110, 216, 255, 0.12);
  color: rgba(232, 242, 250, 0.82);
}

html[data-theme="dark"] body.page-home .brand-tag--search {
  background: rgba(21, 38, 58, 0.94);
  color: #b9ebff;
}

html[data-theme="dark"] body.page-home .site-header {
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.96), rgba(14, 17, 30, 0.92));
  box-shadow:
    var(--home-refine-shadow-card),
    0 0 26px rgba(110, 216, 255, 0.08);
}

html[data-theme="dark"] body.page-home .site-header::before {
  background: var(--home-dark-surface-green);
  box-shadow: 0 0 22px rgba(124, 255, 178, 0.2);
}

html[data-theme="dark"] body.page-home .site-header__mark {
  background: linear-gradient(145deg, var(--home-dark-surface-warm), #3a2916);
  color: var(--home-brand-gold);
}

html[data-theme="dark"] body.page-home .site-header__nav-link {
  background: rgba(17, 21, 37, 0.92);
}

html[data-theme="dark"] body.page-home .site-header__nav-link:hover,
html[data-theme="dark"] body.page-home .site-header__nav-link:focus-visible {
  background: rgba(21, 38, 58, 0.96);
}

html[data-theme="dark"] body.page-home .homepage-hero__poster {
  background: linear-gradient(135deg, #25163a 0%, #132c3c 48%, #2a1b15 100%);
  box-shadow:
    var(--home-refine-shadow-hero),
    0 0 34px rgba(155, 140, 255, 0.14);
}

html[data-theme="dark"] body.page-home .homepage-hero__poster::before {
  background: var(--home-dark-surface-green);
  box-shadow: 0 0 22px rgba(124, 255, 178, 0.2);
}

html[data-theme="dark"] body.page-home .homepage-hero__poster::after {
  background: var(--home-dark-surface-rust);
  box-shadow: 0 0 22px rgba(255, 158, 107, 0.2);
}

html[data-theme="dark"] body.page-home .homepage-hero__kicker,
html[data-theme="dark"] body.page-home .homepage-hero__copy,
html[data-theme="dark"] body.page-home .site-header__eyebrow,
html[data-theme="dark"] body.page-home .homepage-hero__panel-kicker,
html[data-theme="dark"] body.page-home .workflow-card span,
html[data-theme="dark"] body.page-home .interactive-note span,
html[data-theme="dark"] body.page-home .featured-note span,
html[data-theme="dark"] body.page-home .feature-card__eyebrow,
html[data-theme="dark"] body.page-home .resource-card__eyebrow,
html[data-theme="dark"] body.page-home .homepage-library-intro span {
  color: rgba(236, 231, 226, 0.64);
}

html[data-theme="dark"] body.page-home .homepage-hero__pill {
  background: rgba(9, 11, 20, 0.68);
}

html[data-theme="dark"] body.page-home .homepage-hero__panel {
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.96), rgba(17, 21, 37, 0.94));
}

html[data-theme="dark"] body.page-home .homepage-hero__panel::before {
  background: linear-gradient(90deg, var(--home-dark-green), var(--home-dark-cyan) 52%, var(--home-dark-pink));
}

html[data-theme="dark"] body.page-home .homepage-hero__panel--search {
  background: linear-gradient(180deg, rgba(16, 19, 34, 0.98), rgba(20, 24, 42, 0.95));
}

html[data-theme="dark"] body.page-home .homepage-hero__panel--stats {
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.98), rgba(21, 38, 58, 0.92));
}

html[data-theme="dark"] body.page-home .hero-stat {
  background: rgba(10, 12, 22, 0.72);
}

html[data-theme="dark"] body.page-home .hero-stat span {
  color: rgba(236, 231, 226, 0.72);
}

html[data-theme="dark"] body.page-home .workflow-card,
html[data-theme="dark"] body.page-home .interactive-note {
  background: linear-gradient(180deg, rgba(15, 17, 32, 0.96), rgba(17, 21, 37, 0.94));
}

html[data-theme="dark"] body.page-home .workflow-card::before,
html[data-theme="dark"] body.page-home .interactive-note::before {
  background: linear-gradient(180deg, var(--home-dark-cyan), var(--home-dark-pink));
}

html[data-theme="dark"] body.page-home .search-bar__label {
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .search-bar__stamp {
  background: rgba(36, 26, 16, 0.92);
  color: #ffe8a9;
}

html[data-theme="dark"] body.page-home .search-bar__input {
  border-color: rgba(246, 241, 236, 0.24);
  background: rgba(10, 12, 22, 0.74);
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .search-bar__input::placeholder {
  color: rgba(236, 231, 226, 0.42);
}

html[data-theme="dark"] body.page-home .search-bar__input:hover,
html[data-theme="dark"] body.page-home .search-bar__input:focus-visible {
  border-color: rgba(110, 216, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(110, 216, 255, 0.12);
}

html[data-theme="dark"] body.page-home .homepage-section {
  background: linear-gradient(180deg, rgba(14, 17, 32, 0.96), rgba(10, 13, 24, 0.94));
}

html[data-theme="dark"] body.page-home .homepage-section::before {
  background: var(--home-dark-surface-warm);
  box-shadow: 0 0 20px rgba(255, 216, 110, 0.18);
}

html[data-theme="dark"] body.page-home .homepage-section--routes,
html[data-theme="dark"] body.page-home .homepage-section--featured,
html[data-theme="dark"] body.page-home .homepage-library-panel {
  background: linear-gradient(180deg, rgba(14, 17, 32, 0.96), rgba(11, 15, 28, 0.94));
}

html[data-theme="dark"] body.page-home .homepage-section--interactive {
  background:
    radial-gradient(circle at 84% 20%, rgba(110, 216, 255, 0.14), transparent 20%),
    linear-gradient(135deg, rgba(37, 22, 58, 0.98), rgba(19, 44, 60, 0.92) 58%, rgba(42, 27, 21, 0.96));
  border-color: rgba(255, 158, 107, 0.42);
}

html[data-theme="dark"] body.page-home .homepage-section__badge {
  background: rgba(36, 26, 16, 0.92);
  color: #ffe8a9;
}

html[data-theme="dark"] body.page-home .feature-card,
html[data-theme="dark"] body.page-home .feature-card--teal,
html[data-theme="dark"] body.page-home .feature-card--gold,
html[data-theme="dark"] body.page-home .feature-card--ink,
html[data-theme="dark"] body.page-home .feature-card--rust,
html[data-theme="dark"] body.page-home .resource-card--document:not(.resource-card--library),
html[data-theme="dark"] body.page-home .featured-note,
html[data-theme="dark"] body.page-home .homepage-library-intro,
html[data-theme="dark"] body.page-home .resource-card--library {
  background: linear-gradient(180deg, rgba(16, 19, 34, 0.96), rgba(11, 15, 28, 0.94));
}

html[data-theme="dark"] body.page-home .feature-card--lead {
  background: linear-gradient(180deg, rgba(17, 21, 37, 0.98), rgba(12, 16, 30, 0.95));
}

html[data-theme="dark"] body.page-home .feature-card--teal::before {
  background: linear-gradient(90deg, var(--home-dark-cyan), var(--home-dark-green));
}

html[data-theme="dark"] body.page-home .feature-card--gold::before {
  background: linear-gradient(90deg, var(--home-brand-gold), #ff9e6b);
}

html[data-theme="dark"] body.page-home .feature-card--ink::before {
  background: linear-gradient(90deg, var(--home-dark-violet), var(--home-dark-cyan));
}

html[data-theme="dark"] body.page-home .feature-card--rust::before,
html[data-theme="dark"] body.page-home .resource-card--interactive:not(.resource-card--library)::before {
  background: linear-gradient(90deg, var(--home-brand-rust), var(--home-dark-pink));
}

html[data-theme="dark"] body.page-home .feature-card__count,
html[data-theme="dark"] body.page-home .resource-card__status,
html[data-theme="dark"] body.page-home .resource-card:not(.resource-card--library) .resource-card__meta,
html[data-theme="dark"] body.page-home .resource-card--library .resource-card__meta {
  background: rgba(9, 11, 20, 0.74);
}

html[data-theme="dark"] body.page-home .resource-card--interactive:not(.resource-card--library),
html[data-theme="dark"] body.page-home .resource-card--spotlight {
  background: linear-gradient(180deg, rgba(36, 19, 28, 0.98), rgba(18, 27, 48, 0.94));
  border-color: rgba(255, 158, 107, 0.42);
}

html[data-theme="dark"] body.page-home .resource-card--spotlight .resource-card__status {
  background: rgba(41, 25, 21, 0.94);
  color: #ffd7c6;
}

html[data-theme="dark"] body.page-home .resource-card--featured-stack {
  background: linear-gradient(180deg, rgba(16, 19, 34, 0.96), rgba(12, 15, 28, 0.94));
}

html[data-theme="dark"] body.page-home .featured-note {
  background: linear-gradient(180deg, rgba(36, 26, 16, 0.96), rgba(16, 19, 34, 0.94));
}

html[data-theme="dark"] body.page-home .interactive-note--emphasis {
  background: linear-gradient(180deg, rgba(36, 19, 28, 0.96), rgba(20, 24, 42, 0.94));
}

html[data-theme="dark"] body.page-home .interactive-note--support {
  background: linear-gradient(180deg, rgba(16, 19, 34, 0.96), rgba(12, 15, 28, 0.94));
}

html[data-theme="dark"] body.page-home .homepage-library-panel::before {
  background: linear-gradient(90deg, var(--home-dark-cyan), var(--home-brand-gold));
}

html[data-theme="dark"] body.page-home .homepage-library-status {
  background: rgba(9, 11, 20, 0.74);
}

html[data-theme="dark"] body.page-home .homepage-library-intro {
  border-color: rgba(246, 241, 236, 0.2);
}

html[data-theme="dark"] body.page-home .homepage-library-intro strong,
html[data-theme="dark"] body.page-home .filter-tag-group-title,
html[data-theme="dark"] body.page-home .filter-label,
html[data-theme="dark"] body.page-home .filter-topic-summary,
html[data-theme="dark"] body.page-home .resource-card--library .resource-card__eyebrow {
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .homepage-library-filters,
html[data-theme="dark"] body.page-home .filter-bar {
  background: rgba(17, 21, 37, 0.88);
}

html[data-theme="dark"] body.page-home .homepage-library-filters::before {
  background: radial-gradient(circle, rgba(110, 216, 255, 0.12), transparent 70%);
}

html[data-theme="dark"] body.page-home .filter-field-primary,
html[data-theme="dark"] body.page-home .filter-tag-group {
  border-color: rgba(246, 241, 236, 0.16);
  background: rgba(15, 17, 32, 0.74);
}

html[data-theme="dark"] body.page-home .filter-select {
  border-color: rgba(246, 241, 236, 0.22);
  background: rgba(9, 11, 20, 0.74);
  color: var(--home-ink-strong);
  box-shadow: none;
}

html[data-theme="dark"] body.page-home .filter-select:hover,
html[data-theme="dark"] body.page-home .filter-select:focus-visible,
html[data-theme="dark"] body.page-home .filter-select[data-active="true"] {
  border-color: rgba(110, 216, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(110, 216, 255, 0.1);
}

html[data-theme="dark"] body.page-home .filter-toolbar {
  border-bottom-color: rgba(246, 241, 236, 0.08);
}

html[data-theme="dark"] body.page-home .filter-count-chip {
  background: rgba(36, 26, 16, 0.92);
  color: #ffe8a9;
}

html[data-theme="dark"] body.page-home .filter-reset {
  color: rgba(236, 231, 226, 0.62);
}

html[data-theme="dark"] body.page-home .filter-tag {
  border-color: rgba(246, 241, 236, 0.18);
  background: rgba(9, 11, 20, 0.74);
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .filter-tag-priority {
  background: rgba(17, 21, 37, 0.86);
}

html[data-theme="dark"] body.page-home .filter-tag-secondary {
  background: rgba(15, 17, 32, 0.72);
  color: rgba(236, 231, 226, 0.72);
}

html[data-theme="dark"] body.page-home .filter-tag:hover,
html[data-theme="dark"] body.page-home .filter-tag:focus-visible,
html[data-theme="dark"] body.page-home .filter-toggle:hover,
html[data-theme="dark"] body.page-home .filter-toggle:focus-visible,
html[data-theme="dark"] body.page-home .resource-card--library:hover,
html[data-theme="dark"] body.page-home .resource-card--library:focus-within {
  box-shadow:
    var(--home-refine-shadow-soft),
    0 0 18px rgba(110, 216, 255, 0.1);
}

html[data-theme="dark"] body.page-home .filter-tag[aria-pressed="true"] {
  border-color: rgba(110, 216, 255, 0.42);
  background: linear-gradient(180deg, #15263a, #112032);
  box-shadow: none;
}

html[data-theme="dark"] body.page-home .filter-tag[aria-pressed="true"] .filter-tag-label {
  color: #f4fbff;
}

html[data-theme="dark"] body.page-home .filter-toggle {
  background: rgba(17, 21, 37, 0.92);
}

html[data-theme="dark"] body.page-home .resource-card--library h3,
html[data-theme="dark"] body.page-home .resource-card h3,
html[data-theme="dark"] body.page-home .section-title h2,
html[data-theme="dark"] body.page-home .site-header__title,
html[data-theme="dark"] body.page-home .hero-stat strong,
html[data-theme="dark"] body.page-home .workflow-card strong,
html[data-theme="dark"] body.page-home .interactive-note strong,
html[data-theme="dark"] body.page-home .featured-note strong {
  color: var(--home-ink-strong);
}

html[data-theme="dark"] body.page-home .resource-card--library .resource-card__status {
  background: rgba(36, 26, 16, 0.92);
  color: #ffe8a9;
}

html[data-theme="dark"] body.page-home .resource-card--library .brand-tag--outline {
  background: rgba(9, 11, 20, 0.74);
}

html[data-theme="dark"] body.page-home .resource-card--library .brand-tag--soft {
  background: rgba(110, 216, 255, 0.1);
  color: rgba(236, 231, 226, 0.76);
}

html[data-theme="dark"] body.page-home .empty-state--library {
  border-color: rgba(246, 241, 236, 0.18);
  background: linear-gradient(180deg, rgba(16, 19, 34, 0.96), rgba(11, 15, 28, 0.94));
}

html[data-theme="dark"] body.page-home .empty-state--library code {
  border-color: rgba(246, 241, 236, 0.18);
  background: rgba(9, 11, 20, 0.74);
}

@media (max-width: 720px) {
  html[data-theme="dark"] body.page-home .site-header__nav-link,
  html[data-theme="dark"] body.page-home .cta-button,
  html[data-theme="dark"] body.page-home .search-bar__input,
  html[data-theme="dark"] body.page-home .resource-card--spotlight,
  html[data-theme="dark"] body.page-home .resource-card--featured-lead,
  html[data-theme="dark"] body.page-home .feature-card--lead,
  html[data-theme="dark"] body.page-home .homepage-library-intro,
  html[data-theme="dark"] body.page-home .resource-card--library {
    box-shadow: var(--home-refine-shadow-soft);
  }

  html[data-theme="dark"] body.page-home .homepage-library-intro {
    background: rgba(16, 19, 34, 0.96);
  }

  html[data-theme="dark"] body.page-home .featured-showcase__stack-wrap,
  html[data-theme="dark"] body.page-home .interactive-note--support {
    display: none;
  }
}
