/* ==========================================================================
   CAREKA DIGITAL · V124.1 PREMIUM CONTRAST MASTER
   Premium visibility / hierarchy / line system for Light + Dark
   ========================================================================== */

:root{
  --cd1241-radius-xs:8px;
  --cd1241-radius-sm:12px;
  --cd1241-radius-md:18px;
  --cd1241-radius-lg:26px;
  --cd1241-ease:cubic-bezier(.2,.8,.2,1);
}

html[data-careka-theme="light"]{
  color-scheme:light;

  --cd1241-canvas:#F4F0E7;
  --cd1241-canvas-alt:#ECE6DA;
  --cd1241-surface:#FFFDF8;
  --cd1241-surface-alt:#F6F1E8;
  --cd1241-surface-strong:#E8E0D4;

  --cd1241-text:#15120E;
  --cd1241-body:#342F29;
  --cd1241-muted:#5C544A;
  --cd1241-faint:#71675B;

  --cd1241-line:rgba(21,18,14,.18);
  --cd1241-line-strong:rgba(21,18,14,.30);
  --cd1241-line-gold:rgba(122,85,39,.42);

  --cd1241-gold:#7A5527;
  --cd1241-gold-hi:#66451F;
  --cd1241-gold-soft:rgba(122,85,39,.085);

  --cd1241-control:#FBF8F2;
  --cd1241-control-hover:#F0E9DE;
  --cd1241-overlay:rgba(21,18,14,.42);

  --cd1241-shadow-sm:0 10px 32px rgba(55,42,28,.08);
  --cd1241-shadow-md:0 22px 64px rgba(55,42,28,.13);
  --cd1241-shadow-lg:0 34px 100px rgba(55,42,28,.19);
}

html[data-careka-theme="dark"]{
  color-scheme:dark;

  --cd1241-canvas:#070707;
  --cd1241-canvas-alt:#0B0B0B;
  --cd1241-surface:#101010;
  --cd1241-surface-alt:#151515;
  --cd1241-surface-strong:#1C1C1C;

  --cd1241-text:#F5F1E9;
  --cd1241-body:#D8D2C9;
  --cd1241-muted:#B5ADA2;
  --cd1241-faint:#9D958A;

  --cd1241-line:rgba(245,241,233,.18);
  --cd1241-line-strong:rgba(245,241,233,.30);
  --cd1241-line-gold:rgba(211,162,93,.42);

  --cd1241-gold:#D3A25D;
  --cd1241-gold-hi:#E3B975;
  --cd1241-gold-soft:rgba(211,162,93,.10);

  --cd1241-control:#111111;
  --cd1241-control-hover:#1A1A1A;
  --cd1241-overlay:rgba(0,0,0,.68);

  --cd1241-shadow-sm:0 10px 32px rgba(0,0,0,.28);
  --cd1241-shadow-md:0 22px 64px rgba(0,0,0,.38);
  --cd1241-shadow-lg:0 34px 100px rgba(0,0,0,.52);
}

/* --------------------------------------------------------------------------
   1 · FOUNDATION / VISIBILITY FLOOR
   -------------------------------------------------------------------------- */
html[data-careka-theme],
html[data-careka-theme] body{
  background:var(--cd1241-canvas)!important;
  color:var(--cd1241-text)!important;
}

html[data-careka-theme] body :where(
  h1,h2,h3,h4,h5,h6,strong,b,legend,th
){
  color:var(--cd1241-text)!important;
  text-shadow:none!important;
}

html[data-careka-theme] body :where(
  p,li,dd,dt,figcaption,label,td
){
  color:var(--cd1241-body)!important;
  text-shadow:none!important;
}

html[data-careka-theme] body :where(
  small,.muted,.meta,.eyebrow,.kicker,.section-index,
  [class*="eyebrow"],[class*="kicker"],[class*="label"],[class*="meta"]
){
  color:var(--cd1241-muted)!important;
}

/*
 * Historical motion/theme layers left several pieces of copy with very low
 * opacity. Keep decorative aria-hidden items out, but make human information
 * fully legible everywhere.
 */
html[data-careka-theme] body :where(
  main,section,article,aside,nav,header,footer,dialog,
  .panel,.card,.service-dialog,.all-projects-dialog,
  .cd-privacy-modal__panel,.cd123-popover
) :where(
  h1,h2,h3,h4,h5,h6,p,li,a,button,label,small,strong,b,em,
  summary,legend,th,td,
  span:not([aria-hidden="true"])
){
  opacity:1!important;
  filter:none!important;
  text-shadow:none!important;
}

html[data-careka-theme] body :where(
  a,button,[role="button"],[role="tab"],summary,
  input,textarea,select
):focus-visible{
  outline:2px solid var(--cd1241-gold)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 4px var(--cd1241-gold-soft)!important;
}

/* --------------------------------------------------------------------------
   2 · ALL STRUCTURAL SURFACES
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  main,
  .scroll-scene,
  .hero-scene,
  .closing-scene,
  .page-section,
  .blogEditorial,
  .articlePage,
  .blogIndexPage,
  .ckContentBody,
  .careka-legal-page,
  .careka-legal-main,
  #portfolio,#pilares,#editorial,#sobre,#contato
){
  background-color:var(--cd1241-canvas)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line)!important;
}

/* Remove old dark cinematic islands only from structural background. */
html[data-careka-theme="light"] body.careka-v106-home :where(
  .scroll-scene,.hero-scene,.closing-scene
),
html[data-careka-theme="light"] body.careka-final-project :where(
  [data-cd121-role="project-hero"],
  main.container.hero > .panel.section:first-child,
  main.container > .panel.section:first-child
){
  background:var(--cd1241-canvas)!important;
  background-image:none!important;
  color:var(--cd1241-text)!important;
}

/* Dark mode stays intentionally deep, never gray/washed. */
html[data-careka-theme="dark"] body :where(
  .scroll-scene,.hero-scene,.closing-scene
){
  background:var(--cd1241-canvas)!important;
  background-image:none!important;
}

/* --------------------------------------------------------------------------
   3 · HEADERS / NAVIGATION / MEGA MENU
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  .site-header,.site-header.is-scrolled,
  .ck-header-v75,.ck-header-v75.is-scrolled,
  .topbar,.topbar.is-scrolled,
  .careka-legal-header
){
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-bottom:1px solid var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-sm)!important;
  backdrop-filter:blur(18px) saturate(1.05)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.05)!important;
}

html[data-careka-theme] body :where(
  .site-header,.ck-header-v75,.topbar,.careka-legal-header
) :where(
  a,button,strong,b,.brand-copy strong,.brandtxt b,.ck-brand__text b
){
  color:var(--cd1241-text)!important;
}

html[data-careka-theme] body :where(
  .site-header,.ck-header-v75,.topbar,.careka-legal-header
) :where(
  small,.brand-copy small,.brandtxt small,.ck-brand__text small
){
  color:var(--cd1241-muted)!important;
}

html[data-careka-theme] body :where(
  .site-menu,.ck-mega-v75,.mega-menu
){
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-lg)!important;
}

html[data-careka-theme] body :where(
  .site-menu,.ck-mega-v75,.mega-menu
) :where(
  h1,h2,h3,h4,strong,b,a
){
  color:var(--cd1241-text)!important;
}

html[data-careka-theme] body :where(
  .site-menu,.ck-mega-v75,.mega-menu
) :where(
  p,small,span
){
  color:var(--cd1241-body)!important;
}

/* --------------------------------------------------------------------------
   4 · PANELS / CARDS / DETAILS / ACCORDIONS
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  .panel,.card,
  .service-card,.service-details,
  .project-card,.project-slide,
  .story-layer,.pillar-card,.pillar-layer,
  .stat,.deliver,
  .ck-v75-card,.ck-v75-menu-card,
  .ckPostCard,.ckSidebarBox,.ckAnswerBox,.ckInsightBox,.ckInsightBlock,
  .ckDirectBox,.ckChecklist,.ckContentPanel,.ckAsideCard,
  .careka-legal-card,.careka-legal-contact,
  details
){
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line)!important;
}

html[data-careka-theme] body :where(
  .panel,.card,.service-card,.project-card,
  .ck-v75-card,.ckPostCard,.ckSidebarBox,.ckContentPanel,.ckAsideCard
):hover{
  border-color:var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-sm)!important;
}

html[data-careka-theme] body details > summary{
  background:var(--cd1241-control)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body details[open] > summary{
  background:var(--cd1241-gold-soft)!important;
  border-color:var(--cd1241-line-gold)!important;
}

/* --------------------------------------------------------------------------
   5 · LAYOUT LINES / DIVIDERS / GRID VISIBILITY
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  hr,.divider,.separator,.rule,
  [class*="divider"],[class*="separator"]
){
  opacity:1!important;
  border-color:var(--cd1241-line-strong)!important;
  background-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body :where(
  .section-index,.stage-clock,.editorial-label-row,
  .project-meta,.project-footer,.service-card,.pillar-nav,
  .careka-global-footer__bottom,.careka-global-footer__legal,
  .ckEditorialFooter__bottom,.menu-guide,.menu-diagnostic
){
  border-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme="light"] body.careka-v106-home :where(
  .stage-grid,.hero-grid
){
  opacity:.24!important;
}

html[data-careka-theme="dark"] body.careka-v106-home :where(
  .stage-grid,.hero-grid
){
  opacity:.36!important;
}

html[data-careka-theme] body.careka-v106-home .section-index>span:first-child::after{
  background:var(--cd1241-gold)!important;
  opacity:1!important;
}

/* --------------------------------------------------------------------------
   6 · MODALS / DIALOGS / POPOVERS — PERFECT READABILITY
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  dialog,
  .service-dialog,
  .all-projects-dialog,
  .cd-privacy-modal__panel,
  .cd123-popover,
  [role="dialog"],[role="alertdialog"],[role="listbox"]
){
  background:var(--cd1241-surface)!important;
  background-image:none!important;
  color:var(--cd1241-text)!important;
  border:1px solid var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-lg)!important;
}

html[data-careka-theme] body :where(
  .service-dialog,.all-projects-dialog,.cd-privacy-modal__panel,.cd123-popover,
  [role="dialog"]
) :where(
  h1,h2,h3,h4,h5,h6,strong,b
){
  color:var(--cd1241-text)!important;
  opacity:1!important;
}

html[data-careka-theme] body :where(
  .service-dialog,.all-projects-dialog,.cd-privacy-modal__panel,.cd123-popover,
  [role="dialog"]
) :where(
  p,li,small,span,label
){
  color:var(--cd1241-body)!important;
  opacity:1!important;
}

html[data-careka-theme] body :where(
  .service-dialog__close,
  .dialog-close,
  .all-projects-dialog__close,
  .cd-privacy-modal__close,
  [aria-label*="Fechar"],
  [aria-label*="Close"]
){
  background:var(--cd1241-control)!important;
  color:var(--cd1241-text)!important;
  border:1px solid var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body :where(
  .dialog-section,.service-dialog__section,.cd-privacy-category,
  .all-projects-dialog article
){
  background:var(--cd1241-surface-alt)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line)!important;
}

html[data-careka-theme] body :where(
  .cd-privacy-modal,.dialog-backdrop,.modal-backdrop,.menu-overlay
){
  background:var(--cd1241-overlay)!important;
}

html[data-careka-theme] body dialog::backdrop{
  background:var(--cd1241-overlay)!important;
  backdrop-filter:blur(3px)!important;
}

/* --------------------------------------------------------------------------
   7 · FORMS / TABLES / INTERACTIVE CONTROLS
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,select
){
  background:var(--cd1241-control)!important;
  color:var(--cd1241-text)!important;
  border:1px solid var(--cd1241-line-strong)!important;
  caret-color:var(--cd1241-text)!important;
  opacity:1!important;
}

html[data-careka-theme] body :where(input,textarea)::placeholder{
  color:var(--cd1241-faint)!important;
  opacity:1!important;
}

html[data-careka-theme] body :where(
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,select
):hover{
  border-color:var(--cd1241-line-gold)!important;
}

html[data-careka-theme] body :where(
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,select
):focus{
  border-color:var(--cd1241-gold)!important;
  box-shadow:0 0 0 4px var(--cd1241-gold-soft)!important;
}

html[data-careka-theme] body table{
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body :where(table,thead,tbody,tr,th,td){
  border-color:var(--cd1241-line)!important;
}

html[data-careka-theme] body th{
  background:var(--cd1241-surface-alt)!important;
  color:var(--cd1241-text)!important;
}

html[data-careka-theme] body tbody tr:hover{
  background:var(--cd1241-gold-soft)!important;
}

/* --------------------------------------------------------------------------
   8 · CTAs / BUTTONS / ICONS
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  .btnP,.button-primary,.primary-button,
  .cd-privacy-btn--primary,
  .ck-v75-btn--gold,.ck-v75-btn--whatsapp
){
  background:var(--cd1241-gold)!important;
  border-color:var(--cd1241-gold)!important;
}

html[data-careka-theme="light"] body :where(
  .btnP,.button-primary,.primary-button,
  .cd-privacy-btn--primary,.ck-v75-btn--gold,.ck-v75-btn--whatsapp
){
  color:#FFFDF8!important;
}

html[data-careka-theme="dark"] body :where(
  .btnP,.button-primary,.primary-button,
  .cd-privacy-btn--primary,.ck-v75-btn--gold,.ck-v75-btn--whatsapp
){
  color:#080808!important;
}

html[data-careka-theme] body :where(
  button,a,[role="button"],[role="tab"],summary
) svg:not([data-preserve-color]){
  color:currentColor!important;
  stroke:currentColor;
  opacity:1!important;
}

html[data-careka-theme] body :where(
  .cd123-option-icon,.cd123-option-check,
  .icon,.menu-icon,.arrow-icon
){
  color:var(--cd1241-gold)!important;
}

/* --------------------------------------------------------------------------
   9 · PROJECT CASES — NO DARK HERO / HEADER IN LIGHT
   -------------------------------------------------------------------------- */
html[data-careka-theme] body.careka-final-project :where(
  [data-cd121-role="project-hero"],
  main.container.hero > .panel.section:first-child,
  main.container > .panel.section:first-child
){
  background:var(--cd1241-surface)!important;
  background-image:none!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-md)!important;
}

html[data-careka-theme] body.careka-final-project :where(
  [data-cd121-role="project-hero"],
  main.container.hero > .panel.section:first-child,
  main.container > .panel.section:first-child
) :where(
  .title,h1,h2,h3,h4,h5,h6,strong,.stat b
){
  color:var(--cd1241-text)!important;
  opacity:1!important;
}

html[data-careka-theme] body.careka-final-project :where(
  [data-cd121-role="project-hero"],
  main.container.hero > .panel.section:first-child,
  main.container > .panel.section:first-child
) :where(
  .lead,.lead p,p,li,small,.deliver span,.stat span
){
  color:var(--cd1241-body)!important;
  opacity:1!important;
}

/* --------------------------------------------------------------------------
   10 · BLOG / ARTICLE / CONTENT / LEGAL
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  .ckArticleProse,.ckContentText,.careka-legal-content,
  .ckPostCard,.ckSidebarBox,.ckAnswerBox,.ckInsightBox,
  .ckInsightBlock,.ckDirectBox,.ckChecklist,.ckMidCta,
  .ckContentPanel,.ckAsideCard,
  [data-cd121-role="article-final-cta"]
){
  background:var(--cd1241-surface)!important;
  background-image:none!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line)!important;
}

html[data-careka-theme] body blockquote{
  background:var(--cd1241-surface-alt)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-gold)!important;
}

/* --------------------------------------------------------------------------
   11 · FOOTER — LIGHT REALLY LIGHT, DARK REALLY DARK
   Highest CSS specificity to supersede V121.1 permanent-dark styles.
   -------------------------------------------------------------------------- */
html[data-careka-theme="light"] body footer,
html[data-careka-theme="light"] body footer.careka-global-footer,
html[data-careka-theme="light"] body .careka-global-footer,
html[data-careka-theme="light"] body .ckEditorialFooter,
html[data-careka-theme="light"] body .case-site-foot,
html[data-careka-theme="light"] body .site-footer{
  background:#ECE6DA!important;
  background-image:none!important;
  color:#15120E!important;
  border-color:rgba(21,18,14,.22)!important;
}

html[data-careka-theme="light"] body :where(
  footer,.careka-global-footer,.ckEditorialFooter,.case-site-foot,.site-footer
) :where(
  h1,h2,h3,h4,strong,b,a,button
){
  color:#15120E!important;
  opacity:1!important;
}

html[data-careka-theme="light"] body :where(
  footer,.careka-global-footer,.ckEditorialFooter,.case-site-foot,.site-footer
) :where(
  p,small,span
){
  color:#5C544A!important;
  opacity:1!important;
}

html[data-careka-theme="dark"] body footer,
html[data-careka-theme="dark"] body footer.careka-global-footer,
html[data-careka-theme="dark"] body .careka-global-footer,
html[data-careka-theme="dark"] body .ckEditorialFooter,
html[data-careka-theme="dark"] body .case-site-foot,
html[data-careka-theme="dark"] body .site-footer{
  background:#0B0B0B!important;
  background-image:none!important;
  color:#F5F1E9!important;
  border-color:rgba(245,241,233,.18)!important;
}

html[data-careka-theme="dark"] body :where(
  footer,.careka-global-footer,.ckEditorialFooter,.case-site-foot,.site-footer
) :where(
  h1,h2,h3,h4,strong,b,a,button
){
  color:#F5F1E9!important;
  opacity:1!important;
}

html[data-careka-theme="dark"] body :where(
  footer,.careka-global-footer,.ckEditorialFooter,.case-site-foot,.site-footer
) :where(
  p,small,span
){
  color:#B5ADA2!important;
  opacity:1!important;
}

/* --------------------------------------------------------------------------
   12 · LANGUAGE / THEME CONTROLS + DOCK
   -------------------------------------------------------------------------- */
html[data-careka-theme] body .cd123-footer-right,
html[data-careka-theme] body .cd123-footer-right.cd123-dock{
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
  box-shadow:var(--cd1241-shadow-md)!important;
}

html[data-careka-theme] body :where(
  .cd123-control,.cd123-option,.cd123-dock-peek
){
  background:var(--cd1241-control)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body :where(
  .cd123-control,.cd123-option,.cd123-dock-peek
):hover{
  background:var(--cd1241-control-hover)!important;
  border-color:var(--cd1241-line-gold)!important;
}

html[data-careka-theme] body .cd123-popover{
  background:var(--cd1241-surface)!important;
  color:var(--cd1241-text)!important;
  border-color:var(--cd1241-line-strong)!important;
}

html[data-careka-theme] body .cd123-option-copy strong{
  color:var(--cd1241-text)!important;
}

html[data-careka-theme] body :where(
  .cd123-option-copy small,.cd123-popover-title,.cd123-footer-tagline
){
  color:var(--cd1241-muted)!important;
}

/* --------------------------------------------------------------------------
   13 · MEDIA PRESERVATION
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  img,picture,video,canvas,
  .media,.project-media,.story-visual,.hero-media,.hero-video,
  .portfolio-media,.case-media,.image-wrap,.video-wrap
){
  filter:none!important;
}

/* --------------------------------------------------------------------------
   14 · V124.1 RUNTIME CONTRACT ATTRIBUTES
   -------------------------------------------------------------------------- */
html[data-careka-theme="light"] body [data-cd1241-surface="light"]{
  background:#FFFDF8!important;
  background-image:none!important;
  color:#15120E!important;
  border-color:rgba(21,18,14,.18)!important;
}

html[data-careka-theme="dark"] body [data-cd1241-surface="dark"]{
  background:#101010!important;
  background-image:none!important;
  color:#F5F1E9!important;
  border-color:rgba(245,241,233,.18)!important;
}

html[data-careka-theme] body [data-cd1241-fg="dark"]{
  color:#15120E!important;
  opacity:1!important;
  text-shadow:none!important;
}

html[data-careka-theme] body [data-cd1241-fg="light"]{
  color:#F5F1E9!important;
  opacity:1!important;
  text-shadow:none!important;
}

/* --------------------------------------------------------------------------
   15 · MOBILE / REDUCED MOTION
   -------------------------------------------------------------------------- */
@media(max-width:760px){
  html[data-careka-theme] body :where(
    button,[role="button"],[role="tab"],summary,
    .cd123-control,.cd123-option
  ){
    min-height:42px;
  }

  html[data-careka-theme] body :where(
    dialog,.service-dialog,.all-projects-dialog,.cd-privacy-modal__panel
  ){
    max-width:calc(100vw - 20px)!important;
  }
}

@media(prefers-reduced-motion:reduce){
  html[data-careka-theme] body *,
  html[data-careka-theme] body *::before,
  html[data-careka-theme] body *::after{
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    scroll-behavior:auto!important;
  }
}