:root {
  --stagger-dur: 500ms;
  --stagger-distance: 12px;
  --stagger-stagger: 40ms;
  --stagger-blur: 3px;
  --stagger-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lines start translated down + blurred + invisible; .is-shown
   on the parent flips them to their resting state. The second
   line's transition-delay holds it back by --stagger-stagger
   so the eye lands on the headline first. */
.t-stagger-line {
  display: block;
  opacity: 0;
  transform: translateY(var(--stagger-distance));
  filter: blur(var(--stagger-blur));
  transition:
    opacity   var(--stagger-dur) var(--stagger-ease),
    transform var(--stagger-dur) var(--stagger-ease),
    filter    var(--stagger-dur) var(--stagger-ease);
  will-change: transform, opacity, filter;
}
.t-stagger-line--2 { transition-delay: var(--stagger-stagger); }

.t-stagger.is-shown .t-stagger-line {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
/* Exit decouples from the stagger: same fade for every line,
   no Y return, no blur — so the disappearance reads as a
   single quiet fade instead of a reverse reveal. */
.t-stagger.is-hiding .t-stagger-line {
  opacity: 0;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 200ms ease,
    transform 0s linear,
    filter 0s linear;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .t-stagger-line { transition: none !important; }
}

:root {
  --acc-expand: 250ms;
  --acc-collapse: 250ms;
  --acc-chevron: 250ms;
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* grid-template-rows 0fr → 1fr gives a clean height animation
   with no JS measurement; the inner element clips overflow. */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
/* Flip the chevron vertically to turn the "v" into a "^".
   scaleY(-1) about the centre passes through a flat line at
   the midpoint (same look as a `d:` path morph) but animates
   in every browser, unlike CSS `d:` morphing (Chromium only).
   The chevron path is symmetric about the 16x16 viewBox
   centre, so the flip lands exactly on the "^"; non-scaling
   -stroke keeps the stroke width constant through the flip. */
.t-acc-chevron {
  display: inline-flex;
  transform: scaleY(1);
  transform-origin: center;
  transition: transform var(--acc-chevron) var(--acc-ease);
}
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron {
  transform: scaleY(-1);
}

@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}

:root {
  --stagger-dur: 500ms;
  --stagger-distance: 12px;
  --stagger-stagger: 40ms;
  --stagger-blur: 3px;
  --stagger-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lines start translated down + blurred + invisible; .is-shown
   on the parent flips them to their resting state. The second
   line's transition-delay holds it back by --stagger-stagger
   so the eye lands on the headline first. */
.t-stagger-line {
  display: block;
  opacity: 0;
  transform: translateY(var(--stagger-distance));
  filter: blur(var(--stagger-blur));
  transition:
    opacity   var(--stagger-dur) var(--stagger-ease),
    transform var(--stagger-dur) var(--stagger-ease),
    filter    var(--stagger-dur) var(--stagger-ease);
  will-change: transform, opacity, filter;
}
.t-stagger-line--2 { transition-delay: var(--stagger-stagger); }

.t-stagger.is-shown .t-stagger-line {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
/* Exit decouples from the stagger: same fade for every line,
   no Y return, no blur — so the disappearance reads as a
   single quiet fade instead of a reverse reveal. */
.t-stagger.is-hiding .t-stagger-line {
  opacity: 0;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 200ms ease,
    transform 0s linear,
    filter 0s linear;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .t-stagger-line { transition: none !important; }
}

:root {
  --acc-expand: 250ms;
  --acc-collapse: 250ms;
  --acc-chevron: 250ms;
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* grid-template-rows 0fr → 1fr gives a clean height animation
   with no JS measurement; the inner element clips overflow. */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
/* Flip the chevron vertically to turn the "v" into a "^".
   scaleY(-1) about the centre passes through a flat line at
   the midpoint (same look as a `d:` path morph) but animates
   in every browser, unlike CSS `d:` morphing (Chromium only).
   The chevron path is symmetric about the 16x16 viewBox
   centre, so the flip lands exactly on the "^"; non-scaling
   -stroke keeps the stroke width constant through the flip. */
.t-acc-chevron {
  display: inline-flex;
  transform: scaleY(1);
  transform-origin: center;
  transition: transform var(--acc-chevron) var(--acc-ease);
}
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron {
  transform: scaleY(-1);
}

@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}

/* Indigo controls and neutral cards; orange proof never changes to indigo. */
body:is(.brand-services,.brand-services-home) {
  --motion-fast: 180ms;
  --motion-panel: 250ms;
  --motion-ease: cubic-bezier(.22,1,.36,1);
  --stagger-blur: 0px;
}
body.brand-services :is(.btn,.faq-question,.nav-dropdown-menu a),
body.brand-services-home :is(.button,.text-link,.menu-link,.process-tab,.industry-tabs button,.wp-cta,.service-drawer summary) {
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
body.brand-services :is(.process-card,.deliverable-card,.highlight-card,.implementation-card,.service-card,.use-case-card,.lc-tech-card,.lc-feature-item,.lc-deliverable-item,.process-step-card,.lc-diagram),
body.brand-services-home :is(.core-service,.research-card,.trust-strip>a,.hero-framework,.stats>div) {
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, transform var(--motion-panel) var(--motion-ease);
}
body.brand-services :is(.process-number,.step-number),
body.brand-services-home .stats strong {
  display: block;
  transition: transform var(--motion-panel) var(--motion-ease);
}
body.brand-services .service-faq .faq-question:focus-visible,
body.brand-services-home .service-drawer summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
body.brand-services :is(.deliverable-card,.service-card,.lc-tech-card):focus-within,
body.brand-services-home .research-card:focus-within { border-color: var(--brand); box-shadow: 0 4px 16px rgba(32,32,40,.06); }

@media (hover: hover) and (pointer: fine) {
  /* Numbered cards keep their orange text on the warm neutral surface. */
  body.brand-services :is(.process-card,.process-step-card):hover { border-color: var(--signal); box-shadow: 0 6px 18px rgba(32,32,40,.06); transform: translateY(-3px); }
  body.brand-services .process-card:hover .process-number,
  body.brand-services .process-step-card:hover .step-number,
  body.brand-services-home .stats>div:hover strong { transform: translateY(-3px); }
  body.brand-services :is(.highlight-card,.implementation-card,.lc-diagram):hover { border-color: rgba(32,32,40,.36); box-shadow: 0 6px 18px rgba(32,32,40,.05); }
  body.brand-services :is(.deliverable-card,.service-card,.use-case-card,.lc-tech-card,.lc-feature-item,.lc-deliverable-item):hover {
    border-color: var(--brand); box-shadow: 0 6px 18px rgba(32,32,40,.06); transform: translateY(-3px);
  }
  body.brand-services :is(.deliverable-card:hover .deliverable-icon,.lc-tech-card:hover .lc-tech-card-icon) { color: var(--brand); border-color: var(--brand); }
  body.brand-services :is(.deliverable-card:hover .deliverable-icon i,.lc-tech-card:hover .lc-tech-card-icon i) { color: var(--brand); }
  body.brand-services .service-faq .faq-question:hover,
  body.brand-services-home .service-drawer summary:hover { color: var(--brand); background: rgba(81,92,162,.04); }
  body.brand-services-home .service-drawer summary:hover h3 { color: var(--brand); }
  body.brand-services-home :is(.research-card,.trust-strip>a):hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(32,32,40,.06); transform: translateY(-3px); }
  body.brand-services-home .hero-framework:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(32,32,40,.12); }
  body.brand-services :is(.btn-primary,.btn-outline):hover,
  body.brand-services-home :is(.button,.wp-cta):hover { box-shadow: 0 4px 12px rgba(32,32,40,.1); }
  body.brand-services .lc-diagram :is(.lc-pillar,.lc-hub-out,.lc-rag-source,.lc-rag-stage,.lc-stack-layer):hover { border-color: rgba(32,32,40,.4); box-shadow: 0 3px 10px rgba(32,32,40,.05); }
}

/* Diagram nodes keep their warm surface and dark labels. The small orange
   outline belongs to the diagram palette; diagrams in indigo CTAs stay neutral. */
body.brand-services .lc-diagram { --diagram-hover: var(--signal); }
body.brand-services .service-cta .lc-diagram { --diagram-hover: var(--ink); }
body.brand-services .lc-diagram :is(.lc-pillar,.lc-flow-node,.lc-cap,.lc-hub,.lc-spoke,.lc-hub-out,.lc-rag-source,.lc-rag-stage,.lc-stack-layer,.lc-pipeline-marker,.lc-loop-node-bubble,.lc-loop-center) {
  transition: translate var(--motion-panel) var(--motion-ease), border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
@media (hover: hover) and (pointer: fine) {
  body.brand-services .lc-diagram :is(.lc-pillar,.lc-flow-node,.lc-cap,.lc-hub,.lc-spoke,.lc-hub-out,.lc-rag-source,.lc-rag-stage,.lc-stack-layer,.lc-loop-center):hover,
  body.brand-services .lc-diagram .lc-pipeline-step:hover .lc-pipeline-marker,
  body.brand-services .lc-diagram .lc-loop-node:hover .lc-loop-node-bubble {
    background: var(--paper); border-color: var(--diagram-hover);
    box-shadow: 0 4px 12px rgba(32,32,40,.08); translate: 0 -2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.brand-services .lc-diagram :is(.lc-pillar,.lc-flow-node,.lc-cap,.lc-hub,.lc-spoke,.lc-hub-out,.lc-rag-source,.lc-rag-stage,.lc-stack-layer,.lc-pipeline-marker,.lc-loop-node-bubble,.lc-loop-center) { translate: none !important; }
}

/* Adapt the shared accordion recipe to the existing FAQ markup. */
body.brand-services .service-faq .faq-answer.t-acc-panel { display: grid; padding: 0; }
body.brand-services .service-answer-content { padding-bottom: 24px; }
body.brand-services .t-acc-panel-inner { min-height: 0; }
body.brand-services .t-acc[data-open="false"] .faq-answer { visibility: hidden; transition: grid-template-rows var(--acc-collapse) var(--acc-ease), visibility 0s var(--acc-collapse); }
body.brand-services .t-acc[data-open="true"] .faq-answer { visibility: visible; }
body.brand-services .faq-question i { transition: transform var(--motion-panel) var(--motion-ease); }

/* Native details keeps its keyboard behavior; supported browsers interpolate. */
@supports (interpolate-size: allow-keywords) {
  body.brand-services-home .service-drawer { interpolate-size: allow-keywords; }
  body.brand-services-home .service-drawer::details-content {
    height: 0; overflow: clip;
    transition: height var(--motion-panel) var(--motion-ease), content-visibility var(--motion-panel) allow-discrete;
  }
  body.brand-services-home .service-drawer[open]::details-content { height: auto; }
}
@keyframes service-panel-enter {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
body.brand-services-home :is(.process-panel,.industry-panel,.story-card):not([hidden]) { animation: service-panel-enter var(--motion-panel) var(--motion-ease); }

@media (prefers-reduced-motion: reduce) {
  body:is(.brand-services,.brand-services-home) *,
  body:is(.brand-services,.brand-services-home) *::before,
  body:is(.brand-services,.brand-services-home) *::after,
  body.brand-services-home .service-drawer::details-content { animation: none !important; transition: none !important; }
  body.brand-services :is(.process-card,.process-step-card,.deliverable-card,.service-card,.use-case-card,.lc-tech-card,.lc-feature-item,.lc-deliverable-item):hover,
  body.brand-services :is(.process-number,.step-number),
  body.brand-services-home :is(.research-card,.trust-strip>a,.hero-framework):hover,
  body.brand-services-home .stats>div:hover strong { transform: none !important; }
}
