/* Inner-page surfaces follow the resolved appearance tokens in rebrand.css.
   The homepage's deliberate AI band and its layout are left intact. */
body:not(.rebrand-home){--line:var(--brand-line);--line-gold:var(--brand-border);--gold-ink:var(--brand-secondary)}
body:not(.rebrand-home) :is(.hero,.bsys-hero,.team-hero,.legal-hero,.img-hero,.section-dark,.stats,.contact,.team-strip,.team-cta){
  --white:var(--brand-ink);--gray-100:var(--brand-muted);--accent:var(--brand-ink);--gold:var(--brand-ink);
  background:var(--brand-page);color:var(--brand-ink);
}
body:not(.rebrand-home) :is(.section-dark,.stats,.team-strip,.team-cta){background:var(--brand-soft);border-block:1px solid var(--brand-line)}
body:not(.rebrand-home) :is(.hero,.bsys-hero,.team-hero,.legal-hero,.img-hero){border-bottom:1px solid var(--brand-line)}
/* Legacy gradients must not sit over an otherwise light surface. */
body:not(.rebrand-home) :is(.bsys-hero,.team-hero,.legal-hero,.stats,.contact,.team-cta)::before,
body:not(.rebrand-home) .img-hero::after,
body:not(.rebrand-home) .hero-photo::after{display:none}
body:not(.rebrand-home) :is(.bsys-hero,.team-hero,.img-hero) .hero-photo{opacity:.035}
body:not(.rebrand-home) :is(.hero,.bsys-hero,.team-hero,.legal-hero,.img-hero) :is(h1,h2,h3,h1 em){color:var(--brand-ink)}
body:not(.rebrand-home) :is(.bsys-lede,.team-lede,.post-dek,.blog-dek,.hero-sub){color:var(--brand-secondary)}
body:not(.rebrand-home) :is(.legal-breadcrumb,.legal-hero .updated,.post-hero .post-meta){color:var(--brand-muted);opacity:1}
body:not(.rebrand-home) .legal-breadcrumb a{color:var(--brand-focus)}
body:not(.rebrand-home) .legal-breadcrumb a:hover{color:var(--brand-ink)}
body:not(.rebrand-home) :is(.legal-breadcrumb .sep,.post-hero .post-meta .sep){color:var(--brand-muted);opacity:1}
/* Small labels on legal pages stay at the site's 12px minimum; the callout note on its tinted
   surface uses the secondary text colour to stay above 4.5:1 in both appearances. */
body:not(.rebrand-home) .legal-breadcrumb{font-size:12px}
body:not(.rebrand-home) .legal-toc h2{font-size:12px!important}
body:not(.rebrand-home) .prose th{font-size:12px}
body:not(.rebrand-home) .prose .note{color:var(--brand-secondary)}
body:not(.rebrand-home) :is(.section-light,.section-tint,.legal-main,.post-card){--accent:var(--brand-ink)}
body:not(.rebrand-home) :is(.section-light,.section-tint) .eyebrow{color:var(--brand-muted)}

/* Dark-labelled legacy sections now use the selected surface and text pair. */
body:not(.rebrand-home) :is(.section-dark,.stats,.contact,.team-strip,.team-cta) :is(h2,h3,h4,.bsys-endline,.section-cta p){color:var(--brand-ink)}
body:not(.rebrand-home) :is(.case-lede,.bsys-intro,.case-l,.case-note,.stat-label,.office p,.eng .tag,.team-count,.tp span:last-child){color:var(--brand-muted);opacity:1}
body:not(.rebrand-home) :is(.case-n,.stat-num,.snum,.eng .role,.tp .tn){color:var(--brand-ink)}
body:not(.rebrand-home) :is(.case-cols,.case-strip,.eng-grid,.eng,.value,.contact-direct,.audience-grid span){border-color:var(--brand-line)}
body:not(.rebrand-home) :is(.eng,.value):hover{background:var(--brand-raised)}
body:not(.rebrand-home) .value p{color:var(--brand-muted);opacity:1}
body:not(.rebrand-home) :is(.hairline,.stat + .stat::before){background:var(--brand-line)}
body:not(.rebrand-home) .audience-grid span{color:var(--brand-secondary)}
body:not(.rebrand-home) .audience-grid span:hover{background:var(--brand-raised);border-color:var(--brand-border-hover);color:var(--brand-ink)}
body:not(.rebrand-home) .avatar{background:var(--brand-raised);color:var(--brand-ink);border-color:var(--brand-border)}
body:not(.rebrand-home) .bsys-note{background:var(--brand-raised);color:var(--brand-secondary);border-color:var(--brand-border)}
body:not(.rebrand-home) .bsys-note strong{color:var(--brand-ink)}

/* Cards, status chips and rules stay readable in every appearance. */
body:not(.rebrand-home) :is(.post-card,.legal-contactcard,.legal-toc,.work-card,.area-index a,.practice,.built-card,.anchor,.case,.apill,.law-grid .apill,.feat,.stage,.deck .stage){background:var(--brand-raised);border-color:var(--brand-line)}
body:not(.rebrand-home) .stage:hover{background:var(--brand-soft)}
body:not(.rebrand-home) :is(.chip,.chip--dev,.chip--paused){color:var(--brand-secondary);border-color:var(--brand-border)}
body:not(.rebrand-home) .chip--live{background:var(--brand-soft)}
body:not(.rebrand-home) :is(.chip--live,.chip--pilot,.chip--testing,.chip--internal)::before{background:var(--brand-secondary)}
body:not(.rebrand-home) .chip--paused::before{background:transparent;border-color:var(--brand-secondary)}
body:not(.rebrand-home) .chip--ai{background:var(--brand-ink);color:var(--brand-on-button);border-color:var(--brand-ink)}
body:not(.rebrand-home) .chip--ai::before{background:var(--brand-on-button)}
body:not(.rebrand-home) :is(.bsys-list li,.how-list li,.level-ex li,.feat)::before{border-color:var(--brand-secondary)}
body:not(.rebrand-home) :is(.section-dark,.section-light,.section-tint) .snum{color:var(--brand-muted)}

/* Pair each CTA fill with its own text color, independent of legacy tokens. */
body:not(.rebrand-home) main .btn-gold{background:var(--brand-ink);color:var(--brand-on-button);border-color:var(--brand-ink);box-shadow:none}
body:not(.rebrand-home) main .btn-gold:hover{background:var(--brand-button-hover);color:var(--brand-on-button);border-color:var(--brand-button-hover)}
body:not(.rebrand-home) main .btn-ghost{background:transparent;color:var(--brand-ink);border-color:var(--brand-border-hover)}
body:not(.rebrand-home) main .btn-ghost:hover{background:var(--brand-soft);color:var(--brand-ink);border-color:var(--brand-ink)}
body:not(.rebrand-home) main :focus-visible{outline:2px solid var(--brand-focus);outline-offset:4px}

/* Inner-page forms use native controls and the same effective palette. */
body:not(.rebrand-home) .contact-form{background:var(--brand-raised);border-color:var(--brand-line);border-radius:18px}
body:not(.rebrand-home) :is(.apill,.case,.feat,.stage,.anchor,.value,.svc-row){border-radius:18px}
body:not(.rebrand-home) .field :is(input,textarea,select){border-radius:12px}
body:not(.rebrand-home) .field label{color:var(--brand-secondary)}
body:not(.rebrand-home) .field label .opt{color:var(--brand-muted)}
body:not(.rebrand-home) .field :is(input,textarea,select){background-color:var(--brand-soft);color:var(--brand-ink);border-color:var(--brand-border);border-radius:10px;color-scheme:inherit}
body:not(.rebrand-home) .field :is(input,textarea,select):focus{background-color:var(--brand-soft);border-color:var(--brand-focus);box-shadow:0 0 0 3px var(--brand-focus-wash);outline:2px solid var(--brand-focus);outline-offset:2px}
body:not(.rebrand-home) .field select{background-image:none;-webkit-appearance:auto;appearance:auto;padding-right:16px}
.field select option{background:var(--brand-raised);color:var(--brand-ink)}
body:not(.rebrand-home) .form-success{background:var(--brand-soft);border-color:var(--brand-border);color:var(--brand-ink)}
body:not(.rebrand-home) .form-success svg{stroke:var(--brand-focus)}
body:not(.rebrand-home) :is(.success-mailto,.form-note a){color:var(--brand-focus)}
body:not(.rebrand-home) .form-note{color:var(--brand-muted)}
.field input,.field textarea,.rebrand-contact-form input,.rebrand-contact-form textarea{caret-color:var(--brand-ink)}

/* Error feedback is explicit text; both effective themes retain contrast. */
:root{--surface-error:#a52b35}
:root[data-theme="dark"]{--surface-error:#ffb4ba}
@media(prefers-color-scheme:dark){:root:not([data-theme]){--surface-error:#ffb4ba}}
.field .err,.rebrand-contact-form .field .err{color:var(--surface-error)}
.field.invalid :is(input,textarea,select),.rebrand-contact-form .field.invalid :is(input,textarea){border-color:var(--surface-error)}
@media(max-width:880px){
  .field input,.field textarea,.field select,.rebrand-contact-form input,.rebrand-contact-form textarea{font-size:16px}
  body:not(.rebrand-home) .eng{border-color:var(--brand-line)}
}
body:not(.rebrand-home) :is(.section-dark,.contact) .lede{color:var(--brand-muted);opacity:1}
body:not(.rebrand-home) .field.invalid :is(input,textarea,select){border-color:var(--surface-error)}

/* Keep the accent on navigable text; headings, labels and CTA fills stay neutral. */
body:not(.rebrand-home) :is(.prose a,.legal-contactcard a,.legal-back a,.legal-toc a,.text-link,.rules-note a,.work-card .card-link a,.contact-direct a):not(.btn):not(.rebrand-button){color:var(--brand-link)}
body:not(.rebrand-home) :is(.prose a,.legal-contactcard a,.legal-back a,.legal-toc a,.text-link,.rules-note a,.work-card .card-link a,.contact-direct a):not(.btn):not(.rebrand-button):hover{text-decoration:underline;text-underline-offset:4px}
