/* Shared vertical rhythm for the full site, with a tighter and more even section cadence. */
:root {
  /* Give sections generous, consistent breathing room across the site. */
  --rhythm-section: clamp(64px, 5vw, 80px);
  --rhythm-section-mobile: 48px;
  --rhythm-label-heading: 19px;
  --rhythm-heading-copy: 22px;
  --rhythm-hero-kicker-title: 19px;
  --rhythm-hero-title-copy: 22px;
  --rhythm-hero-copy-action: 26px;
  --rhythm-content-start: clamp(28px, 3vw, 38px);
  --rhythm-grid: clamp(14px, 1.65vw, 22px);
}

:is(main > section, main > .phase-content > section):not(.hero):not(.phase-hero):not(.about-intro-hero):not(.segment-fee):not(.segment-next) {
  padding-block: var(--rhythm-section) !important;
}

/* Keep the client process labels close to the stage navigation below its hero. */
.clients-overview-page main > section.clients-process-section {
  padding-top: clamp(32px, 4vw, 48px) !important;
}

/* Match the About page's label, title and copy rhythm across marketing sections. */
main > section.about-intro-hero .about-intro-kicker,
main > section.phase-hero .hero-kicker {
  margin-bottom: var(--rhythm-hero-kicker-title) !important;
}

body.homepage main > section.hero .hero-kicker {
  margin-bottom: var(--rhythm-hero-kicker-title) !important;
}

body.homepage main > section.hero h1 {
  margin-top: 0 !important;
}

main > section.about-intro-hero .about-intro-copy,
main > section.phase-hero .hero-description {
  margin-top: var(--rhythm-hero-title-copy) !important;
}

body.homepage main > section.hero .hero-description {
  margin-top: var(--rhythm-hero-title-copy) !important;
}

/* Anchor interior photo heroes consistently, regardless of how many CTAs they contain. */
main > section.about-intro-hero .about-intro-inner,
main > section.phase-hero .hero-inner,
main > section.services-hero .hero-inner {
  justify-content: flex-start !important;
  padding-top: clamp(140px, 12vw, 160px) !important;
  padding-bottom: 20px !important;
}

main > section.about-intro-hero .about-intro-inner > :is(.clients-hero-actions, .client-segment-actions, .candidate-hero-actions, .diagnostic-hero-actions, .resource-hero-actions),
main > section:is(.phase-hero, .services-hero) .hero-actions {
  margin-top: var(--rhythm-hero-copy-action) !important;
}

/* Keep the claret terminal stop attached to the heading on every page. */
.heading-stop {
  display: inline !important;
  font: inherit;
  color: var(--brand-claret);
  letter-spacing: inherit;
}

main section:not(.hero):not(.phase-hero):not(.about-intro-hero) .eyebrow:has(+ h2) {
  margin-bottom: var(--rhythm-label-heading) !important;
}

main section:not(.hero):not(.phase-hero):not(.about-intro-hero) .eyebrow + h2 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

main section:not(.hero):not(.phase-hero):not(.about-intro-hero) h2:has(+ :is(p:not(.eyebrow), ul, ol)) {
  margin-bottom: 0 !important;
}

main section:not(.hero):not(.phase-hero):not(.about-intro-hero) h2 + :is(p:not(.eyebrow), ul, ol) {
  margin-top: var(--rhythm-heading-copy) !important;
}

/* Keep related cards and steps on a shared grid rhythm. */
:is(main, .phase-content) :is(
  .phase-grid,
  .specialism-grid,
  .hiring-steps,
  .clients-process-grid,
  .clients-pathway-grid,
  .candidate-support-grid,
  .segment-context-grid,
  .segment-process-grid,
  .services-role-grid,
  .services-steps,
  .resource-card-grid
) {
  gap: var(--rhythm-grid);
}

main section:not(.hero):not(.phase-hero):not(.about-intro-hero) :is(.phase-grid, .specialism-grid, .hiring-steps, .clients-process-grid, .clients-pathway-grid, .candidate-support-grid, .segment-context-grid, .segment-process-grid, .services-role-grid, .services-steps, .resource-card-grid) {
  margin-top: var(--rhythm-content-start) !important;
}

@media (max-width: 700px) {
  :root {
    --rhythm-label-heading: 16px;
    --rhythm-heading-copy: 18px;
    --rhythm-hero-kicker-title: 16px;
    --rhythm-hero-title-copy: 18px;
    --rhythm-hero-copy-action: 22px;
  }

  main > section.about-intro-hero .about-intro-inner,
  main > section.phase-hero .hero-inner,
  main > section.services-hero .hero-inner {
    justify-content: flex-start !important;
    padding-top: clamp(76px, 13vw, 96px) !important;
    padding-bottom: 18px !important;
  }

  :is(main > section, main > .phase-content > section):not(.hero):not(.phase-hero):not(.about-intro-hero):not(.segment-fee):not(.segment-next) {
    padding-block: var(--rhythm-section-mobile) !important;
  }

  .clients-overview-page main > section.clients-process-section {
    padding-top: 26px !important;
  }

  :is(main, .phase-content) :is(
    .phase-grid,
    .specialism-grid,
    .hiring-steps,
    .clients-process-grid,
    .clients-pathway-grid,
    .candidate-support-grid,
    .segment-context-grid,
    .segment-process-grid,
    .services-role-grid,
    .services-steps,
    .resource-card-grid
  ) {
    gap: 16px !important;
  }

  main section:not(.hero):not(.phase-hero):not(.about-intro-hero) :is(.phase-grid, .specialism-grid, .hiring-steps, .clients-process-grid, .clients-pathway-grid, .candidate-support-grid, .segment-context-grid, .segment-process-grid, .services-role-grid, .services-steps, .resource-card-grid) {
    margin-top: 28px !important;
  }
}

/* The inserted photo uses the same section padding on either side for an even transition. */
.homepage-photo-break { margin-bottom: 0; }

/* Draw the mobile menu symbol in CSS so it stays visible in browsers that limit external SVG sprites. */
.menu-toggle {
  position: relative;
  color: var(--brand-claret);
  border-radius: 12px;
  transition: background-color 180ms ease, color 180ms ease;
}
.menu-toggle .icon { display: none; }
.menu-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(currentColor 0 0) center 4px / 22px 2px no-repeat,
    linear-gradient(currentColor 0 0) center 11px / 22px 2px no-repeat,
    linear-gradient(currentColor 0 0) center 18px / 22px 2px no-repeat;
}
.menu-toggle[aria-expanded="true"]::before {
  background:
    linear-gradient(45deg, transparent 46%, currentColor 47% 53%, transparent 54%) center / 24px 24px no-repeat,
    linear-gradient(-45deg, transparent 46%, currentColor 47% 53%, transparent 54%) center / 24px 24px no-repeat;
}
.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] { background-color: rgb(122 23 53 / 8%); }
.menu-toggle:focus-visible { outline-color: var(--brand-claret); }

/* Keep both navigation panels curved at every viewport width. */
.mobile-nav {
  top: calc(100% + 8px);
  border: 1px solid var(--brand-border);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgb(25 25 29 / 10%);
}
.homepage .nav-client-menu,
.inner-page .nav-client-menu { border-radius: 20px; }

@media (max-width: 380px) {
  :root { --rhythm-section-mobile: 42px; }
}

/* Balance multi-line interior headings on narrow screens without changing the approved home layout. */
@media (max-width: 700px) {
  body:not(.homepage) main :is(h1, h2, h3) {
    text-wrap: balance;
  }
}

/* Keep CTA shape consistent while letting each layout choose its alignment. */
body .button {
  border-radius: 999px !important;
}

/* Keep homepage headings and labels aligned with their left-aligned copy. */
body.homepage main > section :is(h1, h2, h3, h4, h5, h6) {
  margin-inline: 0;
  text-align: left !important;
}

body.homepage main > section :is(.eyebrow, .hero-kicker) {
  text-align: left !important;
}

/* Center shared interior photo heroes as one group across Phase 2 pages.
   The homepage's approved hero and the global logo/navigation header keep their layouts. */
:is(body.inner-page, body.about-page) main > section.about-intro-hero .about-intro-inner {
  align-items: center !important;
  text-align: center !important;
}

:is(body.inner-page, body.about-page) main > section.about-intro-hero :is(.about-intro-kicker, h1, .about-intro-copy) {
  text-align: center !important;
}

:is(body.inner-page, body.about-page) main > section.about-intro-hero h1 {
  width: min(100%, 980px);
  margin-inline: auto !important;
}

:is(body.inner-page, body.about-page) main > section.about-intro-hero .about-intro-copy {
  width: min(100%, 900px);
  margin-inline: auto !important;
}

:is(body.inner-page, body.about-page) main > section.about-intro-hero :is(
  .clients-hero-actions,
  .client-segment-actions,
  .candidate-hero-actions,
  .diagnostic-hero-actions,
  .resource-hero-actions
) {
  justify-content: center !important;
  justify-items: center;
  text-align: center;
}

:is(body.inner-page, body.about-page) main > section.about-intro-hero .button,
body.inner-page main > section.phase-hero .button {
  justify-content: center;
  text-align: center;
}

body.inner-page main > section.phase-hero .hero-inner {
  align-items: center !important;
  text-align: center !important;
}

body.inner-page main > section.phase-hero .hero-copy {
  margin-inline: auto;
  text-align: center !important;
}

body.inner-page main > section.phase-hero :is(.hero-kicker, h1, .hero-description, .phase-small) {
  text-align: center !important;
  margin-inline: auto;
}

body.inner-page main > section.phase-hero .hero-actions {
  width: 100%;
  justify-content: center !important;
  justify-items: center !important;
  text-align: center;
}

/* About also carries the legacy homepage body class; scope this exception to its interior hero. */
body.about-page main > section.about-intro-hero :is(h1, .about-intro-kicker) {
  text-align: center !important;
}

body.about-page main > section.about-intro-hero .about-intro-copy {
  text-align: center !important;
}

body.about-page main > section.about-intro-hero :is(.clients-hero-actions, .client-segment-actions, .candidate-hero-actions, .diagnostic-hero-actions, .resource-hero-actions) {
  justify-content: center !important;
  justify-items: center !important;
}

body.homepage main > section .hero-kicker {
  justify-content: flex-start;
}

body.homepage main > section .hero-actions,
body.homepage main > section .diagnostic-hero-actions {
  justify-content: flex-start;
}

/* Shared motion tokens and progressive reveal behaviour. */
:root {
  --motion-duration-fast: 160ms;
  --motion-duration-ui: 220ms;
  --motion-duration-reveal: 520ms;
  --motion-easing-ui: cubic-bezier(.2, .7, .2, 1);
  --motion-easing-reveal: cubic-bezier(.22, 1, .36, 1);
  --motion-reveal-distance: 16px;
  --motion-stagger-step: 65ms;
  --motion-stagger-limit: 260ms;
  --motion-hover-lift: -3px;
  --motion-button-lift: -2px;
}

.scroll-reveal { opacity: 1; transform: none; }
html { scroll-behavior: smooth; }
html.motion-ready .scroll-reveal:not(.is-visible) {
  opacity: 0;
  transform: translate3d(0, var(--motion-reveal-distance), 0);
  transition: opacity var(--motion-duration-reveal) var(--motion-easing-reveal),
    transform var(--motion-duration-reveal) var(--motion-easing-reveal);
  transition-delay: var(--motion-delay, 0ms);
}
html.motion-ready .scroll-reveal.is-visible {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}

/* Keep the homepage's existing entrance graceful when JavaScript is unavailable. */
.homepage .hero-copy > :is(.hero-kicker, .hero-description, .hero-actions, .hero-proof) {
  opacity: 1;
  transform: none;
}
html.motion-ready .homepage .hero-copy > :is(.hero-kicker, .hero-description, .hero-actions, .hero-proof) {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
}

/* Consistent, quick feedback for buttons, service cards and resource cards. */
body :is(.button, button:not(.menu-toggle), [role="button"]) {
  transition: background-color var(--motion-duration-ui) var(--motion-easing-ui),
    color var(--motion-duration-ui) var(--motion-easing-ui),
    border-color var(--motion-duration-ui) var(--motion-easing-ui),
    box-shadow var(--motion-duration-ui) var(--motion-easing-ui),
    transform var(--motion-duration-ui) var(--motion-easing-ui);
}
body:is(.homepage, .phase2-page, .inner-page) :is(.phase-card, .specialism-card, .audience-panel, .clients-pathway-card, .services-role-card, .resource-card, .who-cwg-card) {
  transition: background-color var(--motion-duration-ui) var(--motion-easing-ui),
    border-color var(--motion-duration-ui) var(--motion-easing-ui),
    box-shadow var(--motion-duration-ui) var(--motion-easing-ui),
    transform var(--motion-duration-ui) var(--motion-easing-ui);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  body :is(.button, button:not(.menu-toggle), [role="button"]):hover:not(:disabled) {
    transform: translateY(var(--motion-button-lift));
  }
  body:is(.homepage, .phase2-page, .inner-page) :is(.phase-card, .specialism-card, .audience-panel, .clients-pathway-card, .services-role-card, .resource-card, .who-cwg-card):hover {
    transform: translateY(var(--motion-hover-lift));
  }
}

/* Fade and lift the desktop client dropdown without changing its hover/focus behaviour. */
.homepage .nav-client-menu,
.inner-page .nav-client-menu {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 6px, 0);
  transition: opacity var(--motion-duration-ui) var(--motion-easing-ui),
    transform var(--motion-duration-ui) var(--motion-easing-ui),
    visibility 0s linear var(--motion-duration-ui);
}
.homepage .nav-clients:hover .nav-client-menu,
.homepage .nav-clients:focus-within .nav-client-menu,
.inner-page .nav-clients:hover .nav-client-menu,
.inner-page .nav-clients:focus-within .nav-client-menu {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

/* Let the existing long-form CWG background motion run only near the viewport. */
html.motion-ready .homepage main::before,
html.motion-ready .homepage main::after,
html.motion-ready .inner-page main::before,
html.motion-ready .inner-page main::after {
  animation-play-state: paused;
}
html.motion-ready .homepage main.motion-background-active::before,
html.motion-ready .homepage main.motion-background-active::after,
html.motion-ready .inner-page main.motion-background-active::before,
html.motion-ready .inner-page main.motion-background-active::after {
  animation-play-state: running;
}
html.motion-ready .homepage .approach::after,
html.motion-ready .homepage .specialisms::before,
html.motion-ready .homepage .audience::before,
html.motion-ready .homepage .founder-quote::after,
html.motion-ready .homepage .contact-section::after {
  animation-play-state: paused;
}
html.motion-ready .homepage .approach.motion-background-active::after,
html.motion-ready .homepage .specialisms.motion-background-active::before,
html.motion-ready .homepage .audience.motion-background-active::before,
html.motion-ready .homepage .founder-quote.motion-background-active::after,
html.motion-ready .homepage .contact-section.motion-background-active::after {
  animation-play-state: running;
}
html.motion-ready .homepage .hero-brand-stage,
html.motion-ready .homepage .hero .role-track,
html.motion-ready .homepage .hero .hero-orbits {
  animation-play-state: paused;
}
html.motion-ready .homepage .hero.motion-background-active .hero-brand-stage,
html.motion-ready .homepage .hero.motion-background-active .role-track,
html.motion-ready .homepage .hero.motion-background-active .hero-orbits {
  animation-play-state: running;
}

/* Keep the vortex and rolling text; make only the broad ambient washes static on phones. */
@media (max-width: 700px) {
  .homepage main::before,
  .homepage main::after,
  .inner-page main::before,
  .inner-page main::after,
  .homepage .approach::after,
  .homepage .specialisms::before,
  .homepage .audience::before,
  .homepage .founder-quote::after,
  .homepage .contact-section::after {
    animation: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  html.motion-ready .scroll-reveal,
  .homepage .hero-copy > :is(.hero-kicker, .hero-description, .hero-actions, .hero-proof) {
    opacity: 1 !important;
    transform: none !important;
  }
}

