/* ==========================================================================
   CAREKA DIGITAL · V124 PREMIUM DUAL THEME SYSTEM
   Full light + full dark parity · Advanced UX/UI contrast architecture
   ========================================================================== */

:root{
  --cd124-accent:#d3a25d;
  --cd124-radius-xs:8px;
  --cd124-radius-sm:12px;
  --cd124-radius-md:18px;
  --cd124-radius-lg:26px;
  --cd124-focus:0 0 0 3px rgba(211,162,93,.22);
  --cd124-ease:cubic-bezier(.2,.8,.2,1);
}

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

  --cd124-canvas:#f6f2e9;
  --cd124-canvas-2:#eee8dd;
  --cd124-surface:#fffdf8;
  --cd124-surface-2:#f3ede3;
  --cd124-surface-3:#e8e0d4;
  --cd124-text:#17140f;
  --cd124-body:#39342f;
  --cd124-muted:#625b52;
  --cd124-faint:#756c61;
  --cd124-line:rgba(23,20,15,.13);
  --cd124-line-strong:rgba(23,20,15,.22);
  --cd124-accent:#7a5527;
  --cd124-accent-2:#6b461e;
  --cd124-accent-soft:rgba(122,85,39,.08);
  --cd124-control:#fbf8f2;
  --cd124-control-hover:#f1e9dd;
  --cd124-overlay:rgba(23,20,15,.34);
  --cd124-shadow-sm:0 10px 30px rgba(58,45,31,.075);
  --cd124-shadow-md:0 20px 60px rgba(58,45,31,.11);
  --cd124-shadow-lg:0 30px 90px rgba(58,45,31,.16);
  --cd124-selection:#7a5527;
  --cd124-selection-text:#fffdf8;
}

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

  --cd124-canvas:#080808;
  --cd124-canvas-2:#0c0c0c;
  --cd124-surface:#0f0f0f;
  --cd124-surface-2:#141414;
  --cd124-surface-3:#1a1a1a;
  --cd124-text:#f4f0e8;
  --cd124-body:#d7d1c8;
  --cd124-muted:#b4aca2;
  --cd124-faint:#9a9288;
  --cd124-line:rgba(244,240,232,.14);
  --cd124-line-strong:rgba(244,240,232,.24);
  --cd124-accent:#d3a25d;
  --cd124-accent-2:#e3b975;
  --cd124-accent-soft:rgba(211,162,93,.10);
  --cd124-control:#111111;
  --cd124-control-hover:#181818;
  --cd124-overlay:rgba(0,0,0,.62);
  --cd124-shadow-sm:0 10px 30px rgba(0,0,0,.26);
  --cd124-shadow-md:0 20px 60px rgba(0,0,0,.34);
  --cd124-shadow-lg:0 30px 90px rgba(0,0,0,.46);
  --cd124-selection:#d3a25d;
  --cd124-selection-text:#080808;
}

/* --------------------------------------------------------------------------
   1. GLOBAL FOUNDATION
   -------------------------------------------------------------------------- */
html[data-careka-theme]{
  background:var(--cd124-canvas)!important;
  color:var(--cd124-text)!important;
}

html[data-careka-theme] body{
  background:var(--cd124-canvas)!important;
  color:var(--cd124-text)!important;
}

html[data-careka-theme] body::selection,
html[data-careka-theme] body *::selection{
  background:var(--cd124-selection)!important;
  color:var(--cd124-selection-text)!important;
}

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

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

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

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

/* Kill historical low-opacity copy states. */
html[data-careka-theme] body :where(
  h1,h2,h3,h4,h5,h6,p,li,a,button,label,small,strong,span,
  input,textarea,select,summary,th,td
){
  filter:none!important;
}

html[data-careka-theme] body :where(
  [aria-current="page"],
  [aria-current="true"],
  [aria-selected="true"],
  [aria-checked="true"],
  details[open] > summary
){
  opacity:1!important;
}

/* --------------------------------------------------------------------------
   2. FULL CANVAS CONTRACT
   No intentionally dark island remains in light mode; no light island remains
   in dark mode. Media itself is excluded below.
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  main,
  .scroll-scene,
  .hero-scene,
  .closing-scene,
  .section,
  .section-shell,
  .page-section,
  .blogEditorial,
  .articlePage,
  .blogIndexPage,
  .ckContentBody,
  .careka-legal-main,
  .careka-legal-page,
  #portfolio,
  #pilares,
  #editorial,
  #sobre,
  #contato
){
  background-color:var(--cd124-canvas)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
}

html[data-careka-theme="light"] body.careka-v106-home :where(
  .scroll-scene,
  .hero-scene,
  .closing-scene
){
  background:var(--cd124-canvas)!important;
}

html[data-careka-theme="dark"] body.careka-v106-home :where(
  .scroll-scene,
  .hero-scene,
  .closing-scene
){
  background:var(--cd124-canvas)!important;
}

/* V121 deliberate dark/light islands are intentionally neutralized in V124. */
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
),
html[data-careka-theme] body :where(
  [data-cd121-role="article-final-cta"],
  .ckEditorialCta,
  .ckMidCta
){
  background:var(--cd124-surface)!important;
  background-image:none!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
  box-shadow:var(--cd124-shadow-md)!important;
}

/* --------------------------------------------------------------------------
   3. HEADERS + NAVIGATION + MEGA MENUS
   -------------------------------------------------------------------------- */
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:color-mix(in srgb,var(--cd124-surface) 94%,transparent)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
  box-shadow:var(--cd124-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(--cd124-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(--cd124-muted)!important;
}

html[data-careka-theme] body :where(
  .menu-toggle,.ck-menu-toggle-v75
),
html[data-careka-theme] body :where(
  .menu-toggle span,.ck-menu-toggle-v75 span
){
  color:var(--cd124-text)!important;
  border-color:var(--cd124-text)!important;
}

html[data-careka-theme] body :where(
  .site-menu,
  .ck-mega-v75,
  .mega-menu,
  [role="menu"]
){
  background:var(--cd124-surface)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
  box-shadow:var(--cd124-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(--cd124-text)!important;
}

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

/* --------------------------------------------------------------------------
   4. SURFACES / CARDS / PANELS / ACCORDIONS / DETAILS
   -------------------------------------------------------------------------- */
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,
  .cd-privacy-category,
  details
){
  background-color:var(--cd124-surface)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
  box-shadow:none!important;
}

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

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

html[data-careka-theme] body details[open] > summary{
  background:var(--cd124-accent-soft)!important;
  border-color:color-mix(in srgb,var(--cd124-accent) 42%,var(--cd124-line))!important;
}

html[data-careka-theme] body :where(
  .tag,.badge,.chip,[class*="badge"],[class*="chip"]
){
  background:var(--cd124-accent-soft)!important;
  color:var(--cd124-accent-2)!important;
  border-color:color-mix(in srgb,var(--cd124-accent) 30%,transparent)!important;
}

/* --------------------------------------------------------------------------
   5. DIALOGS / MODALS / POPOVERS / OVERLAYS
   -------------------------------------------------------------------------- */
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(--cd124-surface)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line-strong)!important;
  box-shadow:var(--cd124-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(--cd124-text)!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(--cd124-body)!important;
}

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

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

/* --------------------------------------------------------------------------
   6. FORMS + CONTROLS + TABLES
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select
){
  background:var(--cd124-control)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line-strong)!important;
  caret-color:var(--cd124-text)!important;
  box-shadow:none!important;
}

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

html[data-careka-theme] body :where(
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select
):hover{
  border-color:color-mix(in srgb,var(--cd124-accent) 42%,var(--cd124-line))!important;
}

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

html[data-careka-theme] body :where(
  button,
  [role="button"],
  [role="tab"],
  .btn,
  .button
):not(.btnP):not(.cd-privacy-btn--primary):not(.ck-v75-btn--gold):not(.ck-v75-btn--whatsapp){
  border-color:var(--cd124-line-strong)!important;
}

html[data-careka-theme] body :where(
  button,
  [role="button"],
  [role="tab"]
):disabled{
  color:var(--cd124-faint)!important;
  opacity:.58!important;
  cursor:not-allowed!important;
}

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

html[data-careka-theme] body :where(
  table
){
  background:var(--cd124-surface)!important;
  color:var(--cd124-text)!important;
}

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

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

/* --------------------------------------------------------------------------
   7. CTA / PRIMARY ACTIONS
   -------------------------------------------------------------------------- */
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(--cd124-accent)!important;
  border-color:var(--cd124-accent)!important;
  color:var(--cd124-selection-text)!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;
}

/* --------------------------------------------------------------------------
   8. HOME — FULL LIGHT/FULL DARK PARITY
   -------------------------------------------------------------------------- */
html[data-careka-theme] body.careka-v106-home :where(
  .hero-copy,
  .hero-content,
  .about-copy,
  .closing-copy,
  .contact-copy,
  .servicesIntro,
  .editorialHeader
) :where(
  h1,h2,h3,h4,strong,b
){
  color:var(--cd124-text)!important;
}

html[data-careka-theme] body.careka-v106-home :where(
  .hero-copy,
  .hero-content,
  .about-copy,
  .closing-copy,
  .contact-copy,
  .servicesIntro,
  .editorialHeader
) :where(
  p,li,small,span
){
  color:var(--cd124-body)!important;
}

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

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

/* --------------------------------------------------------------------------
   9. PROJECT CASES — LIGHT HERO REALLY 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,
  .topbar,
  .topbar.is-scrolled
) :where(
  .title,h1,h2,h3,h4,h5,h6,strong,.stat b,.brandtxt b,.backlink,a,button
){
  color:var(--cd124-text)!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,
  .topbar,
  .topbar.is-scrolled
) :where(
  .lead,.lead p,p,li,small,.deliver span,.stat span,.brandtxt small,span
){
  color:var(--cd124-body)!important;
}

html[data-careka-theme] body.careka-final-project :where(
  .topbar,.topbar.is-scrolled
){
  background:color-mix(in srgb,var(--cd124-surface) 96%,transparent)!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
){
  background-color:var(--cd124-surface)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
}

html[data-careka-theme] body :where(
  .ckArticleProse,
  .ckContentText,
  .careka-legal-content
) :where(
  p,li,dd,dt
){
  color:var(--cd124-body)!important;
}

html[data-careka-theme] body blockquote{
  background:var(--cd124-surface-2)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-accent)!important;
}

/* --------------------------------------------------------------------------
   11. FOOTERS — NO PERMANENT DARK LOCK IN LIGHT MODE
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  footer,
  .careka-global-footer,
  .ckEditorialFooter,
  .case-site-foot
){
  background:var(--cd124-surface-2)!important;
  background-image:none!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
}

html[data-careka-theme] body :where(
  footer,
  .careka-global-footer,
  .ckEditorialFooter,
  .case-site-foot
) :where(
  h1,h2,h3,h4,strong,b,a,button
){
  color:var(--cd124-text)!important;
}

html[data-careka-theme] body :where(
  footer,
  .careka-global-footer,
  .ckEditorialFooter,
  .case-site-foot
) :where(
  p,small,span
){
  color:var(--cd124-muted)!important;
}

/* --------------------------------------------------------------------------
   12. LANGUAGE + APPEARANCE CONTROLS / OPTIONAL DOCK
   -------------------------------------------------------------------------- */
html[data-careka-theme] body .cd123-footer-right,
html[data-careka-theme] body .cd123-footer-right.cd123-dock{
  background:color-mix(in srgb,var(--cd124-surface) 96%,transparent)!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line-strong)!important;
  box-shadow:var(--cd124-shadow-md)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}

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

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

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

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

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

/* --------------------------------------------------------------------------
   13. ICONS + SVG
   -------------------------------------------------------------------------- */
html[data-careka-theme] body :where(
  button,a,[role="button"],[role="tab"],summary
) svg:not([data-preserve-color]){
  color:currentColor!important;
  stroke:currentColor;
}

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

/* --------------------------------------------------------------------------
   14. MEDIA PRESERVATION
   Structural theme contracts must not wash out photography/video.
   -------------------------------------------------------------------------- */
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;
  opacity:1;
}

/* --------------------------------------------------------------------------
   15. RUNTIME FALLBACK ATTRIBUTES
   JS only applies these when a legacy surface violates the active theme.
   -------------------------------------------------------------------------- */
html[data-careka-theme="light"] body [data-cd124-surface="light"]{
  background:var(--cd124-surface)!important;
  background-image:none!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
}

html[data-careka-theme="dark"] body [data-cd124-surface="dark"]{
  background:var(--cd124-surface)!important;
  background-image:none!important;
  color:var(--cd124-text)!important;
  border-color:var(--cd124-line)!important;
}

html[data-careka-theme] body [data-cd124-fg="dark"]{
  color:#17140f!important;
  text-shadow:none!important;
}

html[data-careka-theme] body [data-cd124-fg="light"]{
  color:#f4f0e8!important;
  text-shadow:none!important;
}

/* Neutralize prior V121 auto-contrast only when V124 has a stronger decision. */
html[data-careka-theme] body [data-cd124-fg][data-cd-contrast-auto]{
  color:inherit;
}

/* --------------------------------------------------------------------------
   16. SCROLLBARS + POLISH
   -------------------------------------------------------------------------- */
html[data-careka-theme]{
  scrollbar-color:var(--cd124-line-strong) var(--cd124-canvas);
}

html[data-careka-theme] body *{
  scrollbar-color:var(--cd124-line-strong) transparent;
}

html[data-careka-theme] body :where(
  .panel,.card,.service-card,.project-card,
  .ckPostCard,.ckContentPanel,.ckAsideCard,
  dialog,.cd123-popover,.cd-privacy-modal__panel
){
  transition:
    background-color .28s var(--cd124-ease),
    color .28s var(--cd124-ease),
    border-color .28s var(--cd124-ease),
    box-shadow .28s var(--cd124-ease);
}

/* --------------------------------------------------------------------------
   17. MOBILE / TOUCH
   -------------------------------------------------------------------------- */
@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;
  }
}