/* Homepage section rhythm: preserve the first surface, then darken gently.
 * The sequence is assigned in the Astro section components as 1 -> 2 -> 3. */
html[data-theme="light"] {
  --home-block-tone-1: #fbfaf7;
  --home-block-tone-2: #faf8f5;
  --home-block-tone-3: #f8f6f2;
  --home-block-divider: rgb(78 68 54 / 8%);
  --home-motif-a: url("/document-provenance-light.svg?v=3");
  --home-motif-b: url("/clause-graph-light.svg?v=3");
  --home-motif-c: url("/audit-trail-light.svg?v=3");
}

html:not([data-theme="light"]) {
  --home-block-tone-1: #080909;
  --home-block-tone-2: rgb(7.5 8.5 8.5);
  --home-block-tone-3: #070808;
  --home-block-divider: rgb(255 255 255 / 7%);
  --home-motif-a: url("/document-provenance-dark.svg?v=3");
  --home-motif-b: url("/clause-graph-dark.svg?v=3");
  --home-motif-c: url("/audit-trail-dark.svg?v=3");
}

html body main:not(#legal-canvas-a):not(#legal-canvas-b):not(#legal-canvas-c) {
  background-color: var(--home-block-tone-1) !important;
  background-image: none !important;
}

/* Exact homepage selectors intentionally outrank the legacy ID overrides. */
html body main > .trust-bar.light-block-tone-1:not(#section-rhythm-a):not(#section-rhythm-b):not(#section-rhythm-c),
html body main > #popular#popular.light-block-tone-1:not(#section-rhythm-a),
html body main #articles#articles.light-block-tone-1:not(#section-rhythm-a),
html body main > .doubts-section.light-block-tone-1:not(#section-rhythm-a):not(#section-rhythm-b):not(#section-rhythm-c) {
  background-color: var(--home-block-tone-1) !important;
  background-image: none !important;
}

html body main > #about#about.light-block-tone-2:not(#section-rhythm-a),
html body main #reasons#reasons.light-block-tone-2:not(#section-rhythm-a),
html body main #pricing#pricing.light-block-tone-2:not(#section-rhythm-a) {
  background-color: var(--home-block-tone-2) !important;
  background-image: none !important;
}

html body main > #why-pro-lex#why-pro-lex.light-block-tone-2:not(#section-rhythm-a) {
  background: transparent !important;
}

html body main > #services#services.light-block-tone-3:not(#section-rhythm-a),
html body main #workflow#workflow.light-block-tone-3:not(#section-rhythm-a),
html body main > #faq#faq.light-block-tone-3:not(#section-rhythm-a) {
  background-color: var(--home-block-tone-3) !important;
  background-image: none !important;
}

/* A pale warm chapter keeps the decorative treatment soft in light mode. */
html[data-theme="light"] body main #workflow#workflow.light-block-tone-3:not(#section-rhythm-a) {
  background-color: #f8f0e8 !important;
}

html:not([data-theme="light"]) body main #workflow#workflow.light-block-tone-3:not(#section-rhythm-a) {
  background-color: #282c2d !important;
}

/* 2026 editorial data-narrative treatment: one oversized document-provenance
 * contour per section, alternating edges instead of a tiled wallpaper. */
html body main :is(
  .trust-bar.light-block-tone-1,
  #about.light-block-tone-2,
  #services.light-block-tone-3,
  #popular.light-block-tone-1,
  #reasons.light-block-tone-2,
  #workflow.light-block-tone-3,
  #articles.light-block-tone-1,
  #pricing.light-block-tone-2,
  #faq.light-block-tone-3,
  .doubts-section.light-block-tone-1
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-repeat: no-repeat !important;
  background-size: clamp(420px, 44vw, 640px) auto !important;
}

html body main :is(
  .trust-bar.light-block-tone-1,
  #popular.light-block-tone-1,
  #articles.light-block-tone-1,
  .doubts-section.light-block-tone-1
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-image: var(--home-motif-a) !important;
}

html body main :is(
  #about.light-block-tone-2,
  #reasons.light-block-tone-2,
  #pricing.light-block-tone-2
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-image: var(--home-motif-b) !important;
}

html body main :is(
  #services.light-block-tone-3,
  #workflow.light-block-tone-3,
  #faq.light-block-tone-3
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-image: var(--home-motif-c) !important;
}

html body main :is(
  .trust-bar.light-block-tone-1,
  #services.light-block-tone-3,
  #reasons.light-block-tone-2,
  #articles.light-block-tone-1,
  #faq.light-block-tone-3
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-position: calc(100% + 120px) 50% !important;
}

html body main :is(
  #about.light-block-tone-2,
  #popular.light-block-tone-1,
  #workflow.light-block-tone-3,
  #pricing.light-block-tone-2,
  .doubts-section.light-block-tone-1
):not(#provenance-a):not(#provenance-b):not(#provenance-c) {
  background-position: -120px 50% !important;
}

/* Every visible homepage block gets a crisp boundary, including the nested
 * reasons/workflow/articles/pricing sequence inside #why-pro-lex. */
html body main :is(
  .trust-bar.light-block-tone-1,
  #about.light-block-tone-2,
  #services.light-block-tone-3,
  #popular.light-block-tone-1,
  #reasons.light-block-tone-2,
  #workflow.light-block-tone-3,
  #articles.light-block-tone-1,
  #pricing.light-block-tone-2,
  #faq.light-block-tone-3,
  .doubts-section.light-block-tone-1
):not(#section-divider-a):not(#section-divider-b):not(#section-divider-c) {
  box-shadow: inset 0 1px 0 var(--home-block-divider) !important;
}
