/* Local visual and interaction pass. Opt-in only; preserves both site themes. */
body.visual-polish {
  --vp-ink: #142b3c;
  --vp-copy: #405569;
  --vp-muted: #53697b;
  --vp-accent: #08657c;
  --vp-surface: #edf4f7;
  --vp-surface-alt: #e4f0f3;
  --vp-line: #cbdbe3;
  --vp-focus: #087d98;
  --vp-ease: cubic-bezier(.22, 1, .36, 1);
}

/* Existing mobile reveals must not compete with the new, visible-by-default layouts. */
html body.visual-polish .pd-motion-item {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.visual-polish main :is(.scene-paths, #design-engagement) { scroll-margin-top: 112px; }
/* Hash destinations remain focusable without adding a decorative heading line. */
.visual-polish main :is(.scene-paths, #design-engagement):focus { outline: none; }
.visual-polish main .scene-paths.section, .visual-polish main .scope-comparison.section { padding-block: 64px; }
.visual-polish .entry-preview { margin: 0; min-width: 0; }
.visual-polish .entry-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #07172b;
}
.visual-polish .entry-preview figcaption {
  margin: 0;
  padding: 10px 0 0;
  color: var(--vp-muted);
  font-size: 14px;
  line-height: 1.65;
}
.visual-polish .scene-path-heading { margin-bottom: 32px; }
.visual-polish .scene-path-heading p { max-width: 62ch; }
.visual-polish .scene-path-actions a { transition: color 180ms var(--vp-ease), background-color 180ms var(--vp-ease); }
.visual-polish .scene-path-actions .entry-primary::after {
  content: '↗';
  display: inline-block;
  margin-left: 8px;
  text-decoration: none;
  transition: transform 200ms var(--vp-ease);
}
.visual-polish :is(.scene-paths a, .scope-contact, .scope-details summary, .table-scroll-controls button):focus-visible {
  outline: 3px solid var(--vp-focus);
  outline-offset: 4px;
}

.visual-polish .project-invitation {
  margin-top: 36px;
  padding: 24px 0 0;
  max-width: 72ch;
  color: var(--vp-copy);
}
.visual-polish .delivery-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: delivery;
}
.visual-polish .delivery-step { counter-increment: delivery; border-top: 1px solid var(--vp-line); padding-top: 20px; min-width: 0; }
.visual-polish .delivery-step::before {
  content: counter(delivery, decimal-leading-zero);
  display: block;
  margin-bottom: 16px;
  color: var(--vp-accent);
  font-size: 28px;
  font-weight: 650;
  line-height: 1.2;
}
.visual-polish .delivery-step h3 { font-size: 21px; margin: 0 0 12px; }
.visual-polish .delivery-step p { color: var(--vp-copy); font-size: 16px; line-height: 1.8; }

/* Real project interfaces make the first three operating questions tangible. */
.visual-polish .scenario-gallery .scene-path-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; }
.visual-polish .scenario-gallery .scene-path-list > .scenario-entry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--vp-line);
}
.visual-polish .scenario-gallery .scene-path-list > .scenario-feature { padding-top: 0; border: 0; }
.visual-polish .scenario-gallery .entry-preview img { border-radius: 8px; }
.visual-polish .scenario-gallery .scene-path-list h3 { font-size: 23px; color: var(--vp-ink); }
.visual-polish .scenario-gallery .scene-path-actions { margin-top: auto; }
.visual-polish .scenario-gallery .scene-path-actions a { flex-basis: 100%; }

/* One lead guide and three nearby reading paths, keeping the rest of the archive intact. */
.visual-polish .guide-gallery .scene-path-list { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0 40px; }
.visual-polish .guide-gallery .scene-path-list > .guide-entry {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  grid-column: 2;
  gap: 10px 20px;
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--vp-line);
  align-items: start;
}
.visual-polish .guide-gallery .guide-entry > .entry-preview { grid-row: 1 / 3; }
.visual-polish .guide-gallery .guide-entry .scene-path-actions { grid-column: 2; gap: 0 16px; }
.visual-polish .guide-gallery .guide-entry h3 { font-size: 21px; color: var(--vp-ink); }
.visual-polish .guide-gallery .scene-path-list > .guide-feature {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  padding: 28px;
  gap: 24px;
  border: 0;
  border-radius: 12px;
  background: var(--vp-surface);
}
.visual-polish .guide-gallery .guide-feature > .entry-preview { width: 100%; }
.visual-polish .guide-gallery .guide-feature img { border-radius: 6px; }
.visual-polish .guide-gallery .guide-feature h3 { font-size: 29px; }
.visual-polish .guide-gallery .guide-feature .scene-path-actions { margin-top: auto; }

/* Three commissioning scopes remain visible together; native details expose preparation notes. */
.visual-polish .scope-comparison .design-engagement-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 24px; margin-block: 36px; }
.visual-polish .scope-option { min-width: 0; background: var(--vp-surface); border-radius: 12px; padding: 28px; }
.visual-polish .scope-option:nth-child(2) { background: var(--vp-surface-alt); }
.visual-polish .scope-comparison .scope-option dt { margin: 0 0 20px; color: var(--vp-ink); font-size: 25px; line-height: 1.45; min-height: 80px; }
.visual-polish .scope-context { display: block; font-weight: 500; color: var(--vp-accent); font-size: 15px; line-height: 1.6; margin-bottom: 12px; }
.visual-polish .scope-comparison .scope-option dd { margin: 0; font-size: 16px; color: var(--vp-copy); }
.visual-polish .scope-description { margin: 0 0 24px; min-height: 180px; color: var(--vp-copy); line-height: 1.85; }
.visual-polish .scope-details { border-block: 1px solid var(--vp-line); }
.visual-polish .scope-details summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding-block: 12px; cursor: pointer; list-style: none; font-weight: 600; color: var(--vp-ink); }
.visual-polish .scope-details summary::-webkit-details-marker { display: none; }
.visual-polish .scope-details summary::after { content: '+'; font-size: 23px; font-weight: 400; transition: transform 180ms var(--vp-ease); }
.visual-polish .scope-details[open] summary::after { transform: rotate(45deg); }
.visual-polish .scope-detail-body { padding-block: 0 12px; }
.visual-polish .scope-detail-body p { margin: 0 0 12px; font-size: 15px; color: var(--vp-copy); line-height: 1.85; }
.visual-polish .scope-details[open] .scope-detail-body { animation: scope-open 180ms var(--vp-ease); }
.visual-polish .scope-contact { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 16px; color: var(--vp-accent); font-size: 16px; font-weight: 650; text-decoration: none; text-underline-offset: 4px; }
.visual-polish .scope-followup { max-width: 76ch; color: var(--vp-copy); }
@keyframes scope-open { from { opacity: .65; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Long-form reading: persistent local contents, continuous prose, and wider visual comparisons. */
html body.article-polish main.article { width: min(1160px, calc(100% - 64px)); max-width: 1160px; }
.article-polish .article-reading-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; margin-top: 40px; }
.article-polish .article-reading-layout > .reading-toc { position: sticky; top: 112px; max-height: calc(100vh - 144px); overflow-y: auto; width: 100%; max-width: none; margin: 0; padding: 8px 16px; background: var(--vp-surface); border: 0; border-radius: 8px; }
.article-polish .article-reading-layout .reading-toc ol { display: block; padding: 0 0 8px; }
.article-polish .article-reading-layout .reading-toc summary { padding-inline: 0; font-size: 16px; }
.article-polish .article-reading-layout .reading-toc summary span { display: block; margin: 4px 0 0; font-size: 14px; }
html body.article-polish .article-reading-layout .reading-toc a { padding: 12px 0; font-size: 14px; line-height: 1.65; border-top: 1px solid var(--vp-line); text-decoration: none; color: var(--vp-copy); font-weight: 450 !important; }
html body.article-polish .article-reading-layout .reading-toc a[aria-current="location"] { color: var(--vp-accent); font-weight: 700 !important; text-decoration: none; text-underline-offset: 4px; }
.article-polish .article-reading-body { min-width: 0; }
.article-polish .article-reading-body > :is(p,ul,ol,h2,h3),
.article-polish .article-reading-body > .reading-section > :is(p,ul,ol,h2,h3) { max-width: 780px; margin-inline: 0; }
html body.article-polish main.article .article-reading-body > h2:first-child,
html body.article-polish main.article .article-reading-body > .reading-section:first-child > h2:first-child { margin-top: 0 !important; }
.article-polish .article-reading-body .reading-table-wrap { margin-block: 20px 32px; }
.article-polish .article-reading-body .reading-table { min-width: 720px; }
.article-polish .article-reading-body .reading-table[data-columns="4"] { min-width: 880px; }
.article-polish .article-reading-body .reading-table tbody tr:nth-child(even) td { background: #f6f9fb; }
.article-polish main.article .article-context-figure { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 20px; margin-block: 32px; background: var(--vp-surface); border-radius: 8px; }
.article-polish main.article .article-context-figure > :first-child { min-width: 0; }
.article-polish main.article .article-context-figure figcaption { margin: 0; color: var(--vp-copy); font-size: 14px; line-height: 1.85; }
.article-polish main.article .article-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; list-style: none; counter-reset: article-step; padding: 0; margin-block: 28px; }
.article-polish main.article .article-steps > li { position: relative; counter-increment: article-step; padding: 16px 0 0 40px; margin: 0; border-top: 1px solid var(--vp-line); font-size: 16px; }
.article-polish main.article .article-steps > li::before { content: counter(article-step); position: absolute; top: 16px; left: 0; color: var(--vp-accent); font-size: 23px; font-weight: 650; }
.visual-polish .table-scroll-controls { display: flex; justify-content: flex-end; gap: 8px; margin-block: 12px 8px; }
.visual-polish .table-scroll-controls[hidden] { display: none; }
.visual-polish .table-scroll-controls button { min-width: 80px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--vp-line); border-radius: 6px; background: var(--vp-surface); color: var(--vp-accent); font: inherit; font-size: 14px; cursor: pointer; transition: background-color 180ms var(--vp-ease), color 180ms var(--vp-ease); }
.visual-polish .table-scroll-controls button[aria-disabled="true"] { color: var(--vp-muted); background: transparent; cursor: default; }
.visual-polish .table-scroll-controls + .reading-table-wrap { margin-top: 0; }

@media (hover: hover) and (pointer: fine) {
  .visual-polish .scene-path-actions .entry-primary:hover::after { transform: translate(3px, -2px); }
  .visual-polish .table-scroll-controls button:not([aria-disabled="true"]):hover { background: var(--vp-accent); color: #fff; }
  .visual-polish .scope-details summary:hover { color: var(--vp-accent); }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .visual-polish .guide-gallery .scene-path-list { gap: 0 24px; }
  .visual-polish .guide-gallery .scene-path-list > .guide-entry:not(.guide-feature) { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 16px; }
  .visual-polish .scope-option { padding: 24px; }
  .visual-polish .scope-description { min-height: 264px; }
}
@media (max-width: 1000px) {
  .article-polish .article-reading-layout { display: block; }
  .article-polish .article-reading-layout > .reading-toc { position: static; max-height: none; margin-bottom: 36px; }
  .article-polish .article-reading-layout .reading-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .article-polish .article-reading-layout .reading-toc summary span { display: inline; margin-left: 12px; }
  .visual-polish .delivery-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.visual-polish {
    --vp-ink: #fff;
    --vp-copy: #deebfa;
    --vp-muted: #adbed4;
    --vp-accent: #79dff5;
    --vp-surface: #10233c;
    --vp-surface-alt: #142c43;
    --vp-line: #36526d;
    --vp-focus: #79dff5;
  }
  html body.visual-polish:not(.home-page) main .scene-paths { padding-block: 40px !important; }
  html body.visual-polish .entry-preview figcaption { color: var(--vp-muted) !important; font-size: 14px !important; }
  html body.visual-polish .scene-path-heading { margin-bottom: 28px; }
  html body.visual-polish:not(.home-page) main .scene-path-list h3 { color: var(--vp-ink) !important; font-size: 22px !important; }
  html body.visual-polish:not(.home-page) main .service-choices .scene-path-list,
  html body.visual-polish:not(.home-page) main .scenario-gallery .scene-path-list,
  html body.visual-polish:not(.home-page) main .guide-gallery .scene-path-list { display: block; }
  html body.visual-polish:not(.home-page) main .service-choices .scene-path-actions { margin-top: 0; }
  html body.visual-polish:not(.home-page) main .project-invitation { padding: 16px 0 0; margin-top: 12px; }
  html body.visual-polish .delivery-steps { display: block; }
  html body.visual-polish .delivery-step { margin-block: 24px; padding: 16px 0 0 48px; position: relative; }
  html body.visual-polish .delivery-step::before { position: absolute; top: 16px; left: 0; font-size: 24px; }
  html body.visual-polish:not(.home-page) main .scenario-gallery .scene-path-list > .scenario-entry { display: flex; gap: 18px; padding: 24px 0; margin: 0; border: 0; border-top: 1px solid var(--vp-line); }
  html body.visual-polish:not(.home-page) main .scenario-gallery .scene-path-list > .scenario-feature { padding-top: 0; margin-bottom: 16px; border: 0; }
  html body.visual-polish:not(.home-page) main .scenario-gallery .scene-path-actions { margin-top: 0; gap: 0; }
  html body.visual-polish:not(.home-page) main .guide-gallery .scene-path-list > .guide-entry { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 16px; margin: 0; padding: 24px 0; border: 0; border-top: 1px solid var(--vp-line); }
  html body.visual-polish:not(.home-page) main .guide-gallery .scene-path-list > .guide-feature { display: flex; padding: 22px 20px; margin-bottom: 24px; border: 0; background: var(--vp-surface); border-radius: 12px; }
  html body.visual-polish:not(.home-page) main .guide-gallery .guide-feature h3 { font-size: 25px !important; }
  html body.visual-polish:not(.home-page) main .guide-gallery .guide-entry:not(.guide-feature) h3 { font-size: 20px !important; }
  html body.visual-polish:not(.home-page) main .guide-gallery .guide-entry .scene-path-actions { grid-column: 1 / -1; margin-top: 0; }
  html body.visual-polish:not(.home-page) main .guide-gallery .guide-entry > .entry-preview { grid-row: 1; }
  html body.visual-polish .scope-comparison .design-engagement-list { display: block; margin-block: 28px; }
  html body.visual-polish .scope-option { padding: 24px 20px; margin-bottom: 20px; border-radius: 12px; }
  html body.visual-polish .scope-comparison .scope-option dt { min-height: 0; font-size: 25px; color: #fff; margin: 0 0 20px; }
  html body.visual-polish .scope-context { color: var(--vp-accent); font-size: 15px; }
  html body.visual-polish .scope-description { min-height: 0; margin-bottom: 24px; }
  html body.visual-polish .scope-detail-body { padding-bottom: 8px; }
  html body.visual-polish .scope-contact { color: var(--vp-accent); font-size: 15px; }
  html body.article-polish:not(.home-page) main.article { width: calc(100% - 36px) !important; }
  html body.article-polish main.article .article-reading-layout { margin-top: 28px; }
  html body.article-polish main.article .article-reading-layout > .reading-toc { padding: 8px 16px; margin-bottom: 32px; }
  html body.article-polish main.article .article-reading-layout .reading-toc ol { display: block; }
  html body.article-polish:not(.home-page) main.article .article-reading-body > p { margin: 0 0 20px; }
  html body.article-polish:not(.home-page) main.article .article-context-figure { display: block; margin-block: 28px; padding: 16px; background: var(--vp-surface); }
  html body.article-polish:not(.home-page) main.article .article-context-figure figcaption { margin-top: 16px; color: var(--vp-copy) !important; }
  html body.article-polish main.article .article-steps { display: block; margin-block: 24px; }
  html body.article-polish main.article .article-steps > li { margin-block: 20px; padding-top: 16px; }
  html body.article-polish .article-reading-body .reading-table { min-width: 512px; }
  html body.article-polish .article-reading-body .reading-table[data-columns="4"] { min-width: 712px; }
  html body.article-polish .article-reading-body .reading-table tbody tr:nth-child(even) td { background: #0d2037; }
  html body.visual-polish .table-scroll-controls { margin-top: 8px; }
  html body.visual-polish .table-scroll-controls button { color: var(--vp-accent); }
  html body.visual-polish .table-scroll-controls button[aria-disabled="true"] { color: var(--vp-muted); }
}
@media (max-width: 359px) {
  html body.visual-polish:not(.home-page) main .guide-gallery .scene-path-list > .guide-entry:not(.guide-feature) { grid-template-columns: 76px minmax(0, 1fr); gap: 10px 12px; }
  html body.article-polish .article-reading-body .reading-table { min-width: 440px; }
  html body.article-polish .article-reading-body .reading-table[data-columns="4"] { min-width: 608px; }
}
/* Local reading links: color and weight identify links, controls retain keyboard focus. */
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(h1,h2,h3,h4,h5,h6),
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main a:not(.brand):not(.button):not(.nav-cta):not(.mobile-menu-cta) {
  text-decoration: none !important;
}
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(h1,h2,h3,h4,h5,h6) { border-bottom: 0 !important; }
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(h1,h2,h3,h4,h5,h6)::after { display: none !important; }
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(h1,h2,h3)[tabindex="-1"]:focus { outline: none; }
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(p,li,td,th,figcaption) a:not(.brand):not(.button):not(.nav-cta):not(.mobile-menu-cta) { text-decoration: none !important; font-weight: 600; }
html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main :is(a,button,summary):focus-visible { outline: 3px solid var(--vp-focus); outline-offset: 4px; border-radius: 2px; }
html body.article-polish .article-reading-layout .reading-toc a[aria-current="location"] { background: var(--vp-surface-alt); border-radius: 3px; }
@media (hover: hover) and (pointer: fine) {
  html body.visual-polish:is(.content-ui,.solution-polish):not(.home-page) main a:not(.button):hover { color: var(--vp-accent) !important; background-color: var(--vp-surface-alt); border-radius: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(body.visual-polish) { scroll-behavior: auto !important; }
  html body.visual-polish *, html body.visual-polish *::before, html body.visual-polish *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
